/[emacs]/emacs/lisp/misc.el
ViewVC logotype

Diff of /emacs/lisp/misc.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by miles, Mon Sep 1 15:45:13 2003 UTC revision 1.11 by lute, Wed Sep 24 08:51:33 2003 UTC
# Line 1  Line 1 
1  ;;; misc.el --- some nonstandard basic editing commands for Emacs  ;;; misc.el --- some nonstandard basic editing commands for Emacs
2    
3  ;; Copyright (C) 1989 Free Software Foundation, Inc.  ;; Copyright (C) 1989, 2003 Free Software Foundation, Inc.
4    
5  ;; Maintainer: FSF  ;; Maintainer: FSF
6  ;; Keywords: convenience  ;; Keywords: convenience
# Line 58  The characters copied are inserted in th Line 58  The characters copied are inserted in th
58                                   (+ n (point)))))))                                   (+ n (point)))))))
59      (insert string)))      (insert string)))
60    
61    ;; Variation of `zap-to-char'.
62    
63    (defun zap-up-to-char (arg char)
64      "Kill up to, but not including ARG'th occurrence of CHAR.
65    Case is ignored if `case-fold-search' is non-nil in the current buffer.
66    Goes backward if ARG is negative; error if CHAR not found.
67    Ignores CHAR at point."
68      (interactive "p\ncZap up to char: ")
69      (let ((direction (if (>= arg 0) 1 -1)))
70        (kill-region (point)
71                     (progn
72                       (forward-char direction)
73                       (unwind-protect
74                           (search-forward (char-to-string char) nil nil arg)
75                         (backward-char direction))
76                       (point)))))
77    
78  ;; These were added with an eye to making possible a more CCA-compatible  ;; These were added with an eye to making possible a more CCA-compatible
79  ;; command set; but that turned out not to be interesting.  ;; command set; but that turned out not to be interesting.
80    
# Line 72  The characters copied are inserted in th Line 89  The characters copied are inserted in th
89    (push-mark (point-max)))    (push-mark (point-max)))
90    
91  (defun upcase-char (arg)  (defun upcase-char (arg)
92    "Uppercasify ARG chars starting from point.  Point doesn't move"    "Uppercasify ARG chars starting from point.  Point doesn't move."
93    (interactive "p")    (interactive "p")
94    (save-excursion    (save-excursion
95      (upcase-region (point) (progn (forward-char arg) (point)))))      (upcase-region (point) (progn (forward-char arg) (point)))))

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26