unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: 24543@debbugs.gnu.org
Subject: bug#24543: 25.1; describe-symbol doesn't show face with same name as a variable
Date: Fri, 16 Jun 2017 15:54:45 -0600	[thread overview]
Message-ID: <87shizwqca.fsf@lylat> (raw)
In-Reply-To: <87d1jrzufs.fsf@gmail.com> (Alex's message of "Sun, 25 Sep 2016 12:49:11 -0600")

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

Alex <agrambot@gmail.com> writes:

> Recipe:
>
> emacs -Q
> C-h o font-lock-comment-face RET
>
> Only the variable of this name is shown, not the face (which can be
> viewed with describe-face, of course).
>
> It appears that when the face only shares a name with a function, then
> both the function and face are shown. Only a variable shadows the face
> in describe-symbol.

This is because describe-symbol isn't returning (buffer-string) like
describe-{function, variable} are.

I've attached a patch fixing this problem.

Additionally, I have attached another patch that re-orders the placement
of variables/faces in describe-symbol, to put more emphasis on the
variable entry rather than the face.


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

From 9a3196624d3a24beb3a0625e8a2a74751368c112 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Fri, 16 Jun 2017 15:37:47 -0600
Subject: [PATCH 1/2] Properly show faces in describe-symbol (Bug#24543)

* lisp/faces.el (describe-face): Return (buffer-string).
---
 lisp/faces.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/faces.el b/lisp/faces.el
index 9a8a1344ca..dabb7c3e7e 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1447,7 +1447,7 @@ describe-face
 	(setq face (list face)))
     (with-help-window (help-buffer)
       (with-current-buffer standard-output
-	(dolist (f face)
+	(dolist (f face (buffer-string))
 	  (if (stringp f) (setq f (intern f)))
 	  ;; We may get called for anonymous faces (i.e., faces
 	  ;; expressed using prop-value plists).  Those can't be
-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: reorder --]
[-- Type: text/x-diff, Size: 992 bytes --]

From 9ec7945fd45af4999a315f2ceba9bbc61cbf0710 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Fri, 16 Jun 2017 15:49:13 -0600
Subject: [PATCH 2/2] * lisp/help-mode.el (describe-symbol-backends): Reorder
 entries

---
 lisp/help-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 3fb793e7aa..24dfb9120b 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -393,12 +393,12 @@ help-buffer
 
 (defvar describe-symbol-backends
   `((nil ,#'fboundp ,(lambda (s _b _f) (describe-function s)))
-    ("face" ,#'facep ,(lambda (s _b _f) (describe-face s)))
     (nil
      ,(lambda (symbol)
         (or (and (boundp symbol) (not (keywordp symbol)))
             (get symbol 'variable-documentation)))
-     ,#'describe-variable)))
+     ,#'describe-variable)
+    ("face" ,#'facep ,(lambda (s _b _f) (describe-face s)))))
 
 ;;;###autoload
 (defun help-make-xrefs (&optional buffer)
-- 
2.11.0


  reply	other threads:[~2017-06-16 21:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 18:49 bug#24543: 25.1; describe-symbol doesn't show face with same name as a variable Alex
2017-06-16 21:54 ` Alex [this message]
2017-07-26  4:28   ` Alex
2017-07-26 14:45     ` Eli Zaretskii
2017-07-28  7:35   ` Eli Zaretskii
2017-07-28 20:45     ` Alex
2017-08-05  8:53       ` Eli Zaretskii

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87shizwqca.fsf@lylat \
    --to=agrambot@gmail.com \
    --cc=24543@debbugs.gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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