emacs-devel
[Top][All Lists]
Advanced

[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: John Shahid
Subject: Re: Let's make C-M-w in isearch yank symbol, not delete character
Date: Sat, 10 Mar 2018 13:34:49 -0500
User-agent: mu4e 1.0-alpha3; emacs 27.0.50

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.

cheers,

-js

Juri Linkov <address@hidden> writes:

>>> >>   Error in pre-command-hook (isearch-pre-command-hook):
>>> >>   (wrong-type-argument characterp right)
>>> >>
>>> >>   Error in pre-command-hook (isearch-pre-command-hook):
>>> >>   (wrong-type-argument characterp 134217830)
>>> >
>>> > That's a bug that needs to be fixed, I think.
>>>
>>> Unfortunately, I have no idea what characters to append to the
>>> search string in such cases.
>>
>> How about nothing?
>
> This reduces the usefulness of this feature.
> But OK, here is a new option for it:
>
> diff --git a/lisp/isearch.el b/lisp/isearch.el
> index 96faa27..b22a775 100644
> --- a/lisp/isearch.el
> +++ b/lisp/isearch.el
> @@ -82,6 +82,7 @@ search-exit-option
>                   (const :tag "Edit the search string" edit)
>                   (const :tag "Extend the search string by motion commands" 
> move)
>                   (const :tag "Extend the search string by shifted motion 
> keys" shift-move)
> +                 (const :tag "Append control characters to the search 
> string" append)
>                   (const :tag "Don't terminate incremental search" nil))
>    :version "27.1")
>
> @@ -2452,13 +2453,18 @@ isearch-pre-command-hook
>                 this-command-keys-shift-translated))
>        (setq this-command-keys-shift-translated nil)
>        (setq isearch-pre-move-point (point)))
> +     ;; Append control characters to the search string
> +     ((eq search-exit-option 'append)
> +      (when (cl-every #'characterp key)
> +        (isearch-process-search-string key key))
> +      (setq this-command 'ignore))
>       ;; Other characters terminate the search and are then executed normally.
>       (search-exit-option
>        (isearch-done)
>        (isearch-clean-overlays))
>       ;; If search-exit-option is nil, run the command without exiting 
> Isearch.
>       (t
> -      (isearch-process-search-string key key)))))
> +      ))))
>
>  (defun isearch-post-command-hook ()
>    (cond



reply via email to

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