From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: PATCH: isearch-yank-until-char Date: Wed, 14 Aug 2019 17:20:09 +0300 Message-ID: <835zmzsuau.fsf@gnu.org> References: <87tvakfnv4.fsf@red-bean.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="47501"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 14 16:20:28 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hxu8a-000CDg-D8 for ged-emacs-devel@m.gmane.org; Wed, 14 Aug 2019 16:20:28 +0200 Original-Received: from localhost ([::1]:32810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hxu8Y-0006ip-Ae for ged-emacs-devel@m.gmane.org; Wed, 14 Aug 2019 10:20:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58453) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hxu8S-0006he-VL for emacs-devel@gnu.org; Wed, 14 Aug 2019 10:20:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hxu8S-0002wK-LC; Wed, 14 Aug 2019 10:20:20 -0400 Original-Received: from [176.228.60.248] (port=4755 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hxu8R-0007ke-UF; Wed, 14 Aug 2019 10:20:20 -0400 In-reply-to: <87tvakfnv4.fsf@red-bean.com> (message from Karl Fogel on Tue, 13 Aug 2019 22:05:19 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239357 Archived-At: > From: Karl Fogel > 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.