[Top][All Lists]

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

Re: Let's make C-M-w in isearch yank symbol, not delete character

From: Juri Linkov
Subject: Re: Let's make C-M-w in isearch yank symbol, not delete character
Date: Sat, 10 Mar 2018 23:15:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> Does it make sense to set the `isearch-move' property on some common
> forward commands, e.g. `forward-char', `forward-symbol' &
> `forward-word'. I just compiled and tried the latest master to test this
> feature and it wasn't immediately obvious that I had to set the property
> for those commands. I was confused because I expected the built-in
> functions to work out of the box with this new feature.

Maybe better to put the `isearch-move' property on the common commands
only when you customize `search-exit-option' to `move' like in this patch:

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 4f5f494..c0f9025 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -86,6 +86,14 @@ search-exit-option
                  (const :tag "Extend the search string by shifted motion keys" 
                  (const :tag "Append control characters to the search string" 
                  (const :tag "Don't terminate incremental search" nil))
+  :set #'(lambda (sym val)
+           (when (eq val 'move)
+             (dolist (sym '(right-char right-word forward-char forward-word
+                            forward-symbol forward-sexp next-line 
+                            left-char left-word backward-char backward-word
+                            backward-symbol backward-sexp previous-line))
+               (put sym 'isearch-move t)))
+           (set-default sym val))
   :version "27.1")
 (defcustom search-slow-window-lines 1

reply via email to

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