From unknown Fri Aug 15 02:04:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49963 <49963@debbugs.gnu.org> To: bug#49963 <49963@debbugs.gnu.org> Subject: Status: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Reply-To: bug#49963 <49963@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:04:04 +0000 retitle 49963 28.0.50; isearch failing in Dired after rectangle-mark-mode a= nd query-replace reassign 49963 emacs submitter 49963 laslydone severity 49963 normal tag 49963 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 09 12:35:13 2021 Received: (at submit) by debbugs.gnu.org; 9 Aug 2021 16:35:13 +0000 Received: from localhost ([127.0.0.1]:57645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD8F5-0000SW-MJ for submit@debbugs.gnu.org; Mon, 09 Aug 2021 12:35:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:49960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD8Ap-0000Ld-AU for submit@debbugs.gnu.org; Mon, 09 Aug 2021 12:30:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD8Ao-0003Jd-Vs for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 12:30:46 -0400 Received: from mail-40138.protonmail.ch ([185.70.40.138]:29086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD8Am-0000Lq-3a for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 12:30:46 -0400 Date: Mon, 09 Aug 2021 16:30:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1628526638; bh=uqRzl8QGkdIJijs/ucUV4XL6mJYysFCSpHt2kshzNs8=; h=Date:To:From:Reply-To:Subject:From; b=e4XH1RslOvnFdbHYAUax76JNIDx1TPDf/kmJa/Iw21vM+/aa+oyO1mNhmSGuAgIho LvqWnXR+xvHeF3hE0LDIpqk5jaccymz/tpNa0nFYLZicjm4ViBip0nk4f97t3rsYbt p70Td4iELScrTYRkzZjwjccRe+05KlJbwRO3fIz4= To: "bug-gnu-emacs@gnu.org" From: laslydone Subject: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.40.138; envelope-from=laslydone@protonmail.com; helo=mail-40138.protonmail.ch 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_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 09 Aug 2021 12:35:11 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: laslydone Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) What happened: In Dired isearch-{forward,backward} will no longer match anything after run= ning `rectangle-mark-mode' and `query-replace'. What I thought would happen: In Dired after running `rectangle-mark-mode' and `query-replace', isearch-{forward,backward} would match again. To reproduce: 1. emacs -Q 2. C-x d 3. C-x C-q 4. C-x C-n 5. M-% (entering nothing) 6. ^s (searching for anything will show "Failing I-search: ANYTHING" in min= ibuffer) In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, c= airo version 1.17.4) of 2021-08-09 built on hcra Repository revision: 799a66c454f4dbb06aeab744f92321d95e5043d0 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Arch Linux Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 50823 6567) (symbols 48 6607 1) (strings 32 18207 1416) (string-bytes 1 601772) (vectors 16 13438) (vector-slots 8 178370 10146) (floats 8 21 36) (intervals 56 293 1) (buffers 992 11)) From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 03:24:16 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 07:24:16 +0000 Received: from localhost ([127.0.0.1]:58322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDM7U-0003mo-4N for submit@debbugs.gnu.org; Tue, 10 Aug 2021 03:24:16 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:57975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDM7R-0003mX-Kp for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 03:24:14 -0400 Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 99D21200004; Tue, 10 Aug 2021 07:24:05 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Organization: LINKOV.NET References: Date: Tue, 10 Aug 2021 10:03:39 +0300 In-Reply-To: (laslydone via's message of "Mon, 09 Aug 2021 16:30:35 +0000") Message-ID: <87k0kudsb8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > What happened: > In Dired isearch-{forward,backward} will no longer match anything after running > `rectangle-mark-mode' and `query-replace'. > > What I thought would happen: > In Dired after running `rectangle-mark-mode' and `query-replace', > isearch-{forward,backward} would match again. > > To reproduce: > 1. emacs -Q > 2. C-x d > 3. C-x C-q > 4. C-x C-n > 5. M-% (entering nothing) > 6. ^s (searching for anything will show "Failing I-search: ANYTHING" in minibuffer) Stefan, please help. Wdired adds advice on a buffer-local isearch-filter-predicate, and perform-replace adds advice on a let-bound isearch-filter-predicate that changes the global value. This is the minimal test case: (add-function :after-while (local 'isearch-filter-predicate) (lambda (&rest _) 'filter-local)) (let ((isearch-filter-predicate isearch-filter-predicate)) (add-function :after-while isearch-filter-predicate (lambda (&rest _) 'filter-letbound))) C-h v isearch-filter-predicate: Value: #f(advice-wrapper :after-while #f(compiled-function (&rest args) #) (closure (t) (&rest _) 'filter-local)) Local in buffer *scratch*; global value is #f(advice-wrapper :after-while isearch-filter-visible (closure (t) (&rest _) 'filter-letbound)) Let-binding was supposed to protect from changing the global value, but with a buffer-local value it still changes the global value. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 09:38:31 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 13:38:31 +0000 Received: from localhost ([127.0.0.1]:58756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDRxf-0006jf-G0 for submit@debbugs.gnu.org; Tue, 10 Aug 2021 09:38:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDRxe-0006jP-2W for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 09:38:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49304) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDRxV-0002IP-TV; Tue, 10 Aug 2021 09:38:23 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1187 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDRxU-00034E-60; Tue, 10 Aug 2021 09:38:21 -0400 Date: Tue, 10 Aug 2021 16:38:29 +0300 Message-Id: <83r1f1fmi2.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87k0kudsb8.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 10 Aug 2021 10:03:39 +0300) Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, monnier@iro.umontreal.ca, laslydone@protonmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Tue, 10 Aug 2021 10:03:39 +0300 > Cc: 49963@debbugs.gnu.org, laslydone > > Stefan, please help. Wdired adds advice on a buffer-local isearch-filter-predicate, > and perform-replace adds advice on a let-bound isearch-filter-predicate > that changes the global value. This is the minimal test case: > > (add-function :after-while (local 'isearch-filter-predicate) > (lambda (&rest _) 'filter-local)) > > (let ((isearch-filter-predicate isearch-filter-predicate)) > (add-function :after-while isearch-filter-predicate > (lambda (&rest _) 'filter-letbound))) Regardless of how we solve this issue, could we please NOT use advices in such cases? is there really no other reasonable solution for this, like perhaps using some existing Isearch hook or (gasp!) introducing a new one? TIA From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 10:28:21 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 14:28:21 +0000 Received: from localhost ([127.0.0.1]:60216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDSjt-00025k-4J for submit@debbugs.gnu.org; Tue, 10 Aug 2021 10:28:21 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDSjq-00025W-MY for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 10:28:20 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1E0F08090F; Tue, 10 Aug 2021 10:28:13 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E6044807A2; Tue, 10 Aug 2021 10:28:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628605691; bh=4MYwTLkpkkYaXVueikGfZ7WZCYGtVZYU9Qs91Ku7AK4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=JHzgrnJa4PE/N9ooPdYTOWcPSV7VyBHapvsAEhEB2A7tgWo9+5WViJm8On/tl9YDs ZRNxIT/dVouQRmXUaeCUSCyeTg/cWAHJzkZvrbq9ly6VCUY6hj16II1daxLyHkJ0fv aZXq7bEiFn8sLKiWoIhyDFB7VFfUpH1PisszK48cCVUzaoF/lYb8Okpjc6Gd69zHip o4i3n5jWeO+BwZ87uN4CUu79XPHKnv1KqRf/jz42oBaBmHsXOqj7pT/96lZR+u6pL/ FoQKx88zFmc3NvibmXcodCcknVlci0e+sxoz/dNbl5bHCxqU9KDGBMB7Ry75gEqUaP rlda16GWdv3eA== Received: from alfajor (104-222-120-40.cpe.teksavvy.com [104.222.120.40]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AC6E212020A; Tue, 10 Aug 2021 10:28:11 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Message-ID: References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> Date: Tue, 10 Aug 2021 10:28:10 -0400 In-Reply-To: <83r1f1fmi2.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Aug 2021 16:38:29 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.064 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone@protonmail.com, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Regardless of how we solve this issue, could we please NOT use advices > in such cases? is there really no other reasonable solution for this, > like perhaps using some existing Isearch hook or (gasp!) introducing a > new one? These are not "advices", they are using a hook. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 10:31:04 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 14:31:04 +0000 Received: from localhost ([127.0.0.1]:60229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDSmV-0002Br-TI for submit@debbugs.gnu.org; Tue, 10 Aug 2021 10:31:04 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDSmU-0002BO-ON for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 10:31:03 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 50E314412B7; Tue, 10 Aug 2021 10:30:57 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1C759440C5A; Tue, 10 Aug 2021 10:30:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628605856; bh=3QYlkCNjx0nvWAlt61ihb7MsZtFhwAyWeuYSWUZCNPc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=L7c6z74IwfBCvo1CHueL2GHH4WM1sllHArtBpKj+rxPOgNL3J06pFd4WpHFJnAxja 95zWos5TnP7GS7JEcOOxMLqZA7SDzVMiGWq/gPrImC1WSG6Q4WwNPb2TDpVPAj/s7F eiFTP+vKe05uqmtlwsB0eKEuvY2YIy+/vpbjXJLPAf8JZGb+MoN2XG5GVuFVFTG/9U KyC1alNvIEMTO4wsMwf0IuclHYMP4cHzzgd5CgitjbIoAN70Af3C7xH7D9+qfS2ln9 jZUFzYcY7KVMqLR0JrdrPgwu80rlLr5ixD96pOnxEEeUfQXk68lg1AKfnLqKfc/7XV lvN9SEzRBPxuw== Received: from alfajor (104-222-120-40.cpe.teksavvy.com [104.222.120.40]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DBD7F12039B; Tue, 10 Aug 2021 10:30:55 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Message-ID: References: <87k0kudsb8.fsf@mail.linkov.net> Date: Tue, 10 Aug 2021 10:30:54 -0400 In-Reply-To: <87k0kudsb8.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 10 Aug 2021 10:03:39 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.092 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > (add-function :after-while (local 'isearch-filter-predicate) > (lambda (&rest _) 'filter-local)) > > (let ((isearch-filter-predicate isearch-filter-predicate)) > (add-function :after-while isearch-filter-predicate > (lambda (&rest _) 'filter-letbound))) > > C-h v isearch-filter-predicate: > > Value: > #f(advice-wrapper :after-while #f(compiled-function > (&rest args) > #) > (closure > (t) > (&rest _) > 'filter-local)) > Local in buffer *scratch*; global value is > #f(advice-wrapper :after-while isearch-filter-visible > (closure > (t) > (&rest _) > 'filter-letbound)) > > Let-binding was supposed to protect from changing the global value, But it doesn't, does it? So don't use `let`. Instead use `remove-function` with `unwind-protect`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 11:32:48 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 15:32:48 +0000 Received: from localhost ([127.0.0.1]:60475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDTkC-0008J7-4f for submit@debbugs.gnu.org; Tue, 10 Aug 2021 11:32:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDTk7-0008Ip-0O for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 11:32:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53970) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDTk1-0003Ay-0C; Tue, 10 Aug 2021 11:32:33 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDTjz-0004Na-Mt; Tue, 10 Aug 2021 11:32:32 -0400 Date: Tue, 10 Aug 2021 18:32:41 +0300 Message-Id: <83lf59fh7q.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 10 Aug 2021 10:28:10 -0400) Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone@protonmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Juri Linkov , 49963@debbugs.gnu.org, > laslydone@protonmail.com > Date: Tue, 10 Aug 2021 10:28:10 -0400 > > > Regardless of how we solve this issue, could we please NOT use advices > > in such cases? is there really no other reasonable solution for this, > > like perhaps using some existing Isearch hook or (gasp!) introducing a > > new one? > > These are not "advices", they are using a hook. I meant can we please not use add-function and friends. Please? From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 11:45:06 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 15:45:06 +0000 Received: from localhost ([127.0.0.1]:60501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDTw9-0000Bu-Os for submit@debbugs.gnu.org; Tue, 10 Aug 2021 11:45:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDTw7-0000B4-LE for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 11:45:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cXOvMc9x7QntvooTo3E7epyyLNji+EVL+ZBxNkZ7QDc=; b=ZxEN2bM7BPi67r4+zihkEvAT8d nqoLSmBVtDTN2kyNarwOitBoqtK867aG2H0ovnw8oWoKzpwXfDCG6fo+cclLUOlT9MkHDfkzPOJvn DBtoaZ7ynvl32RkAqOri/mG1ngiP3hiVD9J/rh8WwT/bgfJr5LS4ubTiWxJk6QcSGpz0=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDTvu-0003gO-Mg; Tue, 10 Aug 2021 17:44:54 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> Date: Tue, 10 Aug 2021 17:44:50 +0200 In-Reply-To: <83lf59fh7q.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Aug 2021 18:32:41 +0300") Message-ID: <87h7fxxq19.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > I meant can we please not use add-function and friends. Please? There isn't much difference between using add-function and add-hook most of the time (although here we trip over a `let' binding not doing what the author thought it did). Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone@protonmail.com, Stefan Monnier , juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > I meant can we please not use add-function and friends. Please? There isn't much difference between using add-function and add-hook most of the time (although here we trip over a `let' binding not doing what the author thought it did). add-function is better than add-hook in most ways, in my opinion, so I think using it is fine. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 11:57:07 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 15:57:07 +0000 Received: from localhost ([127.0.0.1]:60524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDU7n-0000VN-Gt for submit@debbugs.gnu.org; Tue, 10 Aug 2021 11:57:07 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDU7m-0000Uq-FY for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 11:57:06 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DE1031001FB; Tue, 10 Aug 2021 11:57:00 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BD95F1000C4; Tue, 10 Aug 2021 11:56:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628611019; bh=bCdnNmI9avCyOQIALxhZQ3xvVbzu2w5y36L5pwF9efs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=L2PeYXFifubUIwHmh68mIEVkDf1fBfA27uX7wxz2kzbueOySs5W9Lj5qddyJ3THE6 wBIRuURUwr67QOzgqSQWyxIaRnIWtr5JUq7is+CzFPVuZS5bcgaL7R/7aE6dJTaQua WGgrMziGYZ/aec4SLAX0IwWIAfgi0GWfu6Zq8oaVoFqNvGgDoriK/8rer4aeqPc7U+ AEhnqhAN2BP/zxR1uJXsE9Wi+yESYk7EoeC2/QJAcO0f1xvQxs5VAP257Re7dVV3mh xpP9YcHg5LS98wFW+JIpIOOgXv0nYNfse1FCuPYqlnzlTnfiIWrVyaScOG3tw2LmNx WS4JySXYc5IBg== Received: from alfajor (104-222-120-40.cpe.teksavvy.com [104.222.120.40]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8308912027C; Tue, 10 Aug 2021 11:56:59 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Message-ID: References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> Date: Tue, 10 Aug 2021 11:56:58 -0400 In-Reply-To: <87h7fxxq19.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 10 Aug 2021 17:44:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.045 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, Eli Zaretskii , laslydone@protonmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen [2021-08-10 17:44:50] wrote: > Eli Zaretskii writes: >> I meant can we please not use add-function and friends. Please? > There isn't much difference between using add-function and add-hook most > of the time (although here we trip over a `let' binding not doing what > the author thought it did). FWIW, `add-hook` has the exact same problem with `let` (and we already tripped against this exact same situation with `add-hook` and `let`). Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 12:37:36 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 16:37:37 +0000 Received: from localhost ([127.0.0.1]:60701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUku-0008G5-Ik for submit@debbugs.gnu.org; Tue, 10 Aug 2021 12:37:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUkr-0008Fm-Ag for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 12:37:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56844) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDUkj-0000kS-Th; Tue, 10 Aug 2021 12:37:21 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4236 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDUkj-00060W-Hi; Tue, 10 Aug 2021 12:37:21 -0400 Date: Tue, 10 Aug 2021 19:37:30 +0300 Message-Id: <83eeb1fe7p.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87h7fxxq19.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 10 Aug 2021 17:44:50 +0200) Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone@protonmail.com, monnier@iro.umontreal.ca, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Lars Ingebrigtsen > Cc: Stefan Monnier , 49963@debbugs.gnu.org, > juri@linkov.net, laslydone@protonmail.com > Date: Tue, 10 Aug 2021 17:44:50 +0200 > > There isn't much difference between using add-function and add-hook most > of the time (although here we trip over a `let' binding not doing what > the author thought it did). > > add-function is better than add-hook in most ways, in my opinion, so I > think using it is fine. Well, it prevented me from immediately seeing which code is stealing C-s, so I beg to differ. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 12:42:21 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 16:42:21 +0000 Received: from localhost ([127.0.0.1]:60729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUpV-0008OP-1f for submit@debbugs.gnu.org; Tue, 10 Aug 2021 12:42:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDUpP-0008O5-Bd for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 12:42:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57058) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDUpJ-0004Xz-9R; Tue, 10 Aug 2021 12:42:05 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4528 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDUpI-0006tz-SZ; Tue, 10 Aug 2021 12:42:05 -0400 Date: Tue, 10 Aug 2021 19:42:17 +0300 Message-Id: <83bl65fdzq.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 10 Aug 2021 11:56:58 -0400) Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, larsi@gnus.org, laslydone@protonmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 49963@debbugs.gnu.org, juri@linkov.net, > laslydone@protonmail.com > Date: Tue, 10 Aug 2021 11:56:58 -0400 > > Lars Ingebrigtsen [2021-08-10 17:44:50] wrote: > > Eli Zaretskii writes: > >> I meant can we please not use add-function and friends. Please? > > There isn't much difference between using add-function and add-hook most > > of the time (although here we trip over a `let' binding not doing what > > the author thought it did). > > FWIW, `add-hook` has the exact same problem with `let` (and we already > tripped against this exact same situation with `add-hook` and `let`). This is a misunderstanding of what bothers me. The problem is discoverability: add-function is not easily discoverable, if it is used on an internal function. IOW, the documentation of C-s doesn't tell you that its operation could be affected by that "hook". By contrast, if we use some other mechanism, like call a function via a variable or call a hook, and if we document these in the doc string of C-s, that problem will have disappeared, and finding causes of problems such as this one would be easier. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 16:37:43 2021 Received: (at 49963) by debbugs.gnu.org; 10 Aug 2021 20:37:44 +0000 Received: from localhost ([127.0.0.1]:60922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDYVL-0007tc-IP for submit@debbugs.gnu.org; Tue, 10 Aug 2021 16:37:43 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDYVI-0007tN-Ml for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 16:37:42 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AD87E8090F; Tue, 10 Aug 2021 16:37:34 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D404F807A2; Tue, 10 Aug 2021 16:37:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628627848; bh=s6McoF0TI6t39JnkJ7frEsN9Pig4iSFaqK+KT0kmnfc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iBQu78mmMS/U3JG8sjCW8i/8fYU1Z3FKq69vsf/XERyqMXr2lnbbhY9KNpZfdHqdD Uev9RzOxGSjiRoW9soPocPpzhlKbvzcI21RfAxLaIbQFJnJEWveOwIZr0CqXQrQGaG LH3iW26zdo9m5Zaba2TUGhm1A7PcK7gXZ1T4Opq2NgSDmvhNSb8dQVZ+Czb1IH1NYT MEaCz8QxKYjNaFfBKmF7PwxV5HdrH4OElP0BgEIaOc5hUckT19BpIjZzobPe7jY70h fthstb0yMweSyEoWa/kYNtezWpxXpeb3meBBXKUVAUtyJw/7+OX72rFfIewY+au75x Xtqc256ylnLDw== Received: from alfajor (104-222-120-40.cpe.teksavvy.com [104.222.120.40]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9035612031C; Tue, 10 Aug 2021 16:37:28 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Message-ID: References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> <83bl65fdzq.fsf@gnu.org> Date: Tue, 10 Aug 2021 16:37:22 -0400 In-Reply-To: <83bl65fdzq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Aug 2021 19:42:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.062 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, larsi@gnus.org, laslydone@protonmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii [2021-08-10 19:42:17] wrote: >> From: Stefan Monnier >> Cc: Eli Zaretskii , 49963@debbugs.gnu.org, juri@linkov.net, >> laslydone@protonmail.com >> Date: Tue, 10 Aug 2021 11:56:58 -0400 >> >> Lars Ingebrigtsen [2021-08-10 17:44:50] wrote: >> > Eli Zaretskii writes: >> >> I meant can we please not use add-function and friends. Please? >> > There isn't much difference between using add-function and add-hook most >> > of the time (although here we trip over a `let' binding not doing what >> > the author thought it did). >> >> FWIW, `add-hook` has the exact same problem with `let` (and we already >> tripped against this exact same situation with `add-hook` and `let`). > > This is a misunderstanding of what bothers me. The problem is > discoverability: add-function is not easily discoverable, if it is > used on an internal function. I'm sorry, I don't understand. AFAIK it's used on variables (in the present case it's used on the variable `isearch-filter-predicate`) holding functions, not on internal functions. > IOW, the documentation of C-s doesn't tell you that its operation > could be affected by that "hook". You mean the doc of `C-s` should state that it's affected by `isearch-filter-predicate`? Fine by me, but I don't know what this has to do with `add-function` (`isearch-filter-predicate` existed before `add-function` was invented). > By contrast, if we use some other mechanism, like call a function via > a variable or call a hook, Hmm... again I don't understand: we do "call a function via a variable", the variable being `isearch-filter-predicate`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 22:59:06 2021 Received: (at 49963) by debbugs.gnu.org; 11 Aug 2021 02:59:06 +0000 Received: from localhost ([127.0.0.1]:32903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDeSL-0002Jk-Q2 for submit@debbugs.gnu.org; Tue, 10 Aug 2021 22:59:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDeSF-0002JH-B5 for 49963@debbugs.gnu.org; Tue, 10 Aug 2021 22:58:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44950) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDeS8-0006C6-3U; Tue, 10 Aug 2021 22:58:48 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mDeS7-0006zz-Su; Tue, 10 Aug 2021 22:58:47 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <83bl65fdzq.fsf@gnu.org> (message from Eli Zaretskii on Tue, 10 Aug 2021 19:42:17 +0300) Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> <83bl65fdzq.fsf@gnu.org> Message-Id: Date: Tue, 10 Aug 2021 22:58:47 -0400 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, larsi@gnus.org, laslydone@protonmail.com, monnier@iro.umontreal.ca, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > This is a misunderstanding of what bothers me. The problem is > discoverability: add-function is not easily discoverable, if it is > used on an internal function. IOW, the documentation of C-s doesn't > tell you that its operation could be affected by that "hook". By > contrast, if we use some other mechanism, like call a function via a > variable or call a hook, and if we document these in the doc string of > C-s, that problem will have disappeared, and finding causes of > problems such as this one would be easier. For this reason, we had the rule that packages or libraries should not define any advice. Advice is for users to play with, or for code not ready to release; it is not meant for released code to communicate through. However, that rule seems to have been deleted from all the places it ought to be. I can't find it in advice.el (though I may have missed it; the file starts with 1500 lines of documentation). And I can't find it in functions.texi either. We need to document this rule again. Can someone find it in an old version of the Emacs Lisp Reference Manual? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 01:33:12 2021 Received: (at 49963) by debbugs.gnu.org; 11 Aug 2021 05:33:12 +0000 Received: from localhost ([127.0.0.1]:33063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDgrU-0006Ld-SQ for submit@debbugs.gnu.org; Wed, 11 Aug 2021 01:33:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDgrO-0006L4-V7 for 49963@debbugs.gnu.org; Wed, 11 Aug 2021 01:33:06 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3A185808E4; Wed, 11 Aug 2021 01:32:57 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 15A63806A5; Wed, 11 Aug 2021 01:32:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628659976; bh=mLIyDrsBz+0RBlTJVaAlsYJtbwDWSuGvSFhDbF/ObTY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Zcc+T35VPzPPHbtZy0beKe4I7kyGWxcRmQ85KwxkutIZz9aIi4K1UauAPZvPBgB5T uBAECMGJHeOH6LvbckM3wyZPoDU8xR2aZuLFS5l0MTUcs27+UONqF++t8c0np80taO 3QK5N3hkHcMEGT3GCUzRdlCFRo7XtKvT8TxRpYy1C14ZWkofj/IwOvvEtQzH3JEK7B LkWu2l7Tortsxz4354pg21ipQC4gEtLVlkqUNMgn1WdF1Hz1wNr7xQUPPtlrUvXLLZ 2GiC0Va1zfMPnSwnwPGg93RR5tzXOX823Dl6TKh5AsrQRBP4NbBhsakKR3o18IgY0B 7DSiqbdYU845g== Received: from alfajor (104-222-120-40.cpe.teksavvy.com [104.222.120.40]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B1DF81200B8; Wed, 11 Aug 2021 01:32:55 -0400 (EDT) From: Stefan Monnier To: Richard Stallman Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Message-ID: References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> <83bl65fdzq.fsf@gnu.org> Date: Wed, 11 Aug 2021 01:32:54 -0400 In-Reply-To: (Richard Stallman's message of "Tue, 10 Aug 2021 22:58:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.063 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, Eli Zaretskii , laslydone@protonmail.com, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > This is a misunderstanding of what bothers me. The problem is > > discoverability: add-function is not easily discoverable, if it is > > used on an internal function. IOW, the documentation of C-s doesn't > > tell you that its operation could be affected by that "hook". By > > contrast, if we use some other mechanism, like call a function via a > > variable or call a hook, and if we document these in the doc string of > > C-s, that problem will have disappeared, and finding causes of > > problems such as this one would be easier. > > For this reason, we had the rule that packages or libraries should not > define any advice. Again, this bug report is not about the use of an advice. There is no advice used in this code. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:06:07 2021 Received: (at 49963) by debbugs.gnu.org; 11 Aug 2021 07:06:07 +0000 Received: from localhost ([127.0.0.1]:33111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiJT-0000BE-H8 for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:06:07 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:39825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiJR-0000AK-QQ for 49963@debbugs.gnu.org; Wed, 11 Aug 2021 03:06:06 -0400 Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 2FCBFC0007; Wed, 11 Aug 2021 07:05:56 +0000 (UTC) From: Juri Linkov To: Richard Stallman Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Organization: LINKOV.NET References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> <83bl65fdzq.fsf@gnu.org> Date: Wed, 11 Aug 2021 10:04:28 +0300 In-Reply-To: (Richard Stallman's message of "Tue, 10 Aug 2021 22:58:47 -0400") Message-ID: <87v94ccw8z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, larsi@gnus.org, Eli Zaretskii , monnier@iro.umontreal.ca, laslydone@protonmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > However, that rule seems to have been deleted from all the > places it ought to be. I can't find it in advice.el (though I may > have missed it; the file starts with 1500 lines of documentation). > And I can't find it in functions.texi either. > > We need to document this rule again. Can someone find it > in an old version of the Emacs Lisp Reference Manual? The manual still contains this rule in the node Coding Standards: Avoid using ‘defadvice’ or ‘with-eval-after-load’ for Lisp code to be included in Emacs. I'm sorry that I made a mistake when used the wrong word "advice" while describing the problem that is not about the use of an advice. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:10:03 2021 Received: (at 49963) by debbugs.gnu.org; 11 Aug 2021 07:10:03 +0000 Received: from localhost ([127.0.0.1]:33127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiNG-0000Hh-T6 for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:10:03 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:46839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiNE-0000H5-Vo; Wed, 11 Aug 2021 03:10:01 -0400 Received: (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 76C0B60005; Wed, 11 Aug 2021 07:09:52 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace Organization: LINKOV.NET References: <87k0kudsb8.fsf@mail.linkov.net> Date: Wed, 11 Aug 2021 10:08:59 +0300 In-Reply-To: (Stefan Monnier's message of "Tue, 10 Aug 2021 10:30:54 -0400") Message-ID: <87lf58cvas.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, laslydone X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 49963 fixed close 49963 28.0.50 thanks >> Let-binding was supposed to protect from changing the global value, > > But it doesn't, does it? > > So don't use `let`. > Instead use `remove-function` with `unwind-protect`. Thanks, now added `remove-function` in `unwind-protect`. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 08:39:42 2021 Received: (at 49963) by debbugs.gnu.org; 11 Aug 2021 12:39:42 +0000 Received: from localhost ([127.0.0.1]:33813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDnWE-0005Ke-Fg for submit@debbugs.gnu.org; Wed, 11 Aug 2021 08:39:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDnWB-0005KP-MJ for 49963@debbugs.gnu.org; Wed, 11 Aug 2021 08:39:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57072) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDnW5-00087U-5Q; Wed, 11 Aug 2021 08:39:29 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2527 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDnW4-00014S-LP; Wed, 11 Aug 2021 08:39:28 -0400 Date: Wed, 11 Aug 2021 15:39:39 +0300 Message-Id: <83pmukduk4.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 10 Aug 2021 16:37:22 -0400) Subject: Re: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace References: <87k0kudsb8.fsf@mail.linkov.net> <83r1f1fmi2.fsf@gnu.org> <83lf59fh7q.fsf@gnu.org> <87h7fxxq19.fsf@gnus.org> <83bl65fdzq.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49963 Cc: 49963@debbugs.gnu.org, larsi@gnus.org, laslydone@protonmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: larsi@gnus.org, 49963@debbugs.gnu.org, juri@linkov.net, > laslydone@protonmail.com > Date: Tue, 10 Aug 2021 16:37:22 -0400 > > Eli Zaretskii [2021-08-10 19:42:17] wrote: > >> From: Stefan Monnier > >> Cc: Eli Zaretskii , 49963@debbugs.gnu.org, juri@linkov.net, > >> laslydone@protonmail.com > >> Date: Tue, 10 Aug 2021 11:56:58 -0400 > >> > >> Lars Ingebrigtsen [2021-08-10 17:44:50] wrote: > >> > Eli Zaretskii writes: > >> >> I meant can we please not use add-function and friends. Please? > >> > There isn't much difference between using add-function and add-hook most > >> > of the time (although here we trip over a `let' binding not doing what > >> > the author thought it did). > >> > >> FWIW, `add-hook` has the exact same problem with `let` (and we already > >> tripped against this exact same situation with `add-hook` and `let`). > > > > This is a misunderstanding of what bothers me. The problem is > > discoverability: add-function is not easily discoverable, if it is > > used on an internal function. > > I'm sorry, I don't understand. AFAIK it's used on variables (in the > present case it's used on the variable `isearch-filter-predicate`) > holding functions, not on internal functions. And if I've said instead This is a misunderstanding of what bothers me. The problem is discoverability: add-function is not easily discoverable, if it is used on an internal variable. then you'd understand? If so, please excuse my silly typo, and please reply to the amended text above. > > IOW, the documentation of C-s doesn't tell you that its operation > > could be affected by that "hook". > > You mean the doc of `C-s` should state that it's affected by > `isearch-filter-predicate`? > > Fine by me, but I don't know what this has to do with `add-function` > (`isearch-filter-predicate` existed before `add-function` was invented). It makes the rabbit hole much deeper and darker. Because even if and when I find that isearch-filter-predicate is involved in this (which isn't easy, see below), its "C-h v" shows the following gobbledygook: isearch-filter-predicate is a variable defined in ‘isearch.el’. Its value is #f(advice-wrapper :after-while #f(compiled-function (&rest args) #) wdired-isearch-filter-read-only) And that's the second try, after "M-: isearch-filter-predicate RET", a standard way of figuring out the values of variables,which curses thusly: #[128 "\300\302\"\205 ^@\300\301\"\207" [apply wdired-isearch-filter-read-only #[128 "\301\302\300!\"\207" [isearch-filter-predicate apply default-value] 4 " (fn &rest ARGS)"] nil] 4 nil] Why does wdired need to use add-function? why couldn't it simply put its own function on isearch-filter-predicate's value? The code in isearch.el is notoriously hard to debug, because it is written in many layers, uses a lot of function variables and indirect calls, and almost none of its important subroutines have any useful doc strings or comments. And stepping with Edebug through its code is also not easy because of the way Isearch reads input, which conflicts with Edebug's SPC-stepping. So tracking an issue related to isearch.el is an endless mess of guessing the next candidate for being part of the puzzle, following the chain of indirect calls through variables and hooks, then finding the next suspect, etc. etc. Using add-function on top of that makes a bad problem much worse. So I'm asking whether we could improve that by not using add-function. Bonus points for adding meaningful doc strings and/or comments to important isearch.el functions and variables so that one could easier find the possible suspects by following the code and the documentation instead of stepping blindly through complex code. TIA. From unknown Fri Aug 15 02:04:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 Sep 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator