all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
@ 2020-07-04  2:29 Erik Hetzner
  2020-07-04 17:13 ` Kévin Le Gouguec
  0 siblings, 1 reply; 20+ messages in thread
From: Erik Hetzner @ 2020-07-04  2:29 UTC (permalink / raw)
  To: 42184

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

Setting `org-fontify-whole-heading-line' and `org-fontify-whole-block-delimiter-line' does not give a background color to the entire line in emacs 27. It works in 26.3 (although the latter variable is not present).

To reproduce, evaluate:

(require 'org)
(setq org-fontify-whole-heading-line t
      org-fontify-whole-block-delimiter-line t) ;; omit in emacs 26
(load-theme 'leuven t) ;; uses a colored background for org headings

Then open a simple org file, e.g.

* Hello world
** test
#+begin_src
#+end_src

In emacs 26.3, the entire heading line (and block delimiter) has a background color. In emacs 27, this is not the case.

See attached images.


[-- Attachment #2: emacs-26.png --]
[-- Type: image/png, Size: 6528 bytes --]

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



[-- Attachment #4: emacs-27.png --]
[-- Type: image/png, Size: 6425 bytes --]

[-- Attachment #5: Type: text/plain, Size: 4079 bytes --]


In GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
 of 2020-06-29 built on lcy01-amd64-005
Repository revision: 59e768d64ad97782249fda9e53b6adc94c6d0130
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit

Configured using:
 'configure --prefix= --prefix=/snap/emacs/current/usr --with-xwidgets
 --with-x-toolkit=gtk3 --without-xaw3d --with-modules --with-cairo
 'CFLAGS= -isystem/build/emacs/parts/emacs/install/usr/include'
 'CPPFLAGS= -isystem/build/emacs/parts/emacs/install/usr/include'
 'LDFLAGS= -L/build/emacs/parts/emacs/install/lib
 -L/build/emacs/parts/emacs/install/usr/lib
 -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
 -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu''

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr ob-ditaa ob-plantuml ol-bibtex bibtex org-clock
org-colview org-crypt org-habit org-agenda org-indent org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp
org-table ol org-loaddefs find-func cal-menu calendar cal-loaddefs
org-list org-pcomplete pcomplete org-src org-keys ob-comint comint
ansi-color ring ob-core org-compat advice ob-eval org-macs thingatpt
help-fns radix-tree help-mode emacsbug message rmc puny dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache
epa derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date subr-x seq byte-opt gv bytecomp
byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting xwidget-internal cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 114056 8874)
 (symbols 48 12853 1)
 (strings 32 44116 2167)
 (string-bytes 1 1452734)
 (vectors 16 19756)
 (vector-slots 8 231546 15454)
 (floats 8 80 118)
 (intervals 56 298 0)
 (buffers 1000 12))

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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-04  2:29 bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27 Erik Hetzner
@ 2020-07-04 17:13 ` Kévin Le Gouguec
  2020-07-04 17:18   ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-04 17:13 UTC (permalink / raw)
  To: Erik Hetzner; +Cc: 42184

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

Erik Hetzner <egh@e6h.org> writes:

> In emacs 26.3, the entire heading line (and block delimiter) has a background color. In emacs 27, this is not the case.
>
> See attached images.

With the attached diff against leuven, running

    emacs -Q -l $your_elisp_snippet $your_org_file

yields this (with commit d453cee177 on emacs-27):


[-- Attachment #2: bug#42184-leuven-patch.png --]
[-- Type: image/png, Size: 23363 bytes --]

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


I don't know if patching leuven is TRT?  Maybe the :extend t should be
added to the face definitions directly, since Org provides a knob
(org-fontify-whole-heading-line) to control whether the final newline is
fontified?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: leuven.patch --]
[-- Type: text/x-patch, Size: 3599 bytes --]

diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index c298b536d2..30ac880e00 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -45,7 +45,7 @@ leuven
       ;; Leuven generic colors
       (cancel '(:slant italic :strike-through t :foreground "gray55"))
       (clock-line '(:box (:line-width 1 :color "#335EA8") :foreground "black" :background "#EEC900"))
-      (code-block '(:foreground "#000088" :background "#FFFFE0"))
+      (code-block '(:foreground "#000088" :background "#FFFFE0" :extend t))
       (code-inline '(:foreground "#006400" :background "#FDFFF7"))
       (column '(:height 1.0 :weight normal :slant normal :underline nil :strike-through nil :foreground "#E6AD4F" :background "#FFF2DE"))
       (diff-added '(:foreground "#008000" :background "#DDFFDD"))
@@ -66,14 +66,14 @@ leuven
       (mail-unread '(:weight bold :foreground "black"))
       (marked-line '(:weight bold :foreground "white" :background "red"))
       (match '(:weight bold :background "#FBE448")) ; occur patterns
-      (ol1 '(:height 1.3 :weight bold :overline "#A7A7A7" :foreground "#3C3C3C" :background "#F0F0F0"))
-      (ol2 '(:height 1.0 :weight bold :overline "#123555" :foreground "#123555" :background "#E5F4FB"))
-      (ol3 '(:height 1.0 :weight bold :foreground "#005522" :background "#EFFFEF"))
-      (ol4 '(:height 1.0 :weight bold :slant normal :foreground "#EA6300"))
-      (ol5 '(:height 1.0 :weight bold :slant normal :foreground "#E3258D"))
-      (ol6 '(:height 1.0 :weight bold :slant italic :foreground "#0077CC"))
-      (ol7 '(:height 1.0 :weight bold :slant italic :foreground "#2EAE2C"))
-      (ol8 '(:height 1.0 :weight bold :slant italic :foreground "#FD8008"))
+      (ol1 '(:height 1.3 :weight bold :overline "#A7A7A7" :foreground "#3C3C3C" :background "#F0F0F0" :extend t))
+      (ol2 '(:height 1.0 :weight bold :overline "#123555" :foreground "#123555" :background "#E5F4FB" :extend t))
+      (ol3 '(:height 1.0 :weight bold :foreground "#005522" :background "#EFFFEF" :extend t))
+      (ol4 '(:height 1.0 :weight bold :slant normal :foreground "#EA6300" :extend t))
+      (ol5 '(:height 1.0 :weight bold :slant normal :foreground "#E3258D" :extend t))
+      (ol6 '(:height 1.0 :weight bold :slant italic :foreground "#0077CC" :extend t))
+      (ol7 '(:height 1.0 :weight bold :slant italic :foreground "#2EAE2C" :extend t))
+      (ol8 '(:height 1.0 :weight bold :slant italic :foreground "#FD8008" :extend t))
       (paren-matched '(:background "#99CCFF"))
       (paren-unmatched '(:underline "red" :foreground nil :background "#FFDCDC"))
       (region '(:background "#ABDFFA"))
@@ -515,8 +515,8 @@ leuven
    `(org-beamer-tag ((,class (:box (:line-width 1 :color "#FABC18") :foreground "#2C2C2C" :background "#FFF8D0"))))
    `(org-block ((,class ,code-block)))
    `(org-block-background ((,class (:background "#FFFFE0"))))
-   `(org-block-begin-line ((,class (:underline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
-   `(org-block-end-line ((,class (:overline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
+   `(org-block-begin-line ((,class (:underline "#A7A6AA" :foreground "#555555" :background "#E2E1D5" :extend t))))
+   `(org-block-end-line ((,class (:overline "#A7A6AA" :foreground "#555555" :background "#E2E1D5" :extend t))))
    `(org-checkbox ((,class (:weight bold :box (:line-width 1 :style pressed-button) :foreground "white" :background "#777777"))))
    `(org-clock-overlay ((,class (:foreground "white" :background "SkyBlue4"))))
    `(org-code ((,class ,code-inline)))

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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-04 17:13 ` Kévin Le Gouguec
@ 2020-07-04 17:18   ` Eli Zaretskii
  2020-07-04 17:50     ` Kévin Le Gouguec
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-07-04 17:18 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: egh, 42184

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Date: Sat, 04 Jul 2020 19:13:58 +0200
> Cc: 42184@debbugs.gnu.org
> 
> I don't know if patching leuven is TRT?  Maybe the :extend t should be
> added to the face definitions directly, since Org provides a knob
> (org-fontify-whole-heading-line) to control whether the final newline is
> fontified?

Yes, I think the change should be in Org, not in the themes.





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-04 17:18   ` Eli Zaretskii
@ 2020-07-04 17:50     ` Kévin Le Gouguec
  2020-07-04 19:52       ` Kévin Le Gouguec
  0 siblings, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-04 17:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184, Nicolas Goaziou, Bastien

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
>> Date: Sat, 04 Jul 2020 19:13:58 +0200
>> Cc: 42184@debbugs.gnu.org
>> 
>> I don't know if patching leuven is TRT?  Maybe the :extend t should be
>> added to the face definitions directly, since Org provides a knob
>> (org-fontify-whole-heading-line) to control whether the final newline is
>> fontified?
>
> Yes, I think the change should be in Org, not in the themes.

OK.  Paging in Nicolas and Bastien (I don't know who exactly should join
in on our fun, or if I should just cross-post to emacs-orgmode@gnu.org).

Have the Org maintainers given some thought to what should become of
org-fontify-whole-heading-line and
org-fontify-whole-block-delimiter-line from Emacs 27 onward?

If these options still make sense (i.e. users should be able to choose
between extended or non-extended backgrounds/under/overlines,
independently of how themes customize the faces), org-level-* and
org-block-{begin,end}-line should probably be defined with :extend t?


Relatedly (but not crucial to solving this bug), should org-block and
org-block-background also have :extend t?  It would make sense to me
since they delimit visual "blocks".


Last question (that one might be answered somewhere in Org's
documentation): how should we patch org-mode?  First on emacs-27, then
on org-mode's maint branch?





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-04 17:50     ` Kévin Le Gouguec
@ 2020-07-04 19:52       ` Kévin Le Gouguec
  2020-07-05  2:30         ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-04 19:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184, Nicolas Goaziou, Bastien

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

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> If these options still make sense (i.e. users should be able to choose
> between extended or non-extended backgrounds/under/overlines,
> independently of how themes customize the faces), org-level-* and
> org-block-{begin,end}-line should probably be defined with :extend t?

To make the discussion more concrete: here's a suggested patch for Org
against the emacs-27 branch; what say you?


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

diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index c1aaf17ca2..7c905ef07e 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -334,6 +334,13 @@ org-compatible-face
     specs))
 (make-obsolete 'org-compatible-face "you can remove it." "Org 9.0")
 
+(defmacro org-extended-face (attributes)
+  "Make face that extends beyond end of line.
+
+Up to Emacs 26, all faces extended beyond end of line; getting
+the same behaviour starting with Emacs 27 requires :extend t."
+  `(nconc ,attributes (when (>= emacs-major-version 27) '(:extend t))))
+
 (defun org-add-link-type (type &optional follow export)
   "Add a new TYPE link.
 FOLLOW and EXPORT are two functions.
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 30eab9bc6b..37a47e7c50 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -28,6 +28,8 @@
 
 ;;; Code:
 
+(require 'org-compat)
+
 (defgroup org-faces nil
   "Faces in Org mode."
   :tag "Org Faces"
@@ -45,35 +47,35 @@ org-hide
 color of the frame."
   :group 'org-faces)
 
-(defface org-level-1 '((t :inherit outline-1))
+(defface org-level-1 `((t ,(org-extended-face '(:inherit outline-1))))
   "Face used for level 1 headlines."
   :group 'org-faces)
 
-(defface org-level-2 '((t :inherit outline-2))
+(defface org-level-2 `((t ,(org-extended-face '(:inherit outline-2))))
   "Face used for level 2 headlines."
   :group 'org-faces)
 
-(defface org-level-3 '((t :inherit outline-3))
+(defface org-level-3 `((t ,(org-extended-face '(:inherit outline-3))))
   "Face used for level 3 headlines."
   :group 'org-faces)
 
-(defface org-level-4 '((t :inherit outline-4))
+(defface org-level-4 `((t ,(org-extended-face '(:inherit outline-4))))
   "Face used for level 4 headlines."
   :group 'org-faces)
 
-(defface org-level-5 '((t :inherit outline-5))
+(defface org-level-5 `((t ,(org-extended-face '(:inherit outline-5))))
   "Face used for level 5 headlines."
   :group 'org-faces)
 
-(defface org-level-6 '((t :inherit outline-6))
+(defface org-level-6 `((t ,(org-extended-face '(:inherit outline-6))))
   "Face used for level 6 headlines."
   :group 'org-faces)
 
-(defface org-level-7 '((t :inherit outline-7))
+(defface org-level-7 `((t ,(org-extended-face '(:inherit outline-7))))
   "Face used for level 7 headlines."
   :group 'org-faces)
 
-(defface org-level-8 '((t :inherit outline-8))
+(defface org-level-8 `((t ,(org-extended-face '(:inherit outline-8))))
   "Face used for level 8 headlines."
   :group 'org-faces)
 
@@ -399,11 +401,16 @@ org-block
   :group 'org-faces
   :version "26.1")
 
-(defface org-block-begin-line '((t (:inherit org-meta-line)))
+(defface org-block-begin-line `((t ,(org-extended-face
+                                     '(:inherit org-meta-line))))
   "Face used for the line delimiting the begin of source blocks."
   :group 'org-faces)
 
-(defface org-block-end-line '((t (:inherit org-block-begin-line)))
+;; Explicitly extend this face; if a theme does not make it inherit
+;; from org-block-begin-line, the :extend attribute will remain
+;; unspecified.
+(defface org-block-end-line `((t ,(org-extended-face
+                                   '(:inherit org-block-begin-line))))
   "Face used for the line delimiting the end of source blocks."
   :group 'org-faces)
 

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


See the screenshots posted by Erik at the beginning of this thread[1]
and mine[2] for comparison.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42184#5
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42184#8

My aim was to allow you (Org maintainers) to commit this verbatim to the
org-mode repository, where you probably want to keep supporting Emacs
≤26.3.

NB: I'm far from an Elisp wizard, there may more elegant ways to solve
this than my backquotefest; suggestions welcome.

> Relatedly (but not crucial to solving this bug), should org-block and
> org-block-background also have :extend t?  It would make sense to me
> since they delimit visual "blocks".

I still think the answer to the above is "yes".  Will add to my patch if
you agree.

> Last question (that one might be answered somewhere in Org's
> documentation): how should we patch org-mode?  First on emacs-27, then
> on org-mode's maint branch?


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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-04 19:52       ` Kévin Le Gouguec
@ 2020-07-05  2:30         ` Eli Zaretskii
  2020-07-05  8:57           ` Kévin Le Gouguec
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-07-05  2:30 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: egh, 42184, mail, bzg

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: egh@e6h.org,  42184@debbugs.gnu.org,  Nicolas Goaziou
>  <mail@nicolasgoaziou.fr>,  Bastien <bzg@gnu.org>
> Date: Sat, 04 Jul 2020 21:52:08 +0200
> 
> To make the discussion more concrete: here's a suggested patch for Org
> against the emacs-27 branch; what say you?

I don't understand why you extend all those faces: the original report
was about a much smaller set.  It is not the intent that every face
that happens to span the entire line be extended: that's why we made
':extend' by default be off for a face.

What am I missing?





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-05  2:30         ` Eli Zaretskii
@ 2020-07-05  8:57           ` Kévin Le Gouguec
  2020-07-05 14:58             ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-05  8:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184, mail, bzg

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
>> Cc: egh@e6h.org,  42184@debbugs.gnu.org,  Nicolas Goaziou
>>  <mail@nicolasgoaziou.fr>,  Bastien <bzg@gnu.org>
>> Date: Sat, 04 Jul 2020 21:52:08 +0200
>> 
>> To make the discussion more concrete: here's a suggested patch for Org
>> against the emacs-27 branch; what say you?
>
> I don't understand why you extend all those faces: the original report
> was about a much smaller set.  It is not the intent that every face
> that happens to span the entire line be extended: that's why we made
> ':extend' by default be off for a face.
>
> What am I missing?

The original report was about the org-level-1 and org-level-2 faces, as
well as org-block-begin-line and the org-block-end-line.

The only faces I added were org-level-[3-8], because I don't see why
different heading levels should not work with
org-fontify-whole-heading-line.

AFAICT, this is the simplest way to fix org-fontify-whole-heading-line
and org-fontify-whole-block-delimiter-line for Emacs ≥27.  These user
options work under the assumption that simply fontifying the final
newline is enough to extend attributes past EOL.


The long term fix might be for Org to (1) deprecate these user options
and let themes and/or users apply :extend t themselves, or (2) slap
:extend t onto the faces when setting up the major mode fontification
depending on these user options (Org already does similar on-the-fly
face tweaks; see e.g. org-hide).  Or something else.

It seems to me that this kind of change would be somewhat more involved
and breakage-prone, but if Org maintainers think this is the way forward
for emacs-27, I wouldn't mind.





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-05  8:57           ` Kévin Le Gouguec
@ 2020-07-05 14:58             ` Eli Zaretskii
  2020-07-05 16:02               ` Kévin Le Gouguec
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-07-05 14:58 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: egh, 42184, mail, bzg

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: egh@e6h.org,  42184@debbugs.gnu.org,  mail@nicolasgoaziou.fr,  bzg@gnu.org
> Date: Sun, 05 Jul 2020 10:57:34 +0200
> 
> > I don't understand why you extend all those faces: the original report
> > was about a much smaller set.  It is not the intent that every face
> > that happens to span the entire line be extended: that's why we made
> > ':extend' by default be off for a face.
> >
> > What am I missing?
> 
> The original report was about the org-level-1 and org-level-2 faces, as
> well as org-block-begin-line and the org-block-end-line.

Yes.  So I'd expect to see the respective faces have the :extend
attribute under each one of the 2 options cited in the original
report.

> The only faces I added were org-level-[3-8], because I don't see why
> different heading levels should not work with
> org-fontify-whole-heading-line.

The original code only affects certain heading levels, it doesn't
affect all of them.  So I see no need for any "consistency" here.

More generally, the :extend attribute is by default off because we
want most of the faces not to be extended.  Let's only extend the
minimum, not anything that could be extended in principle.  Which is
another aspect of your proposed patch I'd like to change: it seems to
cause these faces be extended unconditionally, not just under these
optional variables.  Or did I miss something?

> AFAICT, this is the simplest way to fix org-fontify-whole-heading-line
> and org-fontify-whole-block-delimiter-line for Emacs ≥27.  These user
> options work under the assumption that simply fontifying the final
> newline is enough to extend attributes past EOL.

Nevertheless, I would like to see the :extend attribute applied only
under the above options; there's the set-face-extend function for
doing that.

> The long term fix might be for Org to (1) deprecate these user options
> and let themes and/or users apply :extend t themselves, or (2) slap
> :extend t onto the faces when setting up the major mode fontification
> depending on these user options (Org already does similar on-the-fly
> face tweaks; see e.g. org-hide).  Or something else.

I don't see why these options should be deprecated, and even less why
the faces should have the :extend attribute.  It would go against the
intent behind introducing that attribute in the first place.

Thanks.





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-05 14:58             ` Eli Zaretskii
@ 2020-07-05 16:02               ` Kévin Le Gouguec
  2020-07-05 16:21                 ` Eli Zaretskii
  2020-07-08 11:50                 ` Kévin Le Gouguec
  0 siblings, 2 replies; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-05 16:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184, mail, bzg

Eli Zaretskii <eliz@gnu.org> writes:

>> The only faces I added were org-level-[3-8], because I don't see why
>> different heading levels should not work with
>> org-fontify-whole-heading-line.
>
> The original code only affects certain heading levels, it doesn't
> affect all of them.

By "the original code", you mean this part in
org-set-font-lock-defaults, right?

> 	   `(,(if org-fontify-whole-heading-line
> 		  "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)"
> 		"^\\(\\**\\)\\(\\* \\)\\(.*\\)")

That seems to apply to all heading levels to me?  Group 1 captures all
but the last stars, group 2 the last star, and group 3 the heading text?

>                                                             Which is
> another aspect of your proposed patch I'd like to change: it seems to
> cause these faces be extended unconditionally, not just under these
> optional variables.  Or did I miss something?

IIUC, org-fontify-whole-heading-line (which predates :extend t) is Org's
way of letting users "opt in" to face extension, by applying the
org-level-* face to the final newline *iff* this user option is set.

Adding :extend t to the face definition thus will not cause the
backgrounds to extend unconditionally: as long as the user option is
unset, the final newline will not be fontified.

>> AFAICT, this is the simplest way to fix org-fontify-whole-heading-line
>> and org-fontify-whole-block-delimiter-line for Emacs ≥27.  These user
>> options work under the assumption that simply fontifying the final
>> newline is enough to extend attributes past EOL.
>
> Nevertheless, I would like to see the :extend attribute applied only
> under the above options; there's the set-face-extend function for
> doing that.

OK.  That's more or less what I had in mind when I went into my
"long-term fix" ideas.

Note that Org tries to support older Emacs versions.  AFAICT, with my
patch, (1) org-fontify-whole-heading-line is fixed for Emacs 27, (2) no
further modification is needed for Emacs ≤26.

I can try to cook up a patch based on set-face-extend instead, with all
the fboundp fun that entails to prevent byte-compiler warnings with
older Emacs versions.  I'm not sure where the calls to set-face-extend
should be inserted; when setting up the major mode?

At this point, I should probably wait for Org maintainers to chime in…





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-05 16:02               ` Kévin Le Gouguec
@ 2020-07-05 16:21                 ` Eli Zaretskii
  2020-07-08 11:50                 ` Kévin Le Gouguec
  1 sibling, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2020-07-05 16:21 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: egh, 42184, mail, bzg

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: egh@e6h.org,  42184@debbugs.gnu.org,  mail@nicolasgoaziou.fr,  bzg@gnu.org
> Date: Sun, 05 Jul 2020 18:02:04 +0200
> 
> At this point, I should probably wait for Org maintainers to chime in…

Indeed, and so would I.





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-05 16:02               ` Kévin Le Gouguec
  2020-07-05 16:21                 ` Eli Zaretskii
@ 2020-07-08 11:50                 ` Kévin Le Gouguec
  2020-07-09 14:16                   ` Kévin Le Gouguec
  1 sibling, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-08 11:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184, mail, bzg

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

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

>>> AFAICT, this is the simplest way to fix org-fontify-whole-heading-line
>>> and org-fontify-whole-block-delimiter-line for Emacs ≥27.  These user
>>> options work under the assumption that simply fontifying the final
>>> newline is enough to extend attributes past EOL.
>>
>> Nevertheless, I would like to see the :extend attribute applied only
>> under the above options; there's the set-face-extend function for
>> doing that.
>
> OK.  That's more or less what I had in mind when I went into my
> "long-term fix" ideas.
>
> Note that Org tries to support older Emacs versions.  AFAICT, with my
> patch, (1) org-fontify-whole-heading-line is fixed for Emacs 27, (2) no
> further modification is needed for Emacs ≤26.
>
> I can try to cook up a patch based on set-face-extend instead, with all
> the fboundp fun that entails to prevent byte-compiler warnings with
> older Emacs versions.  I'm not sure where the calls to set-face-extend
> should be inserted; when setting up the major mode?

Since all the other threads I'm following are stalled, I've taken a stab
at this:


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

diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index c1aaf17ca2..b53c06c94f 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -101,6 +101,10 @@ org-table1-hline-regexp
   (defun org-time-convert-to-list (time)
     (seconds-to-time (float-time time))))
 
+(defun org--extend-faces (faces)
+  (when (fboundp 'set-face-extend)
+    (mapc (lambda (f) (set-face-extend f t)) faces)))
+
 \f
 ;;; Emacs < 26.1 compatibility
 
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 568f5b9b87..7ff4f5587f 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -5310,6 +5310,9 @@ org-fontify-meta-lines-and-blocks-1
 	     beg-of-endline
 	     (min (point-max) (if whole-blockline (min (point-max) (1+ end-of-endline)) end-of-endline))
 	     '(face org-block-end-line))
+            (when whole-blockline
+              (org--extend-faces '(org-block-begin-line
+                                   org-block-end-line)))
 	    t))
 	 ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
 	  (org-remove-flyspell-overlays-in
@@ -5600,7 +5603,8 @@ org-set-font-lock-defaults
 	   '(org-font-lock-hook)
 	   ;; Headlines
 	   `(,(if org-fontify-whole-heading-line
-		  "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)"
+		  (prog1 "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)"
+                    (org--extend-faces org-level-faces))
 		"^\\(\\**\\)\\(\\* \\)\\(.*\\)")
 	     (1 (org-get-level-face 1))
 	     (2 (org-get-level-face 2))

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


While it fixes the issue, I don't know if it's the cleanest way to do it
(repeatedly calling set-face-extend on the same faces every time an Org
buffer is opened/reverted seems a bit silly).


Also, while this is not part of the report because Erik's example
happens not to have any text between the block delimiters (#+begin_src
and #+end_src), I would like to re-emphasize that I'm pretty sure
org-block (and maybe org-quote and org-verse) should be defined with
:extend t unconditionally, to maintain the "rectangular" aspect the
blocks have in a browser once exported to HTML:


[-- Attachment #4: bug#42184-org-block.png --]
[-- Type: image/png, Size: 319121 bytes --]

[-- Attachment #5: Type: text/plain, Size: 84 bytes --]


If people agree, I can make at patch similar to bug#42184#17 for those
faces only.

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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-08 11:50                 ` Kévin Le Gouguec
@ 2020-07-09 14:16                   ` Kévin Le Gouguec
  2020-08-06  4:10                     ` Kyle Meyer
  0 siblings, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-07-09 14:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184, mail, bzg

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

Here is a variant of the previous patch, which correctly resets :extend
to nil if the user disables the relevant options (after reverting the
current buffer, or for newly opened ones).

This ends up looking similar to what Org does for org-hide; IMO this
seems like the most straightforward short-term fix.  In the long run,
these user options would probably deserve :set functions.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-org-fontify-whole-line-by-setting-face-extension.patch --]
[-- Type: text/x-patch, Size: 1851 bytes --]

From 07d123c548051eb7f6bbac5c7f5a4e4b8411f976 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
Date: Thu, 9 Jul 2020 16:02:49 +0200
Subject: [PATCH] Fix org-fontify-whole-*-line by setting face extension
 (bug#42184)

* lisp/org/org-compat.el (org--set-faces-extend): New function to set
face extension, for Emacs versions where this attribute exists.
* lisp/org/org.el (org-mode): Call it to set the extend attribute of
relevant faces to the correct value.
---
 lisp/org/org-compat.el | 4 ++++
 lisp/org/org.el        | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index c1aaf17ca2..fcc325e475 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -101,6 +101,10 @@ org-table1-hline-regexp
   (defun org-time-convert-to-list (time)
     (seconds-to-time (float-time time))))
 
+(defun org--set-faces-extend (faces extend-p)
+  (when (fboundp 'set-face-extend)
+    (mapc (lambda (f) (set-face-extend f extend-p)) faces)))
+
 \f
 ;;; Emacs < 26.1 compatibility
 
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 568f5b9b87..fb31336ea4 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -4944,7 +4944,11 @@ org-mode
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
     (when foreground
-      (set-face-foreground 'org-hide foreground))))
+      (set-face-foreground 'org-hide foreground)))
+  ;; Set face extension as requested.
+  (org--set-faces-extend '(org-block-begin-line org-block-end-line)
+                         org-fontify-whole-block-delimiter-line)
+  (org--set-faces-extend org-level-faces org-fontify-whole-heading-line))
 
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist
-- 
2.27.0


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


Should I post this patch to the org-mode mailing list?

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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-07-09 14:16                   ` Kévin Le Gouguec
@ 2020-08-06  4:10                     ` Kyle Meyer
  2020-08-06  9:32                       ` Kévin Le Gouguec
  2020-08-06 13:35                       ` Eli Zaretskii
  0 siblings, 2 replies; 20+ messages in thread
From: Kyle Meyer @ 2020-08-06  4:10 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: egh, 42184, mail, bzg

Kévin Le Gouguec writes:

> Here is a variant of the previous patch, which correctly resets :extend
> to nil if the user disables the relevant options (after reverting the
> current buffer, or for newly opened ones).
>
> This ends up looking similar to what Org does for org-hide; IMO this
> seems like the most straightforward short-term fix.  In the long run,
> these user options would probably deserve :set functions.

Thanks for working on this fix.  I of course can't speak for Bastien or
Nicolas, but this patch looks fine to me.  Assuming it's okay with Eli,
I'd suggest applying it to the emacs-27 branch.  (Once applied, I'd port
it to the Org repo, as I do with other changes in the Emacs repo that
touch Org files.)

Upstream in the thread you wrote:

> Relatedly (but not crucial to solving this bug), should org-block and
> org-block-background also have :extend t?  It would make sense to me
> since they delimit visual "blocks".

That would make sense to me as well.  (org-block-background hasn't
existed since v8.3, though.)





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-08-06  4:10                     ` Kyle Meyer
@ 2020-08-06  9:32                       ` Kévin Le Gouguec
  2020-08-06 13:35                       ` Eli Zaretskii
  1 sibling, 0 replies; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-08-06  9:32 UTC (permalink / raw)
  To: 42184

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

Kyle Meyer <kyle@kyleam.com> writes:

> Kévin Le Gouguec writes:
>
>> Here is a variant of the previous patch, which correctly resets :extend
>> to nil if the user disables the relevant options (after reverting the
>> current buffer, or for newly opened ones).
>>
>> This ends up looking similar to what Org does for org-hide; IMO this
>> seems like the most straightforward short-term fix.  In the long run,
>> these user options would probably deserve :set functions.
>
> Thanks for working on this fix.  I of course can't speak for Bastien or
> Nicolas, but this patch looks fine to me.  Assuming it's okay with Eli,
> I'd suggest applying it to the emacs-27 branch.  (Once applied, I'd port
> it to the Org repo, as I do with other changes in the Emacs repo that
> touch Org files.)

Thank you for the review.  I hope this can make it into 27.1 since this
bug seems to be getting some attention[1][2], but the (tentative?)
etc/HISTORY file on the emacs-27 branch makes me wonder if we aren't too
close to the release day…

> Upstream in the thread you wrote:
>
>> Relatedly (but not crucial to solving this bug), should org-block and
>> org-block-background also have :extend t?  It would make sense to me
>> since they delimit visual "blocks".
>
> That would make sense to me as well.

OK, here's a patch to do that for org-block:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org-org-faces.el-org-block-Set-face-extension-b.patch --]
[-- Type: text/x-patch, Size: 869 bytes --]

From e489b09d27a36fdf0366a2fecba31eda475bc14d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
Date: Thu, 6 Aug 2020 10:59:38 +0200
Subject: [PATCH] * lisp/org/org-faces.el (org-block): Set face extension
 beyond EOL

---
 lisp/org/org-faces.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 30eab9bc6b..eba5a484ac 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -393,7 +393,7 @@ org-document-info-keyword
   "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
   :group 'org-faces)
 
-(defface org-block '((t :inherit shadow))
+(defface org-block '((t (:extend t :inherit shadow)))
   "Face text in #+begin ... #+end blocks.
 For source-blocks `org-src-block-faces' takes precedence."
   :group 'org-faces
-- 
2.28.0


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


>                                       (org-block-background hasn't
> existed since v8.3, though.)

Huh!  I guess that calls for a further patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0001-etc-themes-leuven-theme.el-class-Remove-obsolete-fac.patch --]
[-- Type: text/x-patch, Size: 1151 bytes --]

From 9b303ca5b717f5ed1ef48cb3a7d40693ec2dc8e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
Date: Thu, 6 Aug 2020 10:45:39 +0200
Subject: [PATCH] * etc/themes/leuven-theme.el (class): Remove obsolete face

---
 etc/themes/leuven-theme.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index 4d8568b7d8..4d8cf0f869 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -515,7 +515,6 @@ leuven
    `(org-archived ((,class (:foreground "gray70"))))
    `(org-beamer-tag ((,class (:box (:line-width 1 :color "#FABC18") :foreground "#2C2C2C" :background "#FFF8D0"))))
    `(org-block ((,class ,code-block)))
-   `(org-block-background ((,class (:background "#FFFFE0"))))
    `(org-block-begin-line ((,class (:underline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
    `(org-block-end-line ((,class (:overline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
    `(org-checkbox ((,class (:weight bold :box (:line-width 1 :style pressed-button) :foreground "white" :background "#777777"))))
-- 
2.28.0


[-- Attachment #5: Type: text/plain, Size: 121 bytes --]


(AFAICT this was the only reference to org-block-background in all Elisp
files.)

All three patches squashed together:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0001-Fix-org-fontify-whole-line-by-setting-face-extension.patch --]
[-- Type: text/x-patch, Size: 3380 bytes --]

From 4328455c2d99ae118fa36401ea89d0e7cbb8c815 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
Date: Thu, 9 Jul 2020 16:02:49 +0200
Subject: [PATCH] Fix org-fontify-whole-*-line by setting face extension
 (bug#42184)

* lisp/org/org-compat.el (org--set-faces-extend): New function to set
face extension, for Emacs versions where this attribute exists.
* lisp/org/org.el (org-mode): Call it to set the extend attribute of
relevant faces to the correct value.

* lisp/org/org-faces.el (org-block): Set face extension beyond EOL.
* etc/themes/leuven-theme.el (class): Remove obsolete face.
---
 etc/themes/leuven-theme.el | 1 -
 lisp/org/org-compat.el     | 4 ++++
 lisp/org/org-faces.el      | 2 +-
 lisp/org/org.el            | 6 +++++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index 4d8568b7d8..4d8cf0f869 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -515,7 +515,6 @@ leuven
    `(org-archived ((,class (:foreground "gray70"))))
    `(org-beamer-tag ((,class (:box (:line-width 1 :color "#FABC18") :foreground "#2C2C2C" :background "#FFF8D0"))))
    `(org-block ((,class ,code-block)))
-   `(org-block-background ((,class (:background "#FFFFE0"))))
    `(org-block-begin-line ((,class (:underline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
    `(org-block-end-line ((,class (:overline "#A7A6AA" :foreground "#555555" :background "#E2E1D5"))))
    `(org-checkbox ((,class (:weight bold :box (:line-width 1 :style pressed-button) :foreground "white" :background "#777777"))))
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index c1aaf17ca2..fcc325e475 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -101,6 +101,10 @@ org-table1-hline-regexp
   (defun org-time-convert-to-list (time)
     (seconds-to-time (float-time time))))
 
+(defun org--set-faces-extend (faces extend-p)
+  (when (fboundp 'set-face-extend)
+    (mapc (lambda (f) (set-face-extend f extend-p)) faces)))
+
 \f
 ;;; Emacs < 26.1 compatibility
 
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 30eab9bc6b..eba5a484ac 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -393,7 +393,7 @@ org-document-info-keyword
   "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
   :group 'org-faces)
 
-(defface org-block '((t :inherit shadow))
+(defface org-block '((t (:extend t :inherit shadow)))
   "Face text in #+begin ... #+end blocks.
 For source-blocks `org-src-block-faces' takes precedence."
   :group 'org-faces
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 568f5b9b87..fb31336ea4 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -4944,7 +4944,11 @@ org-mode
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
     (when foreground
-      (set-face-foreground 'org-hide foreground))))
+      (set-face-foreground 'org-hide foreground)))
+  ;; Set face extension as requested.
+  (org--set-faces-extend '(org-block-begin-line org-block-end-line)
+                         org-fontify-whole-block-delimiter-line)
+  (org--set-faces-extend org-level-faces org-fontify-whole-heading-line))
 
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist
-- 
2.28.0


[-- Attachment #7: Type: text/plain, Size: 198 bytes --]



[1] https://orgmode.org/list/87365za8yk.fsf@gmail.com/t/#mac68a8ca95f64cb3fe7161bb44454253aad39fd6
[2] https://old.reddit.com/r/emacs/comments/i26n46/why_does_my_orgmode_look_different_to_leuven/

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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-08-06  4:10                     ` Kyle Meyer
  2020-08-06  9:32                       ` Kévin Le Gouguec
@ 2020-08-06 13:35                       ` Eli Zaretskii
  2020-09-06  8:12                         ` Bastien
  1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-08-06 13:35 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: egh, 42184, kevin.legouguec, mail, bzg

> From: Kyle Meyer <kyle@kyleam.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  egh@e6h.org,  42184@debbugs.gnu.org,  mail@nicolasgoaziou.fr,  bzg@gnu.org
> Date: Thu, 06 Aug 2020 00:10:55 -0400
> 
> Kévin Le Gouguec writes:
> 
> > Here is a variant of the previous patch, which correctly resets :extend
> > to nil if the user disables the relevant options (after reverting the
> > current buffer, or for newly opened ones).
> >
> > This ends up looking similar to what Org does for org-hide; IMO this
> > seems like the most straightforward short-term fix.  In the long run,
> > these user options would probably deserve :set functions.
> 
> Thanks for working on this fix.  I of course can't speak for Bastien or
> Nicolas, but this patch looks fine to me.  Assuming it's okay with Eli,
> I'd suggest applying it to the emacs-27 branch.

It's too late for Emacs 27.1, and in any case I'd like to hear the
blessing of Org developers before installing this.  (I'd expect this
to be first installed in Org and then in Emacs, not the other way
around, but if it's okay with the Org folks to do it otherwise, I
won't object.)





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-08-06 13:35                       ` Eli Zaretskii
@ 2020-09-06  8:12                         ` Bastien
  2020-09-06 14:10                           ` Kévin Le Gouguec
                                             ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Bastien @ 2020-09-06  8:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: egh, 42184-done, Kyle Meyer, mail, kevin.legouguec

Hi,

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Kyle Meyer <kyle@kyleam.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  egh@e6h.org,  42184@debbugs.gnu.org,  mail@nicolasgoaziou.fr,  bzg@gnu.org
>> Date: Thu, 06 Aug 2020 00:10:55 -0400
>> 
>> Kévin Le Gouguec writes:
>> 
>> > Here is a variant of the previous patch, which correctly resets :extend
>> > to nil if the user disables the relevant options (after reverting the
>> > current buffer, or for newly opened ones).
>> >
>> > This ends up looking similar to what Org does for org-hide; IMO this
>> > seems like the most straightforward short-term fix.  In the long run,
>> > these user options would probably deserve :set functions.
>> 
>> Thanks for working on this fix.  I of course can't speak for Bastien or
>> Nicolas, but this patch looks fine to me.  Assuming it's okay with Eli,
>> I'd suggest applying it to the emacs-27 branch.
>
> It's too late for Emacs 27.1, and in any case I'd like to hear the
> blessing of Org developers before installing this.

The fix has been installed in Org and will be available for Org 9.4,
which we hope to release very soon.  So I'm closing this report now,
unless this is bad policy to close the bug report before it is fixed
in Emacs.

> (I'd expect this
> to be first installed in Org and then in Emacs, not the other way
> around, but if it's okay with the Org folks to do it otherwise, I
> won't object.)

It is okay to make fixes to Emacs Org then to backport them to Org
maint branch, but since it is additional work, we prefer fixes to go
directly to the maint branch, before we merge it into Emacs.

Thanks,

-- 
 Bastien





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-09-06  8:12                         ` Bastien
@ 2020-09-06 14:10                           ` Kévin Le Gouguec
  2020-09-06 15:06                             ` Stefan Kangas
  2020-09-06 14:19                           ` Kyle Meyer
  2020-09-06 15:06                           ` Stefan Kangas
  2 siblings, 1 reply; 20+ messages in thread
From: Kévin Le Gouguec @ 2020-09-06 14:10 UTC (permalink / raw)
  To: 42184; +Cc: bzg, egh

Bastien <bzg@gnu.org> writes:

> It is okay to make fixes to Emacs Org then to backport them to Org
> maint branch, but since it is additional work, we prefer fixes to go
> directly to the maint branch, before we merge it into Emacs.

Speaking of Org's maint branch (where the fix has been applied), are
there plans to synchronize it with the emacs-27 branch, so that Emacs
27.2 benefits from all the fixes to the 9.3 release?





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-09-06  8:12                         ` Bastien
  2020-09-06 14:10                           ` Kévin Le Gouguec
@ 2020-09-06 14:19                           ` Kyle Meyer
  2020-09-06 15:06                           ` Stefan Kangas
  2 siblings, 0 replies; 20+ messages in thread
From: Kyle Meyer @ 2020-09-06 14:19 UTC (permalink / raw)
  To: Bastien, Eli Zaretskii; +Cc: egh, 42184-done, mail, kevin.legouguec

Bastien writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> (I'd expect this
>> to be first installed in Org and then in Emacs, not the other way
>> around, but if it's okay with the Org folks to do it otherwise, I
>> won't object.)
>
> It is okay to make fixes to Emacs Org then to backport them to Org
> maint branch, but since it is additional work, we prefer fixes to go
> directly to the maint branch, before we merge it into Emacs.

As the person primarily doing that porting for quite some time now, I of
course don't disagree with that.  My suggestion was in the context of
hoping to get the change into Emacs 27 at a point when a full Org sync
was not going to happen.





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-09-06  8:12                         ` Bastien
  2020-09-06 14:10                           ` Kévin Le Gouguec
  2020-09-06 14:19                           ` Kyle Meyer
@ 2020-09-06 15:06                           ` Stefan Kangas
  2 siblings, 0 replies; 20+ messages in thread
From: Stefan Kangas @ 2020-09-06 15:06 UTC (permalink / raw)
  To: Bastien, Eli Zaretskii; +Cc: egh, 42184-done, Kyle Meyer, mail, kevin.legouguec

Bastien <bzg@gnu.org> writes:

> The fix has been installed in Org and will be available for Org 9.4,
> which we hope to release very soon.  So I'm closing this report now,
> unless this is bad policy to close the bug report before it is fixed
> in Emacs.

Thank you.

IMO, it is highly preferred that you routinely close Emacs bugs related
to Org mode when you have fixed them on your end.  We only need to track
that the bug has been handled in a satisfactory manner.





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

* bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
  2020-09-06 14:10                           ` Kévin Le Gouguec
@ 2020-09-06 15:06                             ` Stefan Kangas
  0 siblings, 0 replies; 20+ messages in thread
From: Stefan Kangas @ 2020-09-06 15:06 UTC (permalink / raw)
  To: Kévin Le Gouguec, 42184; +Cc: bzg, egh

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> Speaking of Org's maint branch (where the fix has been applied), are
> there plans to synchronize it with the emacs-27 branch, so that Emacs
> 27.2 benefits from all the fixes to the 9.3 release?

If the maint branch contains only bug fixes, why shouldn't we?

Eli will explain what he prefers, but I would propose to open a new bug
report to track it, and we can mark it as blocking for the Emacs 27.2
release.  That way there is less risk of forgetting about it when it's
time to make the next point release.





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

end of thread, other threads:[~2020-09-06 15:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-04  2:29 bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27 Erik Hetzner
2020-07-04 17:13 ` Kévin Le Gouguec
2020-07-04 17:18   ` Eli Zaretskii
2020-07-04 17:50     ` Kévin Le Gouguec
2020-07-04 19:52       ` Kévin Le Gouguec
2020-07-05  2:30         ` Eli Zaretskii
2020-07-05  8:57           ` Kévin Le Gouguec
2020-07-05 14:58             ` Eli Zaretskii
2020-07-05 16:02               ` Kévin Le Gouguec
2020-07-05 16:21                 ` Eli Zaretskii
2020-07-08 11:50                 ` Kévin Le Gouguec
2020-07-09 14:16                   ` Kévin Le Gouguec
2020-08-06  4:10                     ` Kyle Meyer
2020-08-06  9:32                       ` Kévin Le Gouguec
2020-08-06 13:35                       ` Eli Zaretskii
2020-09-06  8:12                         ` Bastien
2020-09-06 14:10                           ` Kévin Le Gouguec
2020-09-06 15:06                             ` Stefan Kangas
2020-09-06 14:19                           ` Kyle Meyer
2020-09-06 15:06                           ` Stefan Kangas

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.