From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 18:04:43 2014 Received: (at submit) by debbugs.gnu.org; 10 Aug 2014 22:04:43 +0000 Received: from localhost ([127.0.0.1]:38080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGbEI-0008KZ-LD for submit@debbugs.gnu.org; Sun, 10 Aug 2014 18:04:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38494) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGbEG-0008KL-IV for submit@debbugs.gnu.org; Sun, 10 Aug 2014 18:04:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGbE4-00019h-E0 for submit@debbugs.gnu.org; Sun, 10 Aug 2014 18:04:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGbE4-00019c-Az for submit@debbugs.gnu.org; Sun, 10 Aug 2014 18:04:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGbDy-00083H-9n for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2014 18:04:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGbDs-00018r-Dq for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2014 18:04:22 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:37249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGbDs-00018k-8D for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2014 18:04:16 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by gateway1.nyi.internal (Postfix) with ESMTP id 7F7102258C for ; Sun, 10 Aug 2014 18:04:13 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Sun, 10 Aug 2014 18:04:13 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=sygkUx8r03Frdep/q9Cl/sOz2rk=; b=XhHYLuS2d49mpsmyJQXNQ 9RGPCmE/wC2Bndw5lyQ/JC44NAnl6zgf0qeQX/4Vo2Pm6cqoHnqYGO0m/GmwivXY cimdr/Ij0vHIaTKaq/ZiVXVshZyb/OVX3DUTXq2Iq9VUPNpAmPHTsuQUwHtqhdnv NnLmf4hRjov3Bv61u2Vl3Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=sygkUx8r03Frdep/q9Cl/s Oz2rk=; b=sNxdyCdItM3c747hAzHWoL8YPdwC6kRdaOViKA235u690iOlRzCLDo h6zsZH+syX+ubRFBI9Mz3OPhr/ItEoDx1AqEI04euZ4lQDPSDEWoWuo2DDm6cNnR BmMd4foCpc/fKiVxWjKxHqvVl9oztp4aa+yOqFkQuyybER0VlFb4o= X-Sasl-enc: gG9FQKezS/UnAVF/lJBBPJo5MGvn/yzZ6yG5NsA2zWBP 1407708253 Received: from shorty.local (unknown [23.243.199.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 3903AC007B0 for ; Sun, 10 Aug 2014 18:04:13 -0400 (EDT) Received: from ip6-localhost ([::1] helo=shorty.local) by shorty.local with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XGbDn-0008Ey-Qs for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2014 15:04:11 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch Date: Sun, 10 Aug 2014 15:04:11 -0700 Message-ID: <87sil4uhlw.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) --=-=-= Content-Type: text/plain Hi. Before this patch it was possible to 'M-s h r' during an isearch to highlight the regexp being sought. This patch adds similar functionality for matching lines with 'M-s h l'. This patch moves the previous 'M-s h r' isearch functionality into a macro, and then calls this macro separately for the regex and line cases. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-I-can-now-highlight-lines-matching-regexp-from-isear.patch >From ca3b5261d034b21467f781d7aa2620d0050fea37 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 10 Aug 2014 14:57:56 -0700 Subject: [PATCH] I can now highlight-lines-matching-regexp from isearch Before this patch it was possible to 'M-s h r' during an isearch to highlight the regexp being sought. This patch adds similar functionality for matching lines --- lisp/isearch.el | 79 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 20dabdc..710890c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -524,6 +524,7 @@ This is like `describe-bindings', but displays only Isearch keys." (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) (define-key map "\M-so" 'isearch-occur) (define-key map "\M-shr" 'isearch-highlight-regexp) + (define-key map "\M-shl" 'isearch-highlight-lines-matching-regexp) ;; The key translations defined in the C-x 8 prefix should add ;; characters to the search string. See iso-transl.el. @@ -732,6 +733,8 @@ Type \\[isearch-occur] to run `occur' that shows\ the last search string. Type \\[isearch-highlight-regexp] to run `highlight-regexp'\ that highlights the last search string. +Type \\[isearch-highlight-lines-matching-regexp] to run `highlight-lines-matching-regexp'\ + that highlights lines matching the last search string. Type \\[isearch-describe-bindings] to display all Isearch key bindings. Type \\[isearch-describe-key] to display documentation of Isearch key. @@ -1804,42 +1807,60 @@ characters in that string." (declare-function hi-lock-read-face-name "hi-lock" ()) + +(defmacro isearch--hi-lock (hi-lock-form) + "Backend for isearch-highlight-*. Does all the setup work, and +evaluates the given `hi-lock-form' to actually invoke the +highlighting function" + `(progn + (let ( + ;; Set `isearch-recursive-edit' to nil to prevent calling + ;; `exit-recursive-edit' in `isearch-done' that terminates + ;; the execution of this command when it is non-nil. + ;; We call `exit-recursive-edit' explicitly at the end below. + (isearch-recursive-edit nil)) + (isearch-done nil t) + (isearch-clean-overlays)) + (let ((regexp (cond ((functionp isearch-word) + (funcall isearch-word isearch-string)) + (isearch-word (word-search-regexp isearch-string)) + (isearch-regexp isearch-string) + ((if (and (eq isearch-case-fold-search t) + search-upper-case) + (isearch-no-upper-case-p + isearch-string isearch-regexp) + isearch-case-fold-search) + ;; Turn isearch-string into a case-insensitive + ;; regexp. + (mapconcat + (lambda (c) + (let ((s (string c))) + (if (string-match "[[:alpha:]]" s) + (format "[%s%s]" (upcase s) (downcase s)) + (regexp-quote s)))) + isearch-string "")) + (t (regexp-quote isearch-string))))) + (eval ,hi-lock-form)) + (and isearch-recursive-edit (exit-recursive-edit)))) + (defun isearch-highlight-regexp () "Run `highlight-regexp' with regexp from the current search string. It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp argument from the last search regexp or a quoted search string, and reads its face argument using `hi-lock-read-face-name'." (interactive) - (let ( - ;; Set `isearch-recursive-edit' to nil to prevent calling - ;; `exit-recursive-edit' in `isearch-done' that terminates - ;; the execution of this command when it is non-nil. - ;; We call `exit-recursive-edit' explicitly at the end below. - (isearch-recursive-edit nil)) - (isearch-done nil t) - (isearch-clean-overlays)) (require 'hi-lock nil t) - (let ((regexp (cond ((functionp isearch-word) - (funcall isearch-word isearch-string)) - (isearch-word (word-search-regexp isearch-string)) - (isearch-regexp isearch-string) - ((if (and (eq isearch-case-fold-search t) - search-upper-case) - (isearch-no-upper-case-p - isearch-string isearch-regexp) - isearch-case-fold-search) - ;; Turn isearch-string into a case-insensitive - ;; regexp. - (mapconcat - (lambda (c) - (let ((s (string c))) - (if (string-match "[[:alpha:]]" s) - (format "[%s%s]" (upcase s) (downcase s)) - (regexp-quote s)))) - isearch-string "")) - (t (regexp-quote isearch-string))))) - (hi-lock-face-buffer regexp (hi-lock-read-face-name))) - (and isearch-recursive-edit (exit-recursive-edit))) + (isearch--hi-lock (hi-lock-face-buffer regexp (hi-lock-read-face-name)))) + +(defun isearch-highlight-lines-matching-regexp () + "Run `highlight-lines-matching-regexp' with regexp from the +current search string. It exits Isearch mode and calls +`hi-lock-face-buffer' with its regexp argument from the last +search regexp or a quoted search string, and reads its face +argument using `hi-lock-read-face-name'." + (interactive) + (require 'hi-lock nil t) + (isearch--hi-lock (hi-lock-line-face-buffer regexp (hi-lock-read-face-name)))) (defun isearch-delete-char () -- 2.0.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 18:32:13 2019 Received: (at 18241) by debbugs.gnu.org; 25 Jun 2019 22:32:13 +0000 Received: from localhost ([127.0.0.1]:33778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hftz2-0007rn-Oz for submit@debbugs.gnu.org; Tue, 25 Jun 2019 18:32:12 -0400 Received: from quimby.gnus.org ([80.91.231.51]:57870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hftyy-0007rb-S4 for 18241@debbugs.gnu.org; Tue, 25 Jun 2019 18:32:09 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hftyt-00059I-91; Wed, 26 Jun 2019 00:32:05 +0200 From: Lars Ingebrigtsen To: Dima Kogan Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch References: <87sil4uhlw.fsf@secretsauce.net> Date: Wed, 26 Jun 2019 00:32:03 +0200 In-Reply-To: <87sil4uhlw.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 10 Aug 2014 15:04:11 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dima Kogan writes: > Before this patch it was possible to 'M-s h r' during an isearch to > highlight the regexp being sought. This patch adds similar functionality > for matching lines with 'M-s h l'. This patch moves t [...] 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: 0.0 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@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 (-) Dima Kogan writes: > Before this patch it was possible to 'M-s h r' during an isearch to > highlight the regexp being sought. This patch adds similar functionality > for matching lines with 'M-s h l'. This patch moves the previous 'M-s h > r' isearch functionality into a macro, and then calls this macro > separately for the regex and line cases. Hm... Is that a feature that would be used a lot? It's a somewhat awkward interface and keystroke, I think. But here's some comments on the code: > +(defmacro isearch--hi-lock (hi-lock-form) > + "Backend for isearch-highlight-*. Does all the setup work, and > +evaluates the given `hi-lock-form' to actually invoke the > +highlighting function" [...] > + (eval ,hi-lock-form)) I think this should be a function that should just take a function to call that takes the parameters required. And if this is something we want, it needs a NEWS entry and documentation updates. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 18:58:12 2019 Received: (at 18241) by debbugs.gnu.org; 25 Jun 2019 22:58:12 +0000 Received: from localhost ([127.0.0.1]:33808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfuOC-0000CV-5h for submit@debbugs.gnu.org; Tue, 25 Jun 2019 18:58:12 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:42077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfuO8-0000CC-F6 for 18241@debbugs.gnu.org; Tue, 25 Jun 2019 18:58:11 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 003F6218BB; Tue, 25 Jun 2019 18:58:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 25 Jun 2019 18:58:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm3; bh=5gR5cOCJq9l8OpfWATZUWATFqr PDeuOhjWFKg6QOwIo=; b=nWRwQdt2y6GCZkacbZN8E0zprlQbdoc2NieeqKyWZL 9NRasod0XPaJYX85IosPqN/DQR/ISMKsKPqD1a/tIiqs6Y026qDPIJS7azKTx3DB G9GjOh7sWXsrZJQGeAR1gBRVX7TsY1WsEkZVtQle6LLv0q+36rgJJYRmNPrE6Bal IfFl0lr70RQvqiiBo9leZ64noXiGOAdIE4B8m9gxYfW1LzCOJVCSKyffbSMb6KuH wglLe0iC7uKWJRRCIE1DqrA8FgB0gaOgCPBbfzcxffOuXIty5TfmJmWZSTPHwGnB wlZs2Gpu32Zk1gh6Q4uSnakm8v+d0cisfsxGcnYg0eoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=5gR5cO CJq9l8OpfWATZUWATFqrPDeuOhjWFKg6QOwIo=; b=sMRaY8Q+WGNAoULdVIy5jW t4Wk3iJ1oXmmRtcjMV2UYjh2emZrRT9fe70Ab7QbW8abtFHCGVHXxXNcMoPSv9xh oOZ1+6csECw4rcUcSSfVXx6HVNddFTtVgJx7DwiXF+i0DuEKnkkhhe9YXuEddORu uhdE3mJNr8WZZE1vpTqJHyK3SP0j4GEYK90hqU5b/8/PdFKDJjutVhznQLBEz0Bu BEXmeKtlHigHp0vXcKp5MSL8B6YiiA1wH7Uv5wXiuNXn4fLQYIasgd4SoUUtlkmy m8ngkWiqK8GOx/O5BWvJLeUU0bWlSiBJoLm83mjlRwMgIi423GbSvtLgzZPd1wCw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudehgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffujgffkfggtgesthdtredttdertdenucfhrhhomhepffhimhgrucfm ohhgrghnuceoughimhgrsehsvggtrhgvthhsrghutggvrdhnvghtqeenucfkphepvddtje drudehuddrvddvfedrudekleenucfrrghrrghmpehmrghilhhfrhhomhepughimhgrsehs vggtrhgvthhsrghutggvrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from shorty.local (nat-guest-189.vonkarman.net [207.151.223.189]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D0BB80059; Tue, 25 Jun 2019 18:58:02 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.90) (envelope-from ) id 1hfuO0-0001YZ-No; Tue, 25 Jun 2019 15:58:00 -0700 References: <87sil4uhlw.fsf@secretsauce.net> User-agent: mu4e 1.0; emacs 27.0.50 From: Dima Kogan To: Lars Ingebrigtsen Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch In-reply-to: Date: Tue, 25 Jun 2019 15:58:00 -0700 Message-ID: <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@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 (-) Lars Ingebrigtsen writes: > Dima Kogan writes: > >> Before this patch it was possible to 'M-s h r' during an isearch to >> highlight the regexp being sought. This patch adds similar functionality >> for matching lines with 'M-s h l'. This patch moves the previous 'M-s h >> r' isearch functionality into a macro, and then calls this macro >> separately for the regex and line cases. > > Hm... Is that a feature that would be used a lot? It's a somewhat > awkward interface and keystroke, I think. I'd use it. If this is already available for "M-s h r", there's a reasonable expectation that "M-s h l" would work too. I don't disagree that the keystroke is awkward, but that's what we've had for a long time, and I'd rather not change it. > I think this should be a function that should just take a function to > call that takes the parameters required. OK > And if this is something we want, it needs a NEWS entry and > documentation updates. I can write them if this is something we want. Is this something we want? From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 09:49:33 2019 Received: (at 18241) by debbugs.gnu.org; 26 Jun 2019 13:49:34 +0000 Received: from localhost ([127.0.0.1]:34532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8In-0007L2-NH for submit@debbugs.gnu.org; Wed, 26 Jun 2019 09:49:33 -0400 Received: from quimby.gnus.org ([80.91.231.51]:49136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8Im-0007Kt-J3 for 18241@debbugs.gnu.org; Wed, 26 Jun 2019 09:49:32 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hg8Ih-0000MD-2n; Wed, 26 Jun 2019 15:49:29 +0200 From: Lars Ingebrigtsen To: Dima Kogan Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEURDw0JBwVMSki7ubdy b24EAwIuLCtErD9UAAACYUlEQVQ4jV1UwXbbIBBcKYnOWjXW2cY8zq3h5ZyifZyj16pnmaj8/yd0 ALl2uyfEMLszywrqN2vfiUitK9FK65OtQRk4Ami4xpcbwBW47T8AlFZizkBPDaXOpBLEK/Z67jtm 2lSctDGFSdzV44gubT4EpSrQd62UmGpurMo5GpJSyuNzLyraXgswdjrXUkrK8cmJfK0ABBB1KWns K3WWt3icS3EtAYyoUEO80kokNEsuHlTDxx6kySl0pUO+byWVQS1I5nFMBA9KjDvNMEtnkJU+8ed0 AYFEvLzMTIQNa816TN0mWcZzknjIDNbZmZMAo8HQBta25OKcYCBEK1HDpZqg0CwLcjGH0oe9J/An fgEFgORP+xBvd6Aw/gLfbwA6kaM2S6xvDihCPKTUjNZcR22dk6TO5loZQ1yp26ys1E4X63VqAx+y XI5a2+Nk0UidhZvW16tlHt5t6Pw6YpJcYH49wXkB+jC51b6V6u7KT6fdII9awcm5SHUNP6tDlTts +ni2Ysq+XXmk7xVoFVqKMSsNuaTfM8cK6OnBuCvr9wzkKbD/9ApxxdViCib7f1waGraHMdxHEd+B XrWYpPcazlpfB9bTENMYtS/TWGcOkX+DheZR+cnfZ64G5YsHfRJV0rnb7QCY51bgBfyIW6o/VNQ0 MzrWfHTRi9nU2mAEMadaaM7XxcsH1kF7qtGKQao9enjN+bXCCIq6AzO/nl3RlFX7HeAMfGYXMRaC ofz3zEuu9Et8VVS0ZcZcWT8nV7RCuknpXmP5AftVqsdj8QA861Aejtw5PB53YFMvRV3UBi/MH7Cj 5g9wELhsAAAAAElFTkSuQmCC Date: Wed, 26 Jun 2019 15:49:26 +0200 In-Reply-To: <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> (Dima Kogan's message of "Tue, 25 Jun 2019 15:58:00 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dima Kogan writes: > I'd use it. If this is already available for "M-s h r", there's a > reasonable expectation that "M-s h l" would work too. I don't disagree > that the keystroke is awkward, but that's what we've had [...] 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: 0.0 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@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 (-) Dima Kogan writes: > I'd use it. If this is already available for "M-s h r", there's a > reasonable expectation that "M-s h l" would work too. I don't disagree > that the keystroke is awkward, but that's what we've had for a long > time, and I'd rather not change it. That does make sense. >> And if this is something we want, it needs a NEWS entry and >> documentation updates. > > I can write them if this is something we want. Is this something we > want? Does anybody else have an opinion here? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 15:19:04 2019 Received: (at 18241) by debbugs.gnu.org; 28 Jun 2019 19:19:04 +0000 Received: from localhost ([127.0.0.1]:43029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgwOm-0007P2-8g for submit@debbugs.gnu.org; Fri, 28 Jun 2019 15:19:04 -0400 Received: from chocolate.birch.relay.mailchannels.net ([23.83.209.35]:5487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgwOk-0007Ob-KZ for 18241@debbugs.gnu.org; Fri, 28 Jun 2019 15:19:03 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CEA24501F18; Fri, 28 Jun 2019 19:19:01 +0000 (UTC) Received: from pdx1-sub0-mail-a62.g.dreamhost.com (100-96-28-110.trex.outbound.svc.cluster.local [100.96.28.110]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 448F3501F52; Fri, 28 Jun 2019 19:19:01 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a62.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Fri, 28 Jun 2019 19:19:01 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Relation-Trouble: 6d73b30c37fb64ff_1561749541589_3899032774 X-MC-Loop-Signature: 1561749541589:347924203 X-MC-Ingress-Time: 1561749541588 Received: from pdx1-sub0-mail-a62.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTP id 10D81836F5; Fri, 28 Jun 2019 12:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=9onC1hMyG0YXsDJIZCcIYmq2o7Q=; b= cR8xH8wWZfbqfzZeWi7eJLw4gN7HeVQWVyHXmo33lcriv/7IIv/za02dxsD+/O5u wGlC+gjwGyZQUKUd2oFBMFwUSWXFw9NEQnGLrTErLWF61r5Q89ikjhSevghQq2t4 KnqNkf3YCdMmeEaH/d/jT6FLxqVUtQfay7YORkHfsZs= Received: from mail.jurta.org (m91-129-109-60.cust.tele2.ee [91.129.109.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTPSA id 9F300836DF; Fri, 28 Jun 2019 12:18:53 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a62 From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch Organization: LINKOV.NET References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> Date: Fri, 28 Jun 2019 22:12:44 +0300 In-Reply-To: (Lars Ingebrigtsen's message of "Wed, 26 Jun 2019 15:49:26 +0200") Message-ID: <87d0ixaawv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrvddtgddufeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrdeitdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrdeitddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehlrghrshhisehgnhhushdrohhrghenucevlhhushhtvghrufhiiigvpedu X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@debbugs.gnu.org, Dima Kogan 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 (-) >> I'd use it. If this is already available for "M-s h r", there's a >> reasonable expectation that "M-s h l" would work too. I don't disagree >> that the keystroke is awkward, but that's what we've had for a long >> time, and I'd rather not change it. > > Does anybody else have an opinion here? It's already possible to do this by typing in isearch: M-s h l M-n M-n M-n RET because the third default value of hi-lock commands is the last isearch string. Its only difference is that it quits isearch, but I wonder is it really useful to keep isearch active after running this hi-lock command? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 14:08:29 2019 Received: (at 18241) by debbugs.gnu.org; 30 Jun 2019 18:08:29 +0000 Received: from localhost ([127.0.0.1]:47264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hheFY-0005iQ-OY for submit@debbugs.gnu.org; Sun, 30 Jun 2019 14:08:29 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:44421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hheFW-0005iE-VO for 18241@debbugs.gnu.org; Sun, 30 Jun 2019 14:08:27 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 0EB243A6; Sun, 30 Jun 2019 14:08:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 30 Jun 2019 14:08:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm3; bh=54GpjeMXRiVzE21nt56WPgayUs uKDmFy8fir8YRRiVs=; b=2Gwa7XbWB6u6Zs0iP4yW5nnW+0gBqI72btYnO11wHr L9vFinloxo+mLEgwUf++CxzjA0hYqzZ4khDD5viKmEmyDE6vOXTAGLiOno08Rod2 8CqbrW+hLoSj4Cwlla1GnyJyFQazk7lxiUmCqQeiJwb7JS1CS1bbm2BausHqSA3r 9/5vSWLgAV+kko5w0pn7BQ7EjEzLO082V9O64Bu5L4zcWGy2//6bBrEk6eqCWQrG aRDjBiCp/5UJCym+2coMqTGFeC6UQhVBypiXL83F27eTymXVJ71rbynacBxCUyz6 3m8BDCf7InYwa+2H5uWDIvUPdj3ZSgjJy54N4iufvaTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=54Gpje MXRiVzE21nt56WPgayUsuKDmFy8fir8YRRiVs=; b=rKPEUG3kEFqc7W+u4fyz5M h8bfnJatxMx8BqX8CI7gTyOxUZpiIsUNCgbZz4ozJljzjnIeZlXuao2otcpgCJnG hId0WsUhRNYAze7Wo52jsRcRZl21dbk/rBOB3YVMKet61ktL6DJ3bNAhcDahyfM2 gcWXHcc6L/uVJVMjpg/rxfdvwmiH6xDrc9D/lsFL5Ub2KUWTB+ZKJe3W9llNgF10 u5/8MYIHkggFSZEnAksDiHPwBBsspgbkB2FjWuS1XJ0syu8D5mFmS3ofNI8NOEGt TjOt0T/G29R2oHgCPYU5J04CFXGX0POv+nQB8SQ+ivjoOrvExA/ggXYI0UR9CZuQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrvdeggdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufgjfffkgggtsehmtderredtredtnecuhfhrohhmpeffihhmrgcu mfhoghgrnhcuoeguihhmrgesshgvtghrvghtshgruhgtvgdrnhgvtheqnecukfhppedutd ejrddvuddtrddvudefrddvgeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpeguihhmrges shgvtghrvghtshgruhgtvgdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from scrawny (107-210-213-243.lightspeed.irvnca.sbcglobal.net [107.210.213.243]) by mail.messagingengine.com (Postfix) with ESMTPA id B7CE380062; Sun, 30 Jun 2019 14:08:19 -0400 (EDT) Received: from dima by scrawny with local (Exim 4.91) (envelope-from ) id 1hheFM-0003h6-Ck; Sun, 30 Jun 2019 11:08:16 -0700 References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> <87d0ixaawv.fsf@mail.linkov.net> User-agent: mu4e 1.0; emacs 27.0.50 From: Dima Kogan To: Juri Linkov Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch In-reply-to: <87d0ixaawv.fsf@mail.linkov.net> Date: Sun, 30 Jun 2019 11:08:16 -0700 Message-ID: <87blyfvtdb.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@debbugs.gnu.org, Lars Ingebrigtsen 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 (-) --=-=-= Content-Type: text/plain Juri Linkov writes: > It's already possible to do this by typing in isearch: > > M-s h l > M-n M-n M-n RET > > because the third default value of hi-lock commands is > the last isearch string. > > Its only difference is that it quits isearch, but I wonder > is it really useful to keep isearch active after running > this hi-lock command? I guess this is true, but that requires 5 extra keystrokes and extra knowledge: I didn't know about this default, and it didn't even work until I updated my 2-month-old emacs Given that 'M-s h r' is handled specially in isearch already, it only makes sense that 'M-s h l' would be too. And there's no down side to supporting this at all. I'm attaching a new patch. It does away with the weird macro thing I was doing (don't know why I was doing that), and adds notes in the NEWS and the documentation. Thanks. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-ability-to-highlight-lines-matching-regexp-direc.patch >From 7267753901e5a5b61c78c982661d1bb3f92a596e Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 30 Jun 2019 10:37:53 -0700 Subject: [PATCH] Add ability to highlight-lines-matching-regexp directly from isearch * lisp/isearch.el: Implement the new functionality. (isearch-highlight-lines-matching-regexp): New function bound to M-s h l in isearch. (isearch--highlight-regexp-or-lines-internal): New internal function * etc/NEWS (Search and Replace): Mention this change. * doc/emacs/search.texi: Added this binding to the documentation --- doc/emacs/search.texi | 10 ++++++++++ etc/NEWS | 3 +++ lisp/isearch.el | 26 +++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index c61578bab76..e7cbd3bef82 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -461,6 +461,16 @@ Special Isearch for the face to use for highlighting. To remove the highlighting, type @kbd{M-s h u} (@code{unhighlight-regexp}). +@kindex M-s h l @r{(Incremental Search)} +@findex isearch-highlight-lines-matching-regexp + Similarly, you can exit the search while highlighting whole lines +containing matches of the last search string. To this end, type +@kbd{M-s h l} (@code{isearch-highlight-lines-matching-regexp}), which +will run @code{highlight-lines-matching-regexp} (@pxref{Highlight +Interactively}) passing it the regexp derived from the last search +string and prompting you for the face to use for highlighting. To +remove the highlighting, type @kbd{M-s h u} (@code{unhighlight-regexp}). + @cindex incremental search, help on special keys @kindex C-h C-h @r{(Incremental Search)} @findex isearch-help-map diff --git a/etc/NEWS b/etc/NEWS index abbece374a4..72b30373587 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1111,6 +1111,9 @@ highlight in one iteration while processing the full buffer. 'isearch-yank-symbol-or-char'. 'isearch-del-char' is now bound to 'C-M-d'. +'M-s h l' invokes highlight-lines-matching-regexp directly using the +search string, similar to what 'M-s h r' was doing already. + +++ *** New variable 'isearch-yank-on-move' provides options 't' and 'shift' to extend the search string by yanking text that ends at the new diff --git a/lisp/isearch.el b/lisp/isearch.el index f150a3bba4b..e54fdb74783 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -753,6 +753,7 @@ isearch-mode-map (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) (define-key map "\M-so" 'isearch-occur) (define-key map "\M-shr" 'isearch-highlight-regexp) + (define-key map "\M-shl" 'isearch-highlight-lines-matching-regexp) ;; The key translations defined in the C-x 8 prefix should add ;; characters to the search string. See iso-transl.el. @@ -1039,6 +1040,9 @@ isearch-forward the last search string. Type \\[isearch-highlight-regexp] to run `highlight-regexp'\ that highlights the last search string. +Type \\[isearch-highlight-lines-matching-regexp] to run + `highlight-lines-matching-regexp'\ that highlights lines + matching the last search string. Type \\[isearch-describe-bindings] to display all Isearch key bindings. Type \\[isearch-describe-key] to display documentation of Isearch key. @@ -2339,12 +2343,11 @@ isearch-occur (declare-function hi-lock-read-face-name "hi-lock" ()) -(defun isearch-highlight-regexp () +(defun isearch--highlight-regexp-or-lines-internal (hi-lock-func) "Run `highlight-regexp' with regexp from the current search string. It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp argument from the last search regexp or a quoted search string, and reads its face argument using `hi-lock-read-face-name'." - (interactive) (let ( ;; Set `isearch-recursive-edit' to nil to prevent calling ;; `exit-recursive-edit' in `isearch-done' that terminates @@ -2373,9 +2376,26 @@ isearch-highlight-regexp (regexp-quote s)))) isearch-string "")) (t (regexp-quote isearch-string))))) - (hi-lock-face-buffer regexp (hi-lock-read-face-name))) + (funcall hi-lock-func regexp (hi-lock-read-face-name))) (and isearch-recursive-edit (exit-recursive-edit))) +(defun isearch-highlight-regexp () + "Run `highlight-regexp' with regexp from the current search string. +It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp +argument from the last search regexp or a quoted search string, +and reads its face argument using `hi-lock-read-face-name'." + (interactive) + (isearch--highlight-regexp-or-lines-internal 'hi-lock-face-buffer)) + +(defun isearch-highlight-lines-matching-regexp () + "Run `highlight-lines-matching-regexp' with regexp from the +current search string. It exits Isearch mode and calls +`hi-lock-face-buffer' with its regexp argument from the last +search regexp or a quoted search string, and reads its face +argument using `hi-lock-read-face-name'." + (interactive) + (isearch--highlight-regexp-or-lines-internal 'hi-lock-line-face-buffer)) + (defun isearch-delete-char () "Undo last input item during a search. -- 2.20.0.rc2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 18:15:53 2019 Received: (at 18241) by debbugs.gnu.org; 30 Jun 2019 22:15:53 +0000 Received: from localhost ([127.0.0.1]:47442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhi6z-0003zX-0r for submit@debbugs.gnu.org; Sun, 30 Jun 2019 18:15:53 -0400 Received: from black.elm.relay.mailchannels.net ([23.83.212.19]:52222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhi6x-0003zO-82 for 18241@debbugs.gnu.org; Sun, 30 Jun 2019 18:15:51 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0E7E56A1BBD; Sun, 30 Jun 2019 22:15:50 +0000 (UTC) Received: from pdx1-sub0-mail-a17.g.dreamhost.com (100-96-85-75.trex.outbound.svc.cluster.local [100.96.85.75]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8C5E96A0300; Sun, 30 Jun 2019 22:15:49 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a17.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Sun, 30 Jun 2019 22:15:50 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tasty-Left: 6e9be2d6007a55a8_1561932949897_526184775 X-MC-Loop-Signature: 1561932949897:2561019342 X-MC-Ingress-Time: 1561932949897 Received: from pdx1-sub0-mail-a17.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a17.g.dreamhost.com (Postfix) with ESMTP id 6026183DFD; Sun, 30 Jun 2019 15:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=0P7TSp/eOFXqsIV3SYWwHUnvZkY=; b= DxypXHRP646nBbgIysAqr63n4osEztR/cx9bd8C+uFS8K7AiC1knqZK43wg4SmfU 9rTlFWR1QQttcDOLLWw2H5CIwYwJ0S9ZSKQPXIz0PdHesg8DtELrYYcV22kw3p8+ JbCMRIPqXxvc/eeQGnN4mEbJu0m3WSwQdbr5kwrLZwI= Received: from mail.jurta.org (m91-129-109-60.cust.tele2.ee [91.129.109.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a17.g.dreamhost.com (Postfix) with ESMTPSA id 6CD9B83DFC; Sun, 30 Jun 2019 15:15:41 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a17 From: Juri Linkov To: Dima Kogan Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch Organization: LINKOV.NET References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> <87d0ixaawv.fsf@mail.linkov.net> <87blyfvtdb.fsf@secretsauce.net> Date: Mon, 01 Jul 2019 00:12:47 +0300 In-Reply-To: <87blyfvtdb.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 30 Jun 2019 11:08:16 -0700") Message-ID: <87o92epvs0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrvdehgddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledriedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledriedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughimhgrsehsvggtrhgvthhsrghutggvrdhnvghtnecuvehluhhsthgvrhfuihiivgepvd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@debbugs.gnu.org, Lars Ingebrigtsen 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 (-) > Given that 'M-s h r' is handled specially in isearch already, it only > makes sense that 'M-s h l' would be too. And there's no down side to > supporting this at all. Yes, it makes sense to do the same that 'M-s h r' already does. > I'm attaching a new patch. It does away with the weird macro thing I was > doing (don't know why I was doing that), and adds notes in the NEWS and > the documentation. Thanks, indeed better to avoid macros: we have 2 macros in isearch, and they are more of a hindrance than a help especially during development. > +@kindex M-s h l @r{(Incremental Search)} > +@findex isearch-highlight-lines-matching-regexp > + Similarly, you can exit the search while highlighting whole lines > +containing matches of the last search string. To this end, type > +@kbd{M-s h l} (@code{isearch-highlight-lines-matching-regexp}), which > +will run @code{highlight-lines-matching-regexp} (@pxref{Highlight > +Interactively}) passing it the regexp derived from the last search > +string and prompting you for the face to use for highlighting. To > +remove the highlighting, type @kbd{M-s h u} (@code{unhighlight-regexp}). Maybe it's possible to make the text shorter by just adding a new sentence about 'M-s h l' to the middle of the paragraph that describes 'M-s h r'? > -(defun isearch-highlight-regexp () > +(defun isearch--highlight-regexp-or-lines-internal (hi-lock-func) The suffix '-internal' is not necessary here because the double dash in 'isearch--' implies that the function is internal. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 23:10:14 2019 Received: (at 18241) by debbugs.gnu.org; 1 Jul 2019 03:10:14 +0000 Received: from localhost ([127.0.0.1]:47535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhmhq-0002GO-9g for submit@debbugs.gnu.org; Sun, 30 Jun 2019 23:10:14 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:55725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhmhm-0002G7-R7 for 18241@debbugs.gnu.org; Sun, 30 Jun 2019 23:10:11 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id BC30D32B; Sun, 30 Jun 2019 23:10:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 30 Jun 2019 23:10:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm3; bh=EHVSrZOlIbv1fz02gxWdcKuh9E FHURjyBtJh4yNX+Dw=; b=t2Cj5sj7+YnGqLke+qW+gnr4MDKHlZ4IyIfc5dGBQf ncALvLXBtp9fmPTG8Na1XN/6WXkg/10KQ+T8vToF+8dhuTiCpCghgdl0mokksc+X b7+rjWqGqyTqvn4tSFWzsYEy9QWl666gsZ/JKjKWqeSU2S+hcTwT3P/0QUiZu9y2 3V5lyNbajPkxOF/KJiuOsOIIMchdKuGsl789YBUF2WwXH4+lrtjTCOdZdxkYf5ZV hTOQVVY9o+0Inm/Sl/eU8oAdUh8JJjDLXt2Fb23ouAaPwNfX6l8bGtkJ9yTDcp0E 6ZEOeJAydn8s/YmJf0fHCk2ub4rdXskgTTt6mplrdd9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=EHVSrZ OlIbv1fz02gxWdcKuh9EFHURjyBtJh4yNX+Dw=; b=Ty85K+F5LtOJdMN463+G5o IZVtyc4ykgpGjzO0IlGyen21BS/ms+Veb4XELOcJQViA67cF7rAael/8TRNcq/En xtw0mrRBKLeEYp2jKK/CyQruBwP2A7yddDFgZ1LNBLCGUn/Opfe+qF9HzyhtXA/y XA9bZWsIIv4XNbqqnYcUAzalvmQYry9pAtlVxy340RZxAwwv7Ay3FIsWmAhvji1A QjPaDcLPeTg8OAQBLaHLV9J6i29cbHISlsACvcJjKHRYGzsFoWrNc9HjfijrxwJo jTaxIckHHNxOK2iO0OxnBS1Bsw7e8NwnvEzvFxEMU6aYbfESszui73+czk9HRfOw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrvdehgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffujgffkfggtgesmhdtreertdertdenucfhrhhomhepffhimhgrucfm ohhgrghnuceoughimhgrsehsvggtrhgvthhsrghutggvrdhnvghtqeenucfkphepuddtje drvddutddrvddufedrvdegfeenucfrrghrrghmpehmrghilhhfrhhomhepughimhgrsehs vggtrhgvthhsrghutggvrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from scrawny (107-210-213-243.lightspeed.irvnca.sbcglobal.net [107.210.213.243]) by mail.messagingengine.com (Postfix) with ESMTPA id B8761380085; Sun, 30 Jun 2019 23:10:02 -0400 (EDT) Received: from dima by scrawny with local (Exim 4.91) (envelope-from ) id 1hhmhb-0000vV-E9; Sun, 30 Jun 2019 20:09:59 -0700 References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> <87d0ixaawv.fsf@mail.linkov.net> <87blyfvtdb.fsf@secretsauce.net> <87o92epvs0.fsf@mail.linkov.net> User-agent: mu4e 1.0; emacs 27.0.50 From: Dima Kogan To: Juri Linkov Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch In-reply-to: <87o92epvs0.fsf@mail.linkov.net> Date: Sun, 30 Jun 2019 20:09:59 -0700 Message-ID: <878stiwiuw.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@debbugs.gnu.org, Lars Ingebrigtsen 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 (-) --=-=-= Content-Type: text/plain Juri Linkov writes: > Maybe it's possible to make the text shorter by just adding a new sentence > about 'M-s h l' to the middle of the paragraph that describes 'M-s h r'? > >> -(defun isearch-highlight-regexp () >> +(defun isearch--highlight-regexp-or-lines-internal (hi-lock-func) > > The suffix '-internal' is not necessary here because the double dash > in 'isearch--' implies that the function is internal. Alright. Here's a new patch --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-ability-to-highlight-lines-matching-regexp-direc.patch >From 7a7f3c50fee9953ff57ed8010d626f7637008d45 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 30 Jun 2019 10:37:53 -0700 Subject: [PATCH] Add ability to highlight-lines-matching-regexp directly from isearch * lisp/isearch.el: Implement the new functionality. (isearch-highlight-lines-matching-regexp): New function bound to M-s h l in isearch. (isearch--highlight-regexp-or-lines): New internal function * etc/NEWS (Search and Replace): Mention this change. * doc/emacs/search.texi: Added this binding to the documentation --- doc/emacs/search.texi | 18 +++++++++++------- etc/NEWS | 3 +++ lisp/isearch.el | 26 +++++++++++++++++++++++--- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index c61578bab76..571705b916f 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -453,13 +453,17 @@ Special Isearch @kindex M-s h r @r{(Incremental Search)} @findex isearch-highlight-regexp - You can exit the search while leaving the matches for the last -search string highlighted on display. To this end, type @kbd{M-s h r} -(@code{isearch-highlight-regexp}), which will run -@code{highlight-regexp} (@pxref{Highlight Interactively}) passing -it the regexp derived from the last search string and prompting you -for the face to use for highlighting. To remove the highlighting, -type @kbd{M-s h u} (@code{unhighlight-regexp}). +@kindex M-s h l @r{(Incremental Search)} +@findex isearch-highlight-lines-matching-regexp + You can exit the search while leaving matches for the last search +string highlighted by typing @kbd{M-s h r} +(@code{isearch-highlight-regexp}). This runs @code{highlight-regexp} +(@pxref{Highlight Interactively}), passing it the regexp derived from +the last search string and prompting you for the face to use for +highlighting. Similarly, you can highlight whole lines containing +matches by typing @kbd{M-s h l} +(@code{isearch-highlight-lines-matching-regexp}). To remove the +highlighting, type @kbd{M-s h u} (@code{unhighlight-regexp}). @cindex incremental search, help on special keys @kindex C-h C-h @r{(Incremental Search)} diff --git a/etc/NEWS b/etc/NEWS index abbece374a4..72b30373587 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1111,6 +1111,9 @@ highlight in one iteration while processing the full buffer. 'isearch-yank-symbol-or-char'. 'isearch-del-char' is now bound to 'C-M-d'. +'M-s h l' invokes highlight-lines-matching-regexp directly using the +search string, similar to what 'M-s h r' was doing already. + +++ *** New variable 'isearch-yank-on-move' provides options 't' and 'shift' to extend the search string by yanking text that ends at the new diff --git a/lisp/isearch.el b/lisp/isearch.el index f150a3bba4b..888e83d15a1 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -753,6 +753,7 @@ isearch-mode-map (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) (define-key map "\M-so" 'isearch-occur) (define-key map "\M-shr" 'isearch-highlight-regexp) + (define-key map "\M-shl" 'isearch-highlight-lines-matching-regexp) ;; The key translations defined in the C-x 8 prefix should add ;; characters to the search string. See iso-transl.el. @@ -1039,6 +1040,9 @@ isearch-forward the last search string. Type \\[isearch-highlight-regexp] to run `highlight-regexp'\ that highlights the last search string. +Type \\[isearch-highlight-lines-matching-regexp] to run + `highlight-lines-matching-regexp'\ that highlights lines + matching the last search string. Type \\[isearch-describe-bindings] to display all Isearch key bindings. Type \\[isearch-describe-key] to display documentation of Isearch key. @@ -2339,12 +2343,11 @@ isearch-occur (declare-function hi-lock-read-face-name "hi-lock" ()) -(defun isearch-highlight-regexp () +(defun isearch--highlight-regexp-or-lines (hi-lock-func) "Run `highlight-regexp' with regexp from the current search string. It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp argument from the last search regexp or a quoted search string, and reads its face argument using `hi-lock-read-face-name'." - (interactive) (let ( ;; Set `isearch-recursive-edit' to nil to prevent calling ;; `exit-recursive-edit' in `isearch-done' that terminates @@ -2373,9 +2376,26 @@ isearch-highlight-regexp (regexp-quote s)))) isearch-string "")) (t (regexp-quote isearch-string))))) - (hi-lock-face-buffer regexp (hi-lock-read-face-name))) + (funcall hi-lock-func regexp (hi-lock-read-face-name))) (and isearch-recursive-edit (exit-recursive-edit))) +(defun isearch-highlight-regexp () + "Run `highlight-regexp' with regexp from the current search string. +It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp +argument from the last search regexp or a quoted search string, +and reads its face argument using `hi-lock-read-face-name'." + (interactive) + (isearch--highlight-regexp-or-lines 'hi-lock-face-buffer)) + +(defun isearch-highlight-lines-matching-regexp () + "Run `highlight-lines-matching-regexp' with regexp from the +current search string. It exits Isearch mode and calls +`hi-lock-face-buffer' with its regexp argument from the last +search regexp or a quoted search string, and reads its face +argument using `hi-lock-read-face-name'." + (interactive) + (isearch--highlight-regexp-or-lines 'hi-lock-line-face-buffer)) + (defun isearch-delete-char () "Undo last input item during a search. -- 2.20.0.rc2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 01 10:09:03 2019 Received: (at 18241) by debbugs.gnu.org; 1 Jul 2019 14:09:04 +0000 Received: from localhost ([127.0.0.1]:48837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhwzP-0005aN-J0 for submit@debbugs.gnu.org; Mon, 01 Jul 2019 10:09:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhwzN-0005Zt-6y for 18241@debbugs.gnu.org; Mon, 01 Jul 2019 10:09:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hhwzG-0005sp-9D; Mon, 01 Jul 2019 10:08:55 -0400 Received: from [176.228.60.248] (port=1399 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hhwz1-00057N-0D; Mon, 01 Jul 2019 10:08:45 -0400 Date: Mon, 01 Jul 2019 17:08:21 +0300 Message-Id: <831rz9g84q.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <878stiwiuw.fsf@secretsauce.net> (message from Dima Kogan on Sun, 30 Jun 2019 20:09:59 -0700) Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> <87d0ixaawv.fsf@mail.linkov.net> <87blyfvtdb.fsf@secretsauce.net> <87o92epvs0.fsf@mail.linkov.net> <878stiwiuw.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18241 Cc: 18241@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Dima Kogan > Date: Sun, 30 Jun 2019 20:09:59 -0700 > Cc: 18241@debbugs.gnu.org, Lars Ingebrigtsen Thanks, some comments regarding the documentation parts: > +@kindex M-s h l @r{(Incremental Search)} > +@findex isearch-highlight-lines-matching-regexp > + You can exit the search while leaving matches for the last search > +string highlighted by typing @kbd{M-s h r} > +(@code{isearch-highlight-regexp}). This runs @code{highlight-regexp} > +(@pxref{Highlight Interactively}), passing it the regexp derived from > +the last search string and prompting you for the face to use for > +highlighting. Similarly, you can highlight whole lines containing > +matches by typing @kbd{M-s h l} > +(@code{isearch-highlight-lines-matching-regexp}). This description left me wondering what is the difference between these two commands. IOW, how does "last search string" and "whole lines containing matches" differ from one another? The problem is probably with using "search string" instead of "match" in the description of the first command, but that's a guess. > +'M-s h l' invokes highlight-lines-matching-regexp directly using the > +search string, similar to what 'M-s h r' was doing already. This needs to be more clear. "Similar" in what sense? and if it's similar enough, why did we introduce a new command/key binding? Also, since the new command is already described in the manual, this entry should be marked with "+++", see the beginning of NEWS for explanations why. > -(defun isearch-highlight-regexp () > +(defun isearch--highlight-regexp-or-lines (hi-lock-func) > "Run `highlight-regexp' with regexp from the current search string. We prefer the first line of the doc string to mention the arguments. > +(defun isearch-highlight-regexp () > + "Run `highlight-regexp' with regexp from the current search string. What is "current search string"? This should be explained in the rest of the doc string, but isn't. > +It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp > +argument from the last search regexp or a quoted search string, I'm guessing "the last search regexp or a quoted search string" refers to the same string as "the current search string" in the first line. If so, please note that it is generally a bad idea to describe the same thing by more than one term, because it leaves the reader wondering whether you indeed mean the same thing. > +(defun isearch-highlight-lines-matching-regexp () > + "Run `highlight-lines-matching-regexp' with regexp from the > +current search string. It exits Isearch mode and calls The first line of the doc string should be a complete sentence. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 21:31:19 2019 Received: (at 18241) by debbugs.gnu.org; 4 Jul 2019 01:31:19 +0000 Received: from localhost ([127.0.0.1]:50197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiqal-0008Fp-Dg for submit@debbugs.gnu.org; Wed, 03 Jul 2019 21:31:19 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiqaj-0008Fa-53 for 18241@debbugs.gnu.org; Wed, 03 Jul 2019 21:31:17 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0622E22128; Wed, 3 Jul 2019 21:31:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 03 Jul 2019 21:31:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm3; bh=ZT+nN2Fkm1VI8iC3EYjATxgHkL AjGhWXbO6KZ3qAIzo=; b=lOrBCk7DGRwjRdFLPSAAc5SgBPOT/PLBi9uxcV/1Di y0C3TGxaX3fo8ZNih0WNqUVHkAk/xUFbjwetEsZwLXrbui9xdu1+PlXGZALVDbfZ q2TrTtPvs1VMyy4o7tVBP0uWPmdelgEocl44C7my41o+IOw9MOtUtzBvI2H/8K0e p4MCHLm8ABPQdgCoX8SaeglulZdU0+v/MvauqlzQ7Eu+JosVwgQYEP5czWM/wIJl Pmemkwu72/dfKbzWJ96XSuST/oKxUWdYwJUed7X+yeCf52F0gi644V0Fayx/ik03 uPR5TCD2LRX+AaZ1QF6VVn1gTynSHyMF0YwPcxAQnExA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ZT+nN2 Fkm1VI8iC3EYjATxgHkLAjGhWXbO6KZ3qAIzo=; b=KuEpJax4OO0VzvqhE+1PDh PfO1o1ChXiZ+48MSP7uY27xfn/GogsJvjhhc2lnFVIeIDEOztVdHCXp4In+1KNdU EEJ11aOMTqwsCJEhfs8JualhdvVbECtU+9CmvUi0FRWuKN+zqlltMd/lrwzAGq9/ t2N/3ztr5hF3Dm9/QHv9qGYiLL8MWHAb502Ws2HoAndw9oD32GvQ87+1mxOBburr BlSNYqmP4OLSAlxLEiD5TGbvJzsh6nSX/68jKyJ2n6aK5j2E73wzDTXYqJ6P65Bl 8+OA28LYYC9c7ohyMn3Xb5d/OWaC+NONwY22SkvO8IMC5ecUAuQ85pK9w5OwgPuA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrfedugdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffujgffkfggtgesmhdtreertdertdenucfhrhhomhepffhimhgrucfm ohhgrghnuceoughimhgrsehsvggtrhgvthhsrghutggvrdhnvghtqeenucfkphepuddtje drvddutddrvddufedrvdegfeenucfrrghrrghmpehmrghilhhfrhhomhepughimhgrsehs vggtrhgvthhsrghutggvrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from scrawny (107-210-213-243.lightspeed.irvnca.sbcglobal.net [107.210.213.243]) by mail.messagingengine.com (Postfix) with ESMTPA id 85BCF380087; Wed, 3 Jul 2019 21:31:10 -0400 (EDT) Received: from dima by scrawny with local (Exim 4.91) (envelope-from ) id 1hiqaa-0000Ir-DD; Wed, 03 Jul 2019 18:31:08 -0700 References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> <87d0ixaawv.fsf@mail.linkov.net> <87blyfvtdb.fsf@secretsauce.net> <87o92epvs0.fsf@mail.linkov.net> <878stiwiuw.fsf@secretsauce.net> <831rz9g84q.fsf@gnu.org> User-agent: mu4e 1.0; emacs 27.0.50 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch In-reply-to: <831rz9g84q.fsf@gnu.org> Date: Wed, 03 Jul 2019 18:31:08 -0700 Message-ID: <871rz6wppf.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18241 Cc: 18241@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Try the attached --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-ability-to-highlight-lines-matching-regexp-direc.patch >From 9d0fd748c0f5648a6687fc590822fae3a0eb2e2a Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 30 Jun 2019 10:37:53 -0700 Subject: [PATCH] Add ability to highlight-lines-matching-regexp directly from isearch * lisp/isearch.el: Implement the new functionality. (isearch-highlight-lines-matching-regexp): New function bound to M-s h l in isearch. (isearch--highlight-regexp-or-lines): New internal function * etc/NEWS (Search and Replace): Mention this change. * doc/emacs/search.texi: Added this binding to the documentation --- doc/emacs/search.texi | 17 ++++++++++------- etc/NEWS | 6 ++++++ lisp/isearch.el | 32 +++++++++++++++++++++++++------- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index c61578bab76..b47d51a2b66 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -453,13 +453,16 @@ Special Isearch @kindex M-s h r @r{(Incremental Search)} @findex isearch-highlight-regexp - You can exit the search while leaving the matches for the last -search string highlighted on display. To this end, type @kbd{M-s h r} -(@code{isearch-highlight-regexp}), which will run -@code{highlight-regexp} (@pxref{Highlight Interactively}) passing -it the regexp derived from the last search string and prompting you -for the face to use for highlighting. To remove the highlighting, -type @kbd{M-s h u} (@code{unhighlight-regexp}). +@kindex M-s h l @r{(Incremental Search)} +@findex isearch-highlight-lines-matching-regexp + You can exit the search while leaving the matches highlighted by +typing @kbd{M-s h r} (@code{isearch-highlight-regexp}). This runs +@code{highlight-regexp} (@pxref{Highlight Interactively}), passing it +the regexp derived from the search string and prompting you for the face +to use for highlighting. To highlight @emph{whole lines} containing +matches (rather than @emph{just} the matches), type @kbd{M-s h l} +(@code{isearch-highlight-lines-matching-regexp}). In either case, to +remove the highlighting, type @kbd{M-s h u} (@code{unhighlight-regexp}). @cindex incremental search, help on special keys @kindex C-h C-h @r{(Incremental Search)} diff --git a/etc/NEWS b/etc/NEWS index abbece374a4..0c2340603d0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1111,6 +1111,12 @@ highlight in one iteration while processing the full buffer. 'isearch-yank-symbol-or-char'. 'isearch-del-char' is now bound to 'C-M-d'. ++++ +'M-s h l' invokes highlight-lines-matching-regexp using the search +string to highlight lines matching the search string. This is similar +to the existing binding 'M-s h r' (highlight-regexp) that highlights +JUST the search string. + +++ *** New variable 'isearch-yank-on-move' provides options 't' and 'shift' to extend the search string by yanking text that ends at the new diff --git a/lisp/isearch.el b/lisp/isearch.el index f150a3bba4b..6c7899a384b 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -753,6 +753,7 @@ isearch-mode-map (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) (define-key map "\M-so" 'isearch-occur) (define-key map "\M-shr" 'isearch-highlight-regexp) + (define-key map "\M-shl" 'isearch-highlight-lines-matching-regexp) ;; The key translations defined in the C-x 8 prefix should add ;; characters to the search string. See iso-transl.el. @@ -1039,6 +1040,9 @@ isearch-forward the last search string. Type \\[isearch-highlight-regexp] to run `highlight-regexp'\ that highlights the last search string. +Type \\[isearch-highlight-lines-matching-regexp] to run + `highlight-lines-matching-regexp'\ that highlights lines + matching the last search string. Type \\[isearch-describe-bindings] to display all Isearch key bindings. Type \\[isearch-describe-key] to display documentation of Isearch key. @@ -2339,12 +2343,12 @@ isearch-occur (declare-function hi-lock-read-face-name "hi-lock" ()) -(defun isearch-highlight-regexp () - "Run `highlight-regexp' with regexp from the current search string. -It exits Isearch mode and calls `hi-lock-face-buffer' with its regexp -argument from the last search regexp or a quoted search string, -and reads its face argument using `hi-lock-read-face-name'." - (interactive) +(defun isearch--highlight-regexp-or-lines (hi-lock-func) + "Run HI-LOCK-FUNC to exit isearch, leaving the matches highlighted. +This is the internal function used by `isearch-highlight-regexp' +and `isearch-highlight-lines-matching-regexp' to invoke +HI-LOCK-FUNC (either `highlight-regexp' or +`highlight-lines-matching-regexp' respectively)." (let ( ;; Set `isearch-recursive-edit' to nil to prevent calling ;; `exit-recursive-edit' in `isearch-done' that terminates @@ -2373,9 +2377,23 @@ isearch-highlight-regexp (regexp-quote s)))) isearch-string "")) (t (regexp-quote isearch-string))))) - (hi-lock-face-buffer regexp (hi-lock-read-face-name))) + (funcall hi-lock-func regexp (hi-lock-read-face-name))) (and isearch-recursive-edit (exit-recursive-edit))) +(defun isearch-highlight-regexp () + "Exit Isearch mode, and call `highlight-regexp' with its regexp +argument from the last search, and the face from +`hi-lock-read-face-name'." + (interactive) + (isearch--highlight-regexp-or-lines 'highlight-regexp)) + +(defun isearch-highlight-lines-matching-regexp () + "Exit Isearch mode, and call `highlight-lines-matching-regexp' +with its regexp argument from the last search, and the face from +`hi-lock-read-face-name'." + (interactive) + (isearch--highlight-regexp-or-lines 'highlight-lines-matching-regexp)) + (defun isearch-delete-char () "Undo last input item during a search. -- 2.20.0.rc2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 03:22:21 2019 Received: (at 18241-done) by debbugs.gnu.org; 13 Jul 2019 07:22:21 +0000 Received: from localhost ([127.0.0.1]:41388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmCMP-0003zN-Gs for submit@debbugs.gnu.org; Sat, 13 Jul 2019 03:22:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmCMN-0003z8-O6 for 18241-done@debbugs.gnu.org; Sat, 13 Jul 2019 03:22:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hmCMI-0005wr-3F; Sat, 13 Jul 2019 03:22:14 -0400 Received: from [176.228.60.248] (port=2464 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hmCMG-0005aN-Dl; Sat, 13 Jul 2019 03:22:12 -0400 Date: Sat, 13 Jul 2019 10:22:07 +0300 Message-Id: <83tvbq1js0.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <871rz6wppf.fsf@secretsauce.net> (message from Dima Kogan on Wed, 03 Jul 2019 18:31:08 -0700) Subject: Re: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch References: <87sil4uhlw.fsf@secretsauce.net> <87a7e55l3b.fsf@shorty.i-did-not-set--mail-host-address--so-tickle-me> <87d0ixaawv.fsf@mail.linkov.net> <87blyfvtdb.fsf@secretsauce.net> <87o92epvs0.fsf@mail.linkov.net> <878stiwiuw.fsf@secretsauce.net> <831rz9g84q.fsf@gnu.org> <871rz6wppf.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18241-done Cc: larsi@gnus.org, 18241-done@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: Dima Kogan > Cc: juri@linkov.net, 18241@debbugs.gnu.org, larsi@gnus.org > Date: Wed, 03 Jul 2019 18:31:08 -0700 > > Try the attached Thanks, I pushed it to master. Please note that there were a few minor nits left that I fixed, see my followup commit. From unknown Sun Jun 22 17:16:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 10 Aug 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator