summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2018-04-04 23:49:45 +0300
committerJuri Linkov <juri@linkov.net>2018-04-04 23:49:45 +0300
commitc26054bbfed6c72ec18675166f2316d9dc2bfdd6 (patch)
treefd4db17ecd8a8eef0169621bb1b0c95916bf88b5 /lisp/isearch.el
parent25b22772a7149a5207e4693f149718329a25e135 (diff)
downloademacs-c26054bbfed6c72ec18675166f2316d9dc2bfdd6.tar.gz
* 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. https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00438.html
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index aa6acfd0c82..15a15436f7c 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 this-command))))))
(and (eq search-exit-option 'shift-move)
this-command-keys-shift-translated))
(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) (point)))
- (goto-char isearch-pre-move-point)
+ (when isearch-forward
+ (goto-char isearch-pre-move-point))
(isearch-search-and-update)))
(setq isearch-pre-move-point nil))))