[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anony
From: |
Markus Triska |
Subject: |
bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face |
Date: |
Fri, 25 Dec 2020 13:34:21 +0100 |
In 39.12 Faces, the Emacs Lisp documentation states:
One way to represent a face is as a property list of attributes,
like ‘(:foreground "red" :weight bold)’. Such a list is called an
“anonymous face”.
And according to 5.9 Property Lists, a property list "is a list of
paired elements.".
Specifying the anonymous face (:height 10.0), i.e., a property list,
works exactly as intended and documented when we invoke Emacs with:
$ emacs -Q --eval '(font-lock-mode 0)' \
--eval "(insert (propertize \
\"hello\" \
'face (quote (:height 10.0))))"
Writing (quote (:height 10.0)) is equal to writing '(:height 10.0):
(equal (quote (:height 10.0)) '(:height 10.0))
==> t
However, using multiple nested (quote ...) forms is not equivalent to
using a single quote in general:
(equal (quote (quote (:height 10.0))) '(:height 10.0))
==> nil
Yet, wrapping the face within multiple nested (quote ...) forms
unexpectedly yields the same visual result as using a single quote form,
namely (again) an enlarged "hello":
$ emacs -Q --eval '(font-lock-mode 0)' \
--eval "(insert (propertize \
\"hello\" \
'face (quote (quote '(:height 10.0)))))"
In this case, the anonymous face is not specified as a property list,
but as a symbolic expression of the form (quote (quote (quote ...))),
and still works. Is this the intended result, and can we rely on it? If
so, could you please document it?
Issue #35005 is related to this.
Thank you a lot!
Markus
In GNU Emacs 27.1 (build 1, x86_64-apple-darwin15.3.0, X toolkit, Xaw scroll
bars)
of 2020-12-12 built on mac
Windowing system distributor 'The X.Org Foundation', version 11.0.11502000
System Description: Mac OS X 10.11.3
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face,
Markus Triska <=
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Lars Ingebrigtsen, 2020/12/26
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Stefan Kangas, 2020/12/26
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Drew Adams, 2020/12/26
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Markus Triska, 2020/12/27
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Eli Zaretskii, 2020/12/27
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Drew Adams, 2020/12/27
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Eli Zaretskii, 2020/12/27
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Drew Adams, 2020/12/27
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Eli Zaretskii, 2020/12/28
- bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face, Drew Adams, 2020/12/28