* bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line
@ 2021-03-09 18:51 Kévin Le Gouguec
2021-03-10 15:15 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Kévin Le Gouguec @ 2021-03-09 18:51 UTC (permalink / raw)
To: 47026
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
Hello,
Some themes add a background to the faces Gnus uses to highlight summary
lines (e.g. gnus-summary-selected, gnus-summary-cancelled); I'd like to
be able to extend that background beyond EOL.
Right now Gnus only applies these faces right up to the char *before*
EOL; if it were to apply them one char further, users could then set (or
unset) the :extend property on these faces.
I'm attaching a patch only for demonstration purposes; I do not know
whether it should be applied as-is. It does Work For Me®, but:
(1) Maybe we want to be as flexible as Org, i.e. let users control this
behaviour with a user option instead of messing with faces.
(Cf. org-fontify-whole-heading-line in org-set-font-lock-defaults)
(2) I haven't looked at the whole beg/end vs. from/to vs. mouse-face
affair in gnus-highlight-selected-summary, so my patch may fail to DTRT
in some circumstances… ?
Thank you for your time.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 925 bytes --]
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index ee74f01393..bf58cf419a 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -12741,7 +12741,7 @@ gnus-highlight-selected-summary
;; so we highlight the entire line instead.
(when (= (+ to 2) from)
(setq from beg)
- (setq to end))
+ (setq to (1+ end)))
(if gnus-newsgroup-selected-overlay
;; Move old overlay.
(move-overlay
@@ -12796,7 +12796,7 @@ gnus-summary-highlight-line
(let ((face (funcall (gnus-summary-highlight-line-0))))
(unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
(gnus-put-text-property-excluding-characters-with-faces
- beg (point-at-eol) 'face
+ beg (1+ (point-at-eol)) 'face
(setq face (if (boundp face) (symbol-value face) face)))
(when gnus-summary-highlight-line-function
(funcall gnus-summary-highlight-line-function article face))))))
[-- Attachment #3: Type: text/plain, Size: 848 bytes --]
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.25, cairo version 1.16.0)
of 2021-03-06 built on my-little-tumbleweed
Repository revision: 6c498786fed219ee8f98092f7921b5a5b1aaca29
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: openSUSE Tumbleweed
Configured using:
'configure --with-xwidgets --with-cairo'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM
XWIDGETS GTK3 ZLIB
Important settings:
value of $LC_CTYPE: en_US.UTF-8
value of $LC_TIME: en_GB.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=local
locale-coding-system: utf-8-unix
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line
2021-03-09 18:51 bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line Kévin Le Gouguec
@ 2021-03-10 15:15 ` Lars Ingebrigtsen
2021-03-12 18:13 ` Kévin Le Gouguec
0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-10 15:15 UTC (permalink / raw)
To: Kévin Le Gouguec; +Cc: 47026
Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
> Right now Gnus only applies these faces right up to the char *before*
> EOL; if it were to apply them one char further, users could then set (or
> unset) the :extend property on these faces.
>
> I'm attaching a patch only for demonstration purposes; I do not know
> whether it should be applied as-is. It does Work For Me®, but:
Makes sense to me, so I've applied it to Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line
2021-03-10 15:15 ` Lars Ingebrigtsen
@ 2021-03-12 18:13 ` Kévin Le Gouguec
2021-03-16 0:25 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Kévin Le Gouguec @ 2021-03-12 18:13 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 47026
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
>
>> Right now Gnus only applies these faces right up to the char *before*
>> EOL; if it were to apply them one char further, users could then set (or
>> unset) the :extend property on these faces.
>>
>> I'm attaching a patch only for demonstration purposes; I do not know
>> whether it should be applied as-is. It does Work For Me®, but:
>
> Makes sense to me, so I've applied it to Emacs 28.
Thanks (publicly this time) for the prompt reply!
Thinking about it some more, I wonder whether the summary faces
(e.g. gnus-summary-selected, gnus-summary-selected) should be defined
with :extend t?
It's not a decision to make lightly of course, since :extend is special
in that themes inherit the value from the original definition. I do
think it makes sense though; for gnus-summary-selected at least, I find
that it makes it easier to keep track of the currently selected article.
Obligatory "everybody else does it this way®" lightning round:
KMail
https://commons.wikimedia.org/wiki/File:Kmail-screenshot.png
Thunderbird
https://commons.wikimedia.org/wiki/File:Thunderbird_screenshot_2.png
https://screenshots.debian.net/package/thunderbird#gallery-2
aerc
https://yukari.sr.ht/aerc-intro.webm (t=35s)
Zimbra
https://www.zimbra.com/wp-content/uploads/2015/12/screenshot_messaging_and_collaboration.png
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line
2021-03-12 18:13 ` Kévin Le Gouguec
@ 2021-03-16 0:25 ` Lars Ingebrigtsen
2021-03-16 18:15 ` Kévin Le Gouguec
0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-16 0:25 UTC (permalink / raw)
To: Kévin Le Gouguec; +Cc: 47026
Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
> Thinking about it some more, I wonder whether the summary faces
> (e.g. gnus-summary-selected, gnus-summary-selected) should be defined
> with :extend t?
>
> It's not a decision to make lightly of course, since :extend is special
> in that themes inherit the value from the original definition. I do
> think it makes sense though; for gnus-summary-selected at least, I find
> that it makes it easier to keep track of the currently selected article.
I think that makes sense -- I mean, that's how Gnus displayed these
things before Emacs was changed (incompatibly) in how faces on newline
characters is displayed.
That is, I think adding :extend t to most Gnus summary faces just brings
us back to how it was designed to be displayed.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line
2021-03-16 0:25 ` Lars Ingebrigtsen
@ 2021-03-16 18:15 ` Kévin Le Gouguec
2021-03-16 23:15 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Kévin Le Gouguec @ 2021-03-16 18:15 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 47026
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
>
>> Thinking about it some more, I wonder whether the summary faces
>> (e.g. gnus-summary-selected, gnus-summary-selected) should be defined
>> with :extend t?
>>
>> It's not a decision to make lightly of course, since :extend is special
>> in that themes inherit the value from the original definition. I do
>> think it makes sense though; for gnus-summary-selected at least, I find
>> that it makes it easier to keep track of the currently selected article.
>
> I think that makes sense -- I mean, that's how Gnus displayed these
> things before Emacs was changed (incompatibly) in how faces on newline
> characters is displayed.
>
> That is, I think adding :extend t to most Gnus summary faces just brings
> us back to how it was designed to be displayed.
Mmm, unless I'm missing something, before my patch, the face was not
applied to the final newline, so even with :extend t the rest of the
line was not highlighted.
To double-check, I just fired up 26.3, removed %( and %) from
gnus-summary-line-format, added a background to gnus-summary-selected,
and opened a summary buffer: sure enough, the background stopped at the
last character, without extending to the window edge.
(Sorry if I'm misunderstanding your point)
Regardless, if we agree that :extend t makes sense, I'll cook up a patch
sometime next week if nobody beats me to it (a bit swamped at the
moment).
Thank you for your time.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line
2021-03-16 18:15 ` Kévin Le Gouguec
@ 2021-03-16 23:15 ` Lars Ingebrigtsen
0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-16 23:15 UTC (permalink / raw)
To: Kévin Le Gouguec; +Cc: 47026
Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:
>> That is, I think adding :extend t to most Gnus summary faces just brings
>> us back to how it was designed to be displayed.
>
> Mmm, unless I'm missing something, before my patch, the face was not
> applied to the final newline, so even with :extend t the rest of the
> line was not highlighted.
>
> To double-check, I just fired up 26.3, removed %( and %) from
> gnus-summary-line-format, added a background to gnus-summary-selected,
> and opened a summary buffer: sure enough, the background stopped at the
> last character, without extending to the window edge.
I didn't mean `gnus-summary-selected' here, but other Gnus summary
faces, like `gnus-summary-normal-ticked'.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-16 23:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-09 18:51 bug#47026: 28.0.50; Allow Gnus summary faces to extend to end of line Kévin Le Gouguec
2021-03-10 15:15 ` Lars Ingebrigtsen
2021-03-12 18:13 ` Kévin Le Gouguec
2021-03-16 0:25 ` Lars Ingebrigtsen
2021-03-16 18:15 ` Kévin Le Gouguec
2021-03-16 23:15 ` Lars Ingebrigtsen
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.