GNU bug report logs -
#18697
25.0.50; [PATCH] hi-lock interactive functions now default to the active region, if there is one
Previous Next
Reported by: Dima Kogan <dima <at> secretsauce.net>
Date: Sun, 12 Oct 2014 22:37:02 UTC
Severity: wishlist
Tags: patch, wontfix
Found in version 25.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>>>> Dima Kogan <dima <at> secretsauce.net> writes:
> Attached is a small feature patch. Currently when a hi-lock.el
> function is called interactively, the default offered by
> (read-regexp) is the last value.
> With the patch, the behavior is the same if no active region is
> available; if an active region IS available, the default is the
> contents of the region.
[…]
> --- a/lisp/hi-lock.el
> +++ b/lisp/hi-lock.el
> @@ -419,7 +419,10 @@ highlighting will not update as you type."
> (interactive
> (list
> (hi-lock-regexp-okay
> - (read-regexp "Regexp to highlight line" 'regexp-history-last))
> + (read-regexp "Regexp to highlight line"
> + (if mark-active
> + (buffer-substring-no-properties (point) (mark))
> + 'regexp-history-last)))
> (hi-lock-read-face-name)))
> (or (facep face) (setq face 'hi-yellow))
> (unless hi-lock-mode (hi-lock-mode 1))
I don’t seem to understand; is mark-active ever supposed to
become nil when /not/ in the transient-mark-mode?
Personally, I find the latter distracting enough not to ever
turn it on. So, I guess that the above would mean that I’d
always be getting anything I have for the region (which may
easily be a substantial portion of the buffer) for the default.
Thus, at the very least, the above should probably use
(and transient-mark-mode mark-active) as the condition, or
something like that.
[…]
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
This bug report was last modified 6 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.