From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Simple isearch concerns Date: Thu, 8 Apr 2021 05:32:34 +0200 Message-ID: <20210408033234.thku242yoripgyez@Ergus> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35194"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 08 05:34:10 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 1lULQo-00094t-G8 for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Apr 2021 05:34:10 +0200 Original-Received: from localhost ([::1]:53866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lULQn-0000Z9-IJ for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Apr 2021 23:34:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lULPn-00006k-T1 for emacs-devel@gnu.org; Wed, 07 Apr 2021 23:33:07 -0400 Original-Received: from sonic301-1.consmr.mail.bf2.yahoo.com ([74.6.129.40]:43310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lULPh-0000us-Df for emacs-devel@gnu.org; Wed, 07 Apr 2021 23:33:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1617852778; bh=18aE5CcEyZkUfgcdHvN58PWtrI6UKQ59LnpuUY8lTGY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=Gm3axm2QM++crxOkvL4rSL2u9hEUI78K947/oujWPWZeB2ZlzbmRgL/0pkbSsB+SzTRW6cMxyAKgXDBCci3ms8Em2V29/gqAXi2998HRw7nXeThsHwLKRU1ej4Pl0s8rys02txssYMPbWZkt3rxKEsCMx/wrEl6GiOjdd9QyH6c/TUrgmrry5G0i/4Yw9YjYqR/81/NHhJ7vRcrwjrb+hBdEpVxKEiNOgvR/8IKCS3J39awd3hMD0W26hKkz20su1sj0S2cOJyb5lFOMsLDpOHx8uzFCtp86KGTkvcyIoRSWLkGp+31rIn1Bmpy6k27DZ5jtTeieur1fGSTBFXyoCQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1617852778; bh=yuJCmstZwmIjesLDH5exvKmFfUfE1e3blEHRG6oL78x=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=OqZQCjG4IebkygpCl6wClctefP2aB6go0tz+Vq/rqFiTxPOQ41iLiGFA3mL+3CfPRd4cwPSCjNqS6/sPsUhKy9bPyEZuR8SzdG72McRwOkCkJ1GvA+WxNTBCINmKcJKhxzg6dUmFHDXi9k79ju3yKC2+81AvP+ZgExExeorMUx0ZcjqlYIb5gnQ5A18+A4A83dJN6JYUR8xfvDRTgdXFD96yWoQFh+Wu9SLTxLVTYyR63sx/p1pskToKlH6c9uIoLTf9xhFyaW/LtYnSQ5EqErtQw/iu8GrTzO6+UCVT5hSM8g017NY/oqORjE01HF0Vrqg/zbHSkERtPan74fjorw== X-YMail-OSG: bH2LJc0VM1l3TqATQYu.B292td_FvEPWUriULDWKWalxqztq84k2aBq62.XVHC5 Ib9RVVwIhmg3x9vucXxYUgOgZl_B.Wq5Ec73WxC7r_dR_VOEuiPsdFlGHgupvwFcXCBtdqPcH7bY T7PPMvcBqeb2WTCbgBBogjnibqp1yB_LpVUR3T2phkVbFHvlkcOXUy7T5qnuhdvkkyjACEVoj6C8 QIpzUuWYN0NQYDzrOIuccuiqag2D2bmpi9KHiwgP1XCrDktoyhBFkU8WEKS9rbcnzEoaGOjC3ypb u7xDaVoF5Gh92hOzjTplzIjCt4CphlBnTQmQ.PyN4S3jMl5UhStPBLzTfpaMg196FbO6FAOzaprm idib9_p5AzTg2xomJxdeUNMBbyCNljlNQxf95IpbI970hU8oJf0lgIj6iqr545N9jzcX2Sg_XAiH xlMpYzXmbTpLd_DLtdR4S6cbvL3yxk0k.7_.VytMBO1pZvNbkqywXu4R9c3pVj7jjfyYdFpOtn_O GOulgTeqrQzx_rak.Lv.2ADsCPGv.CSjcKykNNZsMXtE29hgbx_0TWL1BOeTWcBN21f8SkukzfLI 1wvZVgAh2_r43qUgoV0NzcUfIr.HzxqPW9..hs2UwSNAwJmxOzmHSSMMSIxbLGH7zEZVv2.sz7J1 CspF9ADvdKNj2ZojiZxlGOCV0TYvrq_hPOOejBOJJRbENMLqmqIW5NlGK0I_2kscLXVK3RZh1wnC wQ4Y6amN8DfTVe4nQUdt6Lq.tUpXuZs9y9TFmCeSf4XCAIWeLgYkshlJAlzUrWZTWpKdea7c9mOw xgYS4r2nycoWifwnt2NdyuUznGM9u8Nrq2aiQzk2Y_ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Thu, 8 Apr 2021 03:32:58 +0000 Original-Received: by kubenode541.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 5941a6a3a0d29cc386f907481501096b; Thu, 08 Apr 2021 03:32:56 +0000 (UTC) Content-Disposition: inline In-Reply-To: <878s5tc0rn.fsf@mail.linkov.net> X-Mailer: WebService/1.1.18033 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/16) Received-SPF: pass client-ip=74.6.129.40; envelope-from=spacibba@aol.com; helo=sonic301-1.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:267593 Archived-At: Hi Juri: Sorry to bother. But I don't understand much of this email. Is this documented somewhere? Could you add a simple use case example for a simple user or dumb lisper like me? On Wed, Apr 07, 2021 at 11:12:12PM +0300, Juri Linkov wrote: > >If you want a separate option, this is fine. But then there is no need >to duplicate the key remapping feature. To make the new feature more powerful, >you could attach to command symbol properties a function that >defines where to move point before searching the next match. > >This is similar to how isearch-yank-internal funcalls its arg 'jumpform', >and how its callers like isearch-yank-char uses > > (lambda () (forward-char arg) (point)) > >or isearch-yank-word uses > > (lambda () (forward-word arg) (point)) > >to define where to move point before using it as the buffer position. > >So command symbol properties could be defined using the same logic: > > (put 'beginning-of-buffer 'isearch-match-scroll 'beginning-of-buffer) > (put 'end-of-buffer 'isearch-match-scroll 'end-of-buffer) > (put 'scroll-up-command 'isearch-match-scroll (lambda () (goto-char (window-end)))) > (put 'scroll-down-command 'isearch-match-scroll (lambda () (goto-char (window-start)))) > >where the symbol property is called like (funcall 'beginning-of-buffer) >before repeating the search. > >Then there is no need to add such ad-hoc commands as isearch-scroll-up >and isearch-scroll-down. > >And instead of > > (setq this-command (get this-command 'isearch-match-scroll)) > >isearch-pre-command-hook could contain the same code >that is currently duplicated in several commands: > > (setq isearch-just-started t) > (goto-char (window-end)) ;; only this line needs to be > ;; replaced with (funcall jumpform) > (isearch-repeat 'forward) > >Whereas it would be easy to handle more commands like below: > > >Actually, the 'isearch-match-scroll' above doesn't do what is needed. >It just goes to the next match, whereas the need was to go to the next line >before searching for a new match. > >With the logic above, this is easy to define like: > > (put 'next-line 'isearch-match-scroll (lambda () (forward-line 1))) >