From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Simple isearch concerns Date: Fri, 09 Apr 2021 09:22:58 +0300 Message-ID: <83czv47z99.fsf@gnu.org> References: <20210403001539.x4rb55dvh46rmhb3.ref@Ergus> <20210403001539.x4rb55dvh46rmhb3@Ergus> <878s5wmsjp.fsf@mail.linkov.net> <87mtubz4ls.fsf@mail.linkov.net> <8735w22s9b.fsf@mail.linkov.net> <3ec7e2e58a3733a48ae9@heytings.org> <878s5tc0rn.fsf@mail.linkov.net> <3ec7e2e58a49d4f0ec99@heytings.org> <878s5t9p1i.fsf@mail.linkov.net> <9ff81b52fad2911cc740@heytings.org> <87im4w1tgw.fsf@mail.linkov.net> <9ff81b52fa878cb35a86@heytings.org> <87pmz4zgn5.fsf@mail.linkov.net> <9ff81b52fa72c1233122@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17066"; mail-complaints-to="usenet@ciao.gmane.io" Cc: spacibba@aol.com, emacs-devel@gnu.org, juri@linkov.net To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 09 08:24:03 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUkYk-0004LR-Qp for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 08:24:02 +0200 Original-Received: from localhost ([::1]:55270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUkYj-00049I-T1 for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 02:24:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUkY4-0003ic-Mh for emacs-devel@gnu.org; Fri, 09 Apr 2021 02:23:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60166) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUkY3-0000tk-Gx; Fri, 09 Apr 2021 02:23:19 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4860 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lUkY1-0000qq-Tt; Fri, 09 Apr 2021 02:23:19 -0400 In-Reply-To: <9ff81b52fa72c1233122@heytings.org> (message from Gregory Heytings on Thu, 08 Apr 2021 22:40:42 +0000) 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267688 Archived-At: > Date: Thu, 08 Apr 2021 22:40:42 +0000 > From: Gregory Heytings > Cc: Ergus , emacs-devel@gnu.org > > +@vindex isearch-allow-match-scroll IMO, the name of this variable (and the corresponding property) is not the best one. "Scroll" is the wrong term here, and "match-scroll" doesn't help understanding what it does. How about isearch-allow-motion-commands instead? > +@cindex motion commands, during incremental search, change > + When @code{isearch-allow-match-scroll} is non-@code{nil}, it > +is also possible to change the effect of motion commands during > +incremental search, by modifying the @code{isearch-match-scroll} > +property of their symbols. For example, to make @kbd{C-p} and > +@kbd{C-n} move to the previous and next line and restart Isearch > +forward and backward respectively, you can put the following > +lines in your init file (@pxref{Init File}): > + > +@example > +(put 'next-line 'isearch-match-scroll '(next-line . forward)) > +(put 'previous-line 'isearch-match-scroll '(previous-line . backward)) > +@end example > @end table This is too "Lispy" IMO to be in the user manual. I suggest to move the bulk of it into the ELisp manual, and leave only a reference to that in the user manual. > ++++ > +** New user option 'isearch-allow-match-scroll'. > +When this option is set, the commands 'beginning-of-buffer', > +'end-of-buffer', 'scroll-up-command' and 'scroll-down-command' move > +respectively to the first occurrence of the current search string > +in the buffer, the last one, the first one after the current window, > +and the last one before the current window. This sentence should make it clear that it talks about the named commands that are invoked while in I-search. Otherwise the sentence is misleading. > +(defcustom isearch-allow-match-scroll nil > + "Whether scrolling to another match is allowed during incremental search. ^^^^^^^^^ Whether to allow movement between isearch matches by cursor motion commands. > +If non-nil, the four scrolling commands `beginning-of-buffer', > +`end-of-buffer', `scroll-up-command' and `scroll-down-command' move > +respectively to the first first occurrence of the current search string in > +the buffer, the last one, the first one after the current window, and the > +last one before the current window. Presumably if this option is nil, these commands exit I-search and are executed? This should be in the doc string. > +See also the related option `isearch-allow-scroll'." > + :type '(choice (const :tag "Off" nil) > + (const :tag "On" t)) > + :group 'isearch) The :version tag is missing here. > + ;; Handle match scrolling functions. Again, "scrolling" is the wrong terminology for describing this. > + (condition-case nil > + (funcall function) > + (error nil)) Wouldn't it be better to at least display the error message (or some message) in the case the function signals an error? Thanks.