diff options
author | Yuan Fu <casouri@gmail.com> | 2022-06-14 15:59:46 -0700 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2022-06-14 15:59:46 -0700 |
commit | 98bfb240818bae14cd87a1ffeb8fae7cb7846e05 (patch) | |
tree | 16e8ab06875ed54e110cf98ccdbd7e78f15905c6 /lisp/misc.el | |
parent | 184d212042ffa5a4f02c92085d9b6e8346d66e99 (diff) | |
parent | 787c4ad8b0776280305a220d6669c956d9ed8a5d (diff) | |
download | emacs-98bfb240818bae14cd87a1ffeb8fae7cb7846e05.tar.gz emacs-98bfb240818bae14cd87a1ffeb8fae7cb7846e05.tar.bz2 emacs-98bfb240818bae14cd87a1ffeb8fae7cb7846e05.zip |
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter
Diffstat (limited to 'lisp/misc.el')
-rw-r--r-- | lisp/misc.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/misc.el b/lisp/misc.el index d85f889ffd3..0bb8ee6c7bc 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -64,15 +64,22 @@ The characters copied are inserted in the buffer before point." ;; Variation of `zap-to-char'. ;;;###autoload -(defun zap-up-to-char (arg char) +(defun zap-up-to-char (arg char &optional interactive) "Kill up to, but not including ARGth occurrence of CHAR. +When run interactively, the argument INTERACTIVE is non-nil. 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." +Ignores CHAR at point. +If called interactively, do a case sensitive search if CHAR +is an upper-case character." (interactive (list (prefix-numeric-value current-prefix-arg) (read-char-from-minibuffer "Zap up to char: " - nil 'read-char-history))) - (let ((direction (if (>= arg 0) 1 -1))) + nil 'read-char-history) + t)) + (let ((direction (if (>= arg 0) 1 -1)) + (case-fold-search (if (and interactive (char-uppercase-p char)) + nil + case-fold-search))) (kill-region (point) (progn (forward-char direction) |