]> code.delx.au - gnu-emacs/blobdiff - lisp/isearch.el
Simplify ‘delete-trailing-whitespace’ by not treating \n as whitespace
[gnu-emacs] / lisp / isearch.el
index 418d9ea273a3a118a5712f565335fd38ffa9340a..721f2fc31817eae610208df993a6b63607584630 100644 (file)
@@ -222,7 +222,7 @@ It is nil if none yet.")
 Default value, nil, means edit the string instead."
   :type 'boolean)
 
-(autoload 'character-fold-to-regexp "character-fold")
+(autoload 'char-fold-to-regexp "char-fold")
 
 (defcustom search-default-mode nil
   "Default mode to use when starting isearch.
@@ -236,7 +236,7 @@ isearch).
 If a function, use that function as an `isearch-regexp-function'.
 Example functions (and the keys to toggle them during isearch)
 are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp'
-\(`\\[isearch-toggle-symbol]'), and `character-fold-to-regexp' \(`\\[isearch-toggle-character-fold]')."
+\(`\\[isearch-toggle-symbol]'), and `char-fold-to-regexp' \(`\\[isearch-toggle-char-fold]')."
   ;; :type is set below by `isearch-define-mode-toggle'.
   :type '(choice (const :tag "Literal search" nil)
                  (const :tag "Regexp search" t)
@@ -354,11 +354,7 @@ A value of nil means highlight all matches."
   "Face for lazy highlighting of matches other than the current one."
   :group 'lazy-highlight
   :group 'basic-faces)
-(define-obsolete-face-alias 'isearch-lazy-highlight-face 'lazy-highlight "22.1")
-(define-obsolete-variable-alias 'isearch-lazy-highlight-face
-                                'lazy-highlight-face
-                                "22.1")
-(defvar lazy-highlight-face 'lazy-highlight)
+
 \f
 ;; Define isearch help map.
 
@@ -510,6 +506,7 @@ This is like `describe-bindings', but displays only Isearch keys."
     ;; People expect to be able to paste with the mouse.
     (define-key map [mouse-2] #'isearch-mouse-2)
     (define-key map [down-mouse-2] nil)
+    (define-key map [xterm-paste] #'isearch-xterm-paste)
 
     ;; Some bindings you may want to put in your isearch-mode-hook.
     ;; Suggest some alternates...
@@ -718,7 +715,7 @@ Type \\[isearch-toggle-invisible] to toggle search in invisible text.
 Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
 Type \\[isearch-toggle-word] to toggle word mode.
 Type \\[isearch-toggle-symbol] to toggle symbol mode.
-Type \\[isearch-toggle-character-fold] to toggle character folding.
+Type \\[isearch-toggle-char-fold] to toggle character folding.
 
 Type \\[isearch-toggle-lax-whitespace] to toggle whitespace matching.
 In incremental searches, a space or spaces normally matches any whitespace
@@ -1258,6 +1255,11 @@ You can update the global isearch variables by setting new values to
              (isearch-adjusted isearch-adjusted)
              (isearch-yank-flag isearch-yank-flag)
              (isearch-error isearch-error)
+
+             (multi-isearch-file-list-new multi-isearch-file-list)
+             (multi-isearch-buffer-list-new multi-isearch-buffer-list)
+             (multi-isearch-next-buffer-function multi-isearch-next-buffer-current-function)
+             (multi-isearch-current-buffer-new multi-isearch-current-buffer)
   ;;; Don't bind this.  We want isearch-search, below, to set it.
   ;;; And the old value won't matter after that.
   ;;;      (isearch-other-end isearch-other-end)
@@ -1312,7 +1314,10 @@ You can update the global isearch variables by setting new values to
                  isearch-message isearch-new-message
                  isearch-forward isearch-new-forward
                  isearch-regexp-function isearch-new-regexp-function
-                 isearch-case-fold-search isearch-new-case-fold)
+                 isearch-case-fold-search isearch-new-case-fold
+                 multi-isearch-current-buffer multi-isearch-current-buffer-new
+                 multi-isearch-file-list multi-isearch-file-list-new
+                 multi-isearch-buffer-list multi-isearch-buffer-list-new)
 
            ;; Restore the minibuffer message before moving point.
             (funcall (or isearch-message-function #'isearch-message) nil t)
@@ -1546,9 +1551,9 @@ The command then executes BODY and updates the isearch prompt."
 Turning on word search turns off regexp mode.")
 (isearch-define-mode-toggle symbol "_" isearch-symbol-regexp "\
 Turning on symbol search turns off regexp mode.")
-(isearch-define-mode-toggle character-fold "'" character-fold-to-regexp "\
+(isearch-define-mode-toggle char-fold "'" char-fold-to-regexp "\
 Turning on character-folding turns off regexp mode.")
-(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ")
+(put 'char-fold-to-regexp 'isearch-message-prefix "char-fold ")
 
 (isearch-define-mode-toggle regexp "r" nil nil
   (setq isearch-regexp (not isearch-regexp))
@@ -2001,6 +2006,13 @@ is bound to outside of Isearch."
       (when (functionp binding)
        (call-interactively binding)))))
 
+(declare-function xterm--pasted-text "term/xterm" ())
+
+(defun isearch-xterm-paste ()
+  "Pull terminal paste into search string."
+  (interactive)
+  (isearch-yank-string (xterm--pasted-text)))
+
 (defun isearch-yank-internal (jumpform)
   "Pull the text from point to the point reached by JUMPFORM.
 JUMPFORM is a lambda expression that takes no arguments and returns
@@ -3243,7 +3255,7 @@ Attempt to do the search exactly the way the pending Isearch would."
                          ;; 1000 is higher than ediff's 100+,
                          ;; but lower than isearch main overlay's 1001
                          (overlay-put ov 'priority 1000)
-                         (overlay-put ov 'face lazy-highlight-face)))
+                         (overlay-put ov 'face 'lazy-highlight)))
                          ;(overlay-put ov 'window (selected-window))))
                      ;; Remember the current position of point for
                      ;; the next call of `isearch-lazy-highlight-update'