unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords
@ 2023-09-23  7:50 Gabriel
  2023-09-23 17:33 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel @ 2023-09-23  7:50 UTC (permalink / raw)
  To: 66166

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

Consider outline-heading-end-regexp in outline-font-lock-keywords.

Example of use case:
1) emacs -Q
2) in *scratch* buffer, type ";;; Hello" in a new line, plus some line breaks
3) eval:
   (setq-local outline-regexp ";;;*")
   (setq-local outline-heading-end-regexp "\n")
   (setq-local outline-minor-mode-highlight 'override)
   (custom-set-faces '(outline-1 ((t :background "red" :extend t))))
   (outline-minor-mode 1)
4) expected: since the outline-1 face has the extend attribute and the
heading regexp ends in a line break, the outline-1 face on ";;; Hello"
should be applied until the line break (extended)

Patch:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Consider-outline-heading-end-regexp-in-outline-font-.patch --]
[-- Type: text/x-diff, Size: 1025 bytes --]

From 5d56f04e4f59e8fef9f4521901f527db09004534 Mon Sep 17 00:00:00 2001
From: Gabriel <gabriel376@hotmail.com>
Date: Sat, 23 Sep 2023 04:32:02 -0300
Subject: [PATCH 1/1] Consider outline-heading-end-regexp in
 outline-font-lock-keywords

* lisp/outline.el (outline-font-lock-keywords): Add
outline-heading-end-regexp to regexp.
---
 lisp/outline.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/outline.el b/lisp/outline.el
index d8dd491212e..7f826a4ece2 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -260,7 +260,7 @@ outline-font-lock-keywords
   '(
     ;; Highlight headings according to the level.
     (eval . (list (or outline-search-function
-                      (concat "^\\(?:" outline-regexp "\\).*"))
+                      (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp))
                   0 '(if outline-minor-mode
                          (if outline-minor-mode-highlight
                              (list 'face (outline-font-lock-face)))
-- 
2.34.1


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


---
Gabriel

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

* bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords
  2023-09-23  7:50 bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords Gabriel
@ 2023-09-23 17:33 ` Juri Linkov
  2023-09-23 19:01   ` Eli Zaretskii
  2024-01-10 21:30   ` Stefan Kangas
  0 siblings, 2 replies; 5+ messages in thread
From: Juri Linkov @ 2023-09-23 17:33 UTC (permalink / raw)
  To: Gabriel; +Cc: 66166

> Consider outline-heading-end-regexp in outline-font-lock-keywords.
>
> Example of use case:
> 1) emacs -Q
> 2) in *scratch* buffer, type ";;; Hello" in a new line, plus some line breaks
> 3) eval:
>    (setq-local outline-regexp ";;;*")
>    (setq-local outline-heading-end-regexp "\n")
>    (setq-local outline-minor-mode-highlight 'override)
>    (custom-set-faces '(outline-1 ((t :background "red" :extend t))))
>    (outline-minor-mode 1)
> 4) expected: since the outline-1 face has the extend attribute and the
> heading regexp ends in a line break, the outline-1 face on ";;; Hello"
> should be applied until the line break (extended)
>
> Patch:
> -                      (concat "^\\(?:" outline-regexp "\\).*"))
> +                      (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp))

Thanks, your patch looks right.  I wonder if it might break something,
maybe need more testing.

Then it will fix the extend attribute only when outlines are expanded.
But when collapsed, changes in the display engine are required
to support the extend attribute over the ellipsis (bug#65896).





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

* bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords
  2023-09-23 17:33 ` Juri Linkov
@ 2023-09-23 19:01   ` Eli Zaretskii
  2024-01-10 21:30   ` Stefan Kangas
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2023-09-23 19:01 UTC (permalink / raw)
  To: Juri Linkov; +Cc: gabriel376, 66166

> Cc: 66166@debbugs.gnu.org
> From: Juri Linkov <juri@linkov.net>
> Date: Sat, 23 Sep 2023 20:33:37 +0300
> 
> But when collapsed, changes in the display engine are required
> to support the extend attribute over the ellipsis (bug#65896).

Changes that no one could yet define in a way that doesn't break other
uses of faces.  So it isn't yet established that changes in the
display engine are required, or even possible.





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

* bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords
  2023-09-23 17:33 ` Juri Linkov
  2023-09-23 19:01   ` Eli Zaretskii
@ 2024-01-10 21:30   ` Stefan Kangas
  2024-01-11  7:12     ` Juri Linkov
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2024-01-10 21:30 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Gabriel, 66166

Juri Linkov <juri@linkov.net> writes:

>> Consider outline-heading-end-regexp in outline-font-lock-keywords.
>>
>> Example of use case:
>> 1) emacs -Q
>> 2) in *scratch* buffer, type ";;; Hello" in a new line, plus some line breaks
>> 3) eval:
>>    (setq-local outline-regexp ";;;*")
>>    (setq-local outline-heading-end-regexp "\n")
>>    (setq-local outline-minor-mode-highlight 'override)
>>    (custom-set-faces '(outline-1 ((t :background "red" :extend t))))
>>    (outline-minor-mode 1)
>> 4) expected: since the outline-1 face has the extend attribute and the
>> heading regexp ends in a line break, the outline-1 face on ";;; Hello"
>> should be applied until the line break (extended)
>>
>> Patch:
>> -                      (concat "^\\(?:" outline-regexp "\\).*"))
>> +                      (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp))
>
> Thanks, your patch looks right.  I wonder if it might break something,
> maybe need more testing.

Did you have a chance to do more testing here?  Should this patch be
installed?  Thanks in advance.

> Then it will fix the extend attribute only when outlines are expanded.
> But when collapsed, changes in the display engine are required
> to support the extend attribute over the ellipsis (bug#65896).





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

* bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords
  2024-01-10 21:30   ` Stefan Kangas
@ 2024-01-11  7:12     ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2024-01-11  7:12 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Gabriel, 66166

close 66166 30.0.50
thanks

>>> Consider outline-heading-end-regexp in outline-font-lock-keywords.
>>>
>>> Example of use case:
>>> 1) emacs -Q
>>> 2) in *scratch* buffer, type ";;; Hello" in a new line, plus some line breaks
>>> 3) eval:
>>>    (setq-local outline-regexp ";;;*")
>>>    (setq-local outline-heading-end-regexp "\n")
>>>    (setq-local outline-minor-mode-highlight 'override)
>>>    (custom-set-faces '(outline-1 ((t :background "red" :extend t))))
>>>    (outline-minor-mode 1)
>>> 4) expected: since the outline-1 face has the extend attribute and the
>>> heading regexp ends in a line break, the outline-1 face on ";;; Hello"
>>> should be applied until the line break (extended)
>>>
>>> Patch:
>>> -                      (concat "^\\(?:" outline-regexp "\\).*"))
>>> +                      (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp))
>>
>> Thanks, your patch looks right.  I wonder if it might break something,
>> maybe need more testing.
>
> Did you have a chance to do more testing here?  Should this patch be
> installed?  Thanks in advance.

I have used this change all the time from September 2023 without any problems.
So now this is installed in master.

>> Then it will fix the extend attribute only when outlines are expanded.
>> But when collapsed, changes in the display engine are required
>> to support the extend attribute over the ellipsis (bug#65896).

This could be implemented in another bug report.





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

end of thread, other threads:[~2024-01-11  7:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-23  7:50 bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords Gabriel
2023-09-23 17:33 ` Juri Linkov
2023-09-23 19:01   ` Eli Zaretskii
2024-01-10 21:30   ` Stefan Kangas
2024-01-11  7:12     ` Juri Linkov

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).