unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15934: [Feature request] Highlight full lines
@ 2013-11-20 19:24 Sebastien Vauban
  2013-12-11  1:41 ` Michael Heerdegen
  2019-08-18 17:52 ` Stefan Kangas
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastien Vauban @ 2013-11-20 19:24 UTC (permalink / raw)
  To: 15934-ubl+/3LiMTaZdePnXv/OxA

Hello,

I think it'd be nicer to highlight full lines (vs up to the last character)
when using C-x w l (highlight-lines-matching-regexp).

Best regards,
  Seb

-- 
Sebastien Vauban





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#15934: [Feature request] Highlight full lines
  2013-11-20 19:24 bug#15934: [Feature request] Highlight full lines Sebastien Vauban
@ 2013-12-11  1:41 ` Michael Heerdegen
       [not found]   ` <8738m088qt.fsf-S0/GAf8tV78@public.gmane.org>
  2019-08-18 17:52 ` Stefan Kangas
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Heerdegen @ 2013-12-11  1:41 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-15934-ubl+/3LiMTaZdePnXv/OxA

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

Hi Sebastien,

> I think it'd be nicer to highlight full lines (vs up to the last character)
> when using C-x w l (highlight-lines-matching-regexp).

I too think that this would be more appropriate.  Something like
the following should do the job:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: hi-lock.patch --]
[-- Type: text/x-diff, Size: 691 bytes --]

*** /home/micha/software/emacs/lisp/hi-lock.el	2013-10-26 18:26:42.117620602 +0200
--- /home/micha/today/hi-lock.el	2013-12-11 02:31:03.251432385 +0100
***************
*** 448,454 ****
    (hi-lock-set-pattern
     ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
     ;; or a trailing $ in REGEXP will be interpreted correctly.
!    (concat "^.*\\(?:" regexp "\\).*$") face))
  
  
  ;;;###autoload
--- 448,454 ----
    (hi-lock-set-pattern
     ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
     ;; or a trailing $ in REGEXP will be interpreted correctly.
!    (concat "^.*\\(?:" regexp "\\).*\\($\\)\n?") face))
  
  
  ;;;###autoload

[-- Attachment #3: Type: text/plain, Size: 39 bytes --]


Can we use this?


Regards,

Michael.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#15934: [Feature request] Highlight full lines
       [not found]   ` <8738m088qt.fsf-S0/GAf8tV78@public.gmane.org>
@ 2013-12-11 12:40     ` Sebastien Vauban
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastien Vauban @ 2013-12-11 12:40 UTC (permalink / raw)
  To: Michael Heerdegen
  Cc: public-15934-ubl+/3LiMTaZdePnXv/OxA-wOFGN7rlS/M9smdsby/KFg



Hello Michael,

Michael Heerdegen wrote:
>> I think it'd be nicer to highlight full lines (vs up to the last character)
>> when using C-x w l (highlight-lines-matching-regexp).
>
> I too think that this would be more appropriate.  Something like
> the following should do the job:
>
>
> *** /home/micha/software/emacs/lisp/hi-lock.el	2013-10-26 18:26:42.117620602 +0200
> --- /home/micha/today/hi-lock.el	2013-12-11 02:31:03.251432385 +0100
> ***************
> *** 448,454 ****
>     (hi-lock-set-pattern
>      ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
>      ;; or a trailing $ in REGEXP will be interpreted correctly.
> !    (concat "^.*\\(?:" regexp "\\).*$") face))
>   
>   
>   ;;;###autoload
> --- 448,454 ----
>     (hi-lock-set-pattern
>      ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
>      ;; or a trailing $ in REGEXP will be interpreted correctly.
> !    (concat "^.*\\(?:" regexp "\\).*\\($\\)\n?") face))
>   
>   
>   ;;;###autoload
>
>
> Can we use this?

I've tested it. It does what I wish it should do!

Thanks...

Best regards,
  Seb

-- 
Sebastien Vauban






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#15934: [Feature request] Highlight full lines
  2013-11-20 19:24 bug#15934: [Feature request] Highlight full lines Sebastien Vauban
  2013-12-11  1:41 ` Michael Heerdegen
@ 2019-08-18 17:52 ` Stefan Kangas
  2019-08-19 13:58   ` Michael Heerdegen
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2019-08-18 17:52 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Sebastien Vauban, 15934

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hi Sebastien,
>
>> I think it'd be nicer to highlight full lines (vs up to the last character)
>> when using C-x w l (highlight-lines-matching-regexp).
>
> I too think that this would be more appropriate.  Something like
> the following should do the job:
>
> *** /home/micha/software/emacs/lisp/hi-lock.el    2013-10-26 18:26:42.117620602 +0200
> --- /home/micha/today/hi-lock.el    2013-12-11 02:31:03.251432385 +0100
> ***************
> *** 448,454 ****
>     (hi-lock-set-pattern
>      ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
>      ;; or a trailing $ in REGEXP will be interpreted correctly.
> !    (concat "^.*\\(?:" regexp "\\).*$") face))
>
>
>   ;;;###autoload
> --- 448,454 ----
>     (hi-lock-set-pattern
>      ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
>      ;; or a trailing $ in REGEXP will be interpreted correctly.
> !    (concat "^.*\\(?:" regexp "\\).*\\($\\)\n?") face))
>
>
>   ;;;###autoload
>
>
> Can we use this?
>
>
> Regards,
>
> Michael.

The suggested change works here, and I think the new behaviour makes
more sense.  The user would want this to stand out, and it can be hard
to spot short lines.

Are there any objections to making this change?  If there are none,
could you Michael please consider committing this to master?

Thanks,
Stefan Kangas





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#15934: [Feature request] Highlight full lines
  2019-08-18 17:52 ` Stefan Kangas
@ 2019-08-19 13:58   ` Michael Heerdegen
  2019-08-23 12:00     ` Michael Heerdegen
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Heerdegen @ 2019-08-19 13:58 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 15934

Stefan Kangas <stefan@marxist.se> writes:

> Are there any objections to making this change?  If there are none,
> could you Michael please consider committing this to master?

I'll install the suggested patch in a couple of days if no one objects.

Thanks,

Michael.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#15934: [Feature request] Highlight full lines
  2019-08-19 13:58   ` Michael Heerdegen
@ 2019-08-23 12:00     ` Michael Heerdegen
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Heerdegen @ 2019-08-23 12:00 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 15934-done

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I'll install the suggested patch in a couple of days if no one objects.

Done, with a minor correction:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Hi-lock-lines-up-to-right-margin-Bug-15934.patch --]
[-- Type: text/x-diff, Size: 938 bytes --]

From d534687c43a1517e291b8de31e3ce23c2e6e4603 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Wed, 21 Aug 2019 15:51:13 +0200
Subject: [PATCH] Hi-lock lines up to right margin (Bug#15934)

* lisp/hi-lock.el (hi-lock-line-face-buffer): Change used regexp so
that a line terminating newline character is included in the match.
---
 lisp/hi-lock.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 65465d3b4c..b6b0e2a736 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -447,7 +447,7 @@ hi-lock-line-face-buffer
   (hi-lock-set-pattern
    ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
    ;; or a trailing $ in REGEXP will be interpreted correctly.
-   (concat "^.*\\(?:" regexp "\\).*$") face))
+   (concat "^.*\\(?:" regexp "\\).*\\(?:$\\)\n?") face))


 ;;;###autoload
--
2.23.0.rc1


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]


The installed patch uses a shy group to wrap the $ operator.  Doesn't
change the behavior but should be more correct.

Thanks,

Michael.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-23 12:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-20 19:24 bug#15934: [Feature request] Highlight full lines Sebastien Vauban
2013-12-11  1:41 ` Michael Heerdegen
     [not found]   ` <8738m088qt.fsf-S0/GAf8tV78@public.gmane.org>
2013-12-11 12:40     ` Sebastien Vauban
2019-08-18 17:52 ` Stefan Kangas
2019-08-19 13:58   ` Michael Heerdegen
2019-08-23 12:00     ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).