Subject: bug#24543: 25.1; describe-symbol doesn't show face with same name as a variable

From: Alex <[email-masked]>
Date: Fri, 16 Jun 2017 15:54:45 -0600

Alex <[email-masked]> 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.

>From 9a3196624d3a24beb3a0625e8a2a74751368c112 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <[email-masked]>
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

>From 9ec7945fd45af4999a315f2ceba9bbc61cbf0710 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <[email-masked]>
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