From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Simple isearch concerns Date: Mon, 12 Apr 2021 01:09:58 +0300 Organization: LINKOV.NET Message-ID: <87o8eka2x5.fsf@mail.linkov.net> References: <20210403001539.x4rb55dvh46rmhb3.ref@Ergus> <83eefk802u.fsf@gnu.org> <871rbjdea4.fsf@mail.linkov.net> <8335vz91en.fsf@gnu.org> <940751cee594ef1cf8a4@heytings.org> <83zgy77hep.fsf@gnu.org> <940751cee566285b8519@heytings.org> <83wntb7eli.fsf@gnu.org> <940751cee50d69f2231d@heytings.org> <83r1jj7bhg.fsf@gnu.org> <940751cee5acf0f913df@heytings.org> <83eefj705i.fsf@gnu.org> <940751cee53181aedd72@heytings.org> <83a6q67gme.fsf@gnu.org> <5cf18ab57c8becad2999@heytings.org> <83pmz25sdr.fsf@gnu.org> <5cf18ab57ca5d2cc99ad@heytings.org> <8735vxbwju.fsf@mail.linkov.net> <83wnt947v0.fsf@gnu.org> <3755fe92dcaebb639062@heytings.org> <3755fe92dc9cb5a6a591@heytings.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31465"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , spacibba@aol.com, emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 12 00:34:53 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 1lVifN-00084e-Cn for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Apr 2021 00:34:53 +0200 Original-Received: from localhost ([::1]:41010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVifM-000195-E3 for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Apr 2021 18:34:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVie2-00086K-Rx for emacs-devel@gnu.org; Sun, 11 Apr 2021 18:33:30 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:55985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVie1-00042Y-0a; Sun, 11 Apr 2021 18:33:30 -0400 Original-Received: from mail.gandi.net (m91-129-96-157.cust.tele2.ee [91.129.96.157]) (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 02AC6100003; Sun, 11 Apr 2021 22:33:24 +0000 (UTC) In-Reply-To: <3755fe92dc9cb5a6a591@heytings.org> (Gregory Heytings's message of "Sun, 11 Apr 2021 10:16:37 +0000") Received-SPF: pass client-ip=217.70.178.231; envelope-from=juri@linkov.net; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:267926 Archived-At: > +(put 'beginning-of-buffer 'isearch-motion > + '((lambda () (goto-char (point-min))) . forward)) > +(put 'end-of-buffer 'isearch-motion > + '((lambda () (goto-char (point-max))) . backward)) > +(put 'scroll-up-command 'isearch-motion > + '((lambda () (goto-char (window-end))) . forward)) > +(put 'scroll-down-command 'isearch-motion > + '((lambda () (goto-char (window-start)) > + (when isearch-motion-recenter (recenter nil t))) > + . backward)) > ... > + (if (not isearch-motion-recenter) > + (recenter (if (eq direction 'forward) 1 -1) t)) This 'recenter' should affect only 'scroll-up-command' and 'scroll-down-command' like you used 'recenter' in the 'isearch-motion' property of 'scroll-down-command' above. Otherwise, this recentering has adverse effect in such definitions: (put 'next-line 'isearch-motion '(forward-line . forward)) (put 'previous-line 'isearch-motion '((lambda () (forward-line 0)) . backward))