From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch Date: Mon, 01 Jul 2019 17:08:21 +0300 Message-ID: <831rz9g84q.fsf@gnu.org> 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> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="113140"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 18241@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 01 16:28:41 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhxIP-000TIh-04 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jul 2019 16:28:41 +0200 Original-Received: from localhost ([::1]:59322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhxIN-0006qC-Sm for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jul 2019 10:28:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50554) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhx0P-0007Cd-SD for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhx0N-0007UE-PW for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:10:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hhx0M-0007Sw-0q for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hhx0L-0005bq-Q1 for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jul 2019 14:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18241-submit@debbugs.gnu.org id=B18241.156199014421480 (code B ref 18241); Mon, 01 Jul 2019 14:10:01 +0000 Original-Received: (at 18241) by debbugs.gnu.org; 1 Jul 2019 14:09:04 +0000 Original-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 Original-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 Original-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 Original-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 In-reply-to: <878stiwiuw.fsf@secretsauce.net> (message from Dima Kogan on Sun, 30 Jun 2019 20:09:59 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161934 Archived-At: > 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.