From unknown Tue Jun 17 21:53:08 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#53126 <53126@debbugs.gnu.org> To: bug#53126 <53126@debbugs.gnu.org> Subject: Status: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Reply-To: bug#53126 <53126@debbugs.gnu.org> Date: Wed, 18 Jun 2025 04:53:08 +0000 retitle 53126 29.0.50; [PATCH] Lazy highlight/count when reading query-repl= ace string, etc. reassign 53126 emacs submitter 53126 Augusto Stoffel severity 53126 normal tag 53126 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 08 08:24:45 2022 Received: (at submit) by debbugs.gnu.org; 8 Jan 2022 13:24:45 +0000 Received: from localhost ([127.0.0.1]:46587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6Bi8-0004yY-Dz for submit@debbugs.gnu.org; Sat, 08 Jan 2022 08:24:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:46044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6Bi4-0004yN-Ov for submit@debbugs.gnu.org; Sat, 08 Jan 2022 08:24:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6Bi4-0007js-K3 for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 08:24:40 -0500 Received: from [2a00:1450:4864:20::334] (port=51722 helo=mail-wm1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6Bi2-0002sV-Ah for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 08:24:40 -0500 Received: by mail-wm1-x334.google.com with SMTP id e5so5728044wmq.1 for ; Sat, 08 Jan 2022 05:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:user-agent:mime-version; bh=SgV5AddMxwLgFwrCpf68eS9aqAcUfGRMfInRKJRQ35g=; b=XFKlAWhHxo1vg4rIA6TQ3+gA6EOvf99uTYo06EY4vu2Aoi+IWqtktYZtCdxhA2ZNae AWq3N5iG6HxjkErhVuZFF+FXX5Wbv3gUy79tql1Fry7oNOOl7XgGg07f69+Mf2Jieuja HkE2m0Fa0uX7B1wBelWMD+O3Y/5fsXrgnzbx2rHHnuGRzZE3r9MF67gLN3bcwJyHeY9w z9HB8Ab1WFkkusIXAP4rtdnwedT5ZZnvtjZ1+/w133B6i0EndohqsCntDe3ReyJ1yj0h 1hGXDMJTJUwqlnIR2XBAIbAARdgX08tPV4y+ohb8soMf9WJYA5OLxgIeZ5F9Vlc5nwqQ Tagg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=SgV5AddMxwLgFwrCpf68eS9aqAcUfGRMfInRKJRQ35g=; b=xkNaid8TjdjCLOJlPOLR2ZjUl7bXXqdh/YOnSicxQFCorC9Ho19qOtdFm/71Mj84ZJ scbv4EZ7ABM1+y7yhUN0AWBPFNDyBFABR30ebu5sNJgWQgLTwLDQATeOPXclk0zvsyob 94PQNAvisthd68Z/h8XjdFusd1/z9Cig4mZvf3nn+o4nsPRl6W9JEyQfMzGistrEdoQH liB4YJPTgQgx2BpWsVUYb4bcuP4hL90z9/dv60CUG2bEMgRmQ/7349sPTiYt5FH7xQDS m4bWmyO0LREJ/vHcXU9wFCwFoTI/vOGjo1P12QVmIDbPSQIB27MO2xRu8JCH+/O85E8T bHcw== X-Gm-Message-State: AOAM533A7HjEfRRM1V9N1sjIC/JiYt+xOsUx3JI7GK/uxdgPmpor7XRf b1WLY3IFwjja0gZojc2P9ducA0JGRS8= X-Google-Smtp-Source: ABdhPJyRswlDYINO1Gc7brHFbkCAi6yJHCIAh0kJa5Pvl3ypSVLGG5bEEeALM7c9a5xjJIdR/OmCSg== X-Received: by 2002:a1c:740c:: with SMTP id p12mr14642787wmc.140.1641648275461; Sat, 08 Jan 2022 05:24:35 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::b4b9]) by smtp.gmail.com with ESMTPSA id r19sm730999wmh.42.2022.01.08.05.24.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jan 2022 05:24:34 -0800 (PST) From: Augusto Stoffel To: bug-gnu-emacs@gnu.org Subject: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Date: Sat, 08 Jan 2022 14:24:33 +0100 Message-ID: <87sftyweb2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::334 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=arstoffel@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: The anzu package was mentioned recently in the mailing list. Emacs now includes the lazy-count feature, which is the main purpose of anzu, but it's still missing one nice feature from that package, na [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (arstoffel[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.3 SPOOFED_FREEMAIL No description available. 1.5 SPOOF_GMAIL_MID From Gmail but it doesn't seem to be... X-Debbugs-Envelope-To: submit 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: -2.3 (--) --=-=-= Content-Type: text/plain The anzu package was mentioned recently in the mailing list. Emacs now includes the lazy-count feature, which is the main purpose of anzu, but it's still missing one nice feature from that package, namely the highlighting and count of matches as one types a regexp or string to replace in `query-replace{-regexp}'. See the below patch for a (probably not yet mature) stab at this. I've also added lazy highlighting to the `isearch-edit-string' command. I didn't introduce any new customization variables. Lazy highlighting in both `query-replace{-regexp}' and `isearch-edit-string' is controlled by `isearch-lazy-highlight' (therefore is on by default) and lazy count next to the minibuffer prompt is controlled by `isearch-lazy-count' (therefore off by default). I believe the problems pointed out in a previous iteration of this in https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01196.html are now solved. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Allow-reading-from-minibuffer-with-lazy-highlight-an.patch >From 11e52a1bf1adb2a15dda3097d6c6016034ae4487 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 8 Jan 2022 11:08:46 +0100 Subject: [PATCH 1/2] Allow reading from minibuffer with lazy highlight and match count * lisp/isearch.el (isearch-lazy-count-display-function): New variable allowing to display the lazy count in special ways. (isearch-edit-string): Add lazy highlight and count of matching text. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-buffer-update): Use `isearch-lazy-count-display-function' instead of hardcoded call to `isearch-message'. (isearch-read-with-highlight--overlay, isearch-read-with-highlight--after-change, isearch-read-with-highlight--exit, isearch-read-with-highlight-setup, isearch-read-with-highlight-count): Variable and functions implementing the lazy highlight functionality while reading from minibuffer. * lisp/simple.el (minibuffer-history-isearch-setup): Set `isearch-lazy-count-display-function' appropriately. * lisp/comint.el (comint-history-isearch-setup, comint-history-isearch-end): Set `isearch-lazy-count-display-function' appropriately. --- lisp/comint.el | 2 ++ lisp/isearch.el | 91 +++++++++++++++++++++++++++++++++++++++---------- lisp/simple.el | 1 + 3 files changed, 76 insertions(+), 18 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index fdea3e33bb..c1695bbbdf 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1515,6 +1515,7 @@ comint-history-isearch-setup #'comint-history-isearch-wrap) (setq-local isearch-push-state-function #'comint-history-isearch-push-state) + (setq-local isearch-lazy-count-display-function nil) (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t))) (defun comint-history-isearch-end () @@ -1526,6 +1527,7 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + (setq-local isearch-lazy-count-display-function #'isearch-message) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended (custom-reevaluate-setting 'comint-history-isearch))) diff --git a/lisp/isearch.el b/lisp/isearch.el index 7593a0ec98..ccb06d534e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -465,6 +465,9 @@ lazy-count-suffix-format :group 'lazy-count :version "27.1") +(defvar isearch-lazy-count-display-function #'isearch-message + "Function called when new lazy count results are available.") + ;; Define isearch help map. @@ -1808,19 +1811,21 @@ isearch-edit-string ;; for some incompatibility with gmhist. (minibuffer-history-symbol) ;; Search string might have meta information on text properties. - (minibuffer-allow-text-properties t)) + (minibuffer-allow-text-properties t) + (isearch-lazy-count-display-function #'isearch-read-with-highlight-count)) (setq isearch-new-string - (read-from-minibuffer - (isearch-message-prefix nil isearch-nonincremental) - (cons isearch-string (1+ (or (isearch-fail-pos) - (length isearch-string)))) - minibuffer-local-isearch-map nil - (if isearch-regexp - (cons 'regexp-search-ring - (1+ (or regexp-search-ring-yank-pointer -1))) - (cons 'search-ring - (1+ (or search-ring-yank-pointer -1)))) - nil t) + (minibuffer-with-setup-hook #'isearch-read-with-highlight-setup + (read-from-minibuffer + (isearch-message-prefix nil isearch-nonincremental) + (cons isearch-string (1+ (or (isearch-fail-pos) + (length isearch-string)))) + minibuffer-local-isearch-map nil + (if isearch-regexp + (cons 'regexp-search-ring + (1+ (or regexp-search-ring-yank-pointer -1))) + (cons 'search-ring + (1+ (or search-ring-yank-pointer -1)))) + nil t)) isearch-new-message (mapconcat 'isearch-text-char-description isearch-new-string ""))))) @@ -4023,7 +4028,7 @@ isearch-lazy-highlight-new-loop isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when (and isearch-lazy-count isearch-lazy-count-display-function) (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -4042,7 +4047,8 @@ isearch-lazy-highlight-new-loop (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) ;; Delay updating the message if possible, to avoid flicker - (when (string-equal isearch-string "") (isearch-message)))) + (when (string-equal isearch-string "") + (funcall isearch-lazy-count-display-function)))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error) @@ -4095,13 +4101,13 @@ isearch-lazy-highlight-new-loop 'isearch-lazy-highlight-start)))) ;; Update the current match number only in isearch-mode and ;; unless isearch-mode is used specially with isearch-message-function - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when (and isearch-lazy-count isearch-lazy-count-display-function) ;; Update isearch-lazy-count-current only when it was already set ;; at the end of isearch-lazy-highlight-buffer-update (when isearch-lazy-count-current (setq isearch-lazy-count-current (gethash (point) isearch-lazy-count-hash 0)) - (isearch-message)))) + (funcall isearch-lazy-count-display-function)))) (defun isearch-lazy-highlight-search (string bound) "Search ahead for the next or previous match, for lazy highlighting. @@ -4302,16 +4308,65 @@ isearch-lazy-highlight-buffer-update (setq looping nil nomore t)))) (if nomore - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when (and isearch-lazy-count isearch-lazy-count-display-function) (unless isearch-lazy-count-total (setq isearch-lazy-count-total 0)) (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) - (isearch-message)) + (funcall isearch-lazy-count-display-function)) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) +;; Reading from minibuffer with lazy highlight and match count + +(defvar isearch-read-with-highlight--overlay nil + "Overlay for minibuffer prompt updates.") + +(defvar isearch-read-with-highlight-transform #'identity + "Function to transform minibuffer text into a `isearch-string' for highlighting.") + +(defun isearch-read-with-highlight--after-change (_beg _end _len) + "Update lazy highlight state in minibuffer selected window." + (when isearch-lazy-highlight + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (setq isearch-string (funcall isearch-read-with-highlight-transform string)) + (isearch-lazy-highlight-new-loop))))) + +(defun isearch-read-with-highlight--exit () + "Unwind changes from `isearch-read-with-highlight-setup'." + (remove-hook 'after-change-functions + #'isearch-read-with-highlight--after-change) + (remove-hook 'minibuffer-exit-hook #'isearch-read-with-highlight--exit) + (setq isearch-read-with-highlight--overlay nil) + (lazy-highlight-cleanup)) + +(defun isearch-read-with-highlight-setup () + "Set up minibuffer for lazy highlight of matches in the original window. + +This is intended to be called via `minibuffer-with-setup-hook'. +Note that several other isearch variables influence the lazy +highlighting, including `isearch-regexp' and +`isearch-lazy-count-display-function'." + (add-hook 'after-change-functions + #'isearch-read-with-highlight--after-change) + (add-hook 'minibuffer-exit-hook #'isearch-read-with-highlight--exit) + (setq isearch-read-with-highlight--overlay + (make-overlay (point-min) (point-min) (current-buffer) t t)) + (isearch-read-with-highlight--after-change nil nil nil)) + +(defun isearch-read-with-highlight-count () + "Display total match count in the minibuffer prompt." + (when isearch-read-with-highlight--overlay + (overlay-put isearch-read-with-highlight--overlay + 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format "%s " isearch-lazy-count-total))))) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. STRING is the string or regexp searched for. diff --git a/lisp/simple.el b/lisp/simple.el index 070d2764fe..ecf07b912d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2787,6 +2787,7 @@ minibuffer-history-isearch-setup #'minibuffer-history-isearch-wrap) (setq-local isearch-push-state-function #'minibuffer-history-isearch-push-state) + (setq-local isearch-lazy-count-display-function nil) (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) (defun minibuffer-history-isearch-end () -- 2.33.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Lazy-highlight-when-reading-query-replace-text.patch >From 6d9ec412addfc450f63487de0d90a1076cab47a0 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 8 Jan 2022 13:15:40 +0100 Subject: [PATCH 2/2] Lazy highlight when reading query-replace text * lisp/replace.el (query-replace-read-from): Add lazy highlighting. --- lisp/replace.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/replace.el b/lisp/replace.el index 60e507c642..241a97a3a2 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -244,6 +244,17 @@ query-replace-read-from (query-replace-descr (cdar query-replace-defaults))))) (t (format-prompt prompt nil)))) + ;; Set up lazy highlighting while reading FROM regexp + (isearch-lazy-highlight query-replace-highlight) + (isearch-regexp regexp-flag) + (isearch-regexp-function nil) + (isearch-case-fold-search case-fold-search) ;; TODO: the case-folding rule here is complicated... + (isearch-read-with-highlight-transform + (lambda (string) + (let ((from (query-replace--split-string string))) + (if (consp from) (car from) from)))) + (isearch-lazy-count-display-function + #'isearch-read-with-highlight-count) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. @@ -251,6 +262,7 @@ query-replace-read-from (save-excursion (minibuffer-with-setup-hook (lambda () + (isearch-read-with-highlight-setup) (setq-local text-property-default-nonsticky (append '((separator . t) (face . t)) text-property-default-nonsticky))) -- 2.33.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 08 14:10:32 2022 Received: (at 53126) by debbugs.gnu.org; 8 Jan 2022 19:10:32 +0000 Received: from localhost ([127.0.0.1]:48722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6H6m-0002ik-Ew for submit@debbugs.gnu.org; Sat, 08 Jan 2022 14:10:32 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:41207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6H6k-0002iU-CB for 53126@debbugs.gnu.org; Sat, 08 Jan 2022 14:10:31 -0500 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 3E97D1C0002; Sat, 8 Jan 2022 19:10:22 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> Date: Sat, 08 Jan 2022 20:59:45 +0200 In-Reply-To: <87sftyweb2.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 08 Jan 2022 14:24:33 +0100") Message-ID: <861r1iyrvw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > The anzu package was mentioned recently in the mailing list. Emacs now > includes the lazy-count feature, which is the main purpose of anzu, but > it's still missing one nice feature from that package, namely the > highlighting and count of matches as one types a regexp or string to > replace in `query-replace{-regexp}'. See the below patch for a > (probably not yet mature) stab at this. Strange, I expected that the lazy-count feature applied to query-replace should do a different thing - when querying about replacing the current match, it should show the number of current match and the number of total matches. The latter number should be updated after every replacement. But your patches are intended for a different feature - highlighting of matches in the buffer while entering an input string in the minibuffer. I wonder how many users need this feature, when it's easy to construct a query-replace string using highlighting/counting in isearch-mode, then type M-% (isearch-query-replace) that invokes query-replace with the query-replace string. Perhaps better to ask on emacs-devel if anyone needs this feature. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 08 14:35:47 2022 Received: (at 53126) by debbugs.gnu.org; 8 Jan 2022 19:35:48 +0000 Received: from localhost ([127.0.0.1]:48738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6HVD-0003QG-K9 for submit@debbugs.gnu.org; Sat, 08 Jan 2022 14:35:47 -0500 Received: from mail-wm1-f41.google.com ([209.85.128.41]:54937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6HVB-0003Q2-4f for 53126@debbugs.gnu.org; Sat, 08 Jan 2022 14:35:46 -0500 Received: by mail-wm1-f41.google.com with SMTP id o30so6159363wms.4 for <53126@debbugs.gnu.org>; Sat, 08 Jan 2022 11:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=uaFdM9GK9mFThXF458EmwUwxMBv5A1iBXXFs/RMmQGI=; b=JjEV2dJsDq9LCRftjphE2m1bwrOpzB4f+n7Z14f35n4xgDIHH4gSMSfJq/KoT6WyjL Rdgwe0k1mFZX8h04v+S1ndQxDSyQoyiTRcoTfUgHTByQWpoZPHFfeRMBOlrET0r2QjTV ju/pN4/5P8jVAPHfi5Eajgsnuh8ndnULHG0uXSI6k7ziZGOawj3rzbGTpxWyTcMeS/AS siLUhS9Sq/GAxCNOpK8i/FXIgVj7UPuihzPncgR70xdup/tujvFD3r+qBlJcGLavOZ53 OqSdKKG5fJArat/N0N5jTsCBlewgGgcTsbNE/OnJcnKpXRdcpSB0MNBHanINAQ+aJyEU yJwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=uaFdM9GK9mFThXF458EmwUwxMBv5A1iBXXFs/RMmQGI=; b=Y5LXePkCz/W7nGd3WuL05wS5cmFQ+mS/wrcG5AEi9LSmXQUxTT/5GTtp7X5tMRL/3Q oQz3UXcEkhavP/pMFoqHKNMl9GX+/uG350ZWu/9uSLFP8Ir2Ty/qL3u4A9AXy0r94Hjn xLvH7dsrXH+2mRt4slwYfyGVP2ZB+8BM7PselCfegt4lx7mOtoJnfVW9jmvE1OlBkEuq TDXB5Ws9xPYmcLhqVgQ7urDSLTsuT1pH8A9E8jIckb7YjG4/GwJTDjly1dUTdzg9565g IFjOTrB/FkA0tGWvpWxJ6K3QYuuNRXh+3e4CqBl8ZNI9gSd+F58Mg3k6ilD9KoRHEO+O aQUw== X-Gm-Message-State: AOAM533gscDtbMf+5ZDlpdaA+3UfVI8uFMRHKQ9JTfWVTxekzSMzw4pk OXdoVe3SfjrjyfQrwz9etAn2vL6rN+o= X-Google-Smtp-Source: ABdhPJwSp0nqUfLyX1/18IEtB5/hB0Nmz+AbulT0dk4wEo1PL0b7zruH0D71BaIElfpU2uKHXCh+XA== X-Received: by 2002:a1c:e909:: with SMTP id q9mr15344151wmc.184.1641670538936; Sat, 08 Jan 2022 11:35:38 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::b4b9]) by smtp.gmail.com with ESMTPSA id m39sm2021535wms.33.2022.01.08.11.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jan 2022 11:35:38 -0800 (PST) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> Date: Sat, 08 Jan 2022 20:35:36 +0100 In-Reply-To: <861r1iyrvw.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 08 Jan 2022 20:59:45 +0200") Message-ID: <87zgo6owaf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Sat, 8 Jan 2022 at 20:59, Juri Linkov wrote: > Strange, I expected that the lazy-count feature applied to query-replace > should do a different thing - when querying about replacing the current match, > it should show the number of current match and the number of total matches. > The latter number should be updated after every replacement. > That would be handy too. I haven't checked how the `perform-replace' loop works, but wouldn't this require a hook into the lazy count procedure --- precisely what my patch introduces through the new variable `isearch-lazy-count-display-function'? > But your patches are intended for a different feature - highlighting > of matches in the buffer while entering an input string in the minibuffer. > > I wonder how many users need this feature, when it's easy to construct > a query-replace string using highlighting/counting in isearch-mode, > then type M-% > (isearch-query-replace) that invokes query-replace with the > query-replace string. > Sure, this alternative method works. But somehow it's not the way I usually start a replace, and I think there's nothing wrong with that preference :-) > Perhaps better to ask on emacs-devel if anyone needs this feature. We can ask. But note that the bulk of the patch has a fairly general purpose, namely to read a regexp with live preview of the matches. There's probably a couple extra uses for this. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 09 04:29:09 2022 Received: (at 53126) by debbugs.gnu.org; 9 Jan 2022 09:29:09 +0000 Received: from localhost ([127.0.0.1]:49195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6UVh-0007V9-Ec for submit@debbugs.gnu.org; Sun, 09 Jan 2022 04:29:09 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6UVf-0007Ul-Qy for 53126@debbugs.gnu.org; Sun, 09 Jan 2022 04:29:08 -0500 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 7864E1BF207; Sun, 9 Jan 2022 09:28:59 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> Date: Sun, 09 Jan 2022 11:10:13 +0200 In-Reply-To: <87zgo6owaf.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 08 Jan 2022 20:35:36 +0100") Message-ID: <86k0f9xnrn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Strange, I expected that the lazy-count feature applied to query-replace >> should do a different thing - when querying about replacing the current match, >> it should show the number of current match and the number of total matches. >> The latter number should be updated after every replacement. > > That would be handy too. I haven't checked how the `perform-replace' > loop works, but wouldn't this require a hook into the lazy count > procedure --- precisely what my patch introduces through the new > variable `isearch-lazy-count-display-function'? It seems the "Query replacing" prompt in perform-replace could just display the values of isearch-lazy-count-current and isearch-lazy-count-total. Or for asynchronous lazy-count a new hook needs to be run at the end of isearch-lazy-highlight-buffer-update in addition to the call of isearch-message. >> But your patches are intended for a different feature - highlighting >> of matches in the buffer while entering an input string in the minibuffer. >> >> I wonder how many users need this feature, when it's easy to construct >> a query-replace string using highlighting/counting in isearch-mode, >> then type M-% >> (isearch-query-replace) that invokes query-replace with the >> query-replace string. > > Sure, this alternative method works. But somehow it's not the way I > usually start a replace, and I think there's nothing wrong with that > preference :-) But this method is more limiting - no keys to pull text from the buffer like 'C-w' (isearch-yank-word-or-char) does in isearch-mode, no way to navigate to the first match like it's possible in isearch-mode, etc. >> Perhaps better to ask on emacs-devel if anyone needs this feature. > > We can ask. But note that the bulk of the patch has a fairly general > purpose, namely to read a regexp with live preview of the matches. > There's probably a couple extra uses for this. Maybe then this feature could be added to read-regexp or even to read-from-minibuffer? And activated by adding a setup function to minibuffer-setup-hook like other minibuffer's features do, such as icomplete-minibuffer-setup, minibuffer-depth-setup, rfn-eshadow-setup-minibuffer. Then maybe a new feature could be named e.g. "lazy-minibuffer"? From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 09 05:03:00 2022 Received: (at 53126) by debbugs.gnu.org; 9 Jan 2022 10:03:00 +0000 Received: from localhost ([127.0.0.1]:49246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6V2S-0008NZ-HC for submit@debbugs.gnu.org; Sun, 09 Jan 2022 05:03:00 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:51962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6V2N-0008NF-Fh for 53126@debbugs.gnu.org; Sun, 09 Jan 2022 05:02:59 -0500 Received: by mail-wm1-f51.google.com with SMTP id e5so6883737wmq.1 for <53126@debbugs.gnu.org>; Sun, 09 Jan 2022 02:02:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=NR3hJ1pJzoUao3ou56k+2G1jNK69h6AnXUqpzG1VZS4=; b=CZ2/eKk2TFa9nW4pVqGl7vIOmcBPoJL+K36VfKIvvBwvntNkDJuT/CE4zzSmR1pvPH Pa+5QvHkKT0xiIwV47Q+hZ8Iv8zOEiOZ9hCZbNIYDjQtBPJa6eV+gKPAsbFFCo+LI99a X/+8AEXegm2D/fQqlK3wnOIDe+QqdowylbuZ+FWAMqB+/bWfyGFWNZjYYrlbu8ur8cDZ i4mpabTZuvaxZIGaIm7zb6FJVvfyFnT1Oj2bLu4eKnJFjsVQCHcRQDClQK+6y9MKOzQQ FPlKR2VeDvpLRfmD53OMXA7GRwpFUCyEHLSWPCRchi/6RDg1CC5rNRgt81bocFFVnqSE COPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=NR3hJ1pJzoUao3ou56k+2G1jNK69h6AnXUqpzG1VZS4=; b=6cCKJEzvHCC2141CyheIzGuDKZPCkYF64HeVUOxTm5SK3o5CowcaDqNE5PLpQw5s4Y iZt5SLHft1bGF8ctqex5hAYU4qRpPaCbLPPcTGcsia4AbqVIaDIpnWiBaFzxoOU5FVLz tnTtPjE49Xgns/oKDTq2ARr9aU+or7b+nB+QC9QeYKzTswSRn+7TvNoG7jv3hWRtPzYh NXbth95bFCbZhK4lwIgqZuDPgxH7VfA/yKKBPnPg1c+h0Rud84gR84kA8n1EENdQO5SQ EMsGvSyGuAQMIYO2Qrq+K5On0cqh6gl9ZfFZEU0GjvIWPrKqCJYtJVSHaEWHjMAcArWU ykAA== X-Gm-Message-State: AOAM532hbRDOv/8NB1A/keyBUjrqSDMERn7szdMFxp0NEbTuXQ6mElpN 2/+QcddSFxkwFsfNikevld50yRMtuFI= X-Google-Smtp-Source: ABdhPJw802vdoShSRUq0cUhQhuQ2I1HTYo5Ugd8qd4ipoDWu2zuESRH9Gb3hKe3p5WvTRGPsraMCMw== X-Received: by 2002:a05:600c:1e24:: with SMTP id ay36mr18065529wmb.84.1641722568968; Sun, 09 Jan 2022 02:02:48 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::15a6]) by smtp.gmail.com with ESMTPSA id f8sm4134376wry.16.2022.01.09.02.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 02:02:48 -0800 (PST) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> Date: Sun, 09 Jan 2022 11:02:46 +0100 In-Reply-To: <86k0f9xnrn.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 09 Jan 2022 11:10:13 +0200") Message-ID: <87tuedp6pl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Sun, 9 Jan 2022 at 11:10, Juri Linkov wrote: > It seems the "Query replacing" prompt in perform-replace could just > display the values of isearch-lazy-count-current and > isearch-lazy-count-total. Yes, I guess you are right. > Or for asynchronous lazy-count a new hook needs to be run at the end > of isearch-lazy-highlight-buffer-update in addition to the call of > isearch-message. > That's what the patch does (but with a variable pointing to a function instead of a hook, although this can be changed). But note that it's not enough to do something =E2=80=9Cin addition to the call of isearch-mess= age=E2=80=9D; it's necessary to _suppress_ the call to isearch-message. >>> But your patches are intended for a different feature - highlighting >>> of matches in the buffer while entering an input string in the minibuff= er. >>> >>> I wonder how many users need this feature, when it's easy to construct >>> a query-replace string using highlighting/counting in isearch-mode, >>> then type M-% >>> (isearch-query-replace) that invokes query-replace with the >>> query-replace string. >> >> Sure, this alternative method works. But somehow it's not the way I >> usually start a replace, and I think there's nothing wrong with that >> preference :-) > > But this method is more limiting - no keys to pull text from the buffer > like 'C-w' (isearch-yank-word-or-char) does in isearch-mode, no way > to navigate to the first match like it's possible in isearch-mode, etc. > OTOH, you can't do a replace-in-region that way. > Maybe then this feature could be added to read-regexp or even > to read-from-minibuffer? And activated by adding a setup function > to minibuffer-setup-hook like other minibuffer's features do, such as > icomplete-minibuffer-setup, minibuffer-depth-setup, rfn-eshadow-setup-min= ibuffer. > > Then maybe a new feature could be named e.g. "lazy-minibuffer"? This is what the patch does, with code of this kind: ``` (let ((isearch-regexp t) ;; Whatever else isearch / lazy-highlight settings might be needed (isearch-lazy-count-display-function #'isearch-read-with-highlight-co= unt)) (minibuffer-with-setup-hook #'isearch-read-with-highlight-setup (read-from-minibuffer "Type a regexp with preview: "))) ``` There could be a convenience wrapper for this code, but I'm not sure that makes much sense, because isearch and lazy-highlight have too many parameters one might need to set so it's better to be explicit/flexible. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 09 05:30:40 2022 Received: (at 53126) by debbugs.gnu.org; 9 Jan 2022 10:30:40 +0000 Received: from localhost ([127.0.0.1]:49266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6VTE-0002rF-Es for submit@debbugs.gnu.org; Sun, 09 Jan 2022 05:30:40 -0500 Received: from mail-wr1-f45.google.com ([209.85.221.45]:34578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6VTC-0002r1-Uq for 53126@debbugs.gnu.org; Sun, 09 Jan 2022 05:30:39 -0500 Received: by mail-wr1-f45.google.com with SMTP id h10so10851981wrb.1 for <53126@debbugs.gnu.org>; Sun, 09 Jan 2022 02:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=gvjzta1aPfQKabc+93ZfUQHb0zwtIo8ursBiO7Did0E=; b=Ee6+J2YPd2WT5/V0p+lmgUYec1xGCU6wk8F+iLBL+DaYOSNVAiI2z3C2nnf2aiWZBP HycVgAlK23e+Kn2sLPEEFXqsdJzUO7U4o53fJ+CiXxhL3hjvKZriKkrp7dYpM/OmSYdq ruYVR0yfOIxl165t+7Ownz9jhGYtPT7MEG7zGlsn7P221XrMpEoIzvp+CdfMzaKaVwHq 0VyPq5gDrCOncIjDwoTOijSksWjFTjzOBUk/93Iaspg0JURJt3MvcPjeWThLcjVEjEKy fpAO6hm3h8Wn26/dNGqyNDbtwx11cZVuNTiiJKjbsUTyIykfH1ytDu3Jx61OAUtk1PJd 9arg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=gvjzta1aPfQKabc+93ZfUQHb0zwtIo8ursBiO7Did0E=; b=C38UPQiWtVcEx5xrYWTQBSzNgiOsfQMaCF9oQEA8ny/ukG43sUL9XDf8OLaZMCWoeM BWeDfgVKZkAg1u/+MrtsZcaneVEEWsgzn5VEBkVM/ud0cVT/YznAtttJKjmhnQYcYoF8 HF8vO5EOH3vndBi2NEKLRffRatt3Bi0kn4DXasBPjS6V4tn4yGtqqYCokv/GIujtVqPB /wHUhP1HLSB8gNjrbh943CzYEXbvfYp+yVOBZOSX++1F+TYQz2lzkD4rWaj+5/wTJr7I nfCdVzYyKD0aM2Y9/lyYBO2NVJ6lJUd3i0PNvgT0Dv4OLzETVSUyvQobPCkBegLLls2p qU7A== X-Gm-Message-State: AOAM531Se1F4t2NTJz6HgHWyfwjsVn0FMjtSoJHR022OpxfP9H0tNnKF va+J7agXbRNoqVU8QdxQyZdnzqypEGk= X-Google-Smtp-Source: ABdhPJyioj92klZIxSpayFv7pQy5NQPZrccXEP1kj0srgFzTmpaTG2zPV/BcF5Rlk93ZoT0X2/5ViA== X-Received: by 2002:adf:f985:: with SMTP id f5mr61342148wrr.14.1641724232891; Sun, 09 Jan 2022 02:30:32 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::15a6]) by smtp.gmail.com with ESMTPSA id p11sm4507171wru.99.2022.01.09.02.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 02:30:32 -0800 (PST) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> Date: Sun, 09 Jan 2022 11:30:31 +0100 In-Reply-To: <87tuedp6pl.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 09 Jan 2022 11:02:46 +0100") Message-ID: <871r1hmcag.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Sun, 9 Jan 2022 at 11:02, Augusto Stoffel wrote: > OTOH, you can't do a replace-in-region that way. Or rather -- you can, but it's tricky to keep the desired region unchanged. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 09 14:04:24 2022 Received: (at 53126) by debbugs.gnu.org; 9 Jan 2022 19:04:24 +0000 Received: from localhost ([127.0.0.1]:51270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6dUJ-0007ZS-Jx for submit@debbugs.gnu.org; Sun, 09 Jan 2022 14:04:24 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:47495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6dUD-0007Z8-O6 for 53126@debbugs.gnu.org; Sun, 09 Jan 2022 14:04:18 -0500 Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 63FEC20000A; Sun, 9 Jan 2022 19:04:05 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> Date: Sun, 09 Jan 2022 20:58:32 +0200 In-Reply-To: <87tuedp6pl.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 09 Jan 2022 11:02:46 +0100") Message-ID: <861r1g7n3b.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.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: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Or for asynchronous lazy-count a new hook needs to be run at the end >> of isearch-lazy-highlight-buffer-update in addition to the call of >> isearch-message. > > That's what the patch does (but with a variable pointing to a function > instead of a hook, although this can be changed). But note that it's > not enough to do something “in addition to the call of isearch-message”; > it's necessary to _suppress_ the call to isearch-message. It would be great to use your new variable with a function to show replacement counts in perform-replace. IIUC, let-binding isearch-lazy-count-display-function to isearch-read-with-highlight-count will suppress isearch-message? >> Maybe then this feature could be added to read-regexp or even >> to read-from-minibuffer? And activated by adding a setup function >> to minibuffer-setup-hook like other minibuffer's features do, such as >> icomplete-minibuffer-setup, minibuffer-depth-setup, rfn-eshadow-setup-minibuffer. > > This is what the patch does, with code of this kind: > > ``` > (let ((isearch-regexp t) > ;; Whatever else isearch / lazy-highlight settings might be needed > (isearch-lazy-count-display-function #'isearch-read-with-highlight-count)) > (minibuffer-with-setup-hook #'isearch-read-with-highlight-setup > (read-from-minibuffer "Type a regexp with preview: "))) > ``` > > There could be a convenience wrapper for this code, but I'm not sure > that makes much sense, because isearch and lazy-highlight have too many > parameters one might need to set so it's better to be explicit/flexible. I meant using simply (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) But it seems isearch-read-with-highlight-setup doesn't set isearch-lazy-count-display-function. >> Then maybe a new feature could be named e.g. "lazy-minibuffer"? This feature has little to do with isearch. This is why there are efforts to move away from the prefix isearch- for lazy-related functions and variables, so we have now: lazy-count-prefix-format lazy-count-suffix-format lazy-highlight-buffer lazy-highlight-buffer-max-at-a-time lazy-highlight-cleanup lazy-highlight-initial-delay lazy-highlight-interval lazy-highlight-max-at-a-time ... There are still isearch-specific names like isearch-lazy-count that enables lazy-count in isearch-mode. What would be a similar name for the minibuffer? Maybe minibuffer-lazy-count? Then the prefix isearch- needs to be removed from other names too, e.g. isearch-lazy-count-display-function -> lazy-count-display-function isearch-read-with-highlight-setup maybe to minibuffer-lazy-highlight-setup, etc. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 10 12:34:32 2022 Received: (at 53126) by debbugs.gnu.org; 10 Jan 2022 17:34:32 +0000 Received: from localhost ([127.0.0.1]:53235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6yYx-0004O4-LX for submit@debbugs.gnu.org; Mon, 10 Jan 2022 12:34:32 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:37665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6yYt-0004Nj-54 for 53126@debbugs.gnu.org; Mon, 10 Jan 2022 12:34:30 -0500 Received: by mail-wr1-f42.google.com with SMTP id t28so21418912wrb.4 for <53126@debbugs.gnu.org>; Mon, 10 Jan 2022 09:34:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=pKlFXI4hqbg5bUzdL9GYEL60wd8IM9vJU2PTZzc6Rrs=; b=f5aDXswxJy5RT1FyZL5Y9TKwKBs7VIQTU2tc7WEkgMjTkRYPA26bqZxke4d9fBYefP gyLUT9T5TELLj9h8N/jtmMgsqwdG6wG78sroBY7Z5DlDM1JUl2Sl19jb0qinghUPYtmq WJ3VYLumHYAAfTp/cQZuy7rBLKxLuxdMnI14/8eMY6DyapjXiDkAcEjnqbX/qhXywgt/ /Hh3L8j6/K98bBaGZhk4pfkTwW04LpOMW3vmhdrXOufOsWxc42cepRh3AZO8nEgJFmHR 46YSgiEUbPNr1mP7f5a+osKyIH/ZULCUqzMvUma+QGYQhG2oFj2SArQM9Ks8F0mKU9DU n53A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=pKlFXI4hqbg5bUzdL9GYEL60wd8IM9vJU2PTZzc6Rrs=; b=KiDJIxjwTUuuKmAtmfI7aYVhnzI3pKfx+hHoI0NeMFf8FfFO0fbxA8HaCYLr0aioUc 6w3dZxp8YubG6t3QBYLalmc+adtOBt0Wv67keaijwwum7zETN7+PQl5eW+L5HHZow3+M IoXrZpDx2CofWudWkd/+u2SSL8jWAZJ9AjeiF6mf53H0FBS3INxB7xXGSZQVGlAKyFQj EhDaLoII78ghi8lik8PXXRUqdnZBa3IM7+x6MXJr1dI9Bhy561n4RSXi5r07Cs4uT/P/ 3aTDIA+G9vLBg2Rn6U/A+mihu1cH9IWmhUJeLmBZpN5dBK2hIFzjthGIlfxbBtuaMkA7 0Vmw== X-Gm-Message-State: AOAM532EzN+C/SuxRsVvEKjjToMMuAVDIX8WLVsc1eEXtE61qkwXccZb lOsYBfnjxSFByFAw21dusSF9tf2c1gQ= X-Google-Smtp-Source: ABdhPJy1ZLRKpsF1pBvJE9ACrwl1sjUBu4muypnSj12jEsMMTx8HfqZkbmtc2FHA/ks9N2pyTJEpJA== X-Received: by 2002:adf:d226:: with SMTP id k6mr530173wrh.243.1641836061002; Mon, 10 Jan 2022 09:34:21 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::23a0]) by smtp.gmail.com with ESMTPSA id l6sm9933140wry.18.2022.01.10.09.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:34:20 -0800 (PST) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> Date: Mon, 10 Jan 2022 18:34:18 +0100 In-Reply-To: <861r1g7n3b.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 09 Jan 2022 20:58:32 +0200") Message-ID: <87o84jcx5x.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain Hi Juri, I attached a new patch (still a sketch) that requires no changes in comint.el and simple.el. Perhaps you will find this approach more acceptable. More comments below. On Sun, 9 Jan 2022 at 20:58, Juri Linkov wrote: > It would be great to use your new variable with a function > to show replacement counts in perform-replace. IIUC, > let-binding isearch-lazy-count-display-function to > isearch-read-with-highlight-count will suppress isearch-message? > I tried this and it's relatively simple to do, but there is a problem. Suppose you want to replace all "a" with "z", and your buffer has 20 "a"s initially. Then, as you keep hitting "y" to confirm a replacement the count will be 1/20, 1/19, ..., 1/1 since the number of "a"s decrease, and the point is always at the first of the still-existing ones. But probably one should count the number of prompts, so 1/20, 2/20, ..., 20/20 I think this means `perform-replace' has to implement its own way to display a count. > I meant using simply > > (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) > > But it seems isearch-read-with-highlight-setup doesn't set > isearch-lazy-count-display-function. > I guess this could be done. But note that there are two possible types of counts: a "current/total" counter or just a "total" counter. Each use case calls for a different count style. >>> Then maybe a new feature could be named e.g. "lazy-minibuffer"? > > This feature has little to do with isearch. This is why there are > efforts to move away from the prefix isearch- for lazy-related > functions and variables, so we have now: > > lazy-count-prefix-format > lazy-count-suffix-format > lazy-highlight-buffer > lazy-highlight-buffer-max-at-a-time > lazy-highlight-cleanup > lazy-highlight-initial-delay > lazy-highlight-interval > lazy-highlight-max-at-a-time > ... > > There are still isearch-specific names like isearch-lazy-count > that enables lazy-count in isearch-mode. What would be a similar > name for the minibuffer? Maybe minibuffer-lazy-count? I see, the lazy-* names are the new ones! > > Then the prefix isearch- needs to be removed from other names too, > e.g. isearch-lazy-count-display-function -> lazy-count-display-function > isearch-read-with-highlight-setup maybe to minibuffer-lazy-highlight-setup, > etc. Yes, I agree. The names I came up with are horrible and `lazy-minibuffer' is weird, but your current suggestion is nice. By the way, I'm debating a bit whether `isearch-lazy-count-display-function' should be: 1. Either nil or function, as it is right now, 2. #'ignore by default, so similar to 1) but a bit easier to use with `add-function' 3. a hook, the main inconvenience being that it can't be easily let-bound. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Allow-reading-from-minibuffer-with-lazy-highlight-an.patch >From 471c37844f0baba925bd948e13005d2227d43f65 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 8 Jan 2022 11:08:46 +0100 Subject: [PATCH 1/2] Allow reading from minibuffer with lazy highlight and match count * lisp/isearch.el (isearch-lazy-count-display-function): New variable allowing to display the lazy count in special ways. (isearch-edit-string): Add lazy highlight and count of matching text. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-buffer-update): Use `isearch-lazy-count-display-function' instead of hardcoded call to `isearch-message'. (isearch-read-with-highlight--overlay, isearch-read-with-highlight--after-change, isearch-read-with-highlight--exit, isearch-read-with-highlight-setup, isearch-read-with-highlight-count): Variable and functions implementing the lazy highlight functionality while reading from minibuffer. * lisp/simple.el (minibuffer-history-isearch-setup): Set `isearch-lazy-count-display-function' appropriately. * lisp/comint.el (comint-history-isearch-setup, comint-history-isearch-end): Set `isearch-lazy-count-display-function' appropriately. --- lisp/isearch.el | 100 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 82 insertions(+), 18 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 7593a0ec98..c10f365ee5 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -465,6 +465,9 @@ lazy-count-suffix-format :group 'lazy-count :version "27.1") +(defvar isearch-lazy-count-display-function nil + "Function called when new lazy count results are available.") + ;; Define isearch help map. @@ -1808,19 +1811,21 @@ isearch-edit-string ;; for some incompatibility with gmhist. (minibuffer-history-symbol) ;; Search string might have meta information on text properties. - (minibuffer-allow-text-properties t)) + (minibuffer-allow-text-properties t) + (isearch-lazy-count-display-function #'isearch-read-with-highlight-count)) (setq isearch-new-string - (read-from-minibuffer - (isearch-message-prefix nil isearch-nonincremental) - (cons isearch-string (1+ (or (isearch-fail-pos) - (length isearch-string)))) - minibuffer-local-isearch-map nil - (if isearch-regexp - (cons 'regexp-search-ring - (1+ (or regexp-search-ring-yank-pointer -1))) - (cons 'search-ring - (1+ (or search-ring-yank-pointer -1)))) - nil t) + (minibuffer-with-setup-hook #'isearch-read-with-highlight-setup + (read-from-minibuffer + (isearch-message-prefix nil isearch-nonincremental) + (cons isearch-string (1+ (or (isearch-fail-pos) + (length isearch-string)))) + minibuffer-local-isearch-map nil + (if isearch-regexp + (cons 'regexp-search-ring + (1+ (or regexp-search-ring-yank-pointer -1))) + (cons 'search-ring + (1+ (or search-ring-yank-pointer -1)))) + nil t)) isearch-new-message (mapconcat 'isearch-text-char-description isearch-new-string ""))))) @@ -4023,7 +4028,7 @@ isearch-lazy-highlight-new-loop isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -4042,7 +4047,11 @@ isearch-lazy-highlight-new-loop (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) ;; Delay updating the message if possible, to avoid flicker - (when (string-equal isearch-string "") (isearch-message)))) + (when (string-equal isearch-string "") + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (when isearch-lazy-count-display-function + (funcall isearch-lazy-count-display-function))))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error) @@ -4095,13 +4104,16 @@ isearch-lazy-highlight-new-loop 'isearch-lazy-highlight-start)))) ;; Update the current match number only in isearch-mode and ;; unless isearch-mode is used specially with isearch-message-function - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count ;; Update isearch-lazy-count-current only when it was already set ;; at the end of isearch-lazy-highlight-buffer-update (when isearch-lazy-count-current (setq isearch-lazy-count-current (gethash (point) isearch-lazy-count-hash 0)) - (isearch-message)))) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (when isearch-lazy-count-display-function + (funcall isearch-lazy-count-display-function))))) (defun isearch-lazy-highlight-search (string bound) "Search ahead for the next or previous match, for lazy highlighting. @@ -4302,16 +4314,68 @@ isearch-lazy-highlight-buffer-update (setq looping nil nomore t)))) (if nomore - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (unless isearch-lazy-count-total (setq isearch-lazy-count-total 0)) (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) - (isearch-message)) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (when isearch-lazy-count-display-function + (funcall isearch-lazy-count-display-function))) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) +;; Reading from minibuffer with lazy highlight and match count + +(defvar isearch-read-with-highlight--overlay nil + "Overlay for minibuffer prompt updates.") + +(defvar isearch-read-with-highlight-transform #'identity + "Function to transform minibuffer text into a `isearch-string' for highlighting.") + +(defun isearch-read-with-highlight--after-change (_beg _end _len) + "Update lazy highlight state in minibuffer selected window." + (when isearch-lazy-highlight + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (setq isearch-string (funcall isearch-read-with-highlight-transform string)) + (isearch-lazy-highlight-new-loop))))) + +(defun isearch-read-with-highlight--exit () + "Unwind changes from `isearch-read-with-highlight-setup'." + (remove-hook 'after-change-functions + #'isearch-read-with-highlight--after-change) + (remove-hook 'minibuffer-exit-hook #'isearch-read-with-highlight--exit) + (setq isearch-read-with-highlight--overlay nil) + (lazy-highlight-cleanup)) + +(defun isearch-read-with-highlight-setup () + "Set up minibuffer for lazy highlight of matches in the original window. + +This is intended to be called via `minibuffer-with-setup-hook'. +Note that several other isearch variables influence the lazy +highlighting, including `isearch-regexp' and +`isearch-lazy-count-display-function'." + (add-hook 'after-change-functions + #'isearch-read-with-highlight--after-change) + (add-hook 'minibuffer-exit-hook #'isearch-read-with-highlight--exit) + (setq isearch-read-with-highlight--overlay + (make-overlay (point-min) (point-min) (current-buffer) t t)) + (isearch-read-with-highlight--after-change nil nil nil)) + +(defun isearch-read-with-highlight-count () + "Display total match count in the minibuffer prompt." + (when isearch-read-with-highlight--overlay + (overlay-put isearch-read-with-highlight--overlay + 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format "%s " isearch-lazy-count-total))))) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. STRING is the string or regexp searched for. -- 2.34.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Lazy-highlight-when-reading-query-replace-text.patch >From 8a24c1cc976e003494c3526304a02de8f37b5896 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 8 Jan 2022 13:15:40 +0100 Subject: [PATCH 2/2] Lazy highlight when reading query-replace text * lisp/replace.el (query-replace-read-from): Add lazy highlighting. --- lisp/replace.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/replace.el b/lisp/replace.el index 60e507c642..31478ee4a9 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -244,6 +244,19 @@ query-replace-read-from (query-replace-descr (cdar query-replace-defaults))))) (t (format-prompt prompt nil)))) + ;; Set up lazy highlighting while reading FROM regexp. + ;; TODO: Treat the `region-noncontiguous-p' case by setting + ;; `isearch-filter-predicate'. + (isearch-lazy-highlight query-replace-highlight) + (isearch-regexp regexp-flag) + (isearch-regexp-function nil) + (isearch-case-fold-search case-fold-search) ;; TODO: the case-folding rule here is complicated... + (isearch-read-with-highlight-transform + (lambda (string) + (let ((from (query-replace--split-string string))) + (if (consp from) (car from) from)))) + (isearch-lazy-count-display-function + #'isearch-read-with-highlight-count) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. @@ -251,6 +264,7 @@ query-replace-read-from (save-excursion (minibuffer-with-setup-hook (lambda () + (isearch-read-with-highlight-setup) (setq-local text-property-default-nonsticky (append '((separator . t) (face . t)) text-property-default-nonsticky))) -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 10 14:11:23 2022 Received: (at 53126) by debbugs.gnu.org; 10 Jan 2022 19:11:23 +0000 Received: from localhost ([127.0.0.1]:53318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n704h-0006wO-6x for submit@debbugs.gnu.org; Mon, 10 Jan 2022 14:11:23 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n704f-0006w9-0x for 53126@debbugs.gnu.org; Mon, 10 Jan 2022 14:11:22 -0500 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 98B38FF803; Mon, 10 Jan 2022 19:11:12 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> Date: Mon, 10 Jan 2022 21:09:40 +0200 In-Reply-To: <87o84jcx5x.fsf@gmail.com> (Augusto Stoffel's message of "Mon, 10 Jan 2022 18:34:18 +0100") Message-ID: <8635lvif0r.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > I attached a new patch (still a sketch) that requires no changes in > comint.el and simple.el. Perhaps you will find this approach more > acceptable. Thanks, no changes in other files is certainly a big plus. >> It would be great to use your new variable with a function >> to show replacement counts in perform-replace. IIUC, >> let-binding isearch-lazy-count-display-function to >> isearch-read-with-highlight-count will suppress isearch-message? > > I tried this and it's relatively simple to do, but there is a problem. > Suppose you want to replace all "a" with "z", and your buffer has 20 > "a"s initially. Then, as you keep hitting "y" to confirm a replacement > the count will be > > 1/20, 1/19, ..., 1/1 This is an interesting question. I tried in other editors, and e.g. in the editor xed that is installed by default, this is exactly what is displayed: 1/20, 1/19, ..., 1/1. > since the number of "a"s decrease, and the point is always at the first > of the still-existing ones. But probably one should count the number of > prompts, so > > 1/20, 2/20, ..., 20/20 > > I think this means `perform-replace' has to implement its own way to > display a count. Maybe this makes more sense, when the users will learn what do these numbers mean. >> I meant using simply >> >> (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) >> >> But it seems isearch-read-with-highlight-setup doesn't set >> isearch-lazy-count-display-function. > > I guess this could be done. Maybe two separate hooks could be defined? One highlights like lazy-highlight, and another counts like lazy-count does: (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) (add-hook 'minibuffer-setup-hook 'isearch-read-with-count-setup) > But note that there are two possible types > of counts: a "current/total" counter or just a "total" counter. Each > use case calls for a different count style. The format of the total counter needs to be defined in a separate variable. > By the way, I'm debating a bit whether > `isearch-lazy-count-display-function' should be: > > 1. Either nil or function, as it is right now, > 2. #'ignore by default, so similar to 1) but a bit easier to use with > `add-function' > 3. a hook, the main inconvenience being that it can't be easily let-bound. This can be answered only by testing with all possible cases ;-) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 21 06:20:14 2022 Received: (at control) by debbugs.gnu.org; 21 Jan 2022 11:20:14 +0000 Received: from localhost ([127.0.0.1]:60336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nArxm-0007Cn-6Q for submit@debbugs.gnu.org; Fri, 21 Jan 2022 06:20:14 -0500 Received: from quimby.gnus.org ([95.216.78.240]:33302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nArxj-0007CO-DL for control@debbugs.gnu.org; Fri, 21 Jan 2022 06:20:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ds58G4czGEbhkcVHKaHRVYb9aB/kCvyPA42YP8S5Il4=; b=QW6JUZYPap918LxTeTawatiKGN LzM5mqmDVbv88kZyGvQRHMuLXh+MNs6tD/yzGG5LxpbTcPi13lVGaLVLDS52lq1xoyl59H/3yMaug t5FWiaN0D6TSdyPfwHYolSDSdiGxg9woqz42vOhupTC1TPRAKBmHlFX9zq43NEPf93QU=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nArxb-0002bs-0x for control@debbugs.gnu.org; Fri, 21 Jan 2022 12:20:05 +0100 Date: Fri, 21 Jan 2022 12:20:02 +0100 Message-Id: <871r11tjx9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #53341 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: forcemerge 53341 53126 quit 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: control 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 (---) forcemerge 53341 53126 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 11:13:44 2022 Received: (at 53126) by debbugs.gnu.org; 26 Feb 2022 16:13:44 +0000 Received: from localhost ([127.0.0.1]:56201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNzhX-000102-Cs for submit@debbugs.gnu.org; Sat, 26 Feb 2022 11:13:44 -0500 Received: from mail-ej1-f46.google.com ([209.85.218.46]:46726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNzhU-0000zj-Dc for 53126@debbugs.gnu.org; Sat, 26 Feb 2022 11:13:41 -0500 Received: by mail-ej1-f46.google.com with SMTP id qx21so16567727ejb.13 for <53126@debbugs.gnu.org>; Sat, 26 Feb 2022 08:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=a9Qyv/kb6+ntgdfNYgnJKiAQsT0LeWGTWhFE1p227Js=; b=KUrV5epJfoDz7RR9Us1ZsZhhNptdxZSs3ekwze2mloZ+G/pMTNeOcAieAhgOHz71TA FFUPIux/begJIPdy+z3lMSAB1ZQk305kSNKaq9UW7Gl7SRErz7Kl+dVseqKL3aWIDRu+ d76gxCGiGTkXbqJx+pOyxgg0k0iPXOfFotRpGJ4C63kGkqG1ep9BNIWCE1COtSrJF7hm CisafuIyPbEutin18VHliFo74TVw4Bras74lt04Xl0AEApezceXGj/9cr6cDEczf0z3J hBoXwKjdP5CozopafAkHM+Qrpct/wBIsF6D4Az5dUbtptdAZ1d5yaZCM1AHhNPtbfygz 7K3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=a9Qyv/kb6+ntgdfNYgnJKiAQsT0LeWGTWhFE1p227Js=; b=02+6/dptwLR2O+NTN5NUsIQHNwLQpD7WjyKnkZ0dAlU24wXtQnAgXG6FCaZBsAnHzR hYNJUMmD8omx7ihGhqGhJFsyzmm0XigFPPfcuxPx5QM/swfvHLWaFw6GjZreJaztLzwm qvGbcbbFh2h1HeoUhtFW54UzNCdMv64+T1apO/cslx4dU6qj3NNoGiLWQcS1RMcu2ita 2ZPdMA4ZwYlM9sgcZZJIp8Jd2fgdp9JN534JmV/6T7WAGtmNFrCgjS0uZuoFLSZa7xAI j2+5wL6g4xCvXCsZpvrHciUSJI4KVIXa9kzOhzNVm7x7iqiVZevxFJ50y87QOeSN4ukw 7RCQ== X-Gm-Message-State: AOAM532iRhQQTpX+6kkcT4b1h1OAtahiqS7HsWxJw9L7oawXTv6F1IAb tccLIHsiIJ3hK/uTedlK/EidyZG9EFg9YA== X-Google-Smtp-Source: ABdhPJzwoM4PpTwluMtVwuVXwlpqyRiJyVaMvnKzYKdOEhbGuSWIZHFl9aZQ1pCskdJJoP2ayquwLQ== X-Received: by 2002:a17:906:3588:b0:6a7:7ac1:cac8 with SMTP id o8-20020a170906358800b006a77ac1cac8mr9652694ejb.342.1645892014069; Sat, 26 Feb 2022 08:13:34 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id n13-20020a170906724d00b006cedd6d7e24sm2367283ejk.119.2022.02.26.08.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 08:13:33 -0800 (PST) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> Date: Sat, 26 Feb 2022 17:13:31 +0100 In-Reply-To: <8635lvif0r.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 10 Jan 2022 21:09:40 +0200") Message-ID: <87mtidip1w.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain Hi Juri, Sorry for getting back to this after such a long time. I've attached a new patch that hopefully is good to merge, except for adding some NEWS entry. Let me know what you think. Inlined below some further comments. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Display-lazy-highlight-and-match-count-in-when-readi.patch >From 87ad2a45293e2fa1796a39f368d9ec16c0c4c070 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 8 Jan 2022 11:08:46 +0100 Subject: [PATCH] Display lazy highlight and match count in when reading regexps * lisp/isearch.el (lazy-count-update-hook): New hook allowing to display the lazy count in special ways. (isearch-edit-string): Add lazy highlight and count of matching text. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-buffer-update): Use `isearch-lazy-count-display-function' instead of hardcoded call to `isearch-message'. (minibuffer-lazy-count-format, minibuffer-lazy-highlight-transform, minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count, minibuffer-lazy-highlight--after-change, minibuffer-lazy-highlight--exit, minibuffer-lazy-highlight-setup): Variables and functions implementing the lazy highlight functionality while reading from minibuffer. * lisp/replace.el (query-replace-read-from): Add lazy highlighting. (replace--region-filter): New function, extracted from 'perform-replace'. --- lisp/isearch.el | 84 +++++++++++++++++++++++++++++++++++++++++++++---- lisp/replace.el | 58 ++++++++++++++++++++++++---------- 2 files changed, 120 insertions(+), 22 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 8970216398..6076cc4b5e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1812,6 +1812,8 @@ isearch-edit-string (minibuffer-history-symbol) ;; Search string might have meta information on text properties. (minibuffer-allow-text-properties t)) + (when isearch-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) (setq isearch-new-string (read-from-minibuffer (isearch-message-prefix nil isearch-nonincremental) @@ -3990,6 +3992,8 @@ isearch-lazy-highlight-error (defvar isearch-lazy-count-current nil) (defvar isearch-lazy-count-total nil) (defvar isearch-lazy-count-hash (make-hash-table)) +(defvar lazy-count-update-hook nil + "Hook run after new lazy count results are computed.") (defun lazy-highlight-cleanup (&optional force procrastinate) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -4048,7 +4052,7 @@ isearch-lazy-highlight-new-loop isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -4067,7 +4071,10 @@ isearch-lazy-highlight-new-loop (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) ;; Delay updating the message if possible, to avoid flicker - (when (string-equal isearch-string "") (isearch-message)))) + (when (string-equal isearch-string "") + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error) @@ -4120,13 +4127,15 @@ isearch-lazy-highlight-new-loop 'isearch-lazy-highlight-start)))) ;; Update the current match number only in isearch-mode and ;; unless isearch-mode is used specially with isearch-message-function - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count ;; Update isearch-lazy-count-current only when it was already set ;; at the end of isearch-lazy-highlight-buffer-update (when isearch-lazy-count-current (setq isearch-lazy-count-current (gethash (point) isearch-lazy-count-hash 0)) - (isearch-message)))) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (defun isearch-lazy-highlight-search (string bound) "Search ahead for the next or previous match, for lazy highlighting. @@ -4327,16 +4336,79 @@ isearch-lazy-highlight-buffer-update (setq looping nil nomore t)))) (if nomore - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (unless isearch-lazy-count-total (setq isearch-lazy-count-total 0)) (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) - (isearch-message)) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) +;; Reading from minibuffer with lazy highlight and match count + +(defcustom minibuffer-lazy-count-format "%s " + "Format of the total number of matches for the prompt prefix." + :type '(choice (const :tag "Don't display a count" nil) + (string :tag "Display match count" "%s ")) + :group 'lazy-count + :version "29.1") + +(defvar minibuffer-lazy-highlight-transform #'identity + "Function to transform minibuffer text into a `isearch-string' for highlighting.") + +(defvar minibuffer-lazy-highlight--overlay nil + "Overlay for minibuffer prompt updates.") + +(defun minibuffer-lazy-highlight--count () + "Display total match count in the minibuffer prompt." + (when minibuffer-lazy-highlight--overlay + (overlay-put minibuffer-lazy-highlight--overlay + 'after-string + (and isearch-lazy-count-total + (not isearch-error) + (format minibuffer-lazy-count-format + isearch-lazy-count-total))))) + +(defun minibuffer-lazy-highlight--after-change (_beg _end _len) + "Update lazy highlight state in minibuffer selected window." + (when isearch-lazy-highlight + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (setq isearch-string (funcall minibuffer-lazy-highlight-transform string)) + (isearch-lazy-highlight-new-loop))))) + +(defun minibuffer-lazy-highlight--exit () + "Unwind changes from `minibuffer-lazy-highlight-setup'." + (remove-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (remove-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (remove-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay nil) + (lazy-highlight-cleanup)) + +(defun minibuffer-lazy-highlight-setup () + "Set up minibuffer for lazy highlight of matches in the original window. + +This function is intended to be added to `minibuffer-setup-hook'. +Note that several other isearch variables influence the lazy +highlighting, including `isearch-regexp', +`isearch-lazy-highlight' and `isearch-lazy-count'." + (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (add-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (add-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay + (and minibuffer-lazy-count-format + (make-overlay (point-min) (point-min) (current-buffer) t))) + (minibuffer-lazy-highlight--after-change nil nil nil)) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. STRING is the string or regexp searched for. diff --git a/lisp/replace.el b/lisp/replace.el index 06be597855..bd5a694110 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -254,11 +254,31 @@ query-replace-read-from (query-replace-descr (cdar query-replace-defaults))))) (t (format-prompt prompt nil)))) + ;; Variables controlling lazy highlighting while reading + ;; FROM regexp, which is set up below. + (isearch-lazy-highlight query-replace-lazy-highlight) + (isearch-regexp regexp-flag) + (isearch-regexp-function nil) + (isearch-case-fold-search case-fold-search) ;; FIXME: the case-folding rule here is complicated... + (minibuffer-lazy-highlight-transform + (lambda (string) + (let ((from (query-replace--split-string string))) + (if (consp from) (car from) from)))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. ;; That should not clobber the region for the query-replace itself. (save-excursion + (when query-replace-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (when (use-region-p) + (letrec ((region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (cleanup (lambda () + (remove-function isearch-filter-predicate region-filter) + (remove-hook 'minibuffer-exit-hook cleanup)))) + (add-function :after-while isearch-filter-predicate region-filter) + (add-hook 'minibuffer-exit-hook cleanup)))) (minibuffer-with-setup-hook (lambda () (setq-local text-property-default-nonsticky @@ -2773,6 +2793,26 @@ replace--push-stack ,search-str ,next-replace) ,stack)) +(defun replace--region-filter (bounds) + "Return a function that decides if a region is inside BOUNDS. +BOUNDS is a list of cons cells of the form (START . END). The +returned function takes as argument two buffer positions, START +and END." + (let ((region-bounds + (mapcar (lambda (position) + (cons (copy-marker (car position)) + (copy-marker (cdr position)))) + bounds))) + (lambda (start end) + (delq nil (mapcar + (lambda (bounds) + (and + (>= start (car bounds)) + (<= start (cdr bounds)) + (>= end (car bounds)) + (<= end (cdr bounds)))) + region-bounds))))) + (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p) @@ -2857,22 +2897,8 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - (funcall region-extract-function 'bounds)))) - (setq region-filter - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds)))) - (add-function :after-while isearch-filter-predicate region-filter))) + (setq region-filter (replace--region-filter + (funcall region-extract-function 'bounds)))) ;; If region is active, in Transient Mark mode, operate on region. (if backward -- 2.35.1 --=-=-= Content-Type: text/plain On Mon, 10 Jan 2022 at 21:09, Juri Linkov wrote: >> I attached a new patch (still a sketch) that requires no changes in >> comint.el and simple.el. Perhaps you will find this approach more >> acceptable. > > Thanks, no changes in other files is certainly a big plus. > >>> It would be great to use your new variable with a function >>> to show replacement counts in perform-replace. IIUC, >>> let-binding isearch-lazy-count-display-function to >>> isearch-read-with-highlight-count will suppress isearch-message? >> >> I tried this and it's relatively simple to do, but there is a problem. >> Suppose you want to replace all "a" with "z", and your buffer has 20 >> "a"s initially. Then, as you keep hitting "y" to confirm a replacement >> the count will be >> >> 1/20, 1/19, ..., 1/1 > > This is an interesting question. I tried in other editors, > and e.g. in the editor xed that is installed by default, > this is exactly what is displayed: 1/20, 1/19, ..., 1/1. Let's do this at a later point, to keep this patch smaller and more focused. Note that there is one further fancy feature from anzu that we could add eventually, namely the preview of the replacement text during replace. This was requested in some recent bug. I think it's not so often that such a thing would be useful, but it can be very handy occasionally. >> since the number of "a"s decrease, and the point is always at the first >> of the still-existing ones. But probably one should count the number of >> prompts, so >> >> 1/20, 2/20, ..., 20/20 >> >> I think this means `perform-replace' has to implement its own way to >> display a count. > > Maybe this makes more sense, when the users will learn > what do these numbers mean. > >>> I meant using simply >>> >>> (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) >>> >>> But it seems isearch-read-with-highlight-setup doesn't set >>> isearch-lazy-count-display-function. What used to be 'isearch-read-with-highlight-setup' is now 'minibuffer-lazy-highlight-setup'. Just to make sure I understood you: your suggestion is for this function to remove itself automagically from the minibuffer setup hook, to dispense with the need of 'minibuffer-with-setup-hook'? This seems handy but unusual, hence my question. >> I guess this could be done. > > Maybe two separate hooks could be defined? One highlights like > lazy-highlight, and another counts like lazy-count does: > > (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) > (add-hook 'minibuffer-setup-hook 'isearch-read-with-count-setup) The highlight without counting can be achieved by binding a suitable new variable. Counting without highlight is not supported by isearch AFAIU. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 13:27:25 2022 Received: (at 53126) by debbugs.gnu.org; 15 Mar 2022 17:27:25 +0000 Received: from localhost ([127.0.0.1]:49529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUAxB-0005NO-Bf for submit@debbugs.gnu.org; Tue, 15 Mar 2022 13:27:25 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:56419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUAx8-0005N7-PH for 53126@debbugs.gnu.org; Tue, 15 Mar 2022 13:27:23 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 232E3C0006; Tue, 15 Mar 2022 17:27:14 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> Date: Tue, 15 Mar 2022 19:09:49 +0200 In-Reply-To: <87mtidip1w.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 26 Feb 2022 17:13:31 +0100") Message-ID: <86zglrl4gq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > Inlined below some further comments. > >>>> I meant using simply >>>> >>>> (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) >>>> >>>> But it seems isearch-read-with-highlight-setup doesn't set >>>> isearch-lazy-count-display-function. > > What used to be 'isearch-read-with-highlight-setup' is now > 'minibuffer-lazy-highlight-setup'. > > Just to make sure I understood you: your suggestion is for this function > to remove itself automagically from the minibuffer setup hook, to > dispense with the need of 'minibuffer-with-setup-hook'? This seems > handy but unusual, hence my question. > ... > - In a previous message, you seemed to suggest making > `minibuffer-lazy-highlight-setup' self-cleaning form the > minibuffer-setup-hook, so as to dispense with the need for > `with-minibuffer-setup-hook'. I did exactly that, but since I haven't > seen this convention before, I wanted to double check. Actually, my comment was about having the line that you already added in your latest patch in 'minibuffer-lazy-highlight-setup': (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) So I don't see the need to have this line: (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) Also I noticed that you changed the function 'isearch-lazy-count-display-function' to the hook 'lazy-count-update-hook', and this looks fine, I see no problem with this. > - Besides query-replace, I only added lazy highlight to > isearch-edit-string for now. BTW, what is the relation between the minibuffer-lazy-highlight feature and another proposed feature that immediately updates the search in the buffer while editing the string in the minibuffer by isearch-edit-string? Can minibuffer-lazy-highlight be considered as a lightweight version of the buffer search from the minibuffer? > There are a few more we could add (perhaps later), > such as `occur' and `keep-lines'. I tried (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) in the minibuffer of 'occur' and others, and it works nicely. Maybe it could even semi-deprecate the package re-builder.el. Thanks for this generally usable feature. > - There's no customization variable to enable the minibuffer lazy > highlight. The rationale is that each command that will use it should > define its own user option (or use an existing one). For > `isearch-edit-string' it's `isearch-lazy-highlight'; for > `query-replace' it's `query-replace-lazy-highlight'; and so on. A common customizable option to enable this everywhere would be nice too. Maybe disabling is already possible by customizing 'minibuffer-lazy-count-format' to nil? Then the checks for non-nil 'minibuffer-lazy-count-format' could be added to more places, such as to wrap the whole '(condition-case error' in query-replace-read-args with the 'when' condition, etc. > - As to the lazy count during `perform-replace': I would like to leave > this for later. In fact, I think the lazy highlight has some issues > that need fixing beforehand. For instance, if I replace "a" with > "aba", then the "a"'s from the replacement text also get lazy > highlighted. We shouldn't refresh the lazy highlight during > `preform-replace'. Then adding lazy count on top should be easy. Patches welcome. >>> I guess this could be done. >> >> Maybe two separate hooks could be defined? One highlights like >> lazy-highlight, and another counts like lazy-count does: >> >> (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) >> (add-hook 'minibuffer-setup-hook 'isearch-read-with-count-setup) > > The highlight without counting can be achieved by binding a suitable new > variable. Counting without highlight is not supported by isearch AFAIU. Counting without highlighting is only possible by redefining the function 'isearch-lazy-highlight-match' to a no-op function. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 13:27:30 2022 Received: (at 53126) by debbugs.gnu.org; 15 Mar 2022 17:27:30 +0000 Received: from localhost ([127.0.0.1]:49532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUAxF-0005Ng-PU for submit@debbugs.gnu.org; Tue, 15 Mar 2022 13:27:30 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:40013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUAxE-0005ND-2K for 53126@debbugs.gnu.org; Tue, 15 Mar 2022 13:27:28 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 0C00840009; Tue, 15 Mar 2022 17:27:18 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> Date: Tue, 15 Mar 2022 19:24:01 +0200 In-Reply-To: <87mtidip1w.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 26 Feb 2022 17:13:31 +0100") Message-ID: <86sfrjia5u.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > Sorry for getting back to this after such a long time. I've attached a > new patch that hopefully is good to merge, except for adding some NEWS > entry. Let me know what you think. Please see comments for your latest patch below: > @@ -1812,6 +1812,8 @@ isearch-edit-string > (minibuffer-history-symbol) > ;; Search string might have meta information on text properties. > (minibuffer-allow-text-properties t)) > + (when isearch-lazy-highlight > + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) Since this does both highlighting and counting, shouldn't the condition be (when (and isearch-lazy-highlight isearch-lazy-count)) Or maybe new separate customizable options are needed, e.g. 'minibuffer-lazy-highlight' and 'minibuffer-lazy-count'? > @@ -2350,7 +2352,9 @@ isearch-query-replace > (isearch-recursive-edit nil) > (isearch-string-propertized > (isearch-string-propertize isearch-string))) > - (isearch-done nil t) > + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup > + (not query-replace-lazy-highlight)))) > + (isearch-done nil t)) Is this some optimization? It seems it's intended to leave some existing highlighting? Is this to avoid double highlighting? Also maybe this condition could use a new variable as well. > @@ -4048,7 +4056,7 @@ isearch-lazy-highlight-new-loop > isearch-lazy-highlight-window-end)))))) > ;; something important did indeed change > (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer > - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) > + (when isearch-lazy-count > ... > @@ -4067,7 +4075,10 @@ isearch-lazy-highlight-new-loop > (setq isearch-lazy-count-current nil > isearch-lazy-count-total nil) > ;; Delay updating the message if possible, to avoid flicker > - (when (string-equal isearch-string "") (isearch-message)))) > + (when (string-equal isearch-string "") > + (when (and isearch-mode (null isearch-message-function)) > + (isearch-message)) > ... > @@ -4120,13 +4131,15 @@ isearch-lazy-highlight-new-loop > 'isearch-lazy-highlight-start)))) > ;; Update the current match number only in isearch-mode and > ;; unless isearch-mode is used specially with isearch-message-function > - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) > + (when isearch-lazy-count The problem is that when these conditions 'isearch-mode (null isearch-message-function)' are removed, now this shows wrong counts in the minibuffer history search (e.g. 'M-! C-r s C-r C-r ...') and the shell history search (e.g. 'M-x shell RET M-r s C-r C-r ...'). Before this change counting was disabled in the history search because it shows wrong numbers. > +(defun minibuffer-lazy-highlight--count () > + "Display total match count in the minibuffer prompt." > + (when minibuffer-lazy-highlight--overlay > + (overlay-put minibuffer-lazy-highlight--overlay > + 'after-string > + (and isearch-lazy-count-total > + (not isearch-error) > + (format minibuffer-lazy-count-format > + isearch-lazy-count-total))))) > ... > + (setq minibuffer-lazy-highlight--overlay > + (and minibuffer-lazy-count-format > + (make-overlay (point-min) (point-min) (current-buffer) t))) For some reasons the package lisp/mb-depth.el uses 'after-string' instead of 'before-string', and (make-overlay (point-min) (1+ (point-min))) instead of (make-overlay (point-min) (point-min)), so maybe better to do the same? > @@ -365,14 +372,44 @@ query-replace-read-args > + (condition-case error > + (let (;; Variables controlling lazy highlighting while reading > + ;; FROM and TO. > + (lazy-highlight-cleanup nil) > + (isearch-lazy-highlight query-replace-lazy-highlight) > + (isearch-regexp regexp-flag) > + (isearch-regexp-function nil) Highlighting is still incorrect for word replacement ('C-u M-%') and for non-nil 'replace-char-fold'. To handle these cases correctly, 'replace-highlight' uses: (isearch-regexp-function (or replace-regexp-function delimited-flag (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp))) > @@ -2857,22 +2914,8 @@ perform-replace > (when region-noncontiguous-p > - (let ((region-bounds > - (mapcar (lambda (position) > - (cons (copy-marker (car position)) > - (copy-marker (cdr position)))) > - (funcall region-extract-function 'bounds)))) > - (setq region-filter > - (lambda (start end) > - (delq nil (mapcar > - (lambda (bounds) > - (and > - (>= start (car bounds)) > - (<= start (cdr bounds)) > - (>= end (car bounds)) > - (<= end (cdr bounds)))) > - region-bounds)))) > - (add-function :after-while isearch-filter-predicate region-filter))) > + (setq region-filter (replace--region-filter > + (funcall region-extract-function 'bounds)))) I wonder why (add-function :after-while isearch-filter-predicate region-filter) is removed? From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 17:21:26 2022 Received: (at 53126) by debbugs.gnu.org; 15 Mar 2022 21:21:26 +0000 Received: from localhost ([127.0.0.1]:49708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUEbd-0003FT-AB for submit@debbugs.gnu.org; Tue, 15 Mar 2022 17:21:26 -0400 Received: from mail-ej1-f50.google.com ([209.85.218.50]:40623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUEbZ-0003FC-Ts for 53126@debbugs.gnu.org; Tue, 15 Mar 2022 17:21:23 -0400 Received: by mail-ej1-f50.google.com with SMTP id p15so297266ejc.7 for <53126@debbugs.gnu.org>; Tue, 15 Mar 2022 14:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Wxyht4IfTZ28TJAkCaZCWS2I2W1mpubXSCdAKrF0YQc=; b=RtqYTHRKvZNmFI4DCRoCV5GhpF1dA5FvoskavNKMAS5zS3UOTmStFF9mQxw6eLit3B MzayMK4/7CYsBJ8g3pGrthutywgxpSYVsOa7zExC2ocpx6oLL1OJhHel1r6SVtQwlDo1 kVtI82lEOl3McPggGoK+OR+G4dRoha8hTrb4exlSXb7i3O2Lx9wVF6LTwq6djd2HrChe zvR9J3DCHdK7e4bDDJx9EhSB1yXwEKyQvPmW4Pn0FJIQAQ9dExFZY6OLA5WzXBcuhNGd 0PT4MkplqrT6Ss0zJLcEHht1wKGMLq3iF6CYhiBchzZX/XbPa1hH1UD5Ysn1oaDj41LO rn4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Wxyht4IfTZ28TJAkCaZCWS2I2W1mpubXSCdAKrF0YQc=; b=E4yYrq4cCQI01Rj6HBtJmxET5rc9vj8KqGPOqZAyfMCJSdo9EUqOlF2mxHB7WH+i20 rUDYNirLfANmMdq5M18kabMJNhZgZXmndTWPrTushIAY1g2Yj2lYcSKLquqkAFSgT393 az+HelYW8nItJoO+YCXf8tfJF0yzs9mmCVDpiu7+YA0GsHj85DsJGyrVfvH5AOxvcv3c Ql33q1JwY/spA+Y8TW5bcgIXYvP5Dob5GTep1Q8aeGFMDJnPirSXckAQbITkQ/abMZKo CTsbAvBRQB7VL/omQWN7oeAhTj4RLCd0cTbXNI+J+OQfBdn7BLHurs2jKJPk+t9ziSrk S/4g== X-Gm-Message-State: AOAM5335B1mTC9cQeEFSrAgVptz4CGXaJwY7nPKIsnJS2tHKTwADtr9B mAnakTIPUR0KIKvOZX4NbL2CPENmipg= X-Google-Smtp-Source: ABdhPJzvgjRFdy5Sg5oeWQKbRqIYZt83o8CcnoOi9fDxgU4mABMLyjZaXCv5l1KaEUIDZPRVd9enTQ== X-Received: by 2002:a17:906:16cc:b0:6ce:e607:ff02 with SMTP id t12-20020a17090616cc00b006cee607ff02mr23497777ejd.418.1647379275316; Tue, 15 Mar 2022 14:21:15 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id f3-20020a1709067f8300b006ce051bf215sm60153ejr.192.2022.03.15.14.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 14:21:14 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> Date: Tue, 15 Mar 2022 22:21:12 +0100 In-Reply-To: <86sfrjia5u.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 15 Mar 2022 19:24:01 +0200") Message-ID: <87ilseyks7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Tue, 15 Mar 2022 at 19:24, Juri Linkov wrote: >> Sorry for getting back to this after such a long time. I've attached a >> new patch that hopefully is good to merge, except for adding some NEWS >> entry. Let me know what you think. > > Please see comments for your latest patch below: > >> @@ -1812,6 +1812,8 @@ isearch-edit-string >> (minibuffer-history-symbol) >> ;; Search string might have meta information on text properties. >> (minibuffer-allow-text-properties t)) >> + (when isearch-lazy-highlight >> + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) > > Since this does both highlighting and counting, shouldn't the condition be > > (when (and isearch-lazy-highlight isearch-lazy-count)) > > Or maybe new separate customizable options are needed, e.g. > 'minibuffer-lazy-highlight' and 'minibuffer-lazy-count'? isearch-edit-string already has the behavior your expect: if isearch-lazy-count is nil but isearch-lazy-highlight is t, then the matches are highlighted but the count is not displayed. This happens because the new lazy-count-update-hook is only run when isearch-lazy-highlight is non-nil. I see no need for a customization variable, since the user already gets exactly what they asked for. >> @@ -2350,7 +2352,9 @@ isearch-query-replace >> (isearch-recursive-edit nil) >> (isearch-string-propertized >> (isearch-string-propertize isearch-string))) >> - (isearch-done nil t) >> + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup >> + (not query-replace-lazy-highlight)))) >> + (isearch-done nil t)) > > Is this some optimization? It seems it's intended to leave > some existing highlighting? Is this to avoid double highlighting? > > Also maybe this condition could use a new variable as well. The weird let-binding for lazy-highlight-cleanup is indeed an optimization. Without it, you can see the lazy highlights briefly flash off an on again after you hit RET to confirm the replacement string. (Same remark explains why condition-case is used instead of a unwind-protect in query-replace-read-args). >> @@ -4048,7 +4056,7 @@ isearch-lazy-highlight-new-loop >> isearch-lazy-highlight-window-end)))))) >> ;; something important did indeed change >> (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer >> - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) >> + (when isearch-lazy-count >> ... >> @@ -4067,7 +4075,10 @@ isearch-lazy-highlight-new-loop >> (setq isearch-lazy-count-current nil >> isearch-lazy-count-total nil) >> ;; Delay updating the message if possible, to avoid flicker >> - (when (string-equal isearch-string "") (isearch-message)))) >> + (when (string-equal isearch-string "") >> + (when (and isearch-mode (null isearch-message-function)) >> + (isearch-message)) >> ... >> @@ -4120,13 +4131,15 @@ isearch-lazy-highlight-new-loop >> 'isearch-lazy-highlight-start)))) >> ;; Update the current match number only in isearch-mode and >> ;; unless isearch-mode is used specially with isearch-message-function >> - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) >> + (when isearch-lazy-count > > The problem is that when these conditions 'isearch-mode (null isearch-message-function)' > are removed, now this shows wrong counts in the minibuffer history search > (e.g. 'M-! C-r s C-r C-r ...') and the shell history search > (e.g. 'M-x shell RET M-r s C-r C-r ...'). Before this change > counting was disabled in the history search because it shows wrong numbers. > Okay, so this means we should bind isearch-lazy-count to nil in these commands, do you agree? It has always looked like a hack to me to check for (null isearch-message-function). >> +(defun minibuffer-lazy-highlight--count () >> + "Display total match count in the minibuffer prompt." >> + (when minibuffer-lazy-highlight--overlay >> + (overlay-put minibuffer-lazy-highlight--overlay >> + 'after-string >> + (and isearch-lazy-count-total >> + (not isearch-error) >> + (format minibuffer-lazy-count-format >> + isearch-lazy-count-total))))) >> ... >> + (setq minibuffer-lazy-highlight--overlay >> + (and minibuffer-lazy-count-format >> + (make-overlay (point-min) (point-min) (current-buffer) t))) > > For some reasons the package lisp/mb-depth.el uses 'after-string' > instead of 'before-string', and (make-overlay (point-min) (1+ (point-min))) > instead of (make-overlay (point-min) (point-min)), > so maybe better to do the same? > Okay, but do you know the reasons? I've changed to before-string, but I don't like to make the overlay 1 char longer than it has to be :-P >> @@ -365,14 +372,44 @@ query-replace-read-args >> + (condition-case error >> + (let (;; Variables controlling lazy highlighting while reading >> + ;; FROM and TO. >> + (lazy-highlight-cleanup nil) >> + (isearch-lazy-highlight query-replace-lazy-highlight) >> + (isearch-regexp regexp-flag) >> + (isearch-regexp-function nil) > > Highlighting is still incorrect for word replacement ('C-u M-%') > and for non-nil 'replace-char-fold'. To handle these cases correctly, > 'replace-highlight' uses: > > (isearch-regexp-function (or replace-regexp-function > delimited-flag > (and replace-char-fold > (not regexp-flag) > #'char-fold-to-regexp))) Okay, fixed this. (BTW, where is replace-regexp-function used? It's not set anywhere in Emacs, and it's not a defcustom either.) >> @@ -2857,22 +2914,8 @@ perform-replace >> (when region-noncontiguous-p >> - (let ((region-bounds >> - (mapcar (lambda (position) >> - (cons (copy-marker (car position)) >> - (copy-marker (cdr position)))) >> - (funcall region-extract-function 'bounds)))) >> - (setq region-filter >> - (lambda (start end) >> - (delq nil (mapcar >> - (lambda (bounds) >> - (and >> - (>= start (car bounds)) >> - (<= start (cdr bounds)) >> - (>= end (car bounds)) >> - (<= end (cdr bounds)))) >> - region-bounds)))) >> - (add-function :after-while isearch-filter-predicate region-filter))) >> + (setq region-filter (replace--region-filter >> + (funcall region-extract-function 'bounds)))) > > I wonder why (add-function :after-while isearch-filter-predicate region-filter) > is removed? Oops, that was a very serious typo. I've fixed it now. Here are the changes I applied on top of my previous patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Changes-after-Juri-s-comments.patch >From 216c32ad2f74abf08ea10eb2b11a5c93a146fbe1 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Tue, 15 Mar 2022 22:11:36 +0100 Subject: [PATCH] Changes after Juri's comments * lisp/comint.el (comint-history-isearch-setup, comint-history-isearch-end): Make sure no lazy count is displayed. * lisp/simple.el (minibuffer-history-isearch-setup): Make sure no lazy count is displayed. --- lisp/comint.el | 2 ++ lisp/isearch.el | 2 +- lisp/replace.el | 10 ++++++++-- lisp/simple.el | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 4c82e74e4b..56082f622a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1515,6 +1515,7 @@ comint-history-isearch-setup #'comint-history-isearch-wrap) (setq-local isearch-push-state-function #'comint-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t))) (defun comint-history-isearch-end () @@ -1526,6 +1527,7 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + (kill-local-variable 'isearch-lazy-count) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended (custom-reevaluate-setting 'comint-history-isearch))) diff --git a/lisp/isearch.el b/lisp/isearch.el index e8e3218256..bd337f38b7 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4372,7 +4372,7 @@ minibuffer-lazy-highlight--count "Display total match count in the minibuffer prompt." (when minibuffer-lazy-highlight--overlay (overlay-put minibuffer-lazy-highlight--overlay - 'after-string + 'before-string (and isearch-lazy-count-total (not isearch-error) (format minibuffer-lazy-count-format diff --git a/lisp/replace.el b/lisp/replace.el index 3e1be6f940..f45fb5fb25 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -378,7 +378,12 @@ query-replace-read-args (lazy-highlight-cleanup nil) (isearch-lazy-highlight query-replace-lazy-highlight) (isearch-regexp regexp-flag) - (isearch-regexp-function nil) + (isearch-regexp-function (or replace-regexp-function + (and current-prefix-arg + (not (eq current-prefix-arg '-))) + (and replace-char-fold + (not regexp-flag) + #'char-fold-to-regexp))) (isearch-case-fold-search case-fold-search) (minibuffer-lazy-highlight-transform (lambda (string) @@ -2915,7 +2920,8 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p (setq region-filter (replace--region-filter - (funcall region-extract-function 'bounds)))) + (funcall region-extract-function 'bounds))) + (add-function :after-while isearch-filter-predicate region-filter)) ;; If region is active, in Transient Mark mode, operate on region. (if backward diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..61319b6060 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2840,6 +2840,7 @@ minibuffer-history-isearch-setup #'minibuffer-history-isearch-wrap) (setq-local isearch-push-state-function #'minibuffer-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) (defun minibuffer-history-isearch-end () -- 2.35.1 --=-=-= Content-Type: text/plain And this is the aggregated patch for the entire feature: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Display-lazy-highlight-and-match-count-in-when-readi.patch >From 3e08f33fe45e41419278a614f7edb4f184ca9f5b Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 12 Mar 2022 10:43:54 +0100 Subject: [PATCH] Display lazy highlight and match count in when reading regexps * lisp/isearch.el (lazy-count-update-hook): New hook allowing to display the lazy count in special ways. (isearch-edit-string): Add lazy highlight and count of matching text. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-buffer-update): Use `isearch-lazy-count-display-function' instead of hardcoded call to `isearch-message'. (minibuffer-lazy-count-format, minibuffer-lazy-highlight-transform, minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count, minibuffer-lazy-highlight--after-change, minibuffer-lazy-highlight--exit, minibuffer-lazy-highlight-setup): Variables and functions implementing the lazy highlight functionality while reading from minibuffer. * lisp/replace.el (query-replace-read-args): Add lazy highlighting. (replace--region-filter): New function, extracted from 'perform-replace'. (perform-replace): Use 'replace--region-filter'. * lisp/comint.el (comint-history-isearch-setup, comint-history-isearch-end): Make sure no lazy count is displayed. * lisp/simple.el (minibuffer-history-isearch-setup): Make sure no lazy count is displayed. --- lisp/comint.el | 2 + lisp/isearch.el | 106 +++++++++++++++++++++++++++++++++++++++++------- lisp/replace.el | 99 ++++++++++++++++++++++++++++++++------------ lisp/simple.el | 1 + 4 files changed, 169 insertions(+), 39 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 4c82e74e4b..56082f622a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1515,6 +1515,7 @@ comint-history-isearch-setup #'comint-history-isearch-wrap) (setq-local isearch-push-state-function #'comint-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t))) (defun comint-history-isearch-end () @@ -1526,6 +1527,7 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + (kill-local-variable 'isearch-lazy-count) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended (custom-reevaluate-setting 'comint-history-isearch))) diff --git a/lisp/isearch.el b/lisp/isearch.el index 8970216398..bd337f38b7 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1812,6 +1812,8 @@ isearch-edit-string (minibuffer-history-symbol) ;; Search string might have meta information on text properties. (minibuffer-allow-text-properties t)) + (when isearch-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) (setq isearch-new-string (read-from-minibuffer (isearch-message-prefix nil isearch-nonincremental) @@ -2350,7 +2352,9 @@ isearch-query-replace (isearch-recursive-edit nil) (isearch-string-propertized (isearch-string-propertize isearch-string))) - (isearch-done nil t) + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup + (not query-replace-lazy-highlight)))) + (isearch-done nil t)) (isearch-clean-overlays) (if (and isearch-other-end (if backward @@ -2366,13 +2370,15 @@ isearch-query-replace (symbol-value query-replace-from-history-variable))) (perform-replace isearch-string-propertized - (query-replace-read-to - isearch-string-propertized - (concat "Query replace" - (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) - (if backward " backward" "") - (if (use-region-p) " in region" "")) - isearch-regexp) + (unwind-protect + (query-replace-read-to + isearch-string-propertized + (concat "Query replace" + (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) + (if backward " backward" "") + (if (use-region-p) " in region" "")) + isearch-regexp) + (lazy-highlight-cleanup lazy-highlight-cleanup)) t isearch-regexp (or delimited isearch-regexp-function) nil nil (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) @@ -3990,6 +3996,8 @@ isearch-lazy-highlight-error (defvar isearch-lazy-count-current nil) (defvar isearch-lazy-count-total nil) (defvar isearch-lazy-count-hash (make-hash-table)) +(defvar lazy-count-update-hook nil + "Hook run after new lazy count results are computed.") (defun lazy-highlight-cleanup (&optional force procrastinate) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -4048,7 +4056,7 @@ isearch-lazy-highlight-new-loop isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -4067,7 +4075,10 @@ isearch-lazy-highlight-new-loop (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) ;; Delay updating the message if possible, to avoid flicker - (when (string-equal isearch-string "") (isearch-message)))) + (when (string-equal isearch-string "") + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error) @@ -4120,13 +4131,15 @@ isearch-lazy-highlight-new-loop 'isearch-lazy-highlight-start)))) ;; Update the current match number only in isearch-mode and ;; unless isearch-mode is used specially with isearch-message-function - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count ;; Update isearch-lazy-count-current only when it was already set ;; at the end of isearch-lazy-highlight-buffer-update (when isearch-lazy-count-current (setq isearch-lazy-count-current (gethash (point) isearch-lazy-count-hash 0)) - (isearch-message)))) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (defun isearch-lazy-highlight-search (string bound) "Search ahead for the next or previous match, for lazy highlighting. @@ -4327,16 +4340,81 @@ isearch-lazy-highlight-buffer-update (setq looping nil nomore t)))) (if nomore - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (unless isearch-lazy-count-total (setq isearch-lazy-count-total 0)) (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) - (isearch-message)) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) + +;; Reading from minibuffer with lazy highlight and match count + +(defcustom minibuffer-lazy-count-format "%s " + "Format of the total number of matches for the prompt prefix." + :type '(choice (const :tag "Don't display a count" nil) + (string :tag "Display match count" "%s ")) + :group 'lazy-count + :version "29.1") + +(defvar minibuffer-lazy-highlight-transform #'identity + "Function to transform minibuffer text into a `isearch-string' for highlighting.") + +(defvar minibuffer-lazy-highlight--overlay nil + "Overlay for minibuffer prompt updates.") + +(defun minibuffer-lazy-highlight--count () + "Display total match count in the minibuffer prompt." + (when minibuffer-lazy-highlight--overlay + (overlay-put minibuffer-lazy-highlight--overlay + 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format minibuffer-lazy-count-format + isearch-lazy-count-total))))) + +(defun minibuffer-lazy-highlight--after-change (_beg _end _len) + "Update lazy highlight state in minibuffer selected window." + (when isearch-lazy-highlight + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (setq isearch-string (funcall minibuffer-lazy-highlight-transform string)) + (isearch-lazy-highlight-new-loop))))) + +(defun minibuffer-lazy-highlight--exit () + "Unwind changes from `minibuffer-lazy-highlight-setup'." + (remove-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (remove-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (remove-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay nil) + (when lazy-highlight-cleanup + (lazy-highlight-cleanup))) + +(defun minibuffer-lazy-highlight-setup () + "Set up minibuffer for lazy highlight of matches in the original window. + +This function is intended to be added to `minibuffer-setup-hook'. +Note that several other isearch variables influence the lazy +highlighting, including `isearch-regexp', +`isearch-lazy-highlight' and `isearch-lazy-count'." + (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (add-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (add-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay + (and minibuffer-lazy-count-format + (make-overlay (point-min) (point-min) (current-buffer) t))) + (minibuffer-lazy-highlight--after-change nil nil nil)) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. STRING is the string or regexp searched for. diff --git a/lisp/replace.el b/lisp/replace.el index 06be597855..f45fb5fb25 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -352,8 +352,15 @@ query-replace-read-to (query-replace-compile-replacement (save-excursion (let* ((history-add-new-input nil) + (count (if (and query-replace-lazy-highlight + minibuffer-lazy-count-format + isearch-lazy-count + isearch-lazy-count-total) + (format minibuffer-lazy-count-format + isearch-lazy-count-total) + "")) (to (read-from-minibuffer - (format "%s %s with: " prompt (query-replace-descr from)) + (format "%s%s %s with: " count prompt (query-replace-descr from)) nil nil nil query-replace-to-history-variable from t))) (add-to-history query-replace-to-history-variable to nil t) @@ -365,14 +372,49 @@ query-replace-read-args (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion - (let* ((from (query-replace-read-from prompt regexp-flag)) - (to (if (consp from) (prog1 (cdr from) (setq from (car from))) - (query-replace-read-to from prompt regexp-flag)))) - (list from to - (or (and current-prefix-arg (not (eq current-prefix-arg '-))) - (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) - (get-text-property 0 'isearch-regexp-function from))) - (and current-prefix-arg (eq current-prefix-arg '-)))))) + (condition-case error + (let (;; Variables controlling lazy highlighting while reading + ;; FROM and TO. + (lazy-highlight-cleanup nil) + (isearch-lazy-highlight query-replace-lazy-highlight) + (isearch-regexp regexp-flag) + (isearch-regexp-function (or replace-regexp-function + (and current-prefix-arg + (not (eq current-prefix-arg '-))) + (and replace-char-fold + (not regexp-flag) + #'char-fold-to-regexp))) + (isearch-case-fold-search case-fold-search) + (minibuffer-lazy-highlight-transform + (lambda (string) + (let* ((split (query-replace--split-string string)) + (from-string (if (consp split) (car split) split))) + (when (and case-fold-search search-upper-case) + (setq isearch-case-fold-search + (isearch-no-upper-case-p from-string regexp-flag))) + from-string))) + from to) + (when query-replace-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (when (use-region-p) + (letrec ((region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (cleanup (lambda () + (remove-function isearch-filter-predicate region-filter) + (remove-hook 'minibuffer-exit-hook cleanup)))) + (add-function :after-while isearch-filter-predicate region-filter) + (add-hook 'minibuffer-exit-hook cleanup)))) + (setq from (query-replace-read-from prompt regexp-flag)) + (setq to (if (consp from) + (prog1 (cdr from) (setq from (car from))) + (query-replace-read-to from prompt regexp-flag))) + (list from to + (or (and current-prefix-arg (not (eq current-prefix-arg '-))) + (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) + (get-text-property 0 'isearch-regexp-function from))) + (and current-prefix-arg (eq current-prefix-arg '-)))) + (t (lazy-highlight-cleanup) + (signal (car error) (cdr error)))))) (defun query-replace (from-string to-string &optional delimited start end backward region-noncontiguous-p) "Replace some occurrences of FROM-STRING with TO-STRING. @@ -2773,6 +2815,26 @@ replace--push-stack ,search-str ,next-replace) ,stack)) +(defun replace--region-filter (bounds) + "Return a function that decides if a region is inside BOUNDS. +BOUNDS is a list of cons cells of the form (START . END). The +returned function takes as argument two buffer positions, START +and END." + (let ((region-bounds + (mapcar (lambda (position) + (cons (copy-marker (car position)) + (copy-marker (cdr position)))) + bounds))) + (lambda (start end) + (delq nil (mapcar + (lambda (bounds) + (and + (>= start (car bounds)) + (<= start (cdr bounds)) + (>= end (car bounds)) + (<= end (cdr bounds)))) + region-bounds))))) + (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p) @@ -2857,22 +2919,9 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - (funcall region-extract-function 'bounds)))) - (setq region-filter - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds)))) - (add-function :after-while isearch-filter-predicate region-filter))) + (setq region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (add-function :after-while isearch-filter-predicate region-filter)) ;; If region is active, in Transient Mark mode, operate on region. (if backward diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..61319b6060 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2840,6 +2840,7 @@ minibuffer-history-isearch-setup #'minibuffer-history-isearch-wrap) (setq-local isearch-push-state-function #'minibuffer-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) (defun minibuffer-history-isearch-end () -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 17:33:34 2022 Received: (at 53126) by debbugs.gnu.org; 15 Mar 2022 21:33:34 +0000 Received: from localhost ([127.0.0.1]:49715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUEnO-0003Zj-Et for submit@debbugs.gnu.org; Tue, 15 Mar 2022 17:33:34 -0400 Received: from mail-ej1-f46.google.com ([209.85.218.46]:47063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUEnM-0003ZV-9V for 53126@debbugs.gnu.org; Tue, 15 Mar 2022 17:33:32 -0400 Received: by mail-ej1-f46.google.com with SMTP id qx21so288699ejb.13 for <53126@debbugs.gnu.org>; Tue, 15 Mar 2022 14:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=w+3qdGfMt5dYL6wFfT4VwFG0sn8lMJdDKj7dx8aop3Q=; b=gBxcHZh0FtRSbKcXim+rYnjx061AQ5MfAiAUmUBuAAELvOzLnaxPypYmezEpiUSm5w un+6xUV4ZjGcnRfQGrMS2OC48aKaEMdGGjW+PuxD7hIt3ZdhCyajC4t33LocggeaGK4J gzMvdfgrJU3ruEXk6R4rKetZTGQf2/wgJnmbYGuF+1PiSRsCSBqht8iAyRpvcRwBIwaq vO51wDq9/hleY47xFVzZd4kJXBPvmJwgFcDkBqLT4MYC39F++m7DJ3NTcDd/2DwdDgMY Q0WrL8tiFov71XntWYmH7CMXllDDSSwlZ2qWETdpmdDEp7wYhcTPjxFmvxLtB5oG7db7 ZDvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=w+3qdGfMt5dYL6wFfT4VwFG0sn8lMJdDKj7dx8aop3Q=; b=hT4cSJeuIcS+TK6fVxktpSRt/jiuOcuyqDTVTlS5k9HI1cn70Z8XPAEkk+N+FIh75v K1DjMM3+q3yxqn7JcA+6vxYXd1ThyIdgge55WEj1HbmCDwvixJdB3/axJC9sNTSp86ZK sCHGuyxmvHb1xYwsA6Pa+v84Io+QDSaVmYQ6yrVuS6ksmHrnArSE2lRRJr+zJI/zt9hc ltGEdd8O0PMeygbJfYXMX+CWvHfFOVskqYh81D25j9UIKukVfAob/ZZ/F0dPADQfow7n QSObvRI4aF5HiqFnNW43Tu42Giqlci/MmzMhXGMWfu6J/Epe9JR+7jA/eQZd2YhxGlb8 jQJw== X-Gm-Message-State: AOAM531/qbSSH4fhVpifFUzLnMqYYyzClrfpXxoF4Pvj02tI9Um7hTv4 eb6Y1i9atR1C9T/5FrRFChTgKD/fhS0= X-Google-Smtp-Source: ABdhPJyoWGLsiAOnk8HJgFxh4wTAntVmMljM1WdZxltoasPiyl28Wzl+5VHLh1aC1V7jDchK92gtHg== X-Received: by 2002:a17:907:6d0e:b0:6d7:c85:5bf5 with SMTP id sa14-20020a1709076d0e00b006d70c855bf5mr24419229ejc.31.1647380006015; Tue, 15 Mar 2022 14:33:26 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id ne42-20020a1709077baa00b006d76251f4e7sm74156ejc.109.2022.03.15.14.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 14:33:25 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> Date: Tue, 15 Mar 2022 22:33:24 +0100 In-Reply-To: <86zglrl4gq.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 15 Mar 2022 19:09:49 +0200") Message-ID: <87ee32yk7v.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Tue, 15 Mar 2022 at 19:09, Juri Linkov wrote: >> Inlined below some further comments. >> >>>>> I meant using simply >>>>> >>>>> (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) >>>>> >>>>> But it seems isearch-read-with-highlight-setup doesn't set >>>>> isearch-lazy-count-display-function. >> >> What used to be 'isearch-read-with-highlight-setup' is now >> 'minibuffer-lazy-highlight-setup'. >> >> Just to make sure I understood you: your suggestion is for this function >> to remove itself automagically from the minibuffer setup hook, to >> dispense with the need of 'minibuffer-with-setup-hook'? This seems >> handy but unusual, hence my question. >> ... >> - In a previous message, you seemed to suggest making >> `minibuffer-lazy-highlight-setup' self-cleaning form the >> minibuffer-setup-hook, so as to dispense with the need for >> `with-minibuffer-setup-hook'. I did exactly that, but since I haven't >> seen this convention before, I wanted to double check. > > Actually, my comment was about having the line that you already added > in your latest patch in 'minibuffer-lazy-highlight-setup': > > (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) > > So I don't see the need to have this line: > > (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) Okay, but if I remove this line, then all calls to minibuffer-lazy-highlight-setup will require a with-minibuffer-setup hook. And this will be awkward: (minibuffer-with-setup-hook (if isearch-lazy-highlight #'minibuffer-lazy-highlight-setup #'ignore) (read-from-minibuffer "Something: ")) > Also I noticed that you changed the function 'isearch-lazy-count-display-function' > to the hook 'lazy-count-update-hook', and this looks fine, > I see no problem with this. > >> - Besides query-replace, I only added lazy highlight to >> isearch-edit-string for now. > > BTW, what is the relation between the minibuffer-lazy-highlight feature > and another proposed feature that immediately updates the search in > the buffer while editing the string in the minibuffer by isearch-edit-string? > Can minibuffer-lazy-highlight be considered as a lightweight version of > the buffer search from the minibuffer? Well, there's a package for that on ELPA (isearch-mb), so extending isearch-edit-string to do that seems superfluous now? >> There are a few more we could add (perhaps later), >> such as `occur' and `keep-lines'. > > I tried (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) > in the minibuffer of 'occur' and others, and it works nicely. > Maybe it could even semi-deprecate the package re-builder.el. > > Thanks for this generally usable feature. By the way, this is a byproduct of that long discussion that led to isearch-mb, so it was not all in vain :-). >> - There's no customization variable to enable the minibuffer lazy >> highlight. The rationale is that each command that will use it should >> define its own user option (or use an existing one). For >> `isearch-edit-string' it's `isearch-lazy-highlight'; for >> `query-replace' it's `query-replace-lazy-highlight'; and so on. > > A common customizable option to enable this everywhere would be nice too. > Maybe disabling is already possible by customizing > 'minibuffer-lazy-count-format' to nil? Then the checks for > non-nil 'minibuffer-lazy-count-format' could be added to > more places, such as to wrap the whole '(condition-case error' > in query-replace-read-args with the 'when' condition, etc. Yes, the user can set minibuffer-lazy-count-format to nil to get rid of the lazy count. Concerning query-replace, why would anyone want to have lazy highlight during the perform-replace loop, but not earlier? I'm not a fan of adding a custom option here, not because it would be hard, but because it seems totally unnecessary. >> - As to the lazy count during `perform-replace': I would like to leave >> this for later. In fact, I think the lazy highlight has some issues >> that need fixing beforehand. For instance, if I replace "a" with >> "aba", then the "a"'s from the replacement text also get lazy >> highlighted. We shouldn't refresh the lazy highlight during >> `preform-replace'. Then adding lazy count on top should be easy. > > Patches welcome. > >>>> I guess this could be done. >>> >>> Maybe two separate hooks could be defined? One highlights like >>> lazy-highlight, and another counts like lazy-count does: >>> >>> (add-hook 'minibuffer-setup-hook 'isearch-read-with-highlight-setup) >>> (add-hook 'minibuffer-setup-hook 'isearch-read-with-count-setup) >> >> The highlight without counting can be achieved by binding a suitable new >> variable. Counting without highlight is not supported by isearch AFAIU. > > Counting without highlighting is only possible by redefining the function > 'isearch-lazy-highlight-match' to a no-op function. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 15:04:23 2022 Received: (at 53126) by debbugs.gnu.org; 16 Mar 2022 19:04:24 +0000 Received: from localhost ([127.0.0.1]:52309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUYwZ-0001uM-8G for submit@debbugs.gnu.org; Wed, 16 Mar 2022 15:04:23 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:35091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUYwW-0001u5-JO for 53126@debbugs.gnu.org; Wed, 16 Mar 2022 15:04:21 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C24DC240003; Wed, 16 Mar 2022 19:04:12 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> Date: Wed, 16 Mar 2022 20:56:16 +0200 In-Reply-To: <87ee32yk7v.fsf@gmail.com> (Augusto Stoffel's message of "Tue, 15 Mar 2022 22:33:24 +0100") Message-ID: <861qz1zqfb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> So I don't see the need to have this line: >> >> (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) > > Okay, but if I remove this line, then all calls to > minibuffer-lazy-highlight-setup will require a with-minibuffer-setup > hook. And this will be awkward: > > (minibuffer-with-setup-hook (if isearch-lazy-highlight > #'minibuffer-lazy-highlight-setup > #'ignore) > (read-from-minibuffer "Something: ")) The answer depends on another question: how do you intend the users would enable this feature? When to enable it in all minibuffers (like e.g. minibuffer-depth-indicate-mode does) the users will add to their init files: (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) Then removing the user's customization would not be a nice thing to do. OTOH, minibuffer-with-setup-hook will remove only own hook, not the user's one. So to allow enabling this feature selectively, minibuffer-with-setup-hook is not quite awkward. >> BTW, what is the relation between the minibuffer-lazy-highlight feature >> and another proposed feature that immediately updates the search in >> the buffer while editing the string in the minibuffer by isearch-edit-string? >> Can minibuffer-lazy-highlight be considered as a lightweight version of >> the buffer search from the minibuffer? > > Well, there's a package for that on ELPA (isearch-mb), so extending > isearch-edit-string to do that seems superfluous now? It's still possible to add this feature to isearch-edit-string, when the change would not be too enormous. I recall squeezing it into a small patch, but unfortunately it requires changes in keymap priorities. >>> There are a few more we could add (perhaps later), >>> such as `occur' and `keep-lines'. >> >> I tried (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) >> in the minibuffer of 'occur' and others, and it works nicely. >> Maybe it could even semi-deprecate the package re-builder.el. >> >> Thanks for this generally usable feature. > > By the way, this is a byproduct of that long discussion that led to > isearch-mb, so it was not all in vain :-). Are you sure these features can't be combined? One feature basically runs isearch-search-and-update in the buffer from the minibuffer, and this feature runs isearch-lazy-highlight-new-loop. >>> - There's no customization variable to enable the minibuffer lazy >>> highlight. The rationale is that each command that will use it should >>> define its own user option (or use an existing one). For >>> `isearch-edit-string' it's `isearch-lazy-highlight'; for >>> `query-replace' it's `query-replace-lazy-highlight'; and so on. >> >> A common customizable option to enable this everywhere would be nice too. >> Maybe disabling is already possible by customizing >> 'minibuffer-lazy-count-format' to nil? Then the checks for >> non-nil 'minibuffer-lazy-count-format' could be added to >> more places, such as to wrap the whole '(condition-case error' >> in query-replace-read-args with the 'when' condition, etc. > > Yes, the user can set minibuffer-lazy-count-format to nil to get rid of > the lazy count. > > Concerning query-replace, why would anyone want to have lazy highlight > during the perform-replace loop, but not earlier? I'm not a fan of > adding a custom option here, not because it would be hard, but because > it seems totally unnecessary. Maybe a new option would make sense for the same reason why there is the option isearch-lazy-count? From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 15:04:27 2022 Received: (at 53126) by debbugs.gnu.org; 16 Mar 2022 19:04:27 +0000 Received: from localhost ([127.0.0.1]:52311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUYwc-0001ud-SS for submit@debbugs.gnu.org; Wed, 16 Mar 2022 15:04:27 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:60561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUYwY-0001uA-VX for 53126@debbugs.gnu.org; Wed, 16 Mar 2022 15:04:23 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id DDAEE60002; Wed, 16 Mar 2022 19:04:15 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> Date: Wed, 16 Mar 2022 21:02:25 +0200 In-Reply-To: <87ilseyks7.fsf@gmail.com> (Augusto Stoffel's message of "Tue, 15 Mar 2022 22:21:12 +0100") Message-ID: <868rt9wwji.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >>> @@ -2350,7 +2352,9 @@ isearch-query-replace >>> + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup >>> + (not query-replace-lazy-highlight)))) >>> + (isearch-done nil t)) >> >> Is this some optimization? It seems it's intended to leave >> some existing highlighting? Is this to avoid double highlighting? > > The weird let-binding for lazy-highlight-cleanup is indeed an > optimization. Without it, you can see the lazy highlights briefly flash > off an on again after you hit RET to confirm the replacement string. > > (Same remark explains why condition-case is used instead of a > unwind-protect in query-replace-read-args). When I tried your latest patch, it still flashes when it starts the perform-replace loop. >> The problem is that when these conditions 'isearch-mode (null isearch-message-function)' >> are removed, now this shows wrong counts in the minibuffer history search >> (e.g. 'M-! C-r s C-r C-r ...') and the shell history search >> (e.g. 'M-x shell RET M-r s C-r C-r ...'). Before this change >> counting was disabled in the history search because it shows wrong numbers. > > Okay, so this means we should bind isearch-lazy-count to nil in these > commands, do you agree? It has always looked like a hack to me to check > for (null isearch-message-function). Binding isearch-lazy-count to nil could serve as a temporary measure until lazy-count will be supported in the history search. >> For some reasons the package lisp/mb-depth.el uses 'after-string' >> instead of 'before-string', and (make-overlay (point-min) (1+ (point-min))) >> instead of (make-overlay (point-min) (point-min)), >> so maybe better to do the same? > > Okay, but do you know the reasons? I've changed to before-string, but I > don't like to make the overlay 1 char longer than it has to be :-P I don't know the reason. Since it works in your patch, then it's ok. >> Highlighting is still incorrect for word replacement ('C-u M-%') >> and for non-nil 'replace-char-fold'. To handle these cases correctly, >> 'replace-highlight' uses: >> >> (isearch-regexp-function (or replace-regexp-function >> delimited-flag >> (and replace-char-fold >> (not regexp-flag) >> #'char-fold-to-regexp))) > > Okay, fixed this. (BTW, where is replace-regexp-function used? It's > not set anywhere in Emacs, and it's not a defcustom either.) 'replace-regexp-function' was added recently in bug#52558 to allow implementing more regexp types in bug#54017. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 16:09:29 2022 Received: (at 53126) by debbugs.gnu.org; 16 Mar 2022 20:09:29 +0000 Received: from localhost ([127.0.0.1]:52362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUZxZ-0003gb-B5 for submit@debbugs.gnu.org; Wed, 16 Mar 2022 16:09:29 -0400 Received: from mail-ej1-f46.google.com ([209.85.218.46]:34691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUZxX-0003gM-3y for 53126@debbugs.gnu.org; Wed, 16 Mar 2022 16:09:27 -0400 Received: by mail-ej1-f46.google.com with SMTP id gb39so6517845ejc.1 for <53126@debbugs.gnu.org>; Wed, 16 Mar 2022 13:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=GK1S3p0rVp4K+w7JFPVXCBFjs9GbHi8IU6IX98vfGxQ=; b=XlZm+zs2qzgvQ1J4redCSgv2ETFkAQGe6YxfqVi5w/dIBPCO1F0HFNdAnfh6pyv+Kg m9dI0Rx1wm57tkfJiDt9FogpYubRe4GVBgAwtizo/njWLYoUYw4d1QEKMdUr8m/En58x 0Bz9+8TYGvkZZnPFJXoLmw+oSHWRfqw4bQTW6e+yXOOcAvZHQyuNh6ZzkGM5oPVxGcAX yYw0YSYWfVaGWcS7qrCukfo7VWEvlA0/1HNQG1zPdaljXpwpYh0NpT1uUATXku58IwCd B49s24jtRAs6OI3IuXAmbk3KkUMflC7SZSnAss0Tc86aFkoC2Qfsd7ZNK7eIg90ht7UK w4cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=GK1S3p0rVp4K+w7JFPVXCBFjs9GbHi8IU6IX98vfGxQ=; b=rUQSrleWDU2DTGKor6KMXRaXlBgv9uZw3Xv7jItWQTNvtRSEgyhMDupm3cjTRlMhbK ITqdQb5eElBovaHzrZTwaCmYTeH3zJ6j45hAvbAFMH9X3A69qYKydnqdUgMwWYvqSFpS 1P5BXr6Jlzi5a+yR6MCr6OK7TFS8tDKvfRFrIpGG9LKNFmTek7DYh7t8Y6r+gka8Eic/ zTZpfCGmPdsqlssS2LrmWy9IUQkgrl7XudqvtI0qY26Tgl9eS9+20vr5NW/VkddvD3Dq fC2wYrO8ZuQ8kRXu0eLN9BDYPFG52Q7WyEo7VwHkU2QX6exT3EKlKdUn+zKayCzasFGS nBHA== X-Gm-Message-State: AOAM530nTGJPuaJ1I7YN+1PntBXw0aAPmMotBHc9Uff2VH6IOYq72Bc9 4A6oQT4asupDx1qEEcWoVu+OWL4ZXY8= X-Google-Smtp-Source: ABdhPJyY1RZCc7POJKqYmWgXl3q77kErmTaInhFjgvsPaN5OXTD8MpozwwaEMj/a0S7KhfRuGCHOGA== X-Received: by 2002:a17:906:d205:b0:6d1:4446:d950 with SMTP id w5-20020a170906d20500b006d14446d950mr1359257ejz.702.1647461358741; Wed, 16 Mar 2022 13:09:18 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id s18-20020a170906779200b006dbb2c2a847sm1319681ejm.125.2022.03.16.13.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 13:09:18 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> Date: Wed, 16 Mar 2022 21:09:16 +0100 In-Reply-To: <861qz1zqfb.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 16 Mar 2022 20:56:16 +0200") Message-ID: <875yod1wyb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Wed, 16 Mar 2022 at 20:56, Juri Linkov wrote: >>> So I don't see the need to have this line: >>> >>> (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) >> >> Okay, but if I remove this line, then all calls to >> minibuffer-lazy-highlight-setup will require a with-minibuffer-setup >> hook. And this will be awkward: >> >> (minibuffer-with-setup-hook (if isearch-lazy-highlight >> #'minibuffer-lazy-highlight-setup >> #'ignore) >> (read-from-minibuffer "Something: ")) > > The answer depends on another question: how do you intend the users > would enable this feature? When to enable it in all minibuffers > (like e.g. minibuffer-depth-indicate-mode does) the users will add > to their init files: > > (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) > > Then removing the user's customization would not be a nice thing to do. > OTOH, minibuffer-with-setup-hook will remove only own hook, not the user's one. > So to allow enabling this feature selectively, minibuffer-with-setup-hook > is not quite awkward. My idea is: - The users of the feature are Elisp programmers / package authors. - I don't think end users can meaningfully do anything directly with this new minibuffer hook. - If package X wants to take advantage of the feature, then it will either add minibuffer-lazy-highlight-setup to the minibuffer-setup-hook unconditionally, or it will define an X-lazy-highlight customization option to control this. So I think the conclusion is that the current approach in my patch is an good way to proceed here? >>> BTW, what is the relation between the minibuffer-lazy-highlight feature >>> and another proposed feature that immediately updates the search in >>> the buffer while editing the string in the minibuffer by isearch-edit-string? >>> Can minibuffer-lazy-highlight be considered as a lightweight version of >>> the buffer search from the minibuffer? >> >> Well, there's a package for that on ELPA (isearch-mb), so extending >> isearch-edit-string to do that seems superfluous now? > > It's still possible to add this feature to isearch-edit-string, > when the change would not be too enormous. I recall squeezing > it into a small patch, but unfortunately it requires changes > in keymap priorities. I would suggest taking a look at isearch-mb. I think the code is pretty tight, and I would be unable to shorten the implementation other than by deleting comment :-) >>>> There are a few more we could add (perhaps later), >>>> such as `occur' and `keep-lines'. >>> >>> I tried (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) >>> in the minibuffer of 'occur' and others, and it works nicely. >>> Maybe it could even semi-deprecate the package re-builder.el. >>> >>> Thanks for this generally usable feature. >> >> By the way, this is a byproduct of that long discussion that led to >> isearch-mb, so it was not all in vain :-). > > Are you sure these features can't be combined? One feature basically > runs isearch-search-and-update in the buffer from the minibuffer, > and this feature runs isearch-lazy-highlight-new-loop. For one thing, isearch-mode has 2 essential commands (repeat forward and backwards), a couple more necessary ones (quit, abort, scroll, beginning/end of buffer, mode toggles), and then a number of commands that end the search with a special action (query-replace, etc.). These little details add up to the 283 lines in isearch-mb.el currently has. >>>> - There's no customization variable to enable the minibuffer lazy >>>> highlight. The rationale is that each command that will use it should >>>> define its own user option (or use an existing one). For >>>> `isearch-edit-string' it's `isearch-lazy-highlight'; for >>>> `query-replace' it's `query-replace-lazy-highlight'; and so on. >>> >>> A common customizable option to enable this everywhere would be nice too. >>> Maybe disabling is already possible by customizing >>> 'minibuffer-lazy-count-format' to nil? Then the checks for >>> non-nil 'minibuffer-lazy-count-format' could be added to >>> more places, such as to wrap the whole '(condition-case error' >>> in query-replace-read-args with the 'when' condition, etc. >> >> Yes, the user can set minibuffer-lazy-count-format to nil to get rid of >> the lazy count. >> >> Concerning query-replace, why would anyone want to have lazy highlight >> during the perform-replace loop, but not earlier? I'm not a fan of >> adding a custom option here, not because it would be hard, but because >> it seems totally unnecessary. > > Maybe a new option would make sense for the same reason why there is > the option isearch-lazy-count? Okay, I'm not against this, but let's think about the names of these user options. The existing option is named query-replace-lazy-highlight, which seems to exactly describe the new feature. The existing feature would more specifically be called perform-replace-lazy highlight. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 16:25:11 2022 Received: (at 53126) by debbugs.gnu.org; 16 Mar 2022 20:25:11 +0000 Received: from localhost ([127.0.0.1]:52375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUaCl-00046H-AM for submit@debbugs.gnu.org; Wed, 16 Mar 2022 16:25:11 -0400 Received: from mail-ej1-f53.google.com ([209.85.218.53]:41614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUaCj-00045z-2r for 53126@debbugs.gnu.org; Wed, 16 Mar 2022 16:25:09 -0400 Received: by mail-ej1-f53.google.com with SMTP id a8so6566110ejc.8 for <53126@debbugs.gnu.org>; Wed, 16 Mar 2022 13:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kqarn9g76UQ6L+KvgmF1gBQzmJSDFgBnopK1Q7A5CFg=; b=pYlnYlA/zi/K2Ch1rY3NPZ5iLVh4378O6ST+V5oojC+NIBnye0v2omof80szrbHmU/ 8jXcSxiv8V1+CkTuV4TGHuYxVcP08n5k34nU5fYvhtDUjbfpc0nfKCDWSCrVRhVsmSWv szXagPJyQ9fL/GlfVcvk0lwwKnw3N6O4x7QEdigWDRAOz9tYq4O8ShLsuluUj9Oapcjg 8jrrqTeFyZKjhnz0EjmsCq2crt1xq0PqKL+ShdeaAJBrCKt8bQEd5bxLid1u0ljA2ecr /ONrHKe9DPNZq6q8wVQ2f7JxG0JxBPzxy8m7i7KeEXZg7Qjuli/SISicHzloSbTchrQ0 ddmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=kqarn9g76UQ6L+KvgmF1gBQzmJSDFgBnopK1Q7A5CFg=; b=A1yin5tXJPwX6J225KIs6hEPc9D2AVBAW1fd+rA2WRP4klMm8iot7pP/nV8yqc5xvv XhG0Q0tJjEr/yIrpPUvFBkxSbli31hHOB0ocq6Frb37MmROU/aEsJNRNQMpupqLFC08q aJROtWlA8QYbCLIiYTF7B3RasarNMkBFRRO7CaZaF+8NfYC6/z+5+ziDcRcZ0XdGMLpQ VCUdNG3f+wjG3iW3EclQFEhN8CMeh8iCJLvXp2eeVhUu3x/9CDhdKJgJKm40xoUeqW5p yO6T/UH6rl3+FUDgCCfbXCV3lGyet1X94k1HtOz9RsQIiJyxpI9PfdBokbdUNrhy8N8o 9lRw== X-Gm-Message-State: AOAM53075jfxB/Pj8KG64AqELXuliDnnzkXgl9nZKN8UQKDO+wunpcwO tqOouGVKSl7x3M9wh5164ZEaRd7yJJ0= X-Google-Smtp-Source: ABdhPJzHvjEGj4YvUyIpADYs2JYG/RJOX8RI3EY1to/8xzXdZspeKAGL1hcLmvydmHwK6gdf/5UZ8A== X-Received: by 2002:a17:907:86a3:b0:6da:870c:af44 with SMTP id qa35-20020a17090786a300b006da870caf44mr1403025ejc.445.1647462302877; Wed, 16 Mar 2022 13:25:02 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id k23-20020a1709062a5700b006ccd8fdc300sm1314907eje.180.2022.03.16.13.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 13:25:02 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> Date: Wed, 16 Mar 2022 21:25:01 +0100 In-Reply-To: <868rt9wwji.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 16 Mar 2022 21:02:25 +0200") Message-ID: <871qz11w82.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Wed, 16 Mar 2022 at 21:02, Juri Linkov wrote: >>>> @@ -2350,7 +2352,9 @@ isearch-query-replace >>>> + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup >>>> + (not query-replace-lazy-highlight)))) >>>> + (isearch-done nil t)) >>> >>> Is this some optimization? It seems it's intended to leave >>> some existing highlighting? Is this to avoid double highlighting? >> >> The weird let-binding for lazy-highlight-cleanup is indeed an >> optimization. Without it, you can see the lazy highlights briefly flash >> off an on again after you hit RET to confirm the replacement string. >> >> (Same remark explains why condition-case is used instead of a >> unwind-protect in query-replace-read-args). > > When I tried your latest patch, it still flashes when it starts > the perform-replace loop. Does it always happen for you? I see this occasionally, and as far as I can tell it's random. >>> The problem is that when these conditions 'isearch-mode (null isearch-message-function)' >>> are removed, now this shows wrong counts in the minibuffer history search >>> (e.g. 'M-! C-r s C-r C-r ...') and the shell history search >>> (e.g. 'M-x shell RET M-r s C-r C-r ...'). Before this change >>> counting was disabled in the history search because it shows wrong numbers. >> >> Okay, so this means we should bind isearch-lazy-count to nil in these >> commands, do you agree? It has always looked like a hack to me to check >> for (null isearch-message-function). > > Binding isearch-lazy-count to nil could serve as a temporary measure > until lazy-count will be supported in the history search. Okay, the patch from yesterday already does that. >>> For some reasons the package lisp/mb-depth.el uses 'after-string' >>> instead of 'before-string', and (make-overlay (point-min) (1+ (point-min))) >>> instead of (make-overlay (point-min) (point-min)), >>> so maybe better to do the same? >> >> Okay, but do you know the reasons? I've changed to before-string, but I >> don't like to make the overlay 1 char longer than it has to be :-P > > I don't know the reason. Since it works in your patch, then it's ok. Great. >>> Highlighting is still incorrect for word replacement ('C-u M-%') >>> and for non-nil 'replace-char-fold'. To handle these cases correctly, >>> 'replace-highlight' uses: >>> >>> (isearch-regexp-function (or replace-regexp-function >>> delimited-flag >>> (and replace-char-fold >>> (not regexp-flag) >>> #'char-fold-to-regexp))) >> >> Okay, fixed this. (BTW, where is replace-regexp-function used? It's >> not set anywhere in Emacs, and it's not a defcustom either.) > > 'replace-regexp-function' was added recently in bug#52558 > to allow implementing more regexp types in bug#54017. Ah, I see. I must say, in isearch.el I don't like this trichotomy of the regexp/literal/with isearch-regexp-function cases. Ideally, the regexp and literal search cases would be handled by isearch-regexp-function set to identity respectively regexp-quote. But it would be a large refactoring, perhaps with only aesthetic benefits. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 13:10:30 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 17:10:30 +0000 Received: from localhost ([127.0.0.1]:55064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUtdt-0008CG-Pz for submit@debbugs.gnu.org; Thu, 17 Mar 2022 13:10:30 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUtds-0008C0-Fm for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 13:10:29 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D5CDEC0006; Thu, 17 Mar 2022 17:10:19 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> Date: Thu, 17 Mar 2022 19:05:34 +0200 In-Reply-To: <871qz11w82.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 16 Mar 2022 21:25:01 +0100") Message-ID: <86ilsc7e31.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> When I tried your latest patch, it still flashes when it starts >> the perform-replace loop. > > Does it always happen for you? I see this occasionally, and as far as I > can tell it's random. It happens every time when starting perform-replace from isearch. >>>> Highlighting is still incorrect for word replacement ('C-u M-%') >>>> and for non-nil 'replace-char-fold'. To handle these cases correctly, >>>> 'replace-highlight' uses: >>>> >>>> (isearch-regexp-function (or replace-regexp-function >>>> delimited-flag >>>> (and replace-char-fold >>>> (not regexp-flag) >>>> #'char-fold-to-regexp))) >>> >>> Okay, fixed this. (BTW, where is replace-regexp-function used? It's >>> not set anywhere in Emacs, and it's not a defcustom either.) >> >> 'replace-regexp-function' was added recently in bug#52558 >> to allow implementing more regexp types in bug#54017. > > Ah, I see. I must say, in isearch.el I don't like this trichotomy of > the regexp/literal/with isearch-regexp-function cases. Ideally, the > regexp and literal search cases would be handled by > isearch-regexp-function set to identity respectively regexp-quote. But > it would be a large refactoring, perhaps with only aesthetic benefits. Yep, too much changes for little benefit. The biggest hunk in your patch are changes in query-replace-read-args starting from 'condition-case error'. Would it be possible to simplify this part? Maybe by some refactoring? OTOH, your changes that add lazy-count-update-hook and remove '(null isearch-message-function)' can be already pushed. Could you please send a separate patch for pushing with these changes only? Then the patch with minibuffer-lazy-count feature will be shorter. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 13:10:34 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 17:10:34 +0000 Received: from localhost ([127.0.0.1]:55066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUtdy-0008CX-3m for submit@debbugs.gnu.org; Thu, 17 Mar 2022 13:10:34 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:58925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUtdt-0008C4-HC for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 13:10:30 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C0B65240011; Thu, 17 Mar 2022 17:10:22 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> Date: Thu, 17 Mar 2022 19:09:13 +0200 In-Reply-To: <875yod1wyb.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 16 Mar 2022 21:09:16 +0100") Message-ID: <86mtho5y56.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > My idea is: > > - The users of the feature are Elisp programmers / package authors. > - I don't think end users can meaningfully do anything directly with > this new minibuffer hook. > - If package X wants to take advantage of the feature, then it will > either add minibuffer-lazy-highlight-setup to the > minibuffer-setup-hook unconditionally, or it will define an > X-lazy-highlight customization option to control this. > > So I think the conclusion is that the current approach in my patch is an > good way to proceed here? So do you think end users should not be able to decide where they want to use this feature? For example, if one user will want it for 'occur', but another user doesn't want it in the 'occur' regexp-reading minibuffer, they should have no choice? >>>> BTW, what is the relation between the minibuffer-lazy-highlight feature >>>> and another proposed feature that immediately updates the search in >>>> the buffer while editing the string in the minibuffer by isearch-edit-string? >>>> Can minibuffer-lazy-highlight be considered as a lightweight version of >>>> the buffer search from the minibuffer? >>> >>> Well, there's a package for that on ELPA (isearch-mb), so extending >>> isearch-edit-string to do that seems superfluous now? >> >> It's still possible to add this feature to isearch-edit-string, >> when the change would not be too enormous. I recall squeezing >> it into a small patch, but unfortunately it requires changes >> in keymap priorities. > > I would suggest taking a look at isearch-mb. I think the code is pretty > tight, and I would be unable to shorten the implementation other than by > deleting comment :-) I already looked at isearch-mb. Adding the same to isearch.el will take only 52 lines. >>>>> There are a few more we could add (perhaps later), >>>>> such as `occur' and `keep-lines'. >>>> >>>> I tried (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) >>>> in the minibuffer of 'occur' and others, and it works nicely. >>>> Maybe it could even semi-deprecate the package re-builder.el. >>>> >>>> Thanks for this generally usable feature. >>> >>> By the way, this is a byproduct of that long discussion that led to >>> isearch-mb, so it was not all in vain :-). >> >> Are you sure these features can't be combined? One feature basically >> runs isearch-search-and-update in the buffer from the minibuffer, >> and this feature runs isearch-lazy-highlight-new-loop. > > For one thing, isearch-mode has 2 essential commands (repeat forward and > backwards), a couple more necessary ones (quit, abort, scroll, > beginning/end of buffer, mode toggles), and then a number of commands > that end the search with a special action (query-replace, etc.). > > These little details add up to the 283 lines in isearch-mb.el currently > has. I wonder how this is affected by scroll, beginning/end of buffer, mode toggles? These commands don't use the minibuffer. >>>>> - There's no customization variable to enable the minibuffer lazy >>>>> highlight. The rationale is that each command that will use it should >>>>> define its own user option (or use an existing one). For >>>>> `isearch-edit-string' it's `isearch-lazy-highlight'; for >>>>> `query-replace' it's `query-replace-lazy-highlight'; and so on. >>>> >>>> A common customizable option to enable this everywhere would be nice too. >>>> Maybe disabling is already possible by customizing >>>> 'minibuffer-lazy-count-format' to nil? Then the checks for >>>> non-nil 'minibuffer-lazy-count-format' could be added to >>>> more places, such as to wrap the whole '(condition-case error' >>>> in query-replace-read-args with the 'when' condition, etc. >>> >>> Yes, the user can set minibuffer-lazy-count-format to nil to get rid of >>> the lazy count. >>> >>> Concerning query-replace, why would anyone want to have lazy highlight >>> during the perform-replace loop, but not earlier? I'm not a fan of >>> adding a custom option here, not because it would be hard, but because >>> it seems totally unnecessary. >> >> Maybe a new option would make sense for the same reason why there is >> the option isearch-lazy-count? > > Okay, I'm not against this, but let's think about the names of these user > options. The existing option is named query-replace-lazy-highlight, > which seems to exactly describe the new feature. The existing feature > would more specifically be called perform-replace-lazy highlight. Do you mean lazy-highlight in the minibuffer that reads a string to replace? Then it could be named query-replace-read-lazy-highlight. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 15:07:05 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 19:07:05 +0000 Received: from localhost ([127.0.0.1]:55206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUvSi-0002ko-Nd for submit@debbugs.gnu.org; Thu, 17 Mar 2022 15:07:05 -0400 Received: from mail-ej1-f45.google.com ([209.85.218.45]:33382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUvSh-0002kK-CB for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 15:07:04 -0400 Received: by mail-ej1-f45.google.com with SMTP id pv16so12829765ejb.0 for <53126@debbugs.gnu.org>; Thu, 17 Mar 2022 12:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2U2i5qeBUBOQo5r52AMVeGb0t5xWDgoH97eOxdhgWJI=; b=XyjR5/XH42cmgsMjEQ+d2U2MvhYKb8F8F544MdOTWBa9heYvllbrDwbwcbOHNz9/xn zLmSg/QklqTEXZp6pTG6I0bm0r0HvRRU48tqlOk2o6bX5lKLixzvIN4ytQm+el2Yo3kp tU0TIA7yfbUUGDAf9Tjp6VZj71mWDtdga55zL3fPq1f77/Gu37PhE6gbKbJ+k++1jB5z FmyfjubRcbWBRQEgDYxKiL+1+WBAS03Brko7IxIqMycl2uccKsrDY9k5D+fPXOaGHXFN AMzfc2NVWlSqNSDCvzII2pUhC67lc2g2vhpJHoSj/d4npzoY8MUTrPc90EVJuX85hTP0 9lrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2U2i5qeBUBOQo5r52AMVeGb0t5xWDgoH97eOxdhgWJI=; b=bNlUr7g7p1gP6hz2r0cFNaJ3Y+k4NPEuvvtj6yTylewEK4bMe2K80ajrpvaJ5XdhmI d2jrM8+dRi/QYMiYlF+dcccgTmJ/tCrmS2F4iZFC26EwjzuvOGIzNoUZ4YvhlVpvslQc sGtf+ZCaO3+GVOoM1Mk/1Y+wFG9a36y7YwDJr2th3Q9qsLPKIEw6kZO1FVYNq6W7l9vi B9vUMQ/LUXhBV0m8oTNmICyYuaPEtrOlp9J7OFkbZbSenqKFwDwb7FkkuK/i34XL1urS J8mdIfapEhmrfcZje3FPJsB/W5F6w9o8vqixpsC87qgJmAm439RTBboh5WiwPdvziNZe r0rQ== X-Gm-Message-State: AOAM530DGWCOADxCMRGnNABg/ghtxcKxL6camXSXaDh+tSeHd1xhboRK DY/4Q5vdnW4ztA3gxOlYSRyP/DFwfqo= X-Google-Smtp-Source: ABdhPJzbiTFJNvrpi0BQkj2a/HWOANkxb5P86XnECUoop+dxL3Mi5s/Uie/88LwN0KN0oZ4BAmvNYg== X-Received: by 2002:a17:906:2991:b0:6cc:fc18:f10c with SMTP id x17-20020a170906299100b006ccfc18f10cmr5737529eje.744.1647544017193; Thu, 17 Mar 2022 12:06:57 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id si13-20020a170906cecd00b006cded0c5ee2sm2840370ejb.61.2022.03.17.12.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:06:56 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> Date: Thu, 17 Mar 2022 20:06:54 +0100 In-Reply-To: <86ilsc7e31.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 17 Mar 2022 19:05:34 +0200") Message-ID: <87tubwz9dd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Thu, 17 Mar 2022 at 19:05, Juri Linkov wrote: > OTOH, your changes that add lazy-count-update-hook and remove > '(null isearch-message-function)' can be already pushed. > Could you please send a separate patch for pushing with these changes only? > > Then the patch with minibuffer-lazy-count feature will be shorter. There it is: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Allow-lazy-highlight-and-match-count-while-reading-f.patch >From 3de37cfec647cedd69032df072a1176970224ecb Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Thu, 17 Mar 2022 20:02:13 +0100 Subject: [PATCH] Allow lazy highlight and match count while reading from minibuffer * lisp/isearch.el (lazy-count-update-hook): New hook allowing to display the lazy count in special ways. (isearch-edit-string): Add lazy highlight and count of matching text. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-buffer-update): Use `isearch-lazy-count-display-function' instead of hardcoded call to `isearch-message'. (minibuffer-lazy-count-format, minibuffer-lazy-highlight-transform, minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count, minibuffer-lazy-highlight--after-change, minibuffer-lazy-highlight--exit, minibuffer-lazy-highlight-setup): Variables and functions implementing the lazy highlight functionality while reading from minibuffer. * lisp/comint.el (comint-history-isearch-setup, comint-history-isearch-end): Make sure no lazy count is displayed. * lisp/simple.el (minibuffer-history-isearch-setup): Make sure no lazy count is displayed. --- lisp/comint.el | 2 ++ lisp/isearch.el | 86 +++++++++++++++++++++++++++++++++++++++++++++---- lisp/simple.el | 1 + 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 4c82e74e4b..56082f622a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1515,6 +1515,7 @@ comint-history-isearch-setup #'comint-history-isearch-wrap) (setq-local isearch-push-state-function #'comint-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t))) (defun comint-history-isearch-end () @@ -1526,6 +1527,7 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + (kill-local-variable 'isearch-lazy-count) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended (custom-reevaluate-setting 'comint-history-isearch))) diff --git a/lisp/isearch.el b/lisp/isearch.el index 8970216398..1a83586ef8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1812,6 +1812,8 @@ isearch-edit-string (minibuffer-history-symbol) ;; Search string might have meta information on text properties. (minibuffer-allow-text-properties t)) + (when isearch-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) (setq isearch-new-string (read-from-minibuffer (isearch-message-prefix nil isearch-nonincremental) @@ -3990,6 +3992,8 @@ isearch-lazy-highlight-error (defvar isearch-lazy-count-current nil) (defvar isearch-lazy-count-total nil) (defvar isearch-lazy-count-hash (make-hash-table)) +(defvar lazy-count-update-hook nil + "Hook run after new lazy count results are computed.") (defun lazy-highlight-cleanup (&optional force procrastinate) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -4048,7 +4052,7 @@ isearch-lazy-highlight-new-loop isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -4067,7 +4071,10 @@ isearch-lazy-highlight-new-loop (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) ;; Delay updating the message if possible, to avoid flicker - (when (string-equal isearch-string "") (isearch-message)))) + (when (string-equal isearch-string "") + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error) @@ -4120,13 +4127,15 @@ isearch-lazy-highlight-new-loop 'isearch-lazy-highlight-start)))) ;; Update the current match number only in isearch-mode and ;; unless isearch-mode is used specially with isearch-message-function - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count ;; Update isearch-lazy-count-current only when it was already set ;; at the end of isearch-lazy-highlight-buffer-update (when isearch-lazy-count-current (setq isearch-lazy-count-current (gethash (point) isearch-lazy-count-hash 0)) - (isearch-message)))) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (defun isearch-lazy-highlight-search (string bound) "Search ahead for the next or previous match, for lazy highlighting. @@ -4327,16 +4336,81 @@ isearch-lazy-highlight-buffer-update (setq looping nil nomore t)))) (if nomore - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (unless isearch-lazy-count-total (setq isearch-lazy-count-total 0)) (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) - (isearch-message)) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) + +;; Reading from minibuffer with lazy highlight and match count + +(defcustom minibuffer-lazy-count-format "%s " + "Format of the total number of matches for the prompt prefix." + :type '(choice (const :tag "Don't display a count" nil) + (string :tag "Display match count" "%s ")) + :group 'lazy-count + :version "29.1") + +(defvar minibuffer-lazy-highlight-transform #'identity + "Function to transform minibuffer text into a `isearch-string' for highlighting.") + +(defvar minibuffer-lazy-highlight--overlay nil + "Overlay for minibuffer prompt updates.") + +(defun minibuffer-lazy-highlight--count () + "Display total match count in the minibuffer prompt." + (when minibuffer-lazy-highlight--overlay + (overlay-put minibuffer-lazy-highlight--overlay + 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format minibuffer-lazy-count-format + isearch-lazy-count-total))))) + +(defun minibuffer-lazy-highlight--after-change (_beg _end _len) + "Update lazy highlight state in minibuffer selected window." + (when isearch-lazy-highlight + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (setq isearch-string (funcall minibuffer-lazy-highlight-transform string)) + (isearch-lazy-highlight-new-loop))))) + +(defun minibuffer-lazy-highlight--exit () + "Unwind changes from `minibuffer-lazy-highlight-setup'." + (remove-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (remove-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (remove-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay nil) + (when lazy-highlight-cleanup + (lazy-highlight-cleanup))) + +(defun minibuffer-lazy-highlight-setup () + "Set up minibuffer for lazy highlight of matches in the original window. + +This function is intended to be added to `minibuffer-setup-hook'. +Note that several other isearch variables influence the lazy +highlighting, including `isearch-regexp', +`isearch-lazy-highlight' and `isearch-lazy-count'." + (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (add-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (add-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay + (and minibuffer-lazy-count-format + (make-overlay (point-min) (point-min) (current-buffer) t))) + (minibuffer-lazy-highlight--after-change nil nil nil)) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. STRING is the string or regexp searched for. diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..61319b6060 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2840,6 +2840,7 @@ minibuffer-history-isearch-setup #'minibuffer-history-isearch-wrap) (setq-local isearch-push-state-function #'minibuffer-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) (defun minibuffer-history-isearch-end () -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 15:10:44 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 19:10:44 +0000 Received: from localhost ([127.0.0.1]:55214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUvWF-0002q3-KI for submit@debbugs.gnu.org; Thu, 17 Mar 2022 15:10:44 -0400 Received: from mail-ej1-f47.google.com ([209.85.218.47]:43725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUvWD-0002pk-OY for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 15:10:42 -0400 Received: by mail-ej1-f47.google.com with SMTP id d10so12695937eje.10 for <53126@debbugs.gnu.org>; Thu, 17 Mar 2022 12:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=6QuUdrSw07IanZ5QGayZDiyMwAysBXvcg/ix+mNJqx4=; b=fepe1ndfaq9wO5Qm3/mAwc6G1oxwtwGCZHLTkRTHxzeQtVpShqmXw/g1Swp4p+Zc4p toBAl5S5vaHJL+97TtBppQV9OlYud2gB+0L2cGxnUXwalmIM4kVm5MbdQDWkq1bXOtJs s6QvNfHSWr/QUdrDt407Dih/ez4bdehTibSdtCICAuDvIPKtWd8HS0IKtWq8RcHg279D HcXF9Y/L+S7l2df6Wc/YYHDpRaR1ZSiUigPQhcoPQGpsgZ7o9uf4FuRQ0memrzOQBItD cAykaO4tAbrx2RZvTYIr9ZK3aFwPmmbcw7fmkHk6LxCoUhQ1ZcDIe8CogifbdmN1BgDv 4cqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=6QuUdrSw07IanZ5QGayZDiyMwAysBXvcg/ix+mNJqx4=; b=QUEBcfshRl81ugMkTLWAI0sGTEOOo/wZGu79iFMUTAARc59fAKaubPpOcAI2faWRyD lbA2LnUU5VI9faHM47rXcpFvEKMQpXhxZ/J+TPSJfj/h0Pzr8zayF9H3CSMjMhlrjz+d Kg+7XaaZtE2N2GIdJiDDsTpLDjtap5wu/JHFhtmk3yrVbxUjC3p3gvbZiFAWzegdKzlf bNM1u3mZckokUGqH3256Lt8tYlqErcd2TyceNpHszMwSsS9kaE5RrobhQ6g8ESXUypm2 aPMyUj33wjXcwd9H+mOsb8riPXe+MqQo2jNFdWea4kMeYpBulUHBSDX3PhGqv1AnTH9Y uIRw== X-Gm-Message-State: AOAM530bx/Zz5iVZy2PmT405wlWgjMyO3N54IJQflUfVlvXw9fuc/CVF 036F4N74CNULQ/fXe8LUc0E1SVfY8zw= X-Google-Smtp-Source: ABdhPJydmmJ67iS2UpM471FXwVloUuRuO9TKpEn1CkIFFloTzxbzv+vDN/dF/1gRQjzjlO92lxmVuw== X-Received: by 2002:a17:907:7f1b:b0:6df:7e0c:8842 with SMTP id qf27-20020a1709077f1b00b006df7e0c8842mr5726773ejc.225.1647544235722; Thu, 17 Mar 2022 12:10:35 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id k19-20020a1709067ad300b006da92735c32sm2774894ejo.16.2022.03.17.12.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:10:35 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> Date: Thu, 17 Mar 2022 20:10:34 +0100 In-Reply-To: <86mtho5y56.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 17 Mar 2022 19:09:13 +0200") Message-ID: <87sfrgz979.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Thu, 17 Mar 2022 at 19:09, Juri Linkov wrote: >> My idea is: >> >> - The users of the feature are Elisp programmers / package authors. >> - I don't think end users can meaningfully do anything directly with >> this new minibuffer hook. >> - If package X wants to take advantage of the feature, then it will >> either add minibuffer-lazy-highlight-setup to the >> minibuffer-setup-hook unconditionally, or it will define an >> X-lazy-highlight customization option to control this. >> >> So I think the conclusion is that the current approach in my patch is an >> good way to proceed here? > > So do you think end users should not be able to decide where they want > to use this feature? For example, if one user will want it for 'occur', > but another user doesn't want it in the 'occur' regexp-reading minibuffer, > they should have no choice? Of course there should an option, maybe occur-lazy-highlight. This is why isearch.el itself should _not_ contain a customization option called `minibuffer-lazy-highlight': each use (or group of uses) of this functionality should define their own customization option. >>>>> BTW, what is the relation between the minibuffer-lazy-highlight feature >>>>> and another proposed feature that immediately updates the search in >>>>> the buffer while editing the string in the minibuffer by isearch-edit-string? >>>>> Can minibuffer-lazy-highlight be considered as a lightweight version of >>>>> the buffer search from the minibuffer? >>>> >>>> Well, there's a package for that on ELPA (isearch-mb), so extending >>>> isearch-edit-string to do that seems superfluous now? >>> >>> It's still possible to add this feature to isearch-edit-string, >>> when the change would not be too enormous. I recall squeezing >>> it into a small patch, but unfortunately it requires changes >>> in keymap priorities. >> >> I would suggest taking a look at isearch-mb. I think the code is pretty >> tight, and I would be unable to shorten the implementation other than by >> deleting comment :-) > > I already looked at isearch-mb. Adding the same to isearch.el > will take only 52 lines. Okay, I can give my opinion about these changes if you wish. >>>>>> There are a few more we could add (perhaps later), >>>>>> such as `occur' and `keep-lines'. >>>>> >>>>> I tried (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) >>>>> in the minibuffer of 'occur' and others, and it works nicely. >>>>> Maybe it could even semi-deprecate the package re-builder.el. >>>>> >>>>> Thanks for this generally usable feature. >>>> >>>> By the way, this is a byproduct of that long discussion that led to >>>> isearch-mb, so it was not all in vain :-). >>> >>> Are you sure these features can't be combined? One feature basically >>> runs isearch-search-and-update in the buffer from the minibuffer, >>> and this feature runs isearch-lazy-highlight-new-loop. >> >> For one thing, isearch-mode has 2 essential commands (repeat forward and >> backwards), a couple more necessary ones (quit, abort, scroll, >> beginning/end of buffer, mode toggles), and then a number of commands >> that end the search with a special action (query-replace, etc.). >> >> These little details add up to the 283 lines in isearch-mb.el currently >> has. > > I wonder how this is affected by scroll, beginning/end of buffer, mode toggles? > These commands don't use the minibuffer. I probably misunderstood you then. I thought you wanted to allow C-s and C-r in isearch-edit-string to go back and forth in the search buffer, but apparently this is not the case. (Then I need to see your 52-line patch to understand what exactly you mean...) >>>>>> - There's no customization variable to enable the minibuffer lazy >>>>>> highlight. The rationale is that each command that will use it should >>>>>> define its own user option (or use an existing one). For >>>>>> `isearch-edit-string' it's `isearch-lazy-highlight'; for >>>>>> `query-replace' it's `query-replace-lazy-highlight'; and so on. >>>>> >>>>> A common customizable option to enable this everywhere would be nice too. >>>>> Maybe disabling is already possible by customizing >>>>> 'minibuffer-lazy-count-format' to nil? Then the checks for >>>>> non-nil 'minibuffer-lazy-count-format' could be added to >>>>> more places, such as to wrap the whole '(condition-case error' >>>>> in query-replace-read-args with the 'when' condition, etc. >>>> >>>> Yes, the user can set minibuffer-lazy-count-format to nil to get rid of >>>> the lazy count. >>>> >>>> Concerning query-replace, why would anyone want to have lazy highlight >>>> during the perform-replace loop, but not earlier? I'm not a fan of >>>> adding a custom option here, not because it would be hard, but because >>>> it seems totally unnecessary. >>> >>> Maybe a new option would make sense for the same reason why there is >>> the option isearch-lazy-count? >> >> Okay, I'm not against this, but let's think about the names of these user >> options. The existing option is named query-replace-lazy-highlight, >> which seems to exactly describe the new feature. The existing feature >> would more specifically be called perform-replace-lazy highlight. > > Do you mean lazy-highlight in the minibuffer that reads a string to replace? > Then it could be named query-replace-read-lazy-highlight. I personally find it a bit unnecessary to have separate options for query-replace-read-lazy-highlight and query-replace-lazy-highlight. Of course it's nice to have fine-grained control, but at some point it just becomes too difficult to configure things. But I don't mind adding it. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 15:46:08 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 19:46:08 +0000 Received: from localhost ([127.0.0.1]:55242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUw4W-0003gW-2O for submit@debbugs.gnu.org; Thu, 17 Mar 2022 15:46:08 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:39697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUw4U-0003ft-7Q for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 15:46:06 -0400 Received: by mail-ej1-f43.google.com with SMTP id dr20so12603572ejc.6 for <53126@debbugs.gnu.org>; Thu, 17 Mar 2022 12:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=sWkc5Zk5xTpjgSApnpMIDQFCzdRXU0Yrn9ZKLlRYYNI=; b=eF0XdzJdJlQARLA/M3AAfeOZWoB5MqSaDrnuaCm51LALfRfXxhluS36i/HEE9k0fW3 9sayPwj42jgedzbKhtFwfanQqCErrB9WUZ0QYx61CCGgvzE+sJpCUZe0YkZl4TPayP4P JwhHwuzYF4U3eisPiEMf2H/4p7CHfWUyf4vHMpYQokgUjGnSCloA101t5nGMPiPkSm1d kpZzHXphysJVFa6hy2zt9Qm9bKCtlTem+ff0aUbNu25f97j+8PB1Fi8jlm4AC74N6dxX d8l0F+CEm0fOaaZaDSgExb0mv65+QIULentg0wtHvtdw7oIQa0gpCr90Jf+1sroV70Tn Stnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=sWkc5Zk5xTpjgSApnpMIDQFCzdRXU0Yrn9ZKLlRYYNI=; b=YXFtRdpsevS/3qH4IoCoA6QL7dLnJ5T1pCYyLEidb78EumRL1m/ibpEiQNhqZfSZfu LRXSvaSmfZ+3cuT4oPxE9qngHpbg7y6bI50tfapw8vuBFUsRhc1Vw/ZdjEQX31gSxWZU l8IWzKMP1ffGK9zuH6ai4L7UrC2+dpNQ1aDcTI9OZkjFuDh1qWSO+QB29fStq0WAi0hC ZXlAVIboXNe/f+gna63jcT3wORRM6ppLq7cd1b2kroSMGutz2a+KtYmelnvZxUpPZMrz J6/n+HtRQMEkAYMKzq1gLaXCWcAybbpnmuigBTjht11X19OYuy/6WfLTkKI0wK8OZbp7 MkAw== X-Gm-Message-State: AOAM533v/YU9Z4cU7n7FR42F5yQTPijHyHQ5IcLIQ6CoWR7lRwuvOr8h QLYYMFLIiaWOlL7AMOe3+WKNm2NEfUY= X-Google-Smtp-Source: ABdhPJwVno+o2SkAdxWl1zXtr/p/UG7b/skz5XuFHBPkLSfdSrbtsj74WyFrQJY8dQs6Vl9RvXJWPg== X-Received: by 2002:a17:906:2ad5:b0:6cf:9cca:d9db with SMTP id m21-20020a1709062ad500b006cf9ccad9dbmr5999869eje.252.1647546360035; Thu, 17 Mar 2022 12:46:00 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id v4-20020a170906338400b006d5aca9fc80sm2690362eja.106.2022.03.17.12.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:45:59 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> Date: Thu, 17 Mar 2022 20:45:57 +0100 In-Reply-To: <86ilsc7e31.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 17 Mar 2022 19:05:34 +0200") Message-ID: <87o824z7ka.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Thu, 17 Mar 2022 at 19:05, Juri Linkov wrote: >>> When I tried your latest patch, it still flashes when it starts >>> the perform-replace loop. >> >> Does it always happen for you? I see this occasionally, and as far as I >> can tell it's random. > > It happens every time when starting perform-replace from isearch. Interesting, I can't see thing flash at that particular place. But I've replaced the unwind-protect by a more fine-grained condition-case. Let me know if it helps. > The biggest hunk in your patch are changes in query-replace-read-args > starting from 'condition-case error'. Would it be possible to simplify > this part? Maybe by some refactoring? The only refactoring opportunity I see it to define (defun replace-regexp-function (delimited-flag) (or replace-regexp-function delimited-flag (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp))) which can be used in 3 places. Should I do that? Otherwise, I dont' see much room for improvement. There are a lot of moving parts there, so to me things already turned out surprisingly short. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 17:15:35 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 21:15:35 +0000 Received: from localhost ([127.0.0.1]:55365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxT4-0005xv-QJ for submit@debbugs.gnu.org; Thu, 17 Mar 2022 17:15:35 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:42997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxT3-0005xf-6X for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 17:15:33 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A0F51200008; Thu, 17 Mar 2022 21:15:25 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> Date: Thu, 17 Mar 2022 22:40:19 +0200 In-Reply-To: <87sfrgz979.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 17 Mar 2022 20:10:34 +0100") Message-ID: <861qz0475w.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >>> My idea is: >>> >>> - The users of the feature are Elisp programmers / package authors. >>> - I don't think end users can meaningfully do anything directly with >>> this new minibuffer hook. >>> - If package X wants to take advantage of the feature, then it will >>> either add minibuffer-lazy-highlight-setup to the >>> minibuffer-setup-hook unconditionally, or it will define an >>> X-lazy-highlight customization option to control this. >>> >>> So I think the conclusion is that the current approach in my patch is an >>> good way to proceed here? >> >> So do you think end users should not be able to decide where they want >> to use this feature? For example, if one user will want it for 'occur', >> but another user doesn't want it in the 'occur' regexp-reading minibuffer, >> they should have no choice? > > Of course there should an option, maybe occur-lazy-highlight. This is > why isearch.el itself should _not_ contain a customization option called > `minibuffer-lazy-highlight': each use (or group of uses) of this > functionality should define their own customization option. This means dozens of new options for every possible command that uses the minibuffer: occur-lazy-highlight, keep-lines-lazy-highlight, flush-lines-lazy-highlight, kill-matching-lines-lazy-highlight, copy-matching-lines-lazy-highlight, how-many-lazy-highlight, ... From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 17:15:38 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 21:15:38 +0000 Received: from localhost ([127.0.0.1]:55368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxT8-0005yA-8u for submit@debbugs.gnu.org; Thu, 17 Mar 2022 17:15:38 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:48153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxT6-0005xk-9R for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 17:15:36 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 0D42D240003; Thu, 17 Mar 2022 21:15:28 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87o824z7ka.fsf@gmail.com> Date: Thu, 17 Mar 2022 22:43:20 +0200 In-Reply-To: <87o824z7ka.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 17 Mar 2022 20:45:57 +0100") Message-ID: <86mtho2sg9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > On Thu, 17 Mar 2022 at 19:05, Juri Linkov wrote: > >>>> When I tried your latest patch, it still flashes when it starts >>>> the perform-replace loop. >>> >>> Does it always happen for you? I see this occasionally, and as far as I >>> can tell it's random. >> >> It happens every time when starting perform-replace from isearch. > > Interesting, I can't see thing flash at that particular place. But I've > replaced the unwind-protect by a more fine-grained condition-case. Let > me know if it helps. > >> The biggest hunk in your patch are changes in query-replace-read-args >> starting from 'condition-case error'. Would it be possible to simplify >> this part? Maybe by some refactoring? > > The only refactoring opportunity I see it to define > > (defun replace-regexp-function (delimited-flag) > (or replace-regexp-function > delimited-flag > (and replace-char-fold > (not regexp-flag) > #'char-fold-to-regexp))) > > which can be used in 3 places. Should I do that? > > Otherwise, I dont' see much room for improvement. There are a lot of > moving parts there, so to me things already turned out surprisingly > short. I meant a function that translates arguments of query-replace/perform-replace to search parameters. They are currently used in replace-search and replace-highlight. But maybe could be reused by query-replace-read-args? From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 17 17:42:55 2022 Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 21:42:55 +0000 Received: from localhost ([127.0.0.1]:55415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxtX-0006gf-Im for submit@debbugs.gnu.org; Thu, 17 Mar 2022 17:42:55 -0400 Received: from mail-ej1-f53.google.com ([209.85.218.53]:37730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxtW-0006gR-C7 for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 17:42:54 -0400 Received: by mail-ej1-f53.google.com with SMTP id bg10so13454026ejb.4 for <53126@debbugs.gnu.org>; Thu, 17 Mar 2022 14:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dWRV1+hCC+jCJxw1dsMuxNxMwtqivxsJsujoamXs+pA=; b=IMq6x0XMv32E7Nlz8J7aYt+8Vnf5N/8vha6ltVpYojkQGr2T8w7lzFmISY00Vbdnhr SAR3gGYFQuxHHrU69mu2dEQWla4alfNZYvU143S106CbfwUkfSOOuF8vBMreZc6DMWr+ CTynew12dWdkquHeiGqKcGH2/I1Zgt74gHDPnrET/nXLWnPARpyuQXUKukez2VmNIn6B aAJ6gAEXYQJA5qodCwUZxGc2D1aXqYObGA0Ti+CEziSmK35WRdfi6qdV4SQF7T6lgWoI Dah8TbnW4ulpecZTDcxsrtRSAPJp1P/nXq2L0WVVom+FIlAmNQNZQmc9cgITEk7PTov8 kZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=dWRV1+hCC+jCJxw1dsMuxNxMwtqivxsJsujoamXs+pA=; b=ekl+QyeZTkcQ71xWNTXPVnR29XVch4Ii7MVbcxUHf/EUD0uJuLtlDoxzFCWGanRMr8 Dr3Y60DSKgFuK7bljF2/WfnjKAqbmuq46ZgI471qx+xrl0UeT21CBNw4UD0exh4J8QZD EjiMl5ruvvbMFGgWXb1iwNMC0L5GdyeDx8aVlquJXGsTyhfYVqxW9OuocBeTvfX/FD0G FzDFpGxgb6bCXgZEgDWDF4vWl5dlDj2Qx8WCH9MuYOEUKHEdrZiNaynSMR5fVdzbgZhN m6/QPQ+hC/eUwVrINQYuAY5TzSLRRVCbfc7nmzpT/eJcLAAq4MhIK7hAU2Y6y6YR5D82 NFJw== X-Gm-Message-State: AOAM533ev/b+BJZsZi8WQLuZpgBw9ujQQjzx5/c9Lhtn7BcKD31dqe8D 2RW9uC0QMcq8wG8YnGudRTqra1gbJZo= X-Google-Smtp-Source: ABdhPJxMbGSiONgsnNavDpdyOB75nTV5aHo12aZD3KxwGlqYVsRUq/Fz8QMBMUuter1B5O2mVLERSw== X-Received: by 2002:a17:906:5d08:b0:6da:b4ea:937 with SMTP id g8-20020a1709065d0800b006dab4ea0937mr6433254ejt.446.1647553368069; Thu, 17 Mar 2022 14:42:48 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id s5-20020a170906284500b006cc551d6cabsm2905122ejc.63.2022.03.17.14.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 14:42:47 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> Date: Thu, 17 Mar 2022 22:42:46 +0100 In-Reply-To: <861qz0475w.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 17 Mar 2022 22:40:19 +0200") Message-ID: <87k0csz25l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Thu, 17 Mar 2022 at 22:40, Juri Linkov wrote: >> Of course there should an option, maybe occur-lazy-highlight. This is >> why isearch.el itself should _not_ contain a customization option called >> `minibuffer-lazy-highlight': each use (or group of uses) of this >> functionality should define their own customization option. > > This means dozens of new options for every possible command that uses > the minibuffer: occur-lazy-highlight, keep-lines-lazy-highlight, > flush-lines-lazy-highlight, kill-matching-lines-lazy-highlight, > copy-matching-lines-lazy-highlight, how-many-lazy-highlight, ... I'd say one option that applies to this whole group of commands that work on lines. If we can find a good name for this variable, it probably means this a good idea :-) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 20 05:38:58 2022 Received: (at 53126) by debbugs.gnu.org; 20 Mar 2022 09:38:58 +0000 Received: from localhost ([127.0.0.1]:32829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVs1a-0007jn-DL for submit@debbugs.gnu.org; Sun, 20 Mar 2022 05:38:58 -0400 Received: from mail-ej1-f53.google.com ([209.85.218.53]:41874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVs1Y-0007jX-KQ for 53126@debbugs.gnu.org; Sun, 20 Mar 2022 05:38:57 -0400 Received: by mail-ej1-f53.google.com with SMTP id a8so24649295ejc.8 for <53126@debbugs.gnu.org>; Sun, 20 Mar 2022 02:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=R55TZgkh7P0FokMLgWb7rPIPF31lJrCTAWscRUw0xxM=; b=EN5iXngoGQh0aCaIPdOqoRPhiCok7RwA+DUjybonwdQMLVwM1wgt54PUeCz0Gz5mdt 4KlOHT1qaHg74b3j/A16D3HzV1iVgeK3UNGOhxN6EvKcBiiuGykYc/ADvg3R9TSHsJe3 PtGKYSetWRcoPUPUQlg6ctjijTlFPoWa0xIu39uTknJClGu/+svQ4MJCffxQhy7r14qk 8GEB1F0syPNLRMs+1a5b1jxHYOruz4wD4ExgWjTCcX0JYlO5WwKkP1ndJm0A/qicZeMe 4vFVd5SbMYMOLXUQl+IHf3kdGvqYPSFUpQO6UtguP3X9SmcQJd3QgDHuwjpjEpIrY0XD 77Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=R55TZgkh7P0FokMLgWb7rPIPF31lJrCTAWscRUw0xxM=; b=0tuUWa1HZWYPRddgCq12lqJgoUUBkJBwxiF9K+/R8aQRA7Kt6r7qbBcGFEpTvYDE9d dpRCZiCVCq+4yE9fAHgj1OUELv3pk3Fg6CrXGxqZq+29Zs466BIhUdII4mRWZNfL5GMc C4xWfB/SHuzoGcUIFyllGN20DS+xeTsVxoNRkoNr3VEtkJGbi6Py50dkwEs+oUXNuT5x wQ7p6amAd/LU9PfHHKuVGVz7wLz/4Mgm+hJZv7Ertyse/5QGgGp7+0ZypT9T7TrWPLci zuRH+UAg79G/zWiTKeIOSOFyf8G9n7zfq38WTTBp2XGxcmLL7KZuPhKcIUJ9OFMNw7sP nWYw== X-Gm-Message-State: AOAM530LTwMDSOUw1MJa82QdjjPQvKh53RyHsXvCrbvDcv41FIxVHHqO 0t1pdvnQ8Na6bFOU8ej5uEg= X-Google-Smtp-Source: ABdhPJz1gx0OH29tkcZeXsYmAMumNOSBqlIZZWPBoB6AfmlGzVEB8eduzTzOS1FPCuI0DMe5dojalg== X-Received: by 2002:a17:907:7b9d:b0:6df:fb8f:fe82 with SMTP id ne29-20020a1709077b9d00b006dffb8ffe82mr1439536ejc.652.1647769130487; Sun, 20 Mar 2022 02:38:50 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id sh42-20020a1709076eaa00b006df78692a9csm5675051ejc.94.2022.03.20.02.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 02:38:49 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> Date: Sun, 20 Mar 2022 10:38:48 +0100 In-Reply-To: <861qz0475w.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 17 Mar 2022 22:40:19 +0200") Message-ID: <87sfrd2cbb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org, Dmitry Gutov 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 (-) On Thu, 17 Mar 2022 at 22:40, Juri Linkov wrote: > This means dozens of new options for every possible command that uses > the minibuffer: occur-lazy-highlight, keep-lines-lazy-highlight, > flush-lines-lazy-highlight, kill-matching-lines-lazy-highlight, > copy-matching-lines-lazy-highlight, how-many-lazy-highlight, ... I'm experimenting with adding lazy-highlight directly into `read-regexp', controlled by a new option `read-regexp-lazy-highlight', which, preferably, would be t by default. Thus, in particular, all the above commands would get lazy-highlight by default. At first this felt somewhat intrusive, and third-party code might require adaptation. The advantage is that the said adaptation is very easy. Namely, a package author would have three options: - Do nothing. Then read-regexp will have lazy highlighting as dictated by read-regexp-lazy-highlight. - If lazy-highlighting makes no sense at all in a given context, then let-bind read-regexp-lazy-highlight to nil. - If customizability is desired, define `package-X-lazy-highlight' and let-bind read-regexp-lazy-highlighting to that. What do you think? (This is probably also the approach with the minimal number of additional code/changed lines, which seems to be desirable.) Dmitry -- I've CC'ed you because I noticed project.el makes a bunch of calls to read-regexp, and also a call query-replace-read-args at one point. To summarize the story here: would you like to have lazy highlight and lazy count (in =E2=80=9Canzu=E2=80=9D style) while reading re= gexps and query-replace arguments in package.el? How fine-grained would you like the user options to be here, and what should the defaults be? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 20 14:53:27 2022 Received: (at 53126) by debbugs.gnu.org; 20 Mar 2022 18:53:27 +0000 Received: from localhost ([127.0.0.1]:35134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW0gA-0001tA-NX for submit@debbugs.gnu.org; Sun, 20 Mar 2022 14:53:26 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:46243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW0g8-0001sv-Oi for 53126@debbugs.gnu.org; Sun, 20 Mar 2022 14:53:25 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 620BE240004; Sun, 20 Mar 2022 18:53:15 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> Date: Sun, 20 Mar 2022 20:51:09 +0200 In-Reply-To: <87sfrd2cbb.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 20 Mar 2022 10:38:48 +0100") Message-ID: <86fsnc4fvm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org, Dmitry Gutov 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 (-) >> This means dozens of new options for every possible command that uses >> the minibuffer: occur-lazy-highlight, keep-lines-lazy-highlight, >> flush-lines-lazy-highlight, kill-matching-lines-lazy-highlight, >> copy-matching-lines-lazy-highlight, how-many-lazy-highlight, ... > > I'm experimenting with adding lazy-highlight directly into > `read-regexp', controlled by a new option `read-regexp-lazy-highlight', > which, preferably, would be t by default. Thus, in particular, all the > above commands would get lazy-highlight by default. > > At first this felt somewhat intrusive, and third-party code might > require adaptation. The advantage is that the said adaptation is very > easy. Namely, a package author would have three options: > > - Do nothing. Then read-regexp will have lazy highlighting as dictated > by read-regexp-lazy-highlight. > - If lazy-highlighting makes no sense at all in a given context, then > let-bind read-regexp-lazy-highlight to nil. > - If customizability is desired, define `package-X-lazy-highlight' and > let-bind read-regexp-lazy-highlighting to that. > > What do you think? (This is probably also the approach with the minimal > number of additional code/changed lines, which seems to be desirable.) Sorry, I have no idea who and how might want to use lazy-highlighting in the minibuffer. I'd just provide a hook that any user can add to the minibuffer-setup-hook, or any package author can add to minibuffer-with-setup-hook. But in any case we need more opinions. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 20 15:31:48 2022 Received: (at 53126) by debbugs.gnu.org; 20 Mar 2022 19:31:48 +0000 Received: from localhost ([127.0.0.1]:35146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW1HI-0002nr-AI for submit@debbugs.gnu.org; Sun, 20 Mar 2022 15:31:48 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:51611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW1HG-0002nc-6S for 53126@debbugs.gnu.org; Sun, 20 Mar 2022 15:31:47 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E8B42240002; Sun, 20 Mar 2022 19:31:37 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> Date: Sun, 20 Mar 2022 21:24:43 +0200 In-Reply-To: <87tubwz9dd.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 17 Mar 2022 20:06:54 +0100") Message-ID: <86sfrc2zr8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> OTOH, your changes that add lazy-count-update-hook and remove >> '(null isearch-message-function)' can be already pushed. >> Could you please send a separate patch for pushing with these changes only? >> >> Then the patch with minibuffer-lazy-count feature will be shorter. > > There it is: > > From 3de37cfec647cedd69032df072a1176970224ecb Mon Sep 17 00:00:00 2001 > From: Augusto Stoffel > Date: Thu, 17 Mar 2022 20:02:13 +0100 > Subject: [PATCH] Allow lazy highlight and match count while reading from > minibuffer Could you please split it to more logically separate patches? 1. a patch that removes checks for 'isearch-mode (null isearch-message-function)' and adds '(setq-local isearch-lazy-count nil)'. It could also contain more changes in comint.el etc from your earlier patch from 14 May 2021. 2. a patch that adds and runs 'lazy-count-update-hook'. 3. a patch with minibuffer-lazy-highlight feature in isearch.el. Then what will remain to do is to decide how it would be better to activate the minibuffer-lazy-highlight feature. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 20 15:59:52 2022 Received: (at 53126) by debbugs.gnu.org; 20 Mar 2022 19:59:52 +0000 Received: from localhost ([127.0.0.1]:35166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW1iR-0003UU-AK for submit@debbugs.gnu.org; Sun, 20 Mar 2022 15:59:51 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:33708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW1iP-0003UG-AA for 53126@debbugs.gnu.org; Sun, 20 Mar 2022 15:59:50 -0400 Received: by mail-ej1-f43.google.com with SMTP id pv16so26323168ejb.0 for <53126@debbugs.gnu.org>; Sun, 20 Mar 2022 12:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dYLo2jfmA/TFq28VFEowTW/DA93z7suGP6Bh7sTxZxI=; b=fJGiE8LT3LWEVCKQ04Ux2MRv80Vt4L6uXH+DMD5IAo5Xq+iSKVqMVQ5VhMJr6ewmlz X/gMMXK205z4lFdOTdsiZtAE0okIRqH8oJfnPbz4XdKRq5CxOG86zEhYC6vBW/EcjINN GhzOLQi+F1yiY+16SjOdpy0msbY97CYQGF1DFa4QhVe1W58cCApGWQLr3lzzzLT0u062 4bCvaaz+UotGFnTtkyapCYr3jgFrZ3iEWdgOwJTXyjaGzhxeWS9C8J+1ZRcYP6yMgHWD 3bhWzDbO4gSd3YzlRqJfAPjZHc9AF6ceTJBex7v/2FLdXKWwO3Z6kYfOS66ALqt3f92d yfOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=dYLo2jfmA/TFq28VFEowTW/DA93z7suGP6Bh7sTxZxI=; b=DbO6FF3/w2KwvfYSfGNJPeN10Qdw34NZaM5YF4TyxQkSURhhE69tfMbAjImXChdB8b 7KEvd5JM5CcpQ74yjtJ0+NztSc61SaMr6JfvtIDnEtiAV33MKrGIXvmYL5us167tsBCM OmxrBabv3XGG+VQlwMnIm2jBvspdVt1Wa2XxFlRhSITaLj/Iq+piwwSMQqW79mQoHt/+ S8xR6nRbdX7tknUPeJHqDKGGeGJFu6fUMcIxn9o+a3yKqDb5hThUsxvcYRuV7hc/C6yw Y4OkhkLwCryVxnzET1hSrb13fXURkjH3wXclgmjIz3OOYNfz3ztbuUmF3ooTN2R6g3zb xU3g== X-Gm-Message-State: AOAM5305V8NyXrfNHBwYov21QayiDjzLAS4d3HxsJHT3ldb30xH6Jfpv slhQgAUB0iV+Jfu3BabJqYBtrYLnanGnLg== X-Google-Smtp-Source: ABdhPJyXvzDy9JSXqvJ3Sev12a5eZLcVoNmBOC2BNKdedYSIe7ywd4dmPW+UsgJaGgu3DtkaGr6L0g== X-Received: by 2002:a17:906:7746:b0:6ce:a12e:489f with SMTP id o6-20020a170906774600b006cea12e489fmr17287531ejn.551.1647806382898; Sun, 20 Mar 2022 12:59:42 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id p14-20020a05640210ce00b00413211746d4sm7083919edu.51.2022.03.20.12.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 12:59:42 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> Date: Sun, 20 Mar 2022 20:59:40 +0100 In-Reply-To: <86sfrc2zr8.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 20 Mar 2022 21:24:43 +0200") Message-ID: <87o820iedv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Sun, 20 Mar 2022 at 21:24, Juri Linkov wrote: > Could you please split it to more logically separate patches? > > 1. a patch that removes checks for 'isearch-mode (null isearch-message-function)' > and adds '(setq-local isearch-lazy-count nil)'. > It could also contain more changes in comint.el etc > from your earlier patch from 14 May 2021. > > 2. a patch that adds and runs 'lazy-count-update-hook'. > > 3. a patch with minibuffer-lazy-highlight feature in isearch.el. > > Then what will remain to do is to decide how it would be better to activate > the minibuffer-lazy-highlight feature. Okay. Points 1 and 2 are hard to disentangle, and 1 strictly is only necessary because of 2. Also, separating things further risks introducing bugs in code that has been tested quite a bit by now. So my patch 00001 is for your points 1 and 2, patch 0002 is for point 3, and patch 0003 adds lazy highlight to isearch-edit-string, where I guess there is no controversy about what the configuration variables should be. Feel free to copy-edit my patches before merging if desired. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Add-lazy-highlight-to-isearch-edit-string.patch >From e5b00cd015043eb7c3eca564994babfa2c2f8e0e Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sun, 20 Mar 2022 20:49:32 +0100 Subject: [PATCH 3/3] Add lazy highlight to 'isearch-edit-string' * lisp/isearch.el (isearch-edit-string): Activate lazy highlight and lazy count, provided 'isearch-lazy-highlight' respectively 'isearch-lazy-count' are non-nil. --- lisp/isearch.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/isearch.el b/lisp/isearch.el index 1ee5f2e9a8..1a83586ef8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1812,6 +1812,8 @@ isearch-edit-string (minibuffer-history-symbol) ;; Search string might have meta information on text properties. (minibuffer-allow-text-properties t)) + (when isearch-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) (setq isearch-new-string (read-from-minibuffer (isearch-message-prefix nil isearch-nonincremental) -- 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Allow-lazy-highlight-and-match-count-while-reading-f.patch >From 10290ac4e7f816ab33edad896448ac7d26951225 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sun, 20 Mar 2022 20:46:31 +0100 Subject: [PATCH 2/3] Allow lazy highlight and match count while reading from minibuffer * lisp/isearch.el (minibuffer-lazy-highlight-setup): New function, can be added to 'minibuffer-setup-hook' to enable lazy highlight and count while reading from minibuffer. (minibuffer-lazy-count-format, minibuffer-lazy-highlight-transform, minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count, minibuffer-lazy-highlight--after-change, minibuffer-lazy-highlight--exit): Auxiliary variables and functions implementing the lazy highlight functionality while reading from minibuffer. --- lisp/isearch.el | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/lisp/isearch.el b/lisp/isearch.el index b1951a8659..1ee5f2e9a8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4346,6 +4346,69 @@ isearch-lazy-highlight-buffer-update (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) + +;; Reading from minibuffer with lazy highlight and match count + +(defcustom minibuffer-lazy-count-format "%s " + "Format of the total number of matches for the prompt prefix." + :type '(choice (const :tag "Don't display a count" nil) + (string :tag "Display match count" "%s ")) + :group 'lazy-count + :version "29.1") + +(defvar minibuffer-lazy-highlight-transform #'identity + "Function to transform minibuffer text into a `isearch-string' for highlighting.") + +(defvar minibuffer-lazy-highlight--overlay nil + "Overlay for minibuffer prompt updates.") + +(defun minibuffer-lazy-highlight--count () + "Display total match count in the minibuffer prompt." + (when minibuffer-lazy-highlight--overlay + (overlay-put minibuffer-lazy-highlight--overlay + 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format minibuffer-lazy-count-format + isearch-lazy-count-total))))) + +(defun minibuffer-lazy-highlight--after-change (_beg _end _len) + "Update lazy highlight state in minibuffer selected window." + (when isearch-lazy-highlight + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (setq isearch-string (funcall minibuffer-lazy-highlight-transform string)) + (isearch-lazy-highlight-new-loop))))) + +(defun minibuffer-lazy-highlight--exit () + "Unwind changes from `minibuffer-lazy-highlight-setup'." + (remove-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (remove-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (remove-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay nil) + (when lazy-highlight-cleanup + (lazy-highlight-cleanup))) + +(defun minibuffer-lazy-highlight-setup () + "Set up minibuffer for lazy highlight of matches in the original window. + +This function is intended to be added to `minibuffer-setup-hook'. +Note that several other isearch variables influence the lazy +highlighting, including `isearch-regexp', +`isearch-lazy-highlight' and `isearch-lazy-count'." + (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (add-hook 'after-change-functions + #'minibuffer-lazy-highlight--after-change) + (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) + (add-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) + (setq minibuffer-lazy-highlight--overlay + (and minibuffer-lazy-count-format + (make-overlay (point-min) (point-min) (current-buffer) t))) + (minibuffer-lazy-highlight--after-change nil nil nil)) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. STRING is the string or regexp searched for. -- 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-hook-lazy-count-update-hook.patch >From 3eb2ec884310fc86bde1d9a897a266e5011fe9ec Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sun, 20 Mar 2022 20:43:10 +0100 Subject: [PATCH 1/3] New hook, lazy-count-update-hook * lisp/isearch.el (lazy-count-update-hook): New hook allowing to display the lazy count in special ways. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-buffer-update): Run `lazy-count-update-hook' at appropriate times. * lisp/comint.el (comint-history-isearch-setup, comint-history-isearch-end): Make sure no lazy count is displayed. * lisp/simple.el (minibuffer-history-isearch-setup): Make sure no lazy count is displayed. --- lisp/comint.el | 2 ++ lisp/isearch.el | 21 +++++++++++++++------ lisp/simple.el | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 4c82e74e4b..56082f622a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1515,6 +1515,7 @@ comint-history-isearch-setup #'comint-history-isearch-wrap) (setq-local isearch-push-state-function #'comint-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t))) (defun comint-history-isearch-end () @@ -1526,6 +1527,7 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + (kill-local-variable 'isearch-lazy-count) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended (custom-reevaluate-setting 'comint-history-isearch))) diff --git a/lisp/isearch.el b/lisp/isearch.el index 8970216398..b1951a8659 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3990,6 +3990,8 @@ isearch-lazy-highlight-error (defvar isearch-lazy-count-current nil) (defvar isearch-lazy-count-total nil) (defvar isearch-lazy-count-hash (make-hash-table)) +(defvar lazy-count-update-hook nil + "Hook run after new lazy count results are computed.") (defun lazy-highlight-cleanup (&optional force procrastinate) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -4048,7 +4050,7 @@ isearch-lazy-highlight-new-loop isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -4067,7 +4069,10 @@ isearch-lazy-highlight-new-loop (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) ;; Delay updating the message if possible, to avoid flicker - (when (string-equal isearch-string "") (isearch-message)))) + (when (string-equal isearch-string "") + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error) @@ -4120,13 +4125,15 @@ isearch-lazy-highlight-new-loop 'isearch-lazy-highlight-start)))) ;; Update the current match number only in isearch-mode and ;; unless isearch-mode is used specially with isearch-message-function - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count ;; Update isearch-lazy-count-current only when it was already set ;; at the end of isearch-lazy-highlight-buffer-update (when isearch-lazy-count-current (setq isearch-lazy-count-current (gethash (point) isearch-lazy-count-hash 0)) - (isearch-message)))) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)))) (defun isearch-lazy-highlight-search (string bound) "Search ahead for the next or previous match, for lazy highlighting. @@ -4327,12 +4334,14 @@ isearch-lazy-highlight-buffer-update (setq looping nil nomore t)))) (if nomore - (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) + (when isearch-lazy-count (unless isearch-lazy-count-total (setq isearch-lazy-count-total 0)) (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) - (isearch-message)) + (when (and isearch-mode (null isearch-message-function)) + (isearch-message)) + (run-hooks 'lazy-count-update-hook)) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil 'isearch-lazy-highlight-buffer-update))))))))) diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..61319b6060 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2840,6 +2840,7 @@ minibuffer-history-isearch-setup #'minibuffer-history-isearch-wrap) (setq-local isearch-push-state-function #'minibuffer-history-isearch-push-state) + (setq-local isearch-lazy-count nil) (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) (defun minibuffer-history-isearch-end () -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 20 16:31:58 2022 Received: (at 53126) by debbugs.gnu.org; 20 Mar 2022 20:31:58 +0000 Received: from localhost ([127.0.0.1]:35195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW2DW-0004JK-94 for submit@debbugs.gnu.org; Sun, 20 Mar 2022 16:31:58 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:44073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW2DV-0004J8-Ag for 53126@debbugs.gnu.org; Sun, 20 Mar 2022 16:31:57 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id F41A8C0003; Sun, 20 Mar 2022 20:31:49 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> Date: Sun, 20 Mar 2022 22:29:51 +0200 In-Reply-To: <87o820iedv.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 20 Mar 2022 20:59:40 +0100") Message-ID: <86h77s2wqo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Could you please split it to more logically separate patches? >> >> 1. a patch that removes checks for 'isearch-mode (null isearch-message-function)' >> and adds '(setq-local isearch-lazy-count nil)'. >> It could also contain more changes in comint.el etc >> from your earlier patch from 14 May 2021. >> >> 2. a patch that adds and runs 'lazy-count-update-hook'. >> >> 3. a patch with minibuffer-lazy-highlight feature in isearch.el. >> >> Then what will remain to do is to decide how it would be better to activate >> the minibuffer-lazy-highlight feature. > > Okay. Points 1 and 2 are hard to disentangle, and 1 strictly is only > necessary because of 2. Also, separating things further risks > introducing bugs in code that has been tested quite a bit by now. > > So my patch 00001 is for your points 1 and 2, patch 0002 is for point 3, > and patch 0003 adds lazy highlight to isearch-edit-string, where I guess > there is no controversy about what the configuration variables should > be. Thanks, pushed now, with a NEWS entry. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 20 16:56:16 2022 Received: (at 53126) by debbugs.gnu.org; 20 Mar 2022 20:56:17 +0000 Received: from localhost ([127.0.0.1]:35211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW2b2-0004vh-Pg for submit@debbugs.gnu.org; Sun, 20 Mar 2022 16:56:16 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:33782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW2b0-0004vU-VB for 53126@debbugs.gnu.org; Sun, 20 Mar 2022 16:56:15 -0400 Received: by mail-ed1-f49.google.com with SMTP id r23so15916766edb.0 for <53126@debbugs.gnu.org>; Sun, 20 Mar 2022 13:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=O204RPG7gfAxNiU0HZmmH7myMQZQgE995Atu1fRgdIo=; b=VEPfupyq2Fp/4TXkthA+tI0KNEQ/2XI1jzox1FXxXYD+Q6Kbc9tbI2p6qwYPOoVMuL BSKJe6gCV9G4YRBPDDigvmdfcKm6YzsnQc5WbmeDDUqG09LkPlVLoNoov/HE5R0ONX3T azOhP9OAjZEBpunMjj5MclA3WG5kVdJ++2XCVLxdCt+i5cHkPwtvsVOViTN2G85sMC0e IOyD1TwHVowKyrj6uAzwBXT9PWI/TojxgGec+K00H8epzQl1RipezZJXqH0J7XmLBfiD izlCrm/mGoOpF2FPWaSVBiA/mAZ+KGedc0MlyB7Uvdy9ER6hYbzJC9CHEybqjqCvIZmG nwRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=O204RPG7gfAxNiU0HZmmH7myMQZQgE995Atu1fRgdIo=; b=jc/P2mXA4IyS5vo/cExti4jRA3GwkbRsGw8E/Bg8IPMWxTtI6Lrx9n7Q6x41igR+w+ RpiDnAX+RVdAWMT0EQoTHxgblQOwui2BL1t2/JTEqLKS7Otu409FRYN3v0soIusUEsUk oaKSn+ro5mk+zBCYc7fx3Qr2+1rZ7qML5knI1zh3QDkhpemSZsGg7qoogOa3WVDO2hzk wd/MnK/klfzIxOmtIYj70JqkUqtvp5cpzDD36rZjRqNpzE8NzQsOs7QmnygalRT+WpW8 DSRsznCaasK1+pKLYmZ/8iD55OEggRu4SI9Zlpd/hN6XZHhGD/llUOfNljB/lwdDMVVM xstw== X-Gm-Message-State: AOAM531wTyOhe44m/ORQDtftA5S7MAOXU914XMLfSsO+HuQXkBVoBbE4 GzkOynFjyabORDHMczmXW8sJSJLxBiurpw== X-Google-Smtp-Source: ABdhPJyY5yVafcHY6FAliwRMGKzJourcGgsEjZLwKEGWdqPB6HWQVY2t2NGudLMZTX34qeuBJiStBw== X-Received: by 2002:a05:6402:7c9:b0:419:30b:e3e6 with SMTP id u9-20020a05640207c900b00419030be3e6mr16113041edy.399.1647809768800; Sun, 20 Mar 2022 13:56:08 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id h13-20020a056402280d00b00416d2f2b8a1sm7451339ede.79.2022.03.20.13.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 13:56:08 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> Date: Sun, 20 Mar 2022 21:56:06 +0100 In-Reply-To: <86h77s2wqo.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 20 Mar 2022 22:29:51 +0200") Message-ID: <87k0coibrt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Sun, 20 Mar 2022 at 22:29, Juri Linkov wrote: > Thanks, pushed now, with a NEWS entry. Thanks! From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 14:30:12 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 18:30:12 +0000 Received: from localhost ([127.0.0.1]:45959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX5kK-0000f1-6s for submit@debbugs.gnu.org; Wed, 23 Mar 2022 14:30:12 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:54595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX5kI-0000dd-VA for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 14:30:11 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 4BD4A240006; Wed, 23 Mar 2022 18:30:02 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> Date: Wed, 23 Mar 2022 20:20:10 +0200 In-Reply-To: <87k0coibrt.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 20 Mar 2022 21:56:06 +0100") Message-ID: <864k3o3j1g.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > So my patch 00001 is for your points 1 and 2, patch 0002 is for point 3, > and patch 0003 adds lazy highlight to isearch-edit-string, where I guess > there is no controversy about what the configuration variables should > be. Unfortunately, there is a regression: isearch-yank-char-in-minibuffer bound to C-f and [right] in the minibuffer of isearch-edit-string doesn't work anymore. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 14:54:26 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 18:54:26 +0000 Received: from localhost ([127.0.0.1]:46032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX67l-0001NU-QU for submit@debbugs.gnu.org; Wed, 23 Mar 2022 14:54:26 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:41690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX67j-0001NF-38 for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 14:54:23 -0400 Received: by mail-ej1-f49.google.com with SMTP id a8so4703695ejc.8 for <53126@debbugs.gnu.org>; Wed, 23 Mar 2022 11:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=d8ljeTm5j1NOPGkrGqsay/eJxEUSJiKHkGFjlAEvCzQ=; b=BDDCA3PNV9SIezhn4uUYL6z1CK4hDpZJ0Lv95htnLN1xWeuVyG2OVn9yoH69cjHElQ 22PblobxOFfioJLg3ZLP7UDRxWpF4N94fdfaoDixNVTEe8yXnaTbgRQvkTU447imj84t 0jn9n8TtJT6ZqGyYfkCnSxYIYdaQtkqUqzAsBR/cGGaAnZpw71trU+/l3q/WUz2Y3Vxd 99xnPAvoQUW38tLV3NGtCTr3qoTA+NJSMSXaqyu/4PmcraVe21sLP4D/F0LBjG/1hSwI RX776fDqrzhiVH2vhfXK/65nJdhpxBl5FG8+D3XhJR1eVw8gDnVQL2NWngJCqJEcAuG/ xE0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=d8ljeTm5j1NOPGkrGqsay/eJxEUSJiKHkGFjlAEvCzQ=; b=KvugackxfF19s0BkEFe7H9SP1vN7ZOPrZ7UbnqrlsCJxKLmAQwwBhydSWK/aE+kuKz 5X9FpYLuagnWC46FRijeBMmYfxMcNVMeD7pwMXqh1LCI6FsiGtiMoR67Zh2kKbDAW/kG X/DBblxZMvhXlPF0xrGd39mjxYDWIHWO0eyVuAzRRhQd8IqrtefZ5zxkQpPe+sBnH1uE xs6mhJM17z15Yqbdo8XmYWmMeNGb5z5hk+sSGMDM9Xu6Oj1EzR1BB5ulaXKtJd3I0MU4 2B7cvpRjeHGja4pb52gepa8qs+UZ3EadK1hoaVT6eLiqdyW3GEPLyHEkC1a+4ebteos2 8kAA== X-Gm-Message-State: AOAM533eGZ9yZ440O1eaREyTy3RWGZL67csj7jOdFJrqubHUoypbD5ac K2L86BoCtxQuFeolmCfalihjwsVCmRg= X-Google-Smtp-Source: ABdhPJyFL8wcQ4jObCi+4W3mzhJjP9frIeMILC8WO9Kr3d/lV2goeFqziixCPzQixPWcG3pvEGBZVA== X-Received: by 2002:a17:907:3e16:b0:6df:b4f0:5cc2 with SMTP id hp22-20020a1709073e1600b006dfb4f05cc2mr1641625ejc.285.1648061656681; Wed, 23 Mar 2022 11:54:16 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id u3-20020a17090657c300b006d01de78926sm261383ejr.22.2022.03.23.11.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 11:54:16 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> <864k3o3j1g.fsf@mail.linkov.net> Date: Wed, 23 Mar 2022 19:54:14 +0100 In-Reply-To: <864k3o3j1g.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 23 Mar 2022 20:20:10 +0200") Message-ID: <87k0ck7b55.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Wed, 23 Mar 2022 at 20:20, Juri Linkov wrote: > Unfortunately, there is a regression: isearch-yank-char-in-minibuffer > bound to C-f and [right] in the minibuffer of isearch-edit-string > doesn't work anymore. The following patch solves to problem for me. The point doesn't move visually, so selecting the isearch window puts it in the right place. But what exactly happens to the point in the searched buffer? I find this rather confusing! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-regression-in-isearch-yank-char-in-minibuffer.patch >From b9ed18bdfa72667b7d1e25982b7fd85dcb2c4166 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Wed, 23 Mar 2022 19:43:13 +0100 Subject: [PATCH] Fix regression in isearch-yank-char-in-minibuffer * lisp/isearch.el (isearch-yank-char-in-minibuffer): Select the original window in order to restore point. This is needed when minibuffer lazy highlight is in effect. --- lisp/isearch.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 1a83586ef8..9b311cb49e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2670,7 +2670,7 @@ isearch-yank-char-in-minibuffer (interactive "p") (if (eobp) (insert - (with-current-buffer (cadr (buffer-list)) + (with-minibuffer-selected-window (buffer-substring-no-properties (point) (progn (forward-char arg) (point))))) (forward-char arg))) -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 15:17:34 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 19:17:34 +0000 Received: from localhost ([127.0.0.1]:46043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX6U9-00020C-Up for submit@debbugs.gnu.org; Wed, 23 Mar 2022 15:17:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX6U8-0001zz-SI for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 15:17:33 -0400 Received: from [2001:470:142:3::e] (port=41086 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nX6U3-0002GM-3I; Wed, 23 Mar 2022 15:17:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=h5lhzBopFWpVFwGDVlGTSzDyZruCS+E9E065Mjnw9Qc=; b=Qnl27qh+qqUu LPvrn4hbtLmL7Ycdbn9sLfxcWbX9FKBpw6JnyWm68QO4tfxmC/xSSRhXaBVOxOhTND1r5zDXoGiXr i9STcYiyN7mgGd5hiOokizleSNye2mNxXEbHKuKbZWf5CE30QSVu5PU+Q9goAtruiV9WI30Qkx0Wh LFcW6sKzdHTZc1hDRIv08Nuigmy5YnEJpZ74Qm1XpQ8SLm2bwSXvN+MOw6xMX5b5QW6Ku1AuCtk5e KbxBl65NlL9Vo+2N8Jet+Nh0i/i0Cbwc7knCTyp3RIRsXnxZrau1+J/UEZO+iCnfhuewDTSYWLFAC CXlA8pd9PYBD3R2xQMNJ+Q==; Received: from [87.69.77.57] (port=3797 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 1nX6U2-0001Br-E6; Wed, 23 Mar 2022 15:17:26 -0400 Date: Wed, 23 Mar 2022 21:17:16 +0200 Message-Id: <834k3oeawz.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87k0ck7b55.fsf@gmail.com> (message from Augusto Stoffel on Wed, 23 Mar 2022 19:54:14 +0100) Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> <864k3o3j1g.fsf@mail.linkov.net> <87k0ck7b55.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.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 (---) > From: Augusto Stoffel > Date: Wed, 23 Mar 2022 19:54:14 +0100 > Cc: 53126@debbugs.gnu.org > > The point doesn't move visually, so selecting the isearch window puts it > in the right place. But what exactly happens to the point in the > searched buffer? I find this rather confusing! Because of switch-to-buffer-preserve-window-point, perhaps? From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 15:54:52 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 19:54:52 +0000 Received: from localhost ([127.0.0.1]:46106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX74F-0005Dm-Or for submit@debbugs.gnu.org; Wed, 23 Mar 2022 15:54:51 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX74D-0005DV-LQ for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 15:54:50 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E8EB7E0002; Wed, 23 Mar 2022 19:54:41 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> <864k3o3j1g.fsf@mail.linkov.net> <87k0ck7b55.fsf@gmail.com> Date: Wed, 23 Mar 2022 21:53:41 +0200 In-Reply-To: <87k0ck7b55.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 23 Mar 2022 19:54:14 +0100") Message-ID: <86lex01m4a.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Unfortunately, there is a regression: isearch-yank-char-in-minibuffer >> bound to C-f and [right] in the minibuffer of isearch-edit-string >> doesn't work anymore. > > The following patch solves to problem for me. > > The point doesn't move visually, so selecting the isearch window puts it > in the right place. But what exactly happens to the point in the > searched buffer? I find this rather confusing! > > @@ -2670,7 +2670,7 @@ isearch-yank-char-in-minibuffer > (interactive "p") > (if (eobp) > (insert > - (with-current-buffer (cadr (buffer-list)) > + (with-minibuffer-selected-window Thanks, I confirm your patch fixes the problem. But before pushing it, I'd like to understand how your previous patches changed the order of the buffer list? Before your changes, (cadr (buffer-list)) returned the original buffer, but now it returns the minibuffer. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 16:07:26 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 20:07:26 +0000 Received: from localhost ([127.0.0.1]:46130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7GQ-0007kr-Kg for submit@debbugs.gnu.org; Wed, 23 Mar 2022 16:07:26 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:49021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7GP-0007kc-3T for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 16:07:25 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C5A1A240003; Wed, 23 Mar 2022 20:07:17 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> <864k3o3j1g.fsf@mail.linkov.net> <87k0ck7b55.fsf@gmail.com> <86lex01m4a.fsf@mail.linkov.net> Date: Wed, 23 Mar 2022 22:06:38 +0200 In-Reply-To: <86lex01m4a.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 23 Mar 2022 21:53:41 +0200") Message-ID: <86ee2s1lip.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> + (with-minibuffer-selected-window > > Thanks, I confirm your patch fixes the problem. > But before pushing it, I'd like to understand > how your previous patches changed the order > of the buffer list? Before your changes, > (cadr (buffer-list)) returned the original buffer, > but now it returns the minibuffer. Probably the buffer order is changed by with-minibuffer-selected-window in minibuffer-lazy-highlight--after-change. This is fine, so I pushed your patch. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 16:30:34 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 20:30:34 +0000 Received: from localhost ([127.0.0.1]:46168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7cn-00027C-Vy for submit@debbugs.gnu.org; Wed, 23 Mar 2022 16:30:34 -0400 Received: from mail-ed1-f47.google.com ([209.85.208.47]:35605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7cm-00026y-4k for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 16:30:32 -0400 Received: by mail-ed1-f47.google.com with SMTP id k10so3272589edj.2 for <53126@debbugs.gnu.org>; Wed, 23 Mar 2022 13:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=IqzZGPNRVNPWebmUYUGCCslJoHqh8sKV4OZD1dSzsHs=; b=npg1EFJuBTtRaY09UkhSbi3/k6ROgqmfo0io1Ni+BKhCthYG+lwb272TStKq/xwK5D 2h7FsJS0FGZ+DjeVXxRMi94pHxfaCmIFSHLTb6dXolZDdlM875/q5kWBJomw+cuZDWDF Pq/ScXZ0923MVWyjnsJ3NE0zwa2jF+FaqC4bE9PlSVXCQMqP/ojDG+3ZXBF0P18dzCsw fhN8eg+JnVEMUQxvobw4J20RphlfGbVfq85EChHsueJ1l2iFTly4r4gBgtqB5lX/4Gi1 cASir4pa7yl30L81PHI/txdfldaSswryD/kv8osM3U2tfXvfgF6SN+0j30BqDuQSjLJu eLyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=IqzZGPNRVNPWebmUYUGCCslJoHqh8sKV4OZD1dSzsHs=; b=NntXSB11z61HlhdWpUV65UDA6CLBOk9u9A7OVaTx9PNPZJqHL0CYCisx3MtMf21qf8 CpQ3BBsz3LC0O2ot62oEOFCg3NRTWMJEoDQZPd2A6lha1vIOx1CKB8g237ym56mE32cf 9MODq6z588BtJ3+2/j6MiCivYF2eMyWMUqlfzQISkQSQO5NI6bbreHeFTCwyk+6S9OpN gMl4at/C99ZJj+ppjosdeD/h2GJh+r9vAUxkRrf7TBzo8SGfjL69sU4+oDnm4dZr6BuY sHdDEZ51/1WHSUQjwkzoFhVGja4L6SLpyHPesOnKcBreeGf6wduAodKhZWWOtLHdS3wl NA2Q== X-Gm-Message-State: AOAM531vsoUgglFCKqv5d6BGlxfABrtJWGRqKfOTrq104DZHovKTGqGw 2yyZbKbnKPzL8GzdP5HEhJsylbGBqqE= X-Google-Smtp-Source: ABdhPJxF7SzIeKOlR6/fKV1DmtoyZKh0gTzKK2HI3/IJ6+ToO+RsHpn0z6QCLoiX6IKuMEu2r5/TfQ== X-Received: by 2002:a05:6402:35d4:b0:419:64e3:4ad1 with SMTP id z20-20020a05640235d400b0041964e34ad1mr2532447edc.260.1648067426078; Wed, 23 Mar 2022 13:30:26 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id b8-20020a056402350800b00419407f0dd9sm410005edd.0.2022.03.23.13.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 13:30:25 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> <864k3o3j1g.fsf@mail.linkov.net> <87k0ck7b55.fsf@gmail.com> <86lex01m4a.fsf@mail.linkov.net> <86ee2s1lip.fsf@mail.linkov.net> Date: Wed, 23 Mar 2022 21:30:24 +0100 In-Reply-To: <86ee2s1lip.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 23 Mar 2022 22:06:38 +0200") Message-ID: <87czic76ov.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Wed, 23 Mar 2022 at 22:06, Juri Linkov wrote: >>> + (with-minibuffer-selected-window >> >> Thanks, I confirm your patch fixes the problem. >> But before pushing it, I'd like to understand >> how your previous patches changed the order >> of the buffer list? Before your changes, >> (cadr (buffer-list)) returned the original buffer, >> but now it returns the minibuffer. > > Probably the buffer order is changed by > with-minibuffer-selected-window in > minibuffer-lazy-highlight--after-change. > This is fine, so I pushed your patch. FTR, I just tested and the culprit is not the with-minibuffer-selected-window from minibuffer-lazy-highlight--after-change (which makes sense, since that macro uses NORECORD internally), but rather the calls to `select-window' without NORECORD argument in isearch.el. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 23 16:45:31 2022 Received: (at 53126) by debbugs.gnu.org; 23 Mar 2022 20:45:31 +0000 Received: from localhost ([127.0.0.1]:46177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7rH-0002Ur-Jw for submit@debbugs.gnu.org; Wed, 23 Mar 2022 16:45:31 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:38233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7rF-0002Ua-6D for 53126@debbugs.gnu.org; Wed, 23 Mar 2022 16:45:30 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E798320004; Wed, 23 Mar 2022 20:45:21 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87tubwz9dd.fsf@gmail.com> <86sfrc2zr8.fsf@mail.linkov.net> <87o820iedv.fsf@gmail.com> <86h77s2wqo.fsf@mail.linkov.net> <87k0coibrt.fsf@gmail.com> <864k3o3j1g.fsf@mail.linkov.net> <87k0ck7b55.fsf@gmail.com> <86lex01m4a.fsf@mail.linkov.net> <86ee2s1lip.fsf@mail.linkov.net> <87czic76ov.fsf@gmail.com> Date: Wed, 23 Mar 2022 22:43:46 +0200 In-Reply-To: <87czic76ov.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 23 Mar 2022 21:30:24 +0100") Message-ID: <86tuboz9fh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Probably the buffer order is changed by >> with-minibuffer-selected-window in >> minibuffer-lazy-highlight--after-change. >> This is fine, so I pushed your patch. > > FTR, I just tested and the culprit is not the > with-minibuffer-selected-window from > minibuffer-lazy-highlight--after-change (which makes sense, since that > macro uses NORECORD internally), but rather the calls to `select-window' > without NORECORD argument in isearch.el. I see that you use with-minibuffer-selected-window to start a new loop isearch-lazy-highlight-new-loop, but later every iteration of isearch-lazy-highlight-update needs to select the window again. Then adding NORECORD argument to `select-window' in lazy-highlight functions makes sense indeed. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 24 15:03:44 2022 Received: (at 53126) by debbugs.gnu.org; 24 Mar 2022 19:03:44 +0000 Received: from localhost ([127.0.0.1]:49421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXSkJ-0004W3-SN for submit@debbugs.gnu.org; Thu, 24 Mar 2022 15:03:44 -0400 Received: from mail-ej1-f50.google.com ([209.85.218.50]:39565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXSkI-0004Vg-A6 for 53126@debbugs.gnu.org; Thu, 24 Mar 2022 15:03:42 -0400 Received: by mail-ej1-f50.google.com with SMTP id dr20so11069551ejc.6 for <53126@debbugs.gnu.org>; Thu, 24 Mar 2022 12:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=hwr6fh5e7gexp2f16wA2PCgycn1++CVlkINwCkeRZcY=; b=FydUYV/J690rzY69RTWRefEtJ8nWq0WEclx89G/LFqsZjUWm5OoDc1qUzlohIVraDA yoPFGCMC8EB8iJmRMP9K3RaWyo6YSr+yKjNjcxg+n+WlPQs1X2QvH+y6I4hZ3YfeebiU IvdDW3G5/jj9U2MFJqUlDEKrgsiEcvSqsLrhdjPCBTkN3lLkKgcjuQaUI4gv2K6noKyU n0wN7hAZH4Ju6GdGI4+ceSiewpgE58rn3xayA7sleJaWp8mXCvZy9MrrkLE7xA1HuZDH MWWbccfU5oTjuOv8BQ/IqCP3PLEF0yxdui8fqWK0pAKurMsFp84FMNTsQ+qLu84eC/6N 2sgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=hwr6fh5e7gexp2f16wA2PCgycn1++CVlkINwCkeRZcY=; b=ly0+pbz4Uq/Wb5egNZQGjYWme5Nv+0hLJZEvuJP7Sc2YfzjqrDWwtGNZVKMMCZtpL4 j5OYp6omhKeS/rB0+4f4pal7BxOax9oOgdkXvJyHWS9amoTXFKHgpmQFRkgwwT3XcSwk 7ZZm4Xy51vyLLf9oKwyPaMo7zNxtmed4xbm0PSc61si4yBqTTuSXOHyCYhjR8Jyzn18i bY21SdXyXtXS3mnl5Dmix5Gg4vbpE3EaDcjEVFrEE3dfRyevRNEe6jfMYFEkA+nGC3h5 Mjs68Ivp9WJ+eyBJVvm8sftg+8MgeIxmaa9E8kVwBxw25digOCv8bXAtmop1zcLpgepm iMtA== X-Gm-Message-State: AOAM533p0XM73N928SGIk+0xaHILpwDdIKILW71aE4R0bxLqve9P1LuV RxcSYecZD3PenAvpkJPCgtpoOsOLh3U= X-Google-Smtp-Source: ABdhPJzvb8sFezJLLKCr02K7+jFpE2WK1rDljjDxjbpIyAjMcXYB8yo0SGGdA6tpRWSf+WLoapofbA== X-Received: by 2002:a17:906:7944:b0:6da:b834:2f3e with SMTP id l4-20020a170906794400b006dab8342f3emr7570757ejo.353.1648148615781; Thu, 24 Mar 2022 12:03:35 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id j18-20020a170906535200b006e007fa9d0fsm1515139ejo.149.2022.03.24.12.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 12:03:34 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> Date: Thu, 24 Mar 2022 20:03:33 +0100 In-Reply-To: <86fsnc4fvm.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 20 Mar 2022 20:51:09 +0200") Message-ID: <878rsz6um2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Sun, 20 Mar 2022 at 20:51, Juri Linkov wrote: > Sorry, I have no idea who and how might want to use lazy-highlighting > in the minibuffer. I'd just provide a hook that any user can add > to the minibuffer-setup-hook, or any package author can add > to minibuffer-with-setup-hook. But in any case we need more opinions. All right, I think this brings us back to the original idea: we add lazy highlight to query-replace now and decide later about the other commands in replace.el. I've attached an updated patch that applies over the already merged changes. Juri: you mentioned the idea of adding a new option `query-replace-read-lazy-highlight'. This is easier to add then remove in the future, so my suggestion would be to first wait and see if anyone actually needs that option. For now lazy highlight when reading the query-replace args is controlled by the good old `query-replace-lazy-highlight'. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Display-lazy-highlight-and-match-count-in-query-repl.patch >From bc85df88bf3bee99997163b6233ff82445eac66b Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Thu, 17 Mar 2022 20:17:26 +0100 Subject: [PATCH] Display lazy highlight and match count in query-replace * lisp/isearch.el (isearch-query-replace): Don't clean up lazy highlight if applicable. * lisp/replace.el (query-replace-read-args, query-replace-read-to): Add lazy highlighting and count. (replace--region-filter): New function, extracted from 'perform-replace'. (perform-replace): Use 'replace--region-filter'. --- lisp/isearch.el | 21 +++++++---- lisp/replace.el | 99 ++++++++++++++++++++++++++++++++++++------------- 2 files changed, 87 insertions(+), 33 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 9b311cb49e..e93e4d8b92 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2352,7 +2352,9 @@ isearch-query-replace (isearch-recursive-edit nil) (isearch-string-propertized (isearch-string-propertize isearch-string))) - (isearch-done nil t) + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup + (not query-replace-lazy-highlight)))) + (isearch-done nil t)) (isearch-clean-overlays) (if (and isearch-other-end (if backward @@ -2368,13 +2370,16 @@ isearch-query-replace (symbol-value query-replace-from-history-variable))) (perform-replace isearch-string-propertized - (query-replace-read-to - isearch-string-propertized - (concat "Query replace" - (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) - (if backward " backward" "") - (if (use-region-p) " in region" "")) - isearch-regexp) + (condition-case error + (query-replace-read-to + isearch-string-propertized + (concat "Query replace" + (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) + (if backward " backward" "") + (if (use-region-p) " in region" "")) + isearch-regexp) + (t (lazy-highlight-cleanup lazy-highlight-cleanup) + (signal (car error) (cdr error)))) t isearch-regexp (or delimited isearch-regexp-function) nil nil (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) diff --git a/lisp/replace.el b/lisp/replace.el index 06be597855..a56e493d99 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -352,8 +352,15 @@ query-replace-read-to (query-replace-compile-replacement (save-excursion (let* ((history-add-new-input nil) + (count (if (and query-replace-lazy-highlight + minibuffer-lazy-count-format + isearch-lazy-count + isearch-lazy-count-total) + (format minibuffer-lazy-count-format + isearch-lazy-count-total) + "")) (to (read-from-minibuffer - (format "%s %s with: " prompt (query-replace-descr from)) + (format "%s%s %s with: " count prompt (query-replace-descr from)) nil nil nil query-replace-to-history-variable from t))) (add-to-history query-replace-to-history-variable to nil t) @@ -365,14 +372,49 @@ query-replace-read-args (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion - (let* ((from (query-replace-read-from prompt regexp-flag)) - (to (if (consp from) (prog1 (cdr from) (setq from (car from))) - (query-replace-read-to from prompt regexp-flag)))) - (list from to - (or (and current-prefix-arg (not (eq current-prefix-arg '-))) - (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) - (get-text-property 0 'isearch-regexp-function from))) - (and current-prefix-arg (eq current-prefix-arg '-)))))) + (condition-case error + (let (;; Variables controlling lazy highlighting while reading + ;; FROM and TO. + (isearch-case-fold-search case-fold-search) + (isearch-lazy-highlight query-replace-lazy-highlight) + (isearch-regexp regexp-flag) + (isearch-regexp-function (or replace-regexp-function + (and current-prefix-arg + (not (eq current-prefix-arg '-))) + (and replace-char-fold + (not regexp-flag) + #'char-fold-to-regexp))) + (lazy-highlight-cleanup nil) + (minibuffer-lazy-highlight-transform + (lambda (string) + (let* ((split (query-replace--split-string string)) + (from-string (if (consp split) (car split) split))) + (when (and case-fold-search search-upper-case) + (setq isearch-case-fold-search + (isearch-no-upper-case-p from-string regexp-flag))) + from-string))) + from to) + (when query-replace-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (when (use-region-p) + (letrec ((region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (cleanup (lambda () + (remove-function isearch-filter-predicate region-filter) + (remove-hook 'minibuffer-exit-hook cleanup)))) + (add-function :after-while isearch-filter-predicate region-filter) + (add-hook 'minibuffer-exit-hook cleanup)))) + (setq from (query-replace-read-from prompt regexp-flag)) + (setq to (if (consp from) + (prog1 (cdr from) (setq from (car from))) + (query-replace-read-to from prompt regexp-flag))) + (list from to + (or (and current-prefix-arg (not (eq current-prefix-arg '-))) + (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) + (get-text-property 0 'isearch-regexp-function from))) + (and current-prefix-arg (eq current-prefix-arg '-)))) + (t (lazy-highlight-cleanup) + (signal (car error) (cdr error)))))) (defun query-replace (from-string to-string &optional delimited start end backward region-noncontiguous-p) "Replace some occurrences of FROM-STRING with TO-STRING. @@ -2773,6 +2815,26 @@ replace--push-stack ,search-str ,next-replace) ,stack)) +(defun replace--region-filter (bounds) + "Return a function that decides if a region is inside BOUNDS. +BOUNDS is a list of cons cells of the form (START . END). The +returned function takes as argument two buffer positions, START +and END." + (let ((region-bounds + (mapcar (lambda (position) + (cons (copy-marker (car position)) + (copy-marker (cdr position)))) + bounds))) + (lambda (start end) + (delq nil (mapcar + (lambda (bounds) + (and + (>= start (car bounds)) + (<= start (cdr bounds)) + (>= end (car bounds)) + (<= end (cdr bounds)))) + region-bounds))))) + (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p) @@ -2857,22 +2919,9 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - (funcall region-extract-function 'bounds)))) - (setq region-filter - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds)))) - (add-function :after-while isearch-filter-predicate region-filter))) + (setq region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (add-function :after-while isearch-filter-predicate region-filter)) ;; If region is active, in Transient Mark mode, operate on region. (if backward -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 25 05:10:23 2022 Received: (at 53126) by debbugs.gnu.org; 25 Mar 2022 09:10:23 +0000 Received: from localhost ([127.0.0.1]:50107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfxf-0000sB-62 for submit@debbugs.gnu.org; Fri, 25 Mar 2022 05:10:23 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:48029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfxd-0000rr-2L for 53126@debbugs.gnu.org; Fri, 25 Mar 2022 05:10:22 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B350FC000F; Fri, 25 Mar 2022 09:10:12 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> Date: Fri, 25 Mar 2022 10:39:12 +0200 In-Reply-To: <878rsz6um2.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 24 Mar 2022 20:03:33 +0100") Message-ID: <86ils2mmbe.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > @@ -365,14 +372,49 @@ query-replace-read-args > - (let* ((from (query-replace-read-from prompt regexp-flag)) > - (to (if (consp from) (prog1 (cdr from) (setq from (car from))) > - (query-replace-read-to from prompt regexp-flag)))) > - (list from to > - (or (and current-prefix-arg (not (eq current-prefix-arg '-))) > - (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) > - (get-text-property 0 'isearch-regexp-function from))) > - (and current-prefix-arg (eq current-prefix-arg '-)))))) The name of the function is `query-replace-read-args'. And now most of the function is dealing with highlighting: > + (condition-case error > + (let (;; Variables controlling lazy highlighting while reading > + ;; FROM and TO. > + (isearch-case-fold-search case-fold-search) > + (isearch-lazy-highlight query-replace-lazy-highlight) > + (isearch-regexp regexp-flag) > + (isearch-regexp-function (or replace-regexp-function > + (and current-prefix-arg > + (not (eq current-prefix-arg '-))) > + (and replace-char-fold > + (not regexp-flag) > + #'char-fold-to-regexp))) > + (lazy-highlight-cleanup nil) > + (minibuffer-lazy-highlight-transform > + (lambda (string) > + (let* ((split (query-replace--split-string string)) > + (from-string (if (consp split) (car split) split))) > + (when (and case-fold-search search-upper-case) > + (setq isearch-case-fold-search > + (isearch-no-upper-case-p from-string regexp-flag))) > + from-string))) > + from to) > + (when query-replace-lazy-highlight > + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) > + (when (use-region-p) > + (letrec ((region-filter (replace--region-filter > + (funcall region-extract-function 'bounds))) > + (cleanup (lambda () > + (remove-function isearch-filter-predicate region-filter) > + (remove-hook 'minibuffer-exit-hook cleanup)))) > + (add-function :after-while isearch-filter-predicate region-filter) > + (add-hook 'minibuffer-exit-hook cleanup)))) > + (setq from (query-replace-read-from prompt regexp-flag)) > + (setq to (if (consp from) > + (prog1 (cdr from) (setq from (car from))) > + (query-replace-read-to from prompt regexp-flag))) > + (list from to > + (or (and current-prefix-arg (not (eq current-prefix-arg '-))) > + (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) > + (get-text-property 0 'isearch-regexp-function from))) > + (and current-prefix-arg (eq current-prefix-arg '-)))) > + (t (lazy-highlight-cleanup) > + (signal (car error) (cdr error)))))) This highlighting needs to be refactored from `query-replace-read-args' into a separate highlighting function. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 25 05:43:39 2022 Received: (at 53126) by debbugs.gnu.org; 25 Mar 2022 09:43:40 +0000 Received: from localhost ([127.0.0.1]:50138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXgTo-0001li-9F for submit@debbugs.gnu.org; Fri, 25 Mar 2022 05:43:39 -0400 Received: from mail-ej1-f51.google.com ([209.85.218.51]:46810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXgTh-0001lG-Ln for 53126@debbugs.gnu.org; Fri, 25 Mar 2022 05:43:33 -0400 Received: by mail-ej1-f51.google.com with SMTP id qx21so14165818ejb.13 for <53126@debbugs.gnu.org>; Fri, 25 Mar 2022 02:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=t/+ucGN/oUCHE9NrMAyTyIOugSW/gRER80sIWt+dcJQ=; b=bGwY4rmJXvXnwuLWzWpbMLTHNnL9Xs5Bp9xX6YwiebIXyIBMkN2g5HZeJe44aN5Tr/ +M2lmdlgRSkx+SQSeMvZQPghdE5RaMJmlEJ/w4HP2p2WAVm+o9HyObwAuEMpAixjLY4/ r73XdP4C33lBnn2RuVDM7dPP8S01wfiqavVhgKB9AVTggaSfw8etX1TkO+2E7VoKIh0t 82nZ8hdbUwgeUWdqQ2dbqFFCmTHl44Wxb5pO0X9TPAl41cJwT8AmxZiwApGT5TtapuLx wM4a7Gr6BKyIasYDWZh9oM/2wYCjbvTZhXvqyUiwA4pz5oKuDuzNYODPtX4y+YFoXnjh OJwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=t/+ucGN/oUCHE9NrMAyTyIOugSW/gRER80sIWt+dcJQ=; b=EUTusW8gg0wRW4ZQ3FaQbUMviiGVQ/zFZ0hPwqkm5g3CGJZXfKDiElstLpEJS1U3OV L+T6EZfbFnDYC5tSk6+h/TAWeXupAJ819SIzqGXNZR/UD2dM05obXCNdLTS5RB0fRBMI YBO6g/Slc/JJQ7tndR2c4CZZ3T9dG84hYB08ZBXmzh2HcSkk17er0g+EmhcP5gMtvLsY qEA9ZlcgguRkXQa1JfnlrR6nWKws4D/IIOK3l8WI3GOT9Wnsm2Cclpt5fCFj6wt0x+bt pK41k8autE4OgBL+Y1/p/ghX+EIpSCZ8ZTo34lA/2x5xg1HHzRcbGyrt7KBm/o5KTgO1 7lig== X-Gm-Message-State: AOAM5308WdWYdT7PFjptdTJcK51CwQ64xqnQvE7ySQVnJ7sYnlV09xqx Ad2WChh4ySX8GZ9Ff7TUEcFb66TyvNA= X-Google-Smtp-Source: ABdhPJz1ZHHrKDL+pi1oEm5Sv9p0fvPR481Gjby4YXuhY37AExfQpBYQJaubExbXjut33V/iknqRgA== X-Received: by 2002:a17:906:c211:b0:6ce:e221:4c21 with SMTP id d17-20020a170906c21100b006cee2214c21mr10201573ejz.691.1648201403258; Fri, 25 Mar 2022 02:43:23 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id e9-20020a170906c00900b006d4a45869basm2118756ejz.199.2022.03.25.02.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 02:43:22 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> Date: Fri, 25 Mar 2022 10:43:21 +0100 In-Reply-To: <86ils2mmbe.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 25 Mar 2022 10:39:12 +0200") Message-ID: <87v8w2qsee.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Fri, 25 Mar 2022 at 10:39, Juri Linkov wrote: > The name of the function is `query-replace-read-args'. > And now most of the function is dealing with highlighting: The good thing is that it was a rather short function before, so now it's still reasonably sized. Also, the lazy highlight for query-replace is essentially taken care of in one single place. > This highlighting needs to be refactored from `query-replace-read-args' > into a separate highlighting function. Okay, you've said something along these lines before but I don't understand what you mean. Lazy highlight is controlled by lots of variables. These variables need to be set for the duration of the minibuffer session that reads the replacement strings. If we move this to a separate function, we can't use 'let' anymore, so we basically need to reinvent the dynamic scoping feature of Elisp (i.e., save the current values, set the variables to new values, then restore the old values in some hook). And an even ugly workaround would be needed to replace the necessary condition-case. Or do I misunderstand you altogether? The above accounts for most of the additions to query-replace-read-args. What could move elsewhere are the 10 lines starting from (when query-replace-lazy-highlight but this will not change the fact that most of query-replace-read-args now takes care of setting up lazy highlight, so I don't see any real benefits to this. Or maybe the issue is with this line: (add-hook 'minibuffer-exit-hook cleanup) which adds a closure rather than a symbol to the hook? That I could be changed. I think it would require to add a defvar just to store 'region-filter', among other things I don't like, but I can do it. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 03:49:35 2022 Received: (at 53126) by debbugs.gnu.org; 27 Mar 2022 07:49:35 +0000 Received: from localhost ([127.0.0.1]:55212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYNeZ-0004Jq-0L for submit@debbugs.gnu.org; Sun, 27 Mar 2022 03:49:35 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:58415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYNeW-0004Jb-C8 for 53126@debbugs.gnu.org; Sun, 27 Mar 2022 03:49:34 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A7CEF100004; Sun, 27 Mar 2022 07:49:24 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> Date: Sun, 27 Mar 2022 10:46:01 +0300 In-Reply-To: <87v8w2qsee.fsf@gmail.com> (Augusto Stoffel's message of "Fri, 25 Mar 2022 10:43:21 +0100") Message-ID: <86y20vu9c6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > Lazy highlight is controlled by lots of variables. These variables need > to be set for the duration of the minibuffer session that reads the > replacement strings. If we move this to a separate function, we can't > use 'let' anymore, so we basically need to reinvent the dynamic scoping > feature of Elisp (i.e., save the current values, set the variables to > new values, then restore the old values in some hook). And an even ugly > workaround would be needed to replace the necessary condition-case. Or > do I misunderstand you altogether? Do you think a macro could help to make this function short again? Then when you would want to add highlighting to the minibuffer reading the TO part of replacement too or to other minibuffers, it would be easy to just add a single line with that macro. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 01 05:06:57 2022 Received: (at 53126) by debbugs.gnu.org; 1 Apr 2022 09:06:57 +0000 Received: from localhost ([127.0.0.1]:40884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naDFA-0001fF-T9 for submit@debbugs.gnu.org; Fri, 01 Apr 2022 05:06:57 -0400 Received: from mail-ej1-f52.google.com ([209.85.218.52]:38537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naDF9-0001f0-51 for 53126@debbugs.gnu.org; Fri, 01 Apr 2022 05:06:55 -0400 Received: by mail-ej1-f52.google.com with SMTP id r13so4491418ejd.5 for <53126@debbugs.gnu.org>; Fri, 01 Apr 2022 02:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Xd4fupytZj1bTQaiwxmxyk4Iz8tXojBsaJG9qo9mDic=; b=YCkdjjw6QwqPoTjB5GmojgyQMXElTOj7aPTgfLvxi6z/1MyNQADoWuEk4gcLYKSINs 206UqN+sLMzICjBYA1dSx9iSA9OdMxxq7zpWOTvMyx7yq+dq1If7CqncCAxMXVNVt3jN qggNk5Nlr/82OdVkRKpA2A+etY37YlPl1v8msLLiQreEwXThDXhiMSnDBcwByDoBOGOB WlZnMrjDxYF06N1zOHrHeRw+fgKCpUH/Zppa3FOf4tBug1GkJ+I2LiTLv+lI1kLKjNI4 W8WW6gSldSklEaBhVw1cbFKDCF6WfcI3Fs1DJzLeHT++7oAMmkcZqppGf11pOkb+WWgG 9d0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Xd4fupytZj1bTQaiwxmxyk4Iz8tXojBsaJG9qo9mDic=; b=tyknG/wW1iPp7wsFl1L4z2nKmz3HVKu6mcXtQ1sGLi+XkQSSht3gnGbopiNHlXnqiA sqX8oCEqtYOeLe8paSc5xdJFayikeUkYzHr8IlTUghiPUDa6kQSJo5ZIDsmHQ/7wLbHG d22luFYfn4gaBefiBYjI91TUUmMOQm+fcVA2uEcdWMBhnX74e2mLoBafJ89fRjsy7yBi fUkyhMBcPm08v5uLB2iEkIOQpjRHfNpaSPPkoelxF3nz9wuSY/PAH4jlTG1hDFXl79t9 VFX0Mwd6ESvorx0ZsuEAqYSotoku+uz0zEi+tDmAYcAurcQq/vcb52nSrmJQHxeivwT1 CUwA== X-Gm-Message-State: AOAM5337jLvJxd3VF3cRGOVqW7Zy2UCTgcHRcIMKgdoXvDISbviNDsiT YimGe3wSDcBbLuqbtlbc/fPipSc9j0o= X-Google-Smtp-Source: ABdhPJwTxw9CCZoyiEgYa9xgC48cleeGWuEwrEisV/uu4AsGCTCikDi7fk1sOtiNrnTh7/P5TXpHlA== X-Received: by 2002:a17:906:69d1:b0:6ce:7201:ec26 with SMTP id g17-20020a17090669d100b006ce7201ec26mr8469996ejs.105.1648804008888; Fri, 01 Apr 2022 02:06:48 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id rl16-20020a170907217000b006e4c1027beasm767550ejb.55.2022.04.01.02.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 02:06:47 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> Date: Fri, 01 Apr 2022 11:06:46 +0200 In-Reply-To: <86y20vu9c6.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 27 Mar 2022 10:46:01 +0300") Message-ID: <875ynt41g9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Sun, 27 Mar 2022 at 10:46, Juri Linkov wrote: >> Lazy highlight is controlled by lots of variables. These variables need >> to be set for the duration of the minibuffer session that reads the >> replacement strings. If we move this to a separate function, we can't >> use 'let' anymore, so we basically need to reinvent the dynamic scoping >> feature of Elisp (i.e., save the current values, set the variables to >> new values, then restore the old values in some hook). And an even ugly >> workaround would be needed to replace the necessary condition-case. Or >> do I misunderstand you altogether? > > Do you think a macro could help to make this function short again? That could be done, of course, but I'm pretty sure that this macro would be used exactly once. I don't think we should have a general-purpose macro to set up the lazy highlighting for arbitrary minibuffer commands, because complex cases like query-replace will be rare, and in any case we can't anticipate all special requirements. Anyway, should I refactor my patch to use a macro? Something else that could make 'query-replace-read-args' slightly shorter is to define (defun replace-regexp-function (delimited-flag) (or replace-regexp-function delimited-flag (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp))) This function could be used in 3 different places in replace.el. > Then when you would want to add highlighting to the minibuffer > reading the TO part of replacement too or to other minibuffers, > it would be easy to just add a single line with that macro. Right, a preview of the replacement text will also need some extra work. This will probably involve some extension to 'isearch-lazy-highlight-update', making it even more complicated... From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 01 12:44:04 2022 Received: (at 53126) by debbugs.gnu.org; 1 Apr 2022 16:44:04 +0000 Received: from localhost ([127.0.0.1]:43266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naKNY-0005VX-An for submit@debbugs.gnu.org; Fri, 01 Apr 2022 12:44:04 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naKNW-0005Ut-5U for 53126@debbugs.gnu.org; Fri, 01 Apr 2022 12:44:03 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9E743FF805; Fri, 1 Apr 2022 16:43:54 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> Date: Fri, 01 Apr 2022 19:35:38 +0300 In-Reply-To: <875ynt41g9.fsf@gmail.com> (Augusto Stoffel's message of "Fri, 01 Apr 2022 11:06:46 +0200") Message-ID: <86pmm1azkd.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >>> Lazy highlight is controlled by lots of variables. These variables need >>> to be set for the duration of the minibuffer session that reads the >>> replacement strings. If we move this to a separate function, we can't >>> use 'let' anymore, so we basically need to reinvent the dynamic scoping >>> feature of Elisp (i.e., save the current values, set the variables to >>> new values, then restore the old values in some hook). And an even ugly >>> workaround would be needed to replace the necessary condition-case. Or >>> do I misunderstand you altogether? >> >> Do you think a macro could help to make this function short again? > > That could be done, of course, but I'm pretty sure that this macro would > be used exactly once. I don't think we should have a general-purpose > macro to set up the lazy highlighting for arbitrary minibuffer commands, > because complex cases like query-replace will be rare, Why do you think query-replace is more complex than other minibuffer commands? Other minibuffer commands need to set all the same a dozen of variables that control lazy highlighting. Otherwise, they will highlight some random matches that happen to reuse values left from a previous isearch. > and in any case we can't anticipate all special requirements. To anticipate all requirements, I recommend to try adding this feature at least to occur. Then we will see what code needs to be shared. > Anyway, should I refactor my patch to use a macro? As long as experimentation will prove at least occur can use this macro. > Something else that could make 'query-replace-read-args' slightly > shorter is to define > > (defun replace-regexp-function (delimited-flag) > (or replace-regexp-function > delimited-flag > (and replace-char-fold > (not regexp-flag) > #'char-fold-to-regexp))) > > This function could be used in 3 different places in replace.el. This would be nice, maybe to be used as an optional argument of the macro. >> Then when you would want to add highlighting to the minibuffer >> reading the TO part of replacement too or to other minibuffers, >> it would be easy to just add a single line with that macro. > > Right, a preview of the replacement text will also need some extra work. > This will probably involve some extension to > 'isearch-lazy-highlight-update', making it even more complicated... Why? Shouldn't it just highlight the same way the text entered into the minibuffer that reads the replacement? From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 01 14:12:54 2022 Received: (at 53126) by debbugs.gnu.org; 1 Apr 2022 18:12:54 +0000 Received: from localhost ([127.0.0.1]:43336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naLlK-0003g5-Ic for submit@debbugs.gnu.org; Fri, 01 Apr 2022 14:12:54 -0400 Received: from mail-ej1-f41.google.com ([209.85.218.41]:45959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naLlI-0003ft-SP for 53126@debbugs.gnu.org; Fri, 01 Apr 2022 14:12:41 -0400 Received: by mail-ej1-f41.google.com with SMTP id i16so7407113ejk.12 for <53126@debbugs.gnu.org>; Fri, 01 Apr 2022 11:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7i5xFm747m1s4teIg8/O/YA/VrJ+1VzWEOHtcAzdBsw=; b=YJhw1aRQj4mRElo5LswZGw21fBKSeE2Kj+T2WQ9YmiqjNrq2QxYXfEfbMZnyrHSfQr 2rHJ9gBKeKZZI90zfCdnIHFRgp8HUT71m3xuECEwUM5Z8b8EAvye1vun7rsr6fl2QqeG rDCialHcZEQmErggQPX7/8WqWxHutoQL7+z7JUAhdVNx2/Thpfa1zNnPaEn54EbaV9sC pZTmND6dcbwAyck2A2l+qCOcmXXEjsxgyNAGZby5dxev+xYYkyWQrXj/1/NXzR9pYZTq yOOXVi6Z9+uSb+Dyox3uKSy3ubRgg2G2pLL1gkwZclEghoDO/N4WwezAL0K6AOJmtZ/G RlKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7i5xFm747m1s4teIg8/O/YA/VrJ+1VzWEOHtcAzdBsw=; b=WtoPiA323kJLetcEHMbOimKywvpHJMkS/yj+OLvzRxBsh+xwcWE+NJDU8DOZq327Jg heMqP+o4v8Moywmyr6cu/96pFNrQYvSg7QRpueZBLLpUFqH89TGokRij9rzYgPM588Ht 55Vgz7ublrY7zXH5CD+y6L5iHHBXwgzZXENupesBDUPrtUlq/5uCCiDpLXeXVKZEFiqp uV61l6zea2CJbce8V4+zXgoRa7iLscB8LuUVOcgFr0vEL9IHS6OPJdh8N6C6dhcOQGOR ZRYNsODHOhzzUZbQ4VhwRfL7RmISkhvzi4zsg0xBp803upoPDuVK+I9jTZnPMN4dc0IE R5AQ== X-Gm-Message-State: AOAM533qo6kxzWI4n5rjmQM/Lg10rSIT7xTdw0mrH7B5C94lUCqNeYeM AObR+SY0zZ3kp6/U8Eome50GvAKsoZw= X-Google-Smtp-Source: ABdhPJzJlDtkwZ1Q/BxacizsozBoqK6O7Gq8TOJ2s7drV1Dd33uS4kBteU9BpcJHBy3ZPsKlfo+1Xg== X-Received: by 2002:a17:907:3e99:b0:6db:6c1c:d9d9 with SMTP id hs25-20020a1709073e9900b006db6c1cd9d9mr899583ejc.688.1648836754489; Fri, 01 Apr 2022 11:12:34 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id c11-20020a056402120b00b004196059efd1sm1516014edw.75.2022.04.01.11.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 11:12:33 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> Date: Fri, 01 Apr 2022 20:12:32 +0200 In-Reply-To: <86pmm1azkd.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 01 Apr 2022 19:35:38 +0300") Message-ID: <87a6d43c6n.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Fri, 1 Apr 2022 at 19:35, Juri Linkov wrote: > Why do you think query-replace is more complex than other minibuffer commands? > Other minibuffer commands need to set all the same a dozen of variables that > control lazy highlighting. Otherwise, they will highlight some random matches > that happen to reuse values left from a previous isearch. Without having tested, the lazy highlight feature for occur would only require the addition of 4 lines: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=occur.patch diff --git a/lisp/replace.el b/lisp/replace.el index a56e493d99..cd1bf9057f 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1741,7 +1741,11 @@ occur-excluded-properties :version "22.1") (defun occur-read-primary-args () - (let* ((perform-collect (consp current-prefix-arg)) + (when isearch-lazy-highlight + (add-hook 'minibuffer-setup-hook 'minibuffer-lazy-highlight-setup)) + (let* ((isearch-regexp t) + (isearch-case-fold-search case-fold-search) + (perform-collect (consp current-prefix-arg)) (regexp (read-regexp (if perform-collect "Collect strings matching regexp" "List lines matching regexp") --=-=-= Content-Type: text/plain So yes, I'd say query-replace is very likely to be most complex case there will be. And it has several unique features that make it quite different from other potential uses of lazy highlight: - The splitting of the TO and FROM strings at "->". - The value of case-fold-search can change on the fly - We must clean up the highlight only if the user quits, to avoid flickering at the beginning of the perform-replace stage. Okay, as I write this I realize occur would require some special stuff if the region is active. This indeed should be factored out. But hopefully you will agree with the 3 points above :-). >> Right, a preview of the replacement text will also need some extra work. >> This will probably involve some extension to >> 'isearch-lazy-highlight-update', making it even more complicated... > > Why? Shouldn't it just highlight the same way the text > entered into the minibuffer that reads the replacement? I'm referring to the anzu feature whereby the replacement text is shown next to each match, like this: --=-=-= Content-Type: image/png Content-Disposition: inline; filename=anzu.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAlUAAAGwCAYAAACAZ5AeAAAABHNCSVQICAgIfAhkiAAAABl0RVh0 U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AACAASURBVHic7N17XEz5/wfw1zShi5qki+qL iNyiXEOtRLZZZin2p1JLvljWrm9a6+uWfVjLsuuyZVnWYne/pHJrd20pIqllS8KKSEgXiYpuSjW9 f3/YOduYqWamuz7Px2Mej+acz3zO+3M5Zz5zzueceEREYBiGYRiGYRpEraUDYBiGYRiGeROwQRXD MAzDMEwjYIMqhmEYhmGYRsAGVQzDMAzDMI2ADaoYhmEYhmEaARtUMe2WWCxGaWkpKisrWzoUhmEY 5g3ABlVMu1RYWAh7e3vY29sjPz+/UfMuLS0Fj8fDO++806hp5Tl79ix4PB4+//xzlT7fGG7evAke j4cFCxY02TYePnwIHo+HtWvXNnrebm5u6NatG3755ZdmyzckJAQ8Hg8BAQGNus3X7dixA6ampuDx eNwrMDCwwWnfZIr0B7FYDB6PBw8Pj0bZZnvZj+uzatUqqf7H4/Hg6+vbYvGoQr2lA2CY5lZZWQln Z2e8fPkSMTEx0NXVbemQmBZ05swZPHv2DJcvX4aLi0urz1dRGRkZ8PX1hYODA3x8fLjlNjY2DUr7 pmvpdmvPhEIh9PT0AABZWVnYuXNnC0ekPDaoYtqdrVu3Ijk5GUlJSWxAxSAmJgY3btzAlClT2kS+ ikpLS0N1dTXs7OywYsWKR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oqAhr167FypUr4eLiovX7zp49i759+0IikWDp0qU67//48eM6v7ctyn3S YujI2rJ9d+7cCQD48MMPhQkVAMybNw8uLi749ttvUVtb26oxDRkyBDNnzoRUKm3V/bZHPKlijLWJ 6OhoAMCbb77ZaJ6amhps2LABQ4YMgampKfr164e///3vkMlkCAsLg6+vr0r+b775BmPHjkWPHj3g 4uKC4OBgFBUVCdtTU1MhkUggkUgwfvx4AEBMTIyQpnyJpWu5j4sXAEJDQyGRSLB48WKV9Pz8fEil Uri4uODevXstVjcAiI2NhUQiQVRUFJKSkuDr64sePXpg1KhR+P7771XyLl68WGV/FhYWICKEh4fD 2dkZhoaGmDNnjpCfiLB582Z4enpCKpVi4MCBmDt3rtptLDExiGlfbeMV077V1dWwtrZGnz59UFdX pxbX+vXrIZFIdFqDlJSUhG7dusHT01Ntm7e3N4qLi5GdnS26XDEePnyoVm+JRILffvtNY/7y8nKs WrUKAwcOhJmZGZycnDB16lTExcVpzK9NvwFAdnY2AgMD0bt3b5iammLw4MH46KOP8ODBA5V8Yo9J AEhPT4dcLkfv3r3Ro0cPTJgwock/yL1v3z64urry7T/GWNvYvXs3fH190atXr0bzLFy4EF988QXe ffddrFq1CleuXEF4eDisrKywYsUKlUnCW2+9he3bt8PX1xcrVqxASUkJvvrqKxw4cADp6eno378/ +vXrh/DwcAD1A/26deswdOhQzJw5s1l10aVcbeIFgNWrVyM5ORlRUVGQy+Xw9vYGEeH1119HVVUV YmJiYG5u3mJ1aygjIwNffvklRo8eDWtra8THx8PPzw979uwRFm3L5XJhbVxUVBQqKioQGRmJsLAw uLm5wcnJCYMGDRLKDAoKQnR0NMaPH4+FCxeiqKgIe/bswU8//YS0tDT07dtXdAxi2lfbeMW0b9eu XREcHIyIiAgcOXIEkyZNUtn+9ddfw87ODnK5XHQf3Lx5EzY2NhonyLa2tkKe5rC0tERkZCRGjhyp cbuRkZHQFgAQHx+PtLS0RsuTy+U4efIkgoODMX/+fFRUVODw4cN49dVX8dFHH2HFihVCXm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VHjuFZvx5f9OjG+21aERwXx+rTZzDS1aWDizMAg9u1wdHc jHn7/8OeK9fIzs+nmX1dVo74EO/ndpOp2zZVeFn9q6+tzbLhHzB+8zZWnz6jcN06hgZcnDOTRrY2 atU7Yct2HsfFs2vC57I5oCGRsPXzMTSfPpNR6zbS+qcG2NYumx+qjLE6mOrrEzD/eyZs2c7F4MfE pqXh08qTb7z7sMbvrEL+N3VuljrGP4qNw91RqgwZ6OjgZGVJcGwcPuWU26LiEjn5SimvLK0ZOUJO qdKQSNj02WimbN+pUPZFlaoPvToQkZRMcwd7GtvaVF2gEu7du8eSJUsU0nftKpN57NixDBw4kKIi 6eYjf39//P39ldbn4+ODk5MTn332GQ0aNOCXX37h9OnTZGZm0qBBAyZNmsT06dOxqmRjgojI/xXq xmAojTMzdceuGovr8DJZ63dWwHeEsOW8anFaXgWlMYyWHzvxqkV5I9l79ZpgOvpzhThE2fn5wt6r 1wR8Rwhj1m98qTL822OclZenEKfqf43XYW6KqAdinCqR/3PUdmKwq1MbHS1NboVH8Nspqbm4g4sz Ho4ONaPl1TAbzp3HRF/vhY4BEXm9WXfmHKYG+gpLYvra2vRq3gytWrUorkacNZEXQ5ybIiIibxpq K1UGOjqs/mQEM/fuw2+zNPDgkmFD/6eUqmshoVx4FExWXh7XQkL5fqCP0nPuRP4/cHdw4NTde7z/ 6yq8W7bASFeXopJi4tLS2XLhIhKJhA87Kp5rJlLziHNTRETkTaZa220+6dyRTzp3rGlZaoyz9x8w fddeDHR0GNyuDd8N8H7VIom8Qn4aOggrE2P+unad6bv2kJKVjYGODuZGRni5OrP6k49o29Cp6opE XhhxboqIiLzJSAThX9zDKyIiIiLyxqJO2Arx0SPyJqJSnCoREREREREREZHK+S8AWyKZCiF5jAAA AABJRU5ErkJggg== --=-=-= Content-Type: text/plain This will not be totally trivial to implement, right? And it will add some extra stuff to query-replace-read-args that is very much query-replace specific. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 14:31:28 2022 Received: (at 53126) by debbugs.gnu.org; 2 Apr 2022 18:31:28 +0000 Received: from localhost ([127.0.0.1]:46855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naiX2-0004gk-5R for submit@debbugs.gnu.org; Sat, 02 Apr 2022 14:31:28 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:43817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naiWz-0004gU-Q2 for 53126@debbugs.gnu.org; Sat, 02 Apr 2022 14:31:26 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id ADF9F60004; Sat, 2 Apr 2022 18:31:17 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> Date: Sat, 02 Apr 2022 21:23:10 +0300 In-Reply-To: <87a6d43c6n.fsf@gmail.com> (Augusto Stoffel's message of "Fri, 01 Apr 2022 20:12:32 +0200") Message-ID: <86r16fz6bw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Why do you think query-replace is more complex than other minibuffer commands? >> Other minibuffer commands need to set all the same a dozen of variables that >> control lazy highlighting. Otherwise, they will highlight some random matches >> that happen to reuse values left from a previous isearch. > > Without having tested, the lazy highlight feature for occur would only > require the addition of 4 lines: I could test it, but I'm quite sure 4 lines would not be sufficient, because lazy-highlight relies on much more isearch variables. > So yes, I'd say query-replace is very likely to be most complex case > there will be. And it has several unique features that make it quite > different from other potential uses of lazy highlight: > > - The splitting of the TO and FROM strings at "->". Agreed. > - The value of case-fold-search can change on the fly Please clarify when it can be changed on the fly. > - We must clean up the highlight only if the user quits, to avoid > flickering at the beginning of the perform-replace stage. I don't know how important is to avoid flickering at the beginning, when it flickers after every replacement anyway. > Okay, as I write this I realize occur would require some special stuff > if the region is active. This indeed should be factored out. But > hopefully you will agree with the 3 points above :-). I agreed on 1.5 points :-) >>> Right, a preview of the replacement text will also need some extra work. >>> This will probably involve some extension to >>> 'isearch-lazy-highlight-update', making it even more complicated... >> >> Why? Shouldn't it just highlight the same way the text >> entered into the minibuffer that reads the replacement? > > I'm referring to the anzu feature whereby the replacement text is shown > next to each match, like this: > > This will not be totally trivial to implement, right? And it will add > some extra stuff to query-replace-read-args that is very much > query-replace specific. I very much doubt in usefulness of such a feature. I thought it could simply highlight the replacement text to show the places in the buffer that already contain such replacement text. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 03 04:32:23 2022 Received: (at 53126) by debbugs.gnu.org; 3 Apr 2022 08:32:24 +0000 Received: from localhost ([127.0.0.1]:47540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1navep-00017D-B5 for submit@debbugs.gnu.org; Sun, 03 Apr 2022 04:32:23 -0400 Received: from mail-ej1-f47.google.com ([209.85.218.47]:38878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1navem-000170-VN for 53126@debbugs.gnu.org; Sun, 03 Apr 2022 04:32:21 -0400 Received: by mail-ej1-f47.google.com with SMTP id r13so14117625ejd.5 for <53126@debbugs.gnu.org>; Sun, 03 Apr 2022 01:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8X/vCn0D8Z2qVTOdEgPygKb+soSA0PF0WGiHXG528Uk=; b=GkhroTHXUklvWOba311InENILT5W7z/GkpD2bSz+I8hfZdHV3kK0eP0U0VBmmkUSrj SisZKBi/6yIiBG7Mi1hcipVsmnQ+om5VBYchUUW7+DO3YWPSl4B3kwaRNvqfJ01NQEr1 6nyKqHpuNfVBBVdITKJ2DOxN80m9f/YPADLwKK/8o3bez52N0vsU2arAKHxDAKkQl3+0 tR5LAyxFWWPpbTK3J0d4QAlm1UjdewOBZWlfKqtDYHxJS8bBqdu+cutua8Eii/l6FCrv 3SZ9kiY7jov6bTJX7ng3ALwROPEn5b4bWZm+/q+zF5LfzQaiGdvjdBBIeStmjx8wmnmS kXqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=8X/vCn0D8Z2qVTOdEgPygKb+soSA0PF0WGiHXG528Uk=; b=q9KpYUD43i7d+VuT0cYTVWpQt6iZgXRlJAj9fWbqrcVRWcTkv9zB2oTMlM1yfWRD6C DUa9tBi53cVk4MmOoiRfCRiSB/x2/h4lOot4Kw1/G4TPrlKXesLFeyTb9gTouOQ/Benp FKpntHdGuMls00jRyhMd0Av0ybiBZB/mZqHrTQwaurSmeWYair8W1//pwpbGJq5A200u scMURZIIiU0LUEnVsiMzVTu+mEaZV0QzDYQOXs9MltOd9lWV/5Ho5khT1ie6btKZTrXE iq79F/nR1DtPmTZSMOUOQrQ702ziBs8ziLzNX3xOPPiQ4+8HoStTo+bdZv9W42as0o7D bk8w== X-Gm-Message-State: AOAM530AM7qfkkLbHKpuL/jkU5ZFFUJVOovnfo2P4UQ0XpzqAoGpf027 m/3dive6S5Gzp0BQvaZV/taaHovXqQo= X-Google-Smtp-Source: ABdhPJyYjAGx9YE8ESK7YvjSqY0hd/MMxRUeJ4+M5E1YUydc3xvf65l1wd1B27u6V1Wnk/oQAUYP0w== X-Received: by 2002:a17:907:3f29:b0:6df:7eac:7fa4 with SMTP id hq41-20020a1709073f2900b006df7eac7fa4mr6421577ejc.391.1648974734580; Sun, 03 Apr 2022 01:32:14 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id t1-20020a170906178100b006e7edb2c0bdsm315332eje.15.2022.04.03.01.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 01:32:13 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> Date: Sun, 03 Apr 2022 10:32:12 +0200 In-Reply-To: <86r16fz6bw.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 02 Apr 2022 21:23:10 +0300") Message-ID: <87o81i5zzn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain I've attached a sketch of a macro to help activating the minibuffer lazy highlight. It doesn't make query-replace-read-args exactly short, but if you like this, I can prepare the patch. Note that I haven't tested this code at all. It's for impressionistic purposes only. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Display-lazy-highlight-and-match-count-in-query-repl.patch >From 92394967d27bb2750a88a19951182d1465b57040 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Thu, 17 Mar 2022 20:17:26 +0100 Subject: [PATCH] Display lazy highlight and match count in query-replace * lisp/isearch.el (isearch-query-replace): Don't clean up lazy highlight if applicable. * lisp/replace.el (query-replace-read-args, query-replace-read-to): Add lazy highlighting and count. (replace--region-filter): New function, extracted from 'perform-replace'. (perform-replace): Use 'replace--region-filter'. --- lisp/isearch.el | 65 +++++++++++++++++++++++++++++++++++++++++++------ lisp/replace.el | 49 +++++++++++++++++++++++-------------- 2 files changed, 88 insertions(+), 26 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 956b115ce4..b28a7b88a8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2352,7 +2352,9 @@ isearch-query-replace (isearch-recursive-edit nil) (isearch-string-propertized (isearch-string-propertize isearch-string))) - (isearch-done nil t) + (let ((lazy-highlight-cleanup (and lazy-highlight-cleanup + (not query-replace-lazy-highlight)))) + (isearch-done nil t)) (isearch-clean-overlays) (if (and isearch-other-end (if backward @@ -2368,13 +2370,16 @@ isearch-query-replace (symbol-value query-replace-from-history-variable))) (perform-replace isearch-string-propertized - (query-replace-read-to - isearch-string-propertized - (concat "Query replace" - (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) - (if backward " backward" "") - (if (use-region-p) " in region" "")) - isearch-regexp) + (condition-case error + (query-replace-read-to + isearch-string-propertized + (concat "Query replace" + (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) + (if backward " backward" "") + (if (use-region-p) " in region" "")) + isearch-regexp) + (t (lazy-highlight-cleanup lazy-highlight-cleanup) + (signal (car error) (cdr error)))) t isearch-regexp (or delimited isearch-regexp-function) nil nil (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) @@ -4413,6 +4418,50 @@ minibuffer-lazy-highlight-setup (make-overlay (point-min) (point-min) (current-buffer) t))) (minibuffer-lazy-highlight--after-change nil nil nil)) +(cl-defmacro with-minibuffer-lazy-highlight (lazy-highlight &rest body &keys (regexp 'unset) (regexp-function 'unset) (case-fold 'unset) (cleanup 'unset) (region 'unset) (transform 'unset)) + (while (keywordp (car body) (setq body (cddr body)))) + `(let ((isearch-lazy-highlight ,lazy-highlight) + ,@(unless (eq 'unset ,case-fold) `(isearch-case-fold-search ,case-fold)) + ,@(unless (eq 'unset ,regexp) `(isearch-regexp ,regexp)) + ,@(unless (eq 'unset ,regexp-function) `(isearch-regexp-function ,regexp-function)) + ,@(unless (eq 'unset ,cleanup) `(lazy-highlight-cleanup ,cleanup)) + ,@(unless (eq 'unset ,transform )`(minibuffer-lazy-highlight-transform ,transform))) + (when isearch-lazy-highlight + (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) + (when ,region + (letrec ((region-filter (isearch-region-filter + (funcall region-extract-function ,region))) + (cleanup (lambda () + (remove-function isearch-filter-predicate region-filter) + (remove-hook 'minibuffer-exit-hook cleanup)))) + (add-function :after-while isearch-filter-predicate region-filter) + (add-hook 'minibuffer-exit-hook cleanup)))) + (condition-case error + (progn ,@body) + (t (lazy-highlight-cleanup) + (signal (car error) (cdr error)))))) + +(defun isearch-region-filter (bounds) + "Return a function that decides if a region is inside BOUNDS. +BOUNDS is a list of cons cells of the form (START . END). The +returned function takes as argument two buffer positions, START +and END." + (let ((region-bounds + (mapcar (lambda (position) + (cons (copy-marker (car position)) + (copy-marker (cdr position)))) + bounds))) + (lambda (start end) + (delq nil (mapcar + (lambda (bounds) + (and + (>= start (car bounds)) + (<= start (cdr bounds)) + (>= end (car bounds)) + (<= end (cdr bounds)))) + region-bounds))))) + + (defun isearch-resume (string regexp word forward message case-fold) "Resume an incremental search. diff --git a/lisp/replace.el b/lisp/replace.el index e6f565d802..bed4a2824d 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -352,8 +352,15 @@ query-replace-read-to (query-replace-compile-replacement (save-excursion (let* ((history-add-new-input nil) + (count (if (and query-replace-lazy-highlight + minibuffer-lazy-count-format + isearch-lazy-count + isearch-lazy-count-total) + (format minibuffer-lazy-count-format + isearch-lazy-count-total) + "")) (to (read-from-minibuffer - (format "%s %s with: " prompt (query-replace-descr from)) + (format "%s%s %s with: " count prompt (query-replace-descr from)) nil nil nil query-replace-to-history-variable from t))) (add-to-history query-replace-to-history-variable to nil t) @@ -365,7 +372,26 @@ query-replace-read-args (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion - (let* ((from (query-replace-read-from prompt regexp-flag)) + (let* ((from (with-minibuffer-lazy-highlight + query-replace-lazy-highlight + :case-fold case-fold-search + :regexp regexp-flag + :regexp-function (or replace-regexp-function + (and current-prefix-arg + (not (eq current-prefix-arg '-))) + (and replace-char-fold + (not regexp-flag) + #'char-fold-to-regexp))) + :cleanup nil + :transform (minibuffer-lazy-highlight-transform + (lambda (string) + (let* ((split (query-replace--split-string string)) + (from-string (if (consp split) (car split) split))) + (when (and case-fold-search search-upper-case) + (setq isearch-case-fold-search + (isearch-no-upper-case-p from-string regexp-flag))) + from-string))) + (query-replace-read-from prompt regexp-flag)) (to (if (consp from) (prog1 (cdr from) (setq from (car from))) (query-replace-read-to from prompt regexp-flag)))) (list from to @@ -2862,22 +2888,9 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - (funcall region-extract-function 'bounds)))) - (setq region-filter - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds)))) - (add-function :after-while isearch-filter-predicate region-filter))) + (setq region-filter (isearch-region-filter + (funcall region-extract-function 'bounds))) + (add-function :after-while isearch-filter-predicate region-filter)) ;; If region is active, in Transient Mark mode, operate on region. (if backward -- 2.35.1 --=-=-= Content-Type: text/plain Below a response to your last message. On Sat, 2 Apr 2022 at 21:23, Juri Linkov wrote: >> - The value of case-fold-search can change on the fly > > Please clarify when it can be changed on the fly. I refer to the following lines of my patch, which are necessary. (when (and case-fold-search search-upper-case) (setq isearch-case-fold-search (isearch-no-upper-case-p from-string regexp-flag))) (Incidentally, I like better the ripgrep smart case, where an uppercase character only matches itself, and lowercase characters match both upper and lower case.) >> I'm referring to the anzu feature whereby the replacement text is shown >> next to each match, like this: >> >> This will not be totally trivial to implement, right? And it will add >> some extra stuff to query-replace-read-args that is very much >> query-replace specific. > > I very much doubt in usefulness of such a feature. I thought it could > simply highlight the replacement text to show the places in the buffer > that already contain such replacement text. The anzu thing is only really meaningful if you are doing some complex replacements with \, and whatnot. But in that case, I guess it could help a lot? --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 03 13:19:16 2022 Received: (at 53126) by debbugs.gnu.org; 3 Apr 2022 17:19:16 +0000 Received: from localhost ([127.0.0.1]:49432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nb3si-0000HT-4Q for submit@debbugs.gnu.org; Sun, 03 Apr 2022 13:19:16 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:38289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nb3sg-0000HE-4z for 53126@debbugs.gnu.org; Sun, 03 Apr 2022 13:19:15 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 13164240002; Sun, 3 Apr 2022 17:19:06 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> Date: Sun, 03 Apr 2022 20:06:37 +0300 In-Reply-To: <87o81i5zzn.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 03 Apr 2022 10:32:12 +0200") Message-ID: <861qyerssq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > I've attached a sketch of a macro to help activating the minibuffer lazy > highlight. It doesn't make query-replace-read-args exactly short, I guess it will be much shorter for other less complex uses like occur? So the complexity of this feature activation will be hidden inside the macro. > Note that I haven't tested this code at all. It's for impressionistic > purposes only. This code doesn't look bad when other uses will have just one line with with-minibuffer-lazy-highlight. But then the macro with-minibuffer-lazy-highlight needs to set some reasonable default values to isearch variables, such as setting isearch-forward to t, etc. > but if you like this, I can prepare the patch. Currently it fails with Eager macro-expansion failure: (error "Malformed argument list ends with: ... so it seems the macro complexity makes it too fragile. OTOH, spreading this complexity in every feature use doesn't look better. > The anzu thing is only really meaningful if you are doing some complex > replacements with \, and whatnot. But in that case, I guess it could > help a lot? I can see how it could help during replacements, but not during entering the replacement string. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 12:38:53 2022 Received: (at 53126) by debbugs.gnu.org; 4 Apr 2022 16:38:53 +0000 Received: from localhost ([127.0.0.1]:52820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbPjB-00050C-J3 for submit@debbugs.gnu.org; Mon, 04 Apr 2022 12:38:53 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:55893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbPj9-0004zt-MQ for 53126@debbugs.gnu.org; Mon, 04 Apr 2022 12:38:52 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6ABDF60009; Mon, 4 Apr 2022 16:38:43 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> Date: Mon, 04 Apr 2022 19:37:10 +0300 In-Reply-To: <87o81i5zzn.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 03 Apr 2022 10:32:12 +0200") Message-ID: <86v8vo6c2k.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > I've attached a sketch of a macro to help activating the minibuffer lazy > highlight. It doesn't make query-replace-read-args exactly short, but > if you like this, I can prepare the patch. I realized we already have the macro minibuffer-with-setup-hook, so we don't need more macros. The purpose of minibuffer-with-setup-hook is to set up the minibuffer to the initial state with buffer-local variables. In case of lazy-highlighting, we can't set isearch variables directly, but all isearch variables can be replaced by one variable that contains a set of lazy-highlight parameters. For example: (minibuffer-with-setup-hook (lambda () (setq-local lazy-highlight-params `((case-fold ,case-fold-search) (regexp ,regexp-flag) (regexp-function ,(or replace-regexp-function (and current-prefix-arg (not (eq current-prefix-arg '-))) (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp))))) (minibuffer-lazy-highlight-init)) (query-replace-read-from prompt regexp-flag)) where minibuffer-lazy-highlight-init does a little more than minibuffer-lazy-highlight-setup. Or maybe it's not needed, and minibuffer-lazy-highlight-setup should be enough. Or maybe instead of setq-local is can let-bind variables. Please also note that condition-case can be replaced by a hook in minibuffer-exit-hook that can remove highlighting after exiting the minibuffer. Alternatively, the same lambda above could be added to (add-hook 'minibuffer-setup-hook (lambda () ...)) From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 05 12:39:03 2022 Received: (at 53126) by debbugs.gnu.org; 5 Apr 2022 16:39:03 +0000 Received: from localhost ([127.0.0.1]:55980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbmCt-0000DL-AH for submit@debbugs.gnu.org; Tue, 05 Apr 2022 12:39:03 -0400 Received: from mail-ej1-f50.google.com ([209.85.218.50]:40610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbmCr-0000Cp-Gq for 53126@debbugs.gnu.org; Tue, 05 Apr 2022 12:39:02 -0400 Received: by mail-ej1-f50.google.com with SMTP id p15so27864567ejc.7 for <53126@debbugs.gnu.org>; Tue, 05 Apr 2022 09:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=nXULJH5dhHA76l/gf7B9fQ7Vi0srhYHRM2DC95uH0ds=; b=Qb1+Zd26faTnvkvPiUI71zE1fg0KJfcDpWmYrjZooCGjCqfFOCMcv43P8jwNAWSKzi QeToa5KRfku1wawjbZLD5hzs/AY/k0PLV/qZo4yIHEr5UytI+viNzLJthI84mqJXYkkv Q4iNQLk5tEgELd29TeKXfMphbKqyvALbM83cUq/CE6dyuA/NgNcsQA0oBM2cW61ocfkk ka8dj5KWEE776JR/rrlRqAJOvnD4Npny6xmbaa6yVb6zxyKq1sr7M0h3BN5aPsry5gz1 S/eDQRoRuDBfba4XCF4J4sp8PnPkQx9E3vfVXnB3PBSvls+nS9WB/s04Pf4j4BzZUyxb bPeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=nXULJH5dhHA76l/gf7B9fQ7Vi0srhYHRM2DC95uH0ds=; b=b4dLbo090WAxbm5C5ydQqaGUlDcq9/R+uBlRKVneyAgE71yE/eV6QVDKnasFBCYyl8 /mqMQDQt6bc7ZRnO0q7kc2YSDgE2gbVzkBiL3laNCyCJPfl6FJMSk14HApydBlkLL+LD z/6t4bksVO2S4UdFIpE4IU+MNXeRzdlqcp5qRv1SUqIusCvGu5dq6AzbTsu5PZGt/zvn f69vPE/6SEhIi/XdnFYjgifYa3JEHimPo/0WE82XY8N9TyxUttfyF9+hKPzDiOxyHhlv qLFGpE1dKf+BT/LXrTAhnELoLJPxxgKjcNOllMCaAPDCI2piNYvahgHdAcJtVEtdqddC UfVA== X-Gm-Message-State: AOAM533FIXgTB/Kk/Wuhh3eUfxpv+BETscEybyyTp7isAZiY0ts5nR+S 7A3Kv7IBJwzfAz7I4Yn6krTCwaiIyKI= X-Google-Smtp-Source: ABdhPJx+2AR+01whGEQZKU+nPB+zVWqLBkligNljGAuKPMX7IbNK/vxYaIRKFAMtS7kLVVjVJtwARg== X-Received: by 2002:a17:907:1b10:b0:6e4:dae9:b8e5 with SMTP id mp16-20020a1709071b1000b006e4dae9b8e5mr4437949ejc.470.1649176735210; Tue, 05 Apr 2022 09:38:55 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id v8-20020a50d848000000b0041cb912717asm4722058edj.91.2022.04.05.09.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 09:38:54 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <87mtidip1w.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> Date: Tue, 05 Apr 2022 18:38:52 +0200 In-Reply-To: <86v8vo6c2k.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 04 Apr 2022 19:37:10 +0300") Message-ID: <87bkxfeb8j.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Mon, 4 Apr 2022 at 19:37, Juri Linkov wrote: >> I've attached a sketch of a macro to help activating the minibuffer lazy >> highlight. It doesn't make query-replace-read-args exactly short, but >> if you like this, I can prepare the patch. > > I realized we already have the macro minibuffer-with-setup-hook, > so we don't need more macros. > > The purpose of minibuffer-with-setup-hook is to set up the minibuffer > to the initial state with buffer-local variables. In case of > lazy-highlighting, we can't set isearch variables directly, > but all isearch variables can be replaced by one variable > that contains a set of lazy-highlight parameters. For example: > > (minibuffer-with-setup-hook > (lambda () > (setq-local lazy-highlight-params > `((case-fold ,case-fold-search) > (regexp ,regexp-flag) > (regexp-function ,(or replace-regexp-function > (and current-prefix-arg > (not (eq current-prefix-arg '-))) > (and replace-char-fold > (not regexp-flag) > #'char-fold-to-regexp))))) > (minibuffer-lazy-highlight-init)) > (query-replace-read-from prompt regexp-flag)) With this code, case-fold-search and all following lazy highlight params are evaluated with the minibuffer as current buffer, which is not the intended behavior. But that's a good point, we don't need a macro. Among several variations, we could make the setup code look like this: (minibuffer-with-setup-hook (minibuffer-lazy-highlight-init :case-fold case-fold-search :regexp regexp-flag ...) (query-replace-read-from prompt regexp-flag)) where now `minibuffer-lazy-highlight-init' is not the function that initializes stuff, but rather a function that returns a closure that initializes stuff. > where minibuffer-lazy-highlight-init does a little more than > minibuffer-lazy-highlight-setup. Or maybe it's not needed, > and minibuffer-lazy-highlight-setup should be enough. > Or maybe instead of setq-local is can let-bind variables. > > Please also note that condition-case can be replaced by > a hook in minibuffer-exit-hook that can remove highlighting > after exiting the minibuffer. If it was a `unwind-protect', I would agree. But I don't know how to simulate a `condition-case'. Specifically, how can we determine if some hook (the minibuffer-exit-hook in this case) is being run "normally" or as part of the recovery from a signaled error? > Alternatively, the same lambda above could be added to > > (add-hook 'minibuffer-setup-hook (lambda () ...)) Why was it again that we want to avoid saying something like this? (let ((case-fold-search whatever) (isearch-regexp regexp-flag)) (minibuffer-with-setup-hook #'minibuffer-lazy-highlight-init (query-replace-read-from prompt regexp-flag))) From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 05 13:40:20 2022 Received: (at 53126) by debbugs.gnu.org; 5 Apr 2022 17:40:20 +0000 Received: from localhost ([127.0.0.1]:56059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbnAC-00026L-2T for submit@debbugs.gnu.org; Tue, 05 Apr 2022 13:40:20 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:47541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbnAA-000260-1W for 53126@debbugs.gnu.org; Tue, 05 Apr 2022 13:40:18 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9031A100007; Tue, 5 Apr 2022 17:40:10 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> <87bkxfeb8j.fsf@gmail.com> Date: Tue, 05 Apr 2022 20:12:16 +0300 In-Reply-To: <87bkxfeb8j.fsf@gmail.com> (Augusto Stoffel's message of "Tue, 05 Apr 2022 18:38:52 +0200") Message-ID: <86wng3laj3.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) > But that's a good point, we don't need a macro. Among several > variations, we could make the setup code look like this: > > (minibuffer-with-setup-hook > (minibuffer-lazy-highlight-init :case-fold case-fold-search > :regexp regexp-flag > ...) > (query-replace-read-from prompt regexp-flag)) > > where now `minibuffer-lazy-highlight-init' is not the function that > initializes stuff, but rather a function that returns a closure that > initializes stuff. Looks good. >> Please also note that condition-case can be replaced by >> a hook in minibuffer-exit-hook that can remove highlighting >> after exiting the minibuffer. > > If it was a `unwind-protect', I would agree. But I don't know how to > simulate a `condition-case'. Specifically, how can we determine if some > hook (the minibuffer-exit-hook in this case) is being run "normally" or > as part of the recovery from a signaled error? Shouldn't both cases clean up highlight from the buffer? Then I see no need to distinguish each case. Or if really needed, you can try to bind the cleanup to command-error-function. >> Alternatively, the same lambda above could be added to >> >> (add-hook 'minibuffer-setup-hook (lambda () ...)) > > Why was it again that we want to avoid saying something like this? > > (let ((case-fold-search whatever) > (isearch-regexp regexp-flag)) > (minibuffer-with-setup-hook #'minibuffer-lazy-highlight-init > (query-replace-read-from prompt regexp-flag))) 4 lines look nice, unlike 20 lines in one of your patches ;-) From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 07 15:32:33 2022 Received: (at 53126) by debbugs.gnu.org; 7 Apr 2022 19:32:33 +0000 Received: from localhost ([127.0.0.1]:33410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncXrs-0003Oh-Ip for submit@debbugs.gnu.org; Thu, 07 Apr 2022 15:32:33 -0400 Received: from mail-ed1-f54.google.com ([209.85.208.54]:43633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncXrq-0003OI-PE for 53126@debbugs.gnu.org; Thu, 07 Apr 2022 15:32:31 -0400 Received: by mail-ed1-f54.google.com with SMTP id b24so7581583edu.10 for <53126@debbugs.gnu.org>; Thu, 07 Apr 2022 12:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rYdHH9uneJRQMGsH7qO8oeSJQW+XOfCRE8NWccm7QoE=; b=KqNgHKGgRxmk7uCKfY9N+QISChnwyQ1Dcch7EckQaGiXIGnGAN3tWMIVbCh0aTDvLN 0Ci8Wf2olcCwI7bP+TBPL5bKgkY12WurP1qPihthzHUj8j24GqeQPp11IJ5JpzaePzKs 4GUq+w3+h/mSGhdeEB47boZeJCN7UlXeBR2W+0moINbL12GCrlVwpmKRTURb33Ebtf0E zwH7dramupHFNGGLx6KNfyWhDLd+nKEhs23BjB403tzMu+5WU7wdtRx9yJI3TfwBkxHa TnV1r/jmTPiRD3i19de52vC53PF3HC+zluzPrucopdNajzJnaI3vDBnQ3huCHSGK2Na9 eXjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rYdHH9uneJRQMGsH7qO8oeSJQW+XOfCRE8NWccm7QoE=; b=du5hC1N88UjBieWih9D45v/9y2Jx5ImkccwKwsAb/X0GDhp8a411dhVG47T1kIMwAA uRF7vYNfAuuE4RlJvk4wQ4waS91oGn1mWP727v+UFEWBvGM2zEwXJdYkxyQxH79+hxab e5VUTcxp34agdqXOKEPp5jzBl3pnXWEX3vXXpvMSE6F4NloqWRj/UJtP8E4dEfAElfyS 2xYm9J5Njt7NzlCnUtFEiwOC1GBnRlQZtKfGHxFPR6n+xGNxr1cM8XjZWv6FQ0u889MT YiGFaWgXZIcAXaEM+y4l1xhobu9SN0f95c6QqD1olWk8eYfdQ8xTBNueuGKp7OwBJ6dX OKFg== X-Gm-Message-State: AOAM530HJS7/0zAJftXpTnFAH07IC+DL3i3XbOsTfk26g15XfQ210DOa C6zxcjUttAosWKGXEPAD/5e8itZtlcw= X-Google-Smtp-Source: ABdhPJwhQuiK+gZnpcEl0bROXX2S2ZjAlcD+DJho20W4J8SMBWBli2Oehn4Y8idb9W5obVIzKrSkdA== X-Received: by 2002:aa7:db94:0:b0:410:f0e8:c39e with SMTP id u20-20020aa7db94000000b00410f0e8c39emr15558057edt.14.1649359944346; Thu, 07 Apr 2022 12:32:24 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id jl11-20020a17090775cb00b006e7b1c5cf81sm5539404ejc.189.2022.04.07.12.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 12:32:23 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> <87bkxfeb8j.fsf@gmail.com> <86wng3laj3.fsf@mail.linkov.net> Date: Thu, 07 Apr 2022 21:32:21 +0200 In-Reply-To: <86wng3laj3.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 05 Apr 2022 20:12:16 +0300") Message-ID: <87r168g056.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Tue, 5 Apr 2022 at 20:12, Juri Linkov wrote: >> But that's a good point, we don't need a macro. Among several >> variations, we could make the setup code look like this: >> >> (minibuffer-with-setup-hook >> (minibuffer-lazy-highlight-init :case-fold case-fold-search >> :regexp regexp-flag >> ...) >> (query-replace-read-from prompt regexp-flag)) >> >> where now `minibuffer-lazy-highlight-init' is not the function that >> initializes stuff, but rather a function that returns a closure that >> initializes stuff. > > Looks good. Okay, I've refactored my code like this. I actually like it better that way. (As a downside, the stuff that was already merged to isearch.el is completely changed.) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Display-lazy-highlight-and-match-count-in-query-repl.patch >From 173c24fc4f90c92f5c9035c76fc578bf11d33294 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Thu, 17 Mar 2022 20:17:26 +0100 Subject: [PATCH] Display lazy highlight and match count in query-replace * lisp/isearch.el (isearch-query-replace): Don't clean up lazy highlight if applicable. * lisp/replace.el (query-replace-read-args, query-replace-read-to): Add lazy highlighting and count. (replace--region-filter): New function, extracted from 'perform-replace'. (perform-replace): Use 'replace--region-filter'. --- lisp/isearch.el | 144 +++++++++++++++++++++++++++--------------------- lisp/replace.el | 77 +++++++++++++++++++------- 2 files changed, 140 insertions(+), 81 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 956b115ce4..48f2c3bf41 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1812,20 +1812,20 @@ isearch-edit-string (minibuffer-history-symbol) ;; Search string might have meta information on text properties. (minibuffer-allow-text-properties t)) - (when isearch-lazy-highlight - (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) (setq isearch-new-string - (read-from-minibuffer - (isearch-message-prefix nil isearch-nonincremental) - (cons isearch-string (1+ (or (isearch-fail-pos) - (length isearch-string)))) - minibuffer-local-isearch-map nil - (if isearch-regexp - (cons 'regexp-search-ring - (1+ (or regexp-search-ring-yank-pointer -1))) - (cons 'search-ring - (1+ (or search-ring-yank-pointer -1)))) - nil t) + (minibuffer-with-setup-hook + (minibuffer-lazy-highlight-setup) + (read-from-minibuffer + (isearch-message-prefix nil isearch-nonincremental) + (cons isearch-string (1+ (or (isearch-fail-pos) + (length isearch-string)))) + minibuffer-local-isearch-map nil + (if isearch-regexp + (cons 'regexp-search-ring + (1+ (or regexp-search-ring-yank-pointer -1))) + (cons 'search-ring + (1+ (or search-ring-yank-pointer -1)))) + nil t)) isearch-new-message (mapconcat 'isearch-text-char-description isearch-new-string ""))))) @@ -4361,57 +4361,77 @@ minibuffer-lazy-count-format :group 'lazy-count :version "29.1") -(defvar minibuffer-lazy-highlight-transform #'identity - "Function to transform minibuffer text into a `isearch-string' for highlighting.") - -(defvar minibuffer-lazy-highlight--overlay nil - "Overlay for minibuffer prompt updates.") - -(defun minibuffer-lazy-highlight--count () - "Display total match count in the minibuffer prompt." - (when minibuffer-lazy-highlight--overlay - (overlay-put minibuffer-lazy-highlight--overlay - 'before-string - (and isearch-lazy-count-total - (not isearch-error) - (format minibuffer-lazy-count-format - isearch-lazy-count-total))))) - -(defun minibuffer-lazy-highlight--after-change (_beg _end _len) - "Update lazy highlight state in minibuffer selected window." - (when isearch-lazy-highlight - (let ((inhibit-redisplay t) ;; Avoid cursor flickering - (string (minibuffer-contents))) - (with-minibuffer-selected-window - (setq isearch-string (funcall minibuffer-lazy-highlight-transform string)) - (isearch-lazy-highlight-new-loop))))) - -(defun minibuffer-lazy-highlight--exit () - "Unwind changes from `minibuffer-lazy-highlight-setup'." - (remove-hook 'after-change-functions - #'minibuffer-lazy-highlight--after-change) - (remove-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) - (remove-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) - (setq minibuffer-lazy-highlight--overlay nil) - (when lazy-highlight-cleanup - (lazy-highlight-cleanup))) - -(defun minibuffer-lazy-highlight-setup () +(cl-defun minibuffer-lazy-highlight-setup (&key (highlight isearch-lazy-highlight) + (cleanup lazy-highlight-cleanup) + (transform #'identity) + (filter nil) + (regexp isearch-regexp) + (regexp-function isearch-regexp-function) + (case-fold isearch-case-fold-search) + (lax-whitespace (if regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace))) "Set up minibuffer for lazy highlight of matches in the original window. -This function is intended to be added to `minibuffer-setup-hook'. -Note that several other isearch variables influence the lazy -highlighting, including `isearch-regexp', -`isearch-lazy-highlight' and `isearch-lazy-count'." - (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) - (add-hook 'after-change-functions - #'minibuffer-lazy-highlight--after-change) - (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) - (add-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) - (setq minibuffer-lazy-highlight--overlay - (and minibuffer-lazy-count-format - (make-overlay (point-min) (point-min) (current-buffer) t))) - (minibuffer-lazy-highlight--after-change nil nil nil)) +This function return a closure intended to be added to +`minibuffer-setup-hook'. It accepts the following keyword +arguments, all of which have a default based on the current +isearch settings: + +HIGHLIGHT: Whether to perform lazy highlight. +CLEANUP: Whether to clean up the lazy highlight when the minibuffer +exits. +TRANSFORM: A function to transform the minibuffer contents into a +search string. +FILTER: A function to add to `isearch-filter-predicate'. +REGEXP: The value of `isearch-regexp' to use for lazy highlight. +REGEXP-FUNCTION: The value of `isearch-regexp-function' to use for +lazy highlight. +CASE-FOLD: The value of `isearch-case-fold' to use for lazy highlight. +LAX-WHITESPACE: The value of `isearch-(regexp-)lax-whitespace' to use +for lazy highlight." + (if (not highlight) + #'ignore + (let ((unwind (make-symbol "minibuffer-lazy-highlight--unwind")) + (after-change (make-symbol "minibuffer-lazy-highlight--after-change")) + (display-count (make-symbol "minibuffer-lazy-highlight--display-count")) + overlay) + (fset unwind + (lambda () + (remove-hook 'minibuffer-exit-hook unwind) + (remove-hook 'after-change-functions after-change) + (remove-hook 'lazy-count-update-hook display-count) + (remove-function isearch-filter-predicate filter) + (when cleanup (lazy-highlight-cleanup)))) + (fset after-change + (lambda (_beg _end _len) + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (let* ((isearch-forward t) + (isearch-regexp regexp) + (isearch-regexp-function regexp-function) + (isearch-case-fold-search case-fold) + (isearch-lax-whitespace lax-whitespace) + (isearch-regexp-lax-whitespace lax-whitespace) + (isearch-string (funcall transform string))) + (isearch-lazy-highlight-new-loop)))))) + (fset display-count + (lambda () + (overlay-put overlay 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format minibuffer-lazy-count-format + isearch-lazy-count-total))))) + (lambda () + (add-hook 'minibuffer-exit-hook unwind) + (add-hook 'after-change-functions after-change) + (when filter + (add-function :after-while isearch-filter-predicate filter)) + (when minibuffer-lazy-count-format + (setq overlay (make-overlay (point-min) (point-min) (current-buffer) t)) + (add-hook 'lazy-count-update-hook display-count)) + (funcall after-change nil nil nil))))) (defun isearch-resume (string regexp word forward message case-fold) diff --git a/lisp/replace.el b/lisp/replace.el index e6f565d802..fed4dfd457 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -352,8 +352,15 @@ query-replace-read-to (query-replace-compile-replacement (save-excursion (let* ((history-add-new-input nil) + (count (if (and query-replace-lazy-highlight + minibuffer-lazy-count-format + isearch-lazy-count + isearch-lazy-count-total) + (format minibuffer-lazy-count-format + isearch-lazy-count-total) + "")) (to (read-from-minibuffer - (format "%s %s with: " prompt (query-replace-descr from)) + (format "%s%s %s with: " count prompt (query-replace-descr from)) nil nil nil query-replace-to-history-variable from t))) (add-to-history query-replace-to-history-variable to nil t) @@ -365,11 +372,29 @@ query-replace-read-args (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion - (let* ((from (query-replace-read-from prompt regexp-flag)) + (let* ((delimited-flag (and current-prefix-arg + (not (eq current-prefix-arg '-)))) + (from (minibuffer-with-setup-hook + (minibuffer-lazy-highlight-setup + :case-fold case-fold-search + :filter (when (use-region-p) + (replace--region-filter + (funcall region-extract-function 'bounds))) + :highlight query-replace-lazy-highlight + :regexp regexp-flag + :regexp-function (replace-regexp-function delimited-flag regexp-flag) + :transform (lambda (string) + (let* ((split (query-replace--split-string string)) + (from-string (if (consp split) (car split) split))) + (when (and case-fold-search search-upper-case) + (setq isearch-case-fold-search + (isearch-no-upper-case-p from-string regexp-flag))) + from-string))) + (query-replace-read-from prompt regexp-flag))) (to (if (consp from) (prog1 (cdr from) (setq from (car from))) (query-replace-read-to from prompt regexp-flag)))) (list from to - (or (and current-prefix-arg (not (eq current-prefix-arg '-))) + (or delimited-flag (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) (get-text-property 0 'isearch-regexp-function from))) (and current-prefix-arg (eq current-prefix-arg '-)))))) @@ -2656,6 +2681,13 @@ replace-regexp-function is not to be interpreted literally, but instead should be converted to a regexp that is actually used for the search.") +(defun replace-regexp-function (delimited-flag regexp-flag) + (or replace-regexp-function + delimited-flag + (and replace-char-fold + (not regexp-flag) + #'char-fold-to-regexp))) + (defun replace-search (search-string limit regexp-flag delimited-flag case-fold &optional backward) "Search for the next occurrence of SEARCH-STRING to replace." @@ -2778,6 +2810,26 @@ replace--push-stack ,search-str ,next-replace) ,stack)) +(defun replace--region-filter (bounds) + "Return a function that decides if a region is inside BOUNDS. +BOUNDS is a list of cons cells of the form (START . END). The +returned function takes as argument two buffer positions, START +and END." + (let ((region-bounds + (mapcar (lambda (position) + (cons (copy-marker (car position)) + (copy-marker (cdr position)))) + bounds))) + (lambda (start end) + (delq nil (mapcar + (lambda (bounds) + (and + (>= start (car bounds)) + (<= start (cdr bounds)) + (>= end (car bounds)) + (<= end (cdr bounds)))) + region-bounds))))) + (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p) @@ -2862,22 +2914,9 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - (funcall region-extract-function 'bounds)))) - (setq region-filter - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds)))) - (add-function :after-while isearch-filter-predicate region-filter))) + (setq region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (add-function :after-while isearch-filter-predicate region-filter)) ;; If region is active, in Transient Mark mode, operate on region. (if backward -- 2.35.1 --=-=-= Content-Type: text/plain >>> Please also note that condition-case can be replaced by >>> a hook in minibuffer-exit-hook that can remove highlighting >>> after exiting the minibuffer. >> >> If it was a `unwind-protect', I would agree. But I don't know how to >> simulate a `condition-case'. Specifically, how can we determine if some >> hook (the minibuffer-exit-hook in this case) is being run "normally" or >> as part of the recovery from a signaled error? > > Shouldn't both cases clean up highlight from the buffer? > Then I see no need to distinguish each case. Or if really needed, > you can try to bind the cleanup to command-error-function. My previous patch had only one case: if the user quits, we clean up the highlighting. I can only see one simpler alternative, which is to always unconditionally clean up the highlight. This is not as nice, but if keeping the code as simple as possible is important here, then I guess this is the way forward. So that's what the current patch does. I suspect people will see this as a bug, but maybe discussing this issue by itself later will be easier. >>> Alternatively, the same lambda above could be added to >>> >>> (add-hook 'minibuffer-setup-hook (lambda () ...)) >> >> Why was it again that we want to avoid saying something like this? >> >> (let ((case-fold-search whatever) >> (isearch-regexp regexp-flag)) >> (minibuffer-with-setup-hook #'minibuffer-lazy-highlight-init >> (query-replace-read-from prompt regexp-flag))) > > 4 lines look nice, unlike 20 lines in one of your patches ;-) When you add all the bells and whistles, 4 lines just won't do it. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 08 03:49:45 2022 Received: (at 53126) by debbugs.gnu.org; 8 Apr 2022 07:49:45 +0000 Received: from localhost ([127.0.0.1]:33848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncjNI-00018V-SN for submit@debbugs.gnu.org; Fri, 08 Apr 2022 03:49:45 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:44637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncjNH-00018I-6S for 53126@debbugs.gnu.org; Fri, 08 Apr 2022 03:49:43 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 28C67100017; Fri, 8 Apr 2022 07:49:35 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> <87bkxfeb8j.fsf@gmail.com> <86wng3laj3.fsf@mail.linkov.net> <87r168g056.fsf@gmail.com> Date: Fri, 08 Apr 2022 10:32:41 +0300 In-Reply-To: <87r168g056.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 07 Apr 2022 21:32:21 +0200") Message-ID: <86fsmohwe6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) >> Looks good. > > Okay, I've refactored my code like this. I actually like it better that > way. (As a downside, the stuff that was already merged to isearch.el is > completely changed.) Thanks, now it looks much better! In `isearch-edit-string' you replaced: (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) with (minibuffer-with-setup-hook (minibuffer-lazy-highlight-setup) but the docstring of `minibuffer-lazy-highlight-setup' in your patch is: This function return a closure intended to be added to `minibuffer-setup-hook'. Maybe either a typo that needs to mention `minibuffer-with-setup-hook', or `minibuffer-setup-hook' needs to evaluate such closure with something like (add-hook 'minibuffer-setup-hook (funcall 'minibuffer-lazy-highlight-setup)) But since this is more ugly, then using `minibuffer-with-setup-hook' is fine. >> Shouldn't both cases clean up highlight from the buffer? >> Then I see no need to distinguish each case. Or if really needed, >> you can try to bind the cleanup to command-error-function. > > My previous patch had only one case: if the user quits, we clean up the > highlighting. > > I can only see one simpler alternative, which is to always > unconditionally clean up the highlight. This is not as nice, but if > keeping the code as simple as possible is important here, then I guess > this is the way forward. So that's what the current patch does. > > I suspect people will see this as a bug, but maybe discussing this issue > by itself later will be easier. Yep, let's do this later when people will ask for it. >> 4 lines look nice, unlike 20 lines in one of your patches ;-) > > When you add all the bells and whistles, 4 lines just won't do it. Now the parameters of minibuffer-lazy-highlight-setup look nice, so line count doesn't matter when code keeps simplicity. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 08 03:53:54 2022 Received: (at 53126) by debbugs.gnu.org; 8 Apr 2022 07:53:54 +0000 Received: from localhost ([127.0.0.1]:33855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncjRK-0001EY-L0 for submit@debbugs.gnu.org; Fri, 08 Apr 2022 03:53:54 -0400 Received: from mail-ej1-f52.google.com ([209.85.218.52]:42800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncjRH-0001EL-M7 for 53126@debbugs.gnu.org; Fri, 08 Apr 2022 03:53:53 -0400 Received: by mail-ej1-f52.google.com with SMTP id i27so15644518ejd.9 for <53126@debbugs.gnu.org>; Fri, 08 Apr 2022 00:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bBU9ZB2BXsiUwrdlW/x1QZKhshs7FzEO12Vjd9fH2G4=; b=aDhtTeW9AOC/AmtlpiPWi+adXFdRaH7kGbDvfFkLGyNmund6Yk9DCjboyISANzT+d2 N1BFLnYnBcTFhGTKKzUqFVTigzoefgT6Akd7Y6UJ6UAFub1O4YICacKDeiNshspnS2H2 G5TszAyhEctZca28ba0o8zHkobxNAKfkj3CFsvziRY2/Hv2FZmkPCPsvCdv4PYrFB/qb vhPiJK+HPDPgZhN1BwqXmXv9K2QLHuALZCHu8GgRm+1xX7KtT1yMS4McU7cj1/4q6CPb p1tKMGpdacDSLgKxQawWScFXbMZ9Lyd8SGAoHTAaBNNd14tNjl6NKmC/6Yd1xvJO3ZfQ yl2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bBU9ZB2BXsiUwrdlW/x1QZKhshs7FzEO12Vjd9fH2G4=; b=ZbwZ91ZWUba+0Znf83HPvsUkZiSw5zxb7tVrz+MDSv5WUp3CVgsthmtgpPKUaHyrGS XWQ03rbwS8QEKWzsIRaiIvouqX8clphwmV98Qb/LCejKljI1IY1AF3DG2/WghUze3w8P DLcgbu84Lm3wxUVF55mT1xuTGIGyVGrx3z1vNgWut4JqMWafs/70MvQ3m09BDOoYttud 0v8CoHJfPSRknPVTh8stkUrnPhssO4pHb9FkBsHqWU4AuEXWKSbzgpa1/SjBOJ4HEUSw MaaBAj1AJPxsuFr3VSKb5u2uZfJai9XyHgZvBJcOsCXfxdfkILb2Ht2+sj9ptgLzktDI y6LA== X-Gm-Message-State: AOAM530Jy1y4o/Hg1nAgp/EuQ9Zg8CXlt2POHgM0EF62yycusps/J8Yh t8XD/bMV7kGqSN7Ug5fLxuwZ7B4GIgE= X-Google-Smtp-Source: ABdhPJxxdd20wtwn1ww4hMO10iN8oDPKyLrUetNZHogvzUQDjX/6hg/v1M9BMgIuVIMXAcvU7pNspg== X-Received: by 2002:a17:907:a411:b0:6e1:2084:99d2 with SMTP id sg17-20020a170907a41100b006e1208499d2mr318487ejc.639.1649404423823; Fri, 08 Apr 2022 00:53:43 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id u3-20020a17090657c300b006d01de78926sm8387245ejr.22.2022.04.08.00.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 00:53:43 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> <87bkxfeb8j.fsf@gmail.com> <86wng3laj3.fsf@mail.linkov.net> <87r168g056.fsf@gmail.com> <86fsmohwe6.fsf@mail.linkov.net> Date: Fri, 08 Apr 2022 09:53:42 +0200 In-Reply-To: <86fsmohwe6.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 08 Apr 2022 10:32:41 +0300") Message-ID: <878rsgqad5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) On Fri, 8 Apr 2022 at 10:32, Juri Linkov wrote: >>> Looks good. >> >> Okay, I've refactored my code like this. I actually like it better that >> way. (As a downside, the stuff that was already merged to isearch.el is >> completely changed.) > > Thanks, now it looks much better! Great, then I'll test it some more and prepare properly formatted patches. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 09 07:06:37 2022 Received: (at 53126) by debbugs.gnu.org; 9 Apr 2022 11:06:37 +0000 Received: from localhost ([127.0.0.1]:36821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd8vM-00011g-Bb for submit@debbugs.gnu.org; Sat, 09 Apr 2022 07:06:37 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:40520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nd8vJ-00011T-K4 for 53126@debbugs.gnu.org; Sat, 09 Apr 2022 07:06:34 -0400 Received: by mail-ed1-f49.google.com with SMTP id q26so12671623edc.7 for <53126@debbugs.gnu.org>; Sat, 09 Apr 2022 04:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=uPutWSFQ3aPBEZfdU2zxt92lXpXb6DN7T0Uk+gEnlbw=; b=b0T4sZaCyo9djbkh8gW2KSpRKsTStu+vJLmQy9A7R785flLPMb/je1eu6TLq7OHVxv lGKl/T5IfqI4WNxSgv5E4XvK1veFZDh8E9novJ5Rezj7vUfWbCnrLRBVsDz7vJ79rTWe bU9htZVJkFL3z78pV0ehhtsTWQTkeW9AkiA/D57tIFgmwkA17lEG03weuStGZDumj6VI vm4Gbw5816tlW/oD/4cEDKmuZKH+LWqvB5Ts/+gLvTFhduGSkW+iK5XLuII6LSBecO/D RfJk0ws9yXiKczLwvz9pOh5EOM5Wxrr5RQ7F9k4EGFsn3rJKwGhKexJ9cVzwQyKvTHX/ TeUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=uPutWSFQ3aPBEZfdU2zxt92lXpXb6DN7T0Uk+gEnlbw=; b=rmL7iYf+VxOlR+QTc54BpBFNCzicZkfDp6yDQOZ8M5kRssHpcW1r7YZVbZW2gGERMQ eDCB8PBIISR+uYn4zzQ9UjYAysAtiG7Et1O84jE34az1ve2+9YJ9gX2Ue3w0Uq7IDcJk W9+PNKelezsI1QM+dOkHx/JzJq7CtHnrCYym4Hh/pIB9FtEMbGQ7q2CcoJZe8jebZVYx xYe93ZJdNx714fm36+ZmgrEmyVej3rnF1ljxOISGimmFw/RgP2K3p/EhMxXDZfQjBuUB QCK1ahB7fXirqHBQC3FQl8aO38z6mSwSkOjiPPJuzZ73bAy6OEenp088dA5O18xBAyfr RDDA== X-Gm-Message-State: AOAM533F8c8c6D0K02aK3J2p/re3IWzEqI17NpQQ5f6NyK72FqD5DlzX ssfbCkIHtm1iWhF3P3r51+0o9pGF00Y= X-Google-Smtp-Source: ABdhPJweGRSE2kKIktQsN3TC9BZMZUTTkrLqERvZL2zrZ0eQDGwgFBrG1okycis8kb+SAW86oXQwBg== X-Received: by 2002:aa7:c948:0:b0:413:2bed:e82e with SMTP id h8-20020aa7c948000000b004132bede82emr23684520edt.394.1649502387335; Sat, 09 Apr 2022 04:06:27 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id p9-20020a50c949000000b0041d180b8beesm2292625edh.48.2022.04.09.04.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 04:06:26 -0700 (PDT) From: Augusto Stoffel To: Juri Linkov Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. References: <87sftyweb2.fsf@gmail.com> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> <87bkxfeb8j.fsf@gmail.com> <86wng3laj3.fsf@mail.linkov.net> <87r168g056.fsf@gmail.com> <86fsmohwe6.fsf@mail.linkov.net> Date: Sat, 09 Apr 2022 13:06:25 +0200 In-Reply-To: <86fsmohwe6.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 08 Apr 2022 10:32:41 +0300") Message-ID: <877d7yqzwu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain On Fri, 8 Apr 2022 at 10:32, Juri Linkov wrote: >>> Looks good. >> >> Okay, I've refactored my code like this. I actually like it better that >> way. (As a downside, the stuff that was already merged to isearch.el is >> completely changed.) > > Thanks, now it looks much better! Please find attached the patches. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Rewrite-the-minibuffer-lazy-highlight-feature.patch >From 5ed0e5a850992c62189c0dc74ef98b892522d4df Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 9 Apr 2022 12:38:14 +0200 Subject: [PATCH 1/2] Rewrite the minibuffer lazy highlight feature The new API was discussed in bug#53126. It's more robust and easier to use in complex cases like that of 'query-replace'. * etc/NEWS: Amend the feature announcement * lisp/isearch.el (isearch-edit-string): Use new API. (minibuffer-lazy-highlight-transform, minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count, minibuffer-lazy-highlight--after-change, minibuffer-lazy-highlight--exit) Remove helper functions, which are now kept together with the lazy highlight configuration variables within a closure. (minibuffer-lazy-highlight-setup): This function now takes the lazy highlighting configuration variables as argument, and returns a closure that is intended to run as part of the minibuffer setup. --- etc/NEWS | 5 +- lisp/isearch.el | 148 ++++++++++++++++++++++++++++-------------------- 2 files changed, 88 insertions(+), 65 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2fac893cc5..2cddfcc8db 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1593,9 +1593,8 @@ the clipboard, and insert it into the buffer. --- ** New function 'minibuffer-lazy-highlight-setup'. -This function is intended to be added to 'minibuffer-setup-hook'. -It sets up the minibuffer for lazy highlighting of matches -in the original window. +This function allows to set up the minibuffer so that lazy +highlighting of its content is applied in the original window. +++ ** New text property 'inhibit-isearch'. diff --git a/lisp/isearch.el b/lisp/isearch.el index 956b115ce4..168d71ada3 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1812,20 +1812,20 @@ isearch-edit-string (minibuffer-history-symbol) ;; Search string might have meta information on text properties. (minibuffer-allow-text-properties t)) - (when isearch-lazy-highlight - (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup)) (setq isearch-new-string - (read-from-minibuffer - (isearch-message-prefix nil isearch-nonincremental) - (cons isearch-string (1+ (or (isearch-fail-pos) - (length isearch-string)))) - minibuffer-local-isearch-map nil - (if isearch-regexp - (cons 'regexp-search-ring - (1+ (or regexp-search-ring-yank-pointer -1))) - (cons 'search-ring - (1+ (or search-ring-yank-pointer -1)))) - nil t) + (minibuffer-with-setup-hook + (minibuffer-lazy-highlight-setup) + (read-from-minibuffer + (isearch-message-prefix nil isearch-nonincremental) + (cons isearch-string (1+ (or (isearch-fail-pos) + (length isearch-string)))) + minibuffer-local-isearch-map nil + (if isearch-regexp + (cons 'regexp-search-ring + (1+ (or regexp-search-ring-yank-pointer -1))) + (cons 'search-ring + (1+ (or search-ring-yank-pointer -1)))) + nil t)) isearch-new-message (mapconcat 'isearch-text-char-description isearch-new-string ""))))) @@ -4361,57 +4361,81 @@ minibuffer-lazy-count-format :group 'lazy-count :version "29.1") -(defvar minibuffer-lazy-highlight-transform #'identity - "Function to transform minibuffer text into a `isearch-string' for highlighting.") - -(defvar minibuffer-lazy-highlight--overlay nil - "Overlay for minibuffer prompt updates.") - -(defun minibuffer-lazy-highlight--count () - "Display total match count in the minibuffer prompt." - (when minibuffer-lazy-highlight--overlay - (overlay-put minibuffer-lazy-highlight--overlay - 'before-string - (and isearch-lazy-count-total - (not isearch-error) - (format minibuffer-lazy-count-format - isearch-lazy-count-total))))) - -(defun minibuffer-lazy-highlight--after-change (_beg _end _len) - "Update lazy highlight state in minibuffer selected window." - (when isearch-lazy-highlight - (let ((inhibit-redisplay t) ;; Avoid cursor flickering - (string (minibuffer-contents))) - (with-minibuffer-selected-window - (setq isearch-string (funcall minibuffer-lazy-highlight-transform string)) - (isearch-lazy-highlight-new-loop))))) - -(defun minibuffer-lazy-highlight--exit () - "Unwind changes from `minibuffer-lazy-highlight-setup'." - (remove-hook 'after-change-functions - #'minibuffer-lazy-highlight--after-change) - (remove-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) - (remove-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) - (setq minibuffer-lazy-highlight--overlay nil) - (when lazy-highlight-cleanup - (lazy-highlight-cleanup))) - -(defun minibuffer-lazy-highlight-setup () +(cl-defun minibuffer-lazy-highlight-setup + (&key (highlight isearch-lazy-highlight) + (cleanup lazy-highlight-cleanup) + (transform #'identity) + (filter nil) + (regexp isearch-regexp) + (regexp-function isearch-regexp-function) + (case-fold isearch-case-fold-search) + (lax-whitespace (if regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace))) "Set up minibuffer for lazy highlight of matches in the original window. -This function is intended to be added to `minibuffer-setup-hook'. -Note that several other isearch variables influence the lazy -highlighting, including `isearch-regexp', -`isearch-lazy-highlight' and `isearch-lazy-count'." - (remove-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) - (add-hook 'after-change-functions - #'minibuffer-lazy-highlight--after-change) - (add-hook 'lazy-count-update-hook #'minibuffer-lazy-highlight--count) - (add-hook 'minibuffer-exit-hook #'minibuffer-lazy-highlight--exit) - (setq minibuffer-lazy-highlight--overlay - (and minibuffer-lazy-count-format - (make-overlay (point-min) (point-min) (current-buffer) t))) - (minibuffer-lazy-highlight--after-change nil nil nil)) +This function return a closure intended to be added to +`minibuffer-setup-hook'. It accepts the following keyword +arguments, all of which have a default based on the current +isearch settings. + +HIGHLIGHT: Whether to perform lazy highlight. +CLEANUP: Whether to clean up the lazy highlight when the minibuffer +exits. +TRANSFORM: A function taking one argument, the minibuffer contents, +and returning the `isearch-string' to use for lazy highlighting. +FILTER: A function to add to `isearch-filter-predicate'. +REGEXP: The value of `isearch-regexp' to use for lazy highlighting. +REGEXP-FUNCTION: The value of `isearch-regexp-function' to use for +lazy highlighting. +CASE-FOLD: The value of `isearch-case-fold' to use for lazy +highlighting. +LAX-WHITESPACE: The value of `isearch-lax-whitespace' and +`isearch-regexp-lax-whitespace' to use for lazy highlighting." + (if (not highlight) + #'ignore + (let ((unwind (make-symbol "minibuffer-lazy-highlight--unwind")) + (after-change (make-symbol "minibuffer-lazy-highlight--after-change")) + (display-count (make-symbol "minibuffer-lazy-highlight--display-count")) + overlay) + (fset unwind + (lambda () + (remove-function isearch-filter-predicate filter) + (remove-hook 'lazy-count-update-hook display-count) + (when overlay (delete-overlay overlay)) + (remove-hook 'after-change-functions after-change) + (remove-hook 'minibuffer-exit-hook unwind) + (let ((lazy-highlight-cleanup cleanup)) + (lazy-highlight-cleanup)))) + (fset after-change + (lambda (_beg _end _len) + (let ((inhibit-redisplay t) ;; Avoid cursor flickering + (string (minibuffer-contents))) + (with-minibuffer-selected-window + (let* ((isearch-forward t) + (isearch-regexp regexp) + (isearch-regexp-function regexp-function) + (isearch-case-fold-search case-fold) + (isearch-lax-whitespace lax-whitespace) + (isearch-regexp-lax-whitespace lax-whitespace) + (isearch-string (funcall transform string))) + (isearch-lazy-highlight-new-loop)))))) + (fset display-count + (lambda () + (overlay-put overlay 'before-string + (and isearch-lazy-count-total + (not isearch-error) + (format minibuffer-lazy-count-format + isearch-lazy-count-total))))) + (lambda () + (add-hook 'minibuffer-exit-hook unwind) + (add-hook 'after-change-functions after-change) + (when minibuffer-lazy-count-format + (setq overlay (make-overlay (point-min) (point-min) (current-buffer) t)) + (add-hook 'lazy-count-update-hook display-count)) + (when filter + (add-function :after-while isearch-filter-predicate filter)) + (funcall after-change nil nil nil))))) (defun isearch-resume (string regexp word forward message case-fold) -- 2.35.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Add-lazy-highlight-when-reading-query-replace-argume.patch >From 432fcd0172a538713d85e3d4a64c2586ae1a9a5b Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 9 Apr 2022 12:47:28 +0200 Subject: [PATCH 2/2] Add lazy highlight when reading 'query-replace' arguments * lisp/replace.el (query-replace-read-args): Use 'minibuffer-lazy-highlight-setup' to highlight the text to be replaced in the original buffer (and a match count, if applicable). (replace--region-filter): New function for code that used to be inlined in perform-replace but is useful elsewhere. (perform-replace): Use 'replace--region-filter'. --- lisp/replace.el | 65 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index e6f565d802..00d30d1e38 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -365,11 +365,33 @@ query-replace-read-args (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion - (let* ((from (query-replace-read-from prompt regexp-flag)) + (let* ((delimited-flag (and current-prefix-arg + (not (eq current-prefix-arg '-)))) + (from (minibuffer-with-setup-hook + (minibuffer-lazy-highlight-setup + :case-fold case-fold-search + :filter (when (use-region-p) + (replace--region-filter + (funcall region-extract-function 'bounds))) + :highlight query-replace-lazy-highlight + :regexp regexp-flag + :regexp-function (or replace-regexp-function + delimited-flag + (and replace-char-fold + (not regexp-flag) + #'char-fold-to-regexp)) + :transform (lambda (string) + (let* ((split (query-replace--split-string string)) + (from-string (if (consp split) (car split) split))) + (when (and case-fold-search search-upper-case) + (setq isearch-case-fold-search + (isearch-no-upper-case-p from-string regexp-flag))) + from-string))) + (query-replace-read-from prompt regexp-flag))) (to (if (consp from) (prog1 (cdr from) (setq from (car from))) (query-replace-read-to from prompt regexp-flag)))) (list from to - (or (and current-prefix-arg (not (eq current-prefix-arg '-))) + (or delimited-flag (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) (get-text-property 0 'isearch-regexp-function from))) (and current-prefix-arg (eq current-prefix-arg '-)))))) @@ -2778,6 +2800,26 @@ replace--push-stack ,search-str ,next-replace) ,stack)) +(defun replace--region-filter (bounds) + "Return a function that decides if a region is inside BOUNDS. +BOUNDS is a list of cons cells of the form (START . END). The +returned function takes as argument two buffer positions, START +and END." + (let ((region-bounds + (mapcar (lambda (position) + (cons (copy-marker (car position)) + (copy-marker (cdr position)))) + bounds))) + (lambda (start end) + (delq nil (mapcar + (lambda (bounds) + (and + (>= start (car bounds)) + (<= start (cdr bounds)) + (>= end (car bounds)) + (<= end (cdr bounds)))) + region-bounds))))) + (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p) @@ -2862,22 +2904,9 @@ perform-replace ;; Unless a single contiguous chunk is selected, operate on multiple chunks. (when region-noncontiguous-p - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - (funcall region-extract-function 'bounds)))) - (setq region-filter - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds)))) - (add-function :after-while isearch-filter-predicate region-filter))) + (setq region-filter (replace--region-filter + (funcall region-extract-function 'bounds))) + (add-function :after-while isearch-filter-predicate region-filter)) ;; If region is active, in Transient Mark mode, operate on region. (if backward -- 2.35.1 --=-=-= Content-Type: text/plain > In `isearch-edit-string' you replaced: > (add-hook 'minibuffer-setup-hook #'minibuffer-lazy-highlight-setup) > with > (minibuffer-with-setup-hook (minibuffer-lazy-highlight-setup) > but the docstring of `minibuffer-lazy-highlight-setup' in your patch is: > > This function return a closure intended to be added to > `minibuffer-setup-hook'. > > Maybe either a typo that needs to mention `minibuffer-with-setup-hook', > or `minibuffer-setup-hook' needs to evaluate such closure with something like > > (add-hook 'minibuffer-setup-hook (funcall 'minibuffer-lazy-highlight-setup)) > > But since this is more ugly, then using `minibuffer-with-setup-hook' is fine. > Well, as a matter of fact the closure is meant to run in the 'minibuffer-setup-hook'. This is not to say it's a good idea to use 'add-hook' to do add it there. One should always use 'minibuffer-with-setup-hook' for that kind of stuff, I guess. Feel free to copy edit the docstring, but in light of the above I didn't change it for now. >>> Shouldn't both cases clean up highlight from the buffer? >>> Then I see no need to distinguish each case. Or if really needed, >>> you can try to bind the cleanup to command-error-function. >> >> My previous patch had only one case: if the user quits, we clean up the >> highlighting. >> >> I can only see one simpler alternative, which is to always >> unconditionally clean up the highlight. This is not as nice, but if >> keeping the code as simple as possible is important here, then I guess >> this is the way forward. So that's what the current patch does. >> >> I suspect people will see this as a bug, but maybe discussing this issue >> by itself later will be easier. > > Yep, let's do this later when people will ask for it. All right, I've removed all the "clever business" related to delayed clean up of the lazy highlight for now. >>> 4 lines look nice, unlike 20 lines in one of your patches ;-) >> >> When you add all the bells and whistles, 4 lines just won't do it. > > Now the parameters of minibuffer-lazy-highlight-setup look nice, > so line count doesn't matter when code keeps simplicity. So, my sample code from the previous message defined a function for this snippet which already repeats 3 times (or replace-regexp-function delimited-flag (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp)) I've removed that function for now. We can reintroduce the function if you deem it helpful. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 10 15:39:10 2022 Received: (at 53126) by debbugs.gnu.org; 10 Apr 2022 19:39:10 +0000 Received: from localhost ([127.0.0.1]:41566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nddOw-0006n0-BA for submit@debbugs.gnu.org; Sun, 10 Apr 2022 15:39:10 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:53593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nddOv-0006mg-4J; Sun, 10 Apr 2022 15:39:09 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 32EE81C0002; Sun, 10 Apr 2022 19:38:59 +0000 (UTC) From: Juri Linkov To: Augusto Stoffel Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Organization: LINKOV.NET References: <87sftyweb2.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.fsf@gmail.com> <86y20vu9c6.fsf@mail.linkov.net> <875ynt41g9.fsf@gmail.com> <86pmm1azkd.fsf@mail.linkov.net> <87a6d43c6n.fsf@gmail.com> <86r16fz6bw.fsf@mail.linkov.net> <87o81i5zzn.fsf@gmail.com> <86v8vo6c2k.fsf@mail.linkov.net> <87bkxfeb8j.fsf@gmail.com> <86wng3laj3.fsf@mail.linkov.net> <87r168g056.fsf@gmail.com> <86fsmohwe6.fsf@mail.linkov.net> <877d7yqzwu.fsf@gmail.com> Date: Sun, 10 Apr 2022 22:38:19 +0300 In-Reply-To: <877d7yqzwu.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 09 Apr 2022 13:06:25 +0200") Message-ID: <861qy4bufo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53126 Cc: 53126@debbugs.gnu.org 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 (-) close 53126 29.0.50 thanks > Please find attached the patches. Thanks for working on this feature. Now your patch provides a quote elegant code with an easy-to-use function with simple parameters. So now pushed to master. >> Yep, let's do this later when people will ask for it. > > All right, I've removed all the "clever business" related to delayed > clean up of the lazy highlight for now. Please create a new request when you want to add more features. From unknown Tue Jun 17 21:53:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 09 May 2022 11:24:05 +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