emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/misc.el


From: Lute Kamstra
Subject: [Emacs-diffs] Changes to emacs/lisp/misc.el
Date: Wed, 24 Sep 2003 04:51:33 -0400

Index: emacs/lisp/misc.el
diff -c emacs/lisp/misc.el:1.10 emacs/lisp/misc.el:1.11
*** emacs/lisp/misc.el:1.10     Mon Sep  1 11:45:13 2003
--- emacs/lisp/misc.el  Wed Sep 24 04:51:33 2003
***************
*** 1,6 ****
  ;;; misc.el --- some nonstandard basic editing commands for Emacs
  
! ;; Copyright (C) 1989 Free Software Foundation, Inc.
  
  ;; Maintainer: FSF
  ;; Keywords: convenience
--- 1,6 ----
  ;;; misc.el --- some nonstandard basic editing commands for Emacs
  
! ;; Copyright (C) 1989, 2003 Free Software Foundation, Inc.
  
  ;; Maintainer: FSF
  ;; Keywords: convenience
***************
*** 58,63 ****
--- 58,80 ----
                                 (+ n (point)))))))
      (insert string)))
  
+ ;; Variation of `zap-to-char'.
+ 
+ (defun zap-up-to-char (arg char)
+   "Kill up to, but not including ARG'th occurrence of CHAR.
+ Case is ignored if `case-fold-search' is non-nil in the current buffer.
+ Goes backward if ARG is negative; error if CHAR not found.
+ Ignores CHAR at point."
+   (interactive "p\ncZap up to char: ")
+   (let ((direction (if (>= arg 0) 1 -1)))
+     (kill-region (point)
+                (progn
+                  (forward-char direction)
+                  (unwind-protect
+                      (search-forward (char-to-string char) nil nil arg)
+                    (backward-char direction))
+                  (point)))))
+ 
  ;; These were added with an eye to making possible a more CCA-compatible
  ;; command set; but that turned out not to be interesting.
  
***************
*** 72,78 ****
    (push-mark (point-max)))
  
  (defun upcase-char (arg)
!   "Uppercasify ARG chars starting from point.  Point doesn't move"
    (interactive "p")
    (save-excursion
      (upcase-region (point) (progn (forward-char arg) (point)))))
--- 89,95 ----
    (push-mark (point-max)))
  
  (defun upcase-char (arg)
!   "Uppercasify ARG chars starting from point.  Point doesn't move."
    (interactive "p")
    (save-excursion
      (upcase-region (point) (progn (forward-char arg) (point)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]