emacs-devel
[Top][All Lists]
Advanced

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

Re: PATCH: isearch-yank-until-char


From: Eli Zaretskii
Subject: Re: PATCH: isearch-yank-until-char
Date: Wed, 14 Aug 2019 17:20:09 +0300

> From: Karl Fogel <address@hidden>
> Date: Tue, 13 Aug 2019 22:05:19 -0500
> 
> This patch implements 'isearch-yank-until-char', a new yank command in 
> isearch.
> 
> While in an isearch, one types C-M-c to yank into the search string 
> everything from point up to (but not including) the next instance of a 
> specified character.  It prompts for the character.
> 
> For example, assume point is on the "m" after the "#" mark below:
> 
>   [example from a recent macro I wrote](#markdown-link-syntax)
> 
> Start an isearch with C-s, then do C-M-c followed by ")".  The search string 
> is now "markdown-link-syntax".
> 
> I have found this functionality very helpful in macros.
> 
> If it's a useful contribution to Emacs, then I'll install it.  I'll wait at 
> least three days to get feedback, both about the feature itself and about the 
> choice of M-C-c as the keybinding.  If there's no response or no consensus, 
> then I won't install it, as being conservative about isearch seems 
> appropriate.

I think it's useful (but please wait for a few days to let others
opine).

Please see a few comments to the patch below.

> --- doc/emacs/search.texi
> +++ doc/emacs/search.texi
> @@ -262,11 +262,17 @@ Isearch Yank
>  
>  @kindex M-s C-e @r{(Incremental search)}
>  @findex isearch-yank-line
> -  Similarly, @kbd{M-s C-e} (@code{isearch-yank-line}) appends the rest
> +  @kbd{M-s C-e} (@code{isearch-yank-line}) appends the rest
>  of the current line to the search string.  If point is already at the
>  end of a line, it appends the next line.  With a prefix argument
>  @var{n}, it appends the next @var{n} lines.
>  
> +@kindex M-s C-e @r{(Incremental search)}
           ^^^^^^^
> +@findex isearch-yank-line
           ^^^^^^^^^^^^^^^^^
Copy-paste errors, I believe.

> +    (define-key map [isearch-yank-until-char]
> +      '(menu-item "Until char" isearch-yank-until-char

Our convention is to end with ellipsis any menu item that prompts for
input, so this should be "Until char..."

> +                  :help "Yank everything until the specified character to 
> search string"))

I suggest "Yank from point to specified character into search string".

This is a new command, so please prepare a NEWS entry as well.

Thanks.



reply via email to

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