all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dima Kogan <dima@secretsauce.net>
Cc: 18241@debbugs.gnu.org, larsi@gnus.org, juri@linkov.net
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	[thread overview]
Message-ID: <831rz9g84q.fsf@gnu.org> (raw)
In-Reply-To: <878stiwiuw.fsf@secretsauce.net> (message from Dima Kogan on Sun,  30 Jun 2019 20:09:59 -0700)

> From: Dima Kogan <dima@secretsauce.net>
> Date: Sun, 30 Jun 2019 20:09:59 -0700
> Cc: 18241@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>

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.





  reply	other threads:[~2019-07-01 14:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-10 22:04 bug#18241: 24.4.50; [PATCH] I can now highlight-lines-matching-regexp from isearch Dima Kogan
2019-06-25 22:32 ` Lars Ingebrigtsen
2019-06-25 22:58   ` Dima Kogan
2019-06-26 13:49     ` Lars Ingebrigtsen
2019-06-28 19:12       ` Juri Linkov
2019-06-30 18:08         ` Dima Kogan
2019-06-30 21:12           ` Juri Linkov
2019-07-01  3:09             ` Dima Kogan
2019-07-01 14:08               ` Eli Zaretskii [this message]
2019-07-04  1:31                 ` Dima Kogan
2019-07-13  7:22                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831rz9g84q.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18241@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.