emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug#42184: org-fontify-whole-*-line in emacs 27
Date: Sun, 09 Aug 2020 00:43:25 -0400	[thread overview]
Message-ID: <878seotonm.fsf@kyleam.com> (raw)
In-Reply-To: <87o8nmq00s.fsf@gmail.com>

Kévin Le Gouguec writes:

> I made patches for both maint and master because
>
> - the patch for maint has a small conflict in org-compat when applied
>   against master,
>
> - I'm not sure which branch will eventually be synchronized with
>   emacs-27 (assuming we'll include this fix in 27.2).

Thanks.  This patch is appropriate for maint in my view.

> diff --git a/lisp/org-compat.el b/lisp/org-compat.el
> index c757355ba..c0f4833a3 100644
> --- a/lisp/org-compat.el
> +++ b/lisp/org-compat.el
> @@ -101,6 +101,21 @@ is nil)."
>    (defun org-time-convert-to-list (time)
>      (seconds-to-time (float-time time))))
>  
> +(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))))

Two minor thoughts, neither really important:

  * Style nit-pick: s/when/and/, as the return value is of interest.

  * I'm guessing your main reason for choosing a macro when a function
    would do here is to get inline expansion at compile time.

However ...

>  ;;; Emacs < 26.1 compatibility
>  
> diff --git a/lisp/org-faces.el b/lisp/org-faces.el
> index 30eab9bc6..4c5a51624 100644
> --- a/lisp/org-faces.el
> +++ b/lisp/org-faces.el
> @@ -393,7 +393,7 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
>    "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
>    :group 'org-faces)
> -(defface org-block '((t :inherit shadow))
> +(defface org-block `((t ,(org--extended-face '(:inherit shadow))))
>    "Face text in #+begin ... #+end blocks.
>  For source-blocks `org-src-block-faces' takes precedence."
>    :group 'org-faces

... the main thing I wonder is whether this kludge is necessary at all.
AFAICT unconditionally including :extend in the face spec doesn't seem
to bother earlier Emacs versions.  Even if there is a reason to avoid
:extend on older versions, it's perhaps an overkill to add a
compatibility macro for just one spot.  Maybe instead just define it
directly in the value for org-block:

    `(t ,@(and (>= emacs-major-version 27) '(:extend t))
        :inherit shadow)


If org--extended-face stays, org-face.el should be adjusted to load
org-compat.el.  (`make single' flags this.)


  reply	other threads:[~2020-08-09  4:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10  9:23 Couple of issues with org block meta lines faces Sébastien Miquel
2020-07-10 11:46 ` Kévin Le Gouguec
2020-07-14 10:19   ` Bug#42184: org-fontify-whole-*-line in emacs 27 (was: Couple of issues with org block meta lines faces) Kévin Le Gouguec
2020-08-02 21:23     ` Bug#42184: org-fontify-whole-*-line in emacs 27 Kévin Le Gouguec
2020-08-07  0:44       ` Kyle Meyer
2020-08-07  9:26         ` Kévin Le Gouguec
2020-08-09  4:43           ` Kyle Meyer [this message]
2020-08-09 14:12             ` Kévin Le Gouguec
2020-08-09 19:27               ` Kyle Meyer
2020-08-10 13:27                 ` Kévin Le Gouguec
2020-08-11  0:43                   ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878seotonm.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kevin.legouguec@gmail.com \
    --subject='Re: Bug#42184: org-fontify-whole-*-line in emacs 27' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).