[Top][All Lists]

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

[Emacs-diffs] master c26054b: * lisp/isearch.el (isearch-pre-command-hoo

From: Juri Linkov
Subject: [Emacs-diffs] master c26054b: * lisp/isearch.el (isearch-pre-command-hook): Default to shift-translated
Date: Wed, 4 Apr 2018 16:49:54 -0400 (EDT)

branch: master
commit c26054bbfed6c72ec18675166f2316d9dc2bfdd6
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/isearch.el (isearch-pre-command-hook): Default to shift-translated
    move commands that can be enabled by the `isearch-move' property `enabled',
    and disabled by `disabled'.
    (search-exit-option): Doc fix.
    (isearch-post-command-hook): Check for isearch-forward.
 lisp/isearch.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index aa6acfd..15a1543 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -72,7 +72,9 @@ If t, random control and meta characters terminate the search
 and are then executed normally.
 If `edit', edit the search string instead of exiting.
 If `move', extend the search string by motion commands
-that have the `isearch-move' property on their symbols.
+that have the `isearch-move' property on their symbols
+equal to `enabled', or the shift-translated command is
+not disabled by the value `disabled' of the same property.
 If `shift-move', extend the search string by motion commands
 while holding down the shift key.
 Both `move' and `shift-move' extend the search string by yanking text
@@ -2434,7 +2436,10 @@ See more for options in `search-exit-option'."
      ;; Don't terminate the search for motion commands.
      ((or (and (eq search-exit-option 'move)
                (symbolp this-command)
-               (eq (get this-command 'isearch-move) t))
+               (or (eq (get this-command 'isearch-move) 'enabled)
+                   (and (not (eq (get this-command 'isearch-move) 'disabled))
+                        (stringp (nth 1 (interactive-form this-command)))
+                        (string-match-p "^^" (nth 1 (interactive-form 
           (and (eq search-exit-option 'shift-move)
       (setq this-command-keys-shift-translated nil)
@@ -2469,7 +2474,8 @@ See more for options in `search-exit-option'."
                                          string ""))
         (setq isearch-yank-flag t)
         (setq isearch-forward (<= (or isearch-other-end isearch-opoint) 
-        (goto-char isearch-pre-move-point)
+        (when isearch-forward
+          (goto-char isearch-pre-move-point))
     (setq isearch-pre-move-point nil))))

reply via email to

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