* Re: master 270ca8c: Fix internal-lisp-face-attributes to match face.
[not found] ` <20191020144611.3484F20BBC@vcs0.savannah.gnu.org>
@ 2019-10-20 15:44 ` Stephen Berman
2019-10-20 16:08 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Berman @ 2019-10-20 15:44 UTC (permalink / raw
To: emacs-devel; +Cc: Jimmy Aguilar Mena
On Sun, 20 Oct 2019 10:46:10 -0400 (EDT) ergus@savannah.gnu.org (Jimmy Aguilar Mena) wrote:
> branch: master
> commit 270ca8c2735cfc7935b9e4d0b770a55138493ef3
> Author: Jimmy Aguilar Mena <spacibba@aol.com>
> Commit: Jimmy Aguilar Mena <spacibba@aol.com>
>
> Fix internal-lisp-face-attributes to match face.
>
> * lisp/face-remap.el (internal-lisp-face-attributes): Updated the
^^^^^^^
The conventional practice is to use the imperative form of verbs in
commit messages (so here "Update"). (I couldn't find documentation of
this practice -- unlike for doc strings in (info "(elisp) Documentation
Tips") -- but you'll see it in most commit messages.)
> vector members to match the real member names. (Bug#37806) (Bug#37824)
> ---
> lisp/face-remap.el | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/face-remap.el b/lisp/face-remap.el
> index 5cdecb9..f2ff2ec 100644
> --- a/lisp/face-remap.el
> +++ b/lisp/face-remap.el
> @@ -64,12 +64,14 @@
> ;; Names of face attributes corresponding to lisp face-vector positions.
> ;; This variable should probably be defined in C code where the actual
> ;; definitions are available.
> +;; :vector must be always at the end as a guard
I don't think this is true for this vector, since it's only the length
that's used here. (It is of course true for the enum
LFACE_ATTRIBUTE_INDEX, which internal-lisp-face-attributes is meant to
mirror, even though it doesn't use its content.)
> ;;
> (defvar internal-lisp-face-attributes
> [nil
> - :family :foundry :swidth :height :weight :slant :underline :inverse
> - :foreground :background :stipple :overline :strike :box
> - :font :inherit :fontset :vector])
> + :family :foundry :width :height :weight :slant :underline
> + :inverse-video
> + :foreground :background :stipple :overline :strike-through :box
> + :font :inherit :fontset :distant-foreground :extend :vector])
For the same reason the attribute names here are not important (that's
why :swidth and :inverse, and the absence of :distant(-foreground),
didn't matter before). Indeed, I think :swidth was used instead of
:width because the model for internal-lisp-face-attributes was the enum
LFACE_ATTRIBUTE_INDEX, not the Lisp face attribute keywords defined in
xfaces.c. I think that's also why internal-lisp-face-attributes begins
with nil, so that the indices of the remaining elements match those of
LFACE_ATTRIBUTE_INDEX; for it's use in face-remap.el, that element is
superfluous.
These remarks will probably become irrelevant when you replace
internal-lisp-face-attributes with a vector defined in C in terms of the
attribute keywords in xfaces.c.
Steve Berman
^ permalink raw reply [flat|nested] 3+ messages in thread