[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/isearch.el
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/isearch.el |
Date: |
Mon, 18 Jul 2005 10:32:31 -0400 |
Index: emacs/lisp/isearch.el
diff -c emacs/lisp/isearch.el:1.265 emacs/lisp/isearch.el:1.266
*** emacs/lisp/isearch.el:1.265 Sat Jul 16 19:13:30 2005
--- emacs/lisp/isearch.el Mon Jul 18 14:32:30 2005
***************
*** 361,373 ****
(define-key map "\M-\C-y" 'isearch-yank-char)
(define-key map "\C-y" 'isearch-yank-line)
- ;; Define keys for regexp chars * ? } |.
- ;; Nothing special for + because it matches at least once.
- (define-key map "*" 'isearch-*-char)
- (define-key map "?" 'isearch-*-char)
- (define-key map "}" 'isearch-}-char)
- (define-key map "|" 'isearch-|-char)
-
;; Turned off because I find I expect to get the global definition--rms.
;; ;; Instead bind C-h to special help command for isearch-mode.
;; (define-key map "\C-h" 'isearch-mode-help)
--- 361,366 ----
***************
*** 1416,1429 ****
Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by
stopping at `isearch-barrier' as needed.
! Do nothing if a backslash is escaping the liberalizing character. If
! WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|).
! Do nothing if regexp has recently been invalid unless optional ALLOW-INVALID
! non-nil.
! If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the
! barrier."
;; (eq (not a) (not b)) makes all non-nil values equivalent
(when (and isearch-regexp (eq (not (isearch-backslash isearch-string))
(not want-backslash))
--- 1409,1422 ----
Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by
stopping at `isearch-barrier' as needed.
! Do nothing if a backslash is escaping the liberalizing character.
! If WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|).
! Do nothing if regexp has recently been invalid unless optional
! ALLOW-INVALID non-nil.
! If optional TO-BARRIER non-nil, ignore previous matches and go exactly
! to the barrier."
;; (eq (not a) (not b)) makes all non-nil values equivalent
(when (and isearch-regexp (eq (not (isearch-backslash isearch-string))
(not want-backslash))
***************
*** 1469,1494 ****
(goto-char (if isearch-forward
(max last-other-end isearch-barrier)
(min last-other-end isearch-barrier)))
! (setq isearch-adjusted t))))))
! (isearch-process-search-char last-command-char))
!
! ;; * and ? are special when not preceded by \.
! (defun isearch-*-char ()
! "Maybe back up to handle * and ? specially in regexps."
! (interactive)
! (isearch-fallback nil))
!
! ;; } is special when it is preceded by \.
! (defun isearch-}-char ()
! "Handle \\} specially in regexps."
! (interactive)
! (isearch-fallback t t))
!
! ;; | is special when it is preceded by \.
! (defun isearch-|-char ()
! "If in regexp search, jump to the barrier unless in a group."
! (interactive)
! (isearch-fallback t nil t))
(defun isearch-unread-key-sequence (keylist)
"Unread the given key-sequence KEYLIST.
--- 1462,1468 ----
(goto-char (if isearch-forward
(max last-other-end isearch-barrier)
(min last-other-end isearch-barrier)))
! (setq isearch-adjusted t)))))))
(defun isearch-unread-key-sequence (keylist)
"Unread the given key-sequence KEYLIST.
***************
*** 1786,1795 ****
(isearch-process-search-char char))))
(defun isearch-return-char ()
! "Convert return into newline for incremental search.
! Obsolete."
(interactive)
(isearch-process-search-char ?\n))
(defun isearch-printing-char ()
"Add this ordinary printing character to the search string and search."
--- 1760,1769 ----
(isearch-process-search-char char))))
(defun isearch-return-char ()
! "Convert return into newline for incremental search."
(interactive)
(isearch-process-search-char ?\n))
+ (make-obsolete 'isearch-return-char 'isearch-printing-char)
(defun isearch-printing-char ()
"Add this ordinary printing character to the search string and search."
***************
*** 1808,1813 ****
--- 1782,1795 ----
(isearch-process-search-char char)))))
(defun isearch-process-search-char (char)
+ ;; * and ? are special in regexps when not preceded by \.
+ ;; } and | are special in regexps when preceded by \.
+ ;; Nothing special for + because it matches at least once.
+ (cond
+ ((memq char '(?* ??)) (isearch-fallback nil))
+ ((eq char ?\}) (isearch-fallback t t))
+ ((eq char ?|) (isearch-fallback t nil t)))
+
;; Append the char to the search string, update the message and re-search.
(isearch-process-search-string
(char-to-string char)