Subject: 28.0.50; Allow Gnus summary faces to extend to end of line

From: Kévin Le Gouguec <[email-masked]>
Date: Tue, 09 Mar 2021 19:51:10 +0100

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.

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

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