From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs 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 Message-ID: <87shizwqca.fsf@lylat> References: <87d1jrzufs.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1497650116 11111 195.159.176.226 (16 Jun 2017 21:55:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Jun 2017 21:55:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 24543@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 16 23:55:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzCu-0002RW-43 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jun 2017 23:55:08 +0200 Original-Received: from localhost ([::1]:60831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLzCz-0008E2-9n for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jun 2017 17:55:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLzCr-0008Dq-2o for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 17:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLzCn-0006ut-WF for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 17:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49102) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLzCn-0006up-SZ for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 17:55:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dLzCn-0006q6-N4 for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 17:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jun 2017 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24543 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24543-submit@debbugs.gnu.org id=B24543.149765009826275 (code B ref 24543); Fri, 16 Jun 2017 21:55:01 +0000 Original-Received: (at 24543) by debbugs.gnu.org; 16 Jun 2017 21:54:58 +0000 Original-Received: from localhost ([127.0.0.1]:51779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzCj-0006pj-RM for submit@debbugs.gnu.org; Fri, 16 Jun 2017 17:54:58 -0400 Original-Received: from mail-it0-f44.google.com ([209.85.214.44]:35866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzCj-0006pW-23 for 24543@debbugs.gnu.org; Fri, 16 Jun 2017 17:54:57 -0400 Original-Received: by mail-it0-f44.google.com with SMTP id m47so41647957iti.1 for <24543@debbugs.gnu.org>; Fri, 16 Jun 2017 14:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=keiYYQvRK/72EzgcwG9z7aCA044biB3myANn3Oa2GmM=; b=TzlVnYZDJFkpgfJ1rE3+QrIB5uoJlzPPpe/Z61S+0GM4w6O2+g/ONCbSbJ5RyF6KET FkMMhZBusaJACpFQh18QaTHzEkoXMAXk0zSHgTDKO+lLGDy+JzzDl2+SjJcvzQgwcU6e h50jVdOPdktDI7s+iIAJ6OkJ3Q7r3Qkz1GG22ogPexPsQkDHlUUzNG1/CBnoIAPEKBjk qJUQf41BHFRAZ9Gouj5sWcZKv+kX/EPqc5uKh5LngRQcCb/QNeR2JKHMtRY63+L84eQq gVYWcfZbFM9pD+5UaJPO5ZPA1uTu8DJeUZOIlJrtkYT3PjZfvx3jV2MpNJR/1l2/3QAz fEBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=keiYYQvRK/72EzgcwG9z7aCA044biB3myANn3Oa2GmM=; b=trJYcP44p0wlo7w3p3X6OxIUOhH5crqbw0P/WfAefe72ozwl/wWjRPIYrj+wyGxCcq F4P8QE2SR5/WR2SX3CsX64hVgjeeXLXUtXZxzZVB35T2IbcVoxPpiL8qwJar3QdnH0Sz sSuu9aKNmrvHw7UR/qI/i+bvp9oeK3zGXYli5D8Y7BukOS/8BEmlM4//rC9cGkG6Lfua Xi2DqDanB2Fl2TVqmuhHAPfUFWFkAB+IvOquE/2W68tWMY1kDY1dfEEL9nJYGMGeb6gT SZ86Is2qp0CtcAIw4KOpmkjGdVs2Q6WmB0q2UmtppUxr2e0D/nkbaq0b8/Z/pMDqV4EB HfbA== X-Gm-Message-State: AKS2vOzH7w+P3aJ4ZiWr4hHbfOv8KfL4czEk1KqNmDoqj3ym8wUkMlF0 ySTlh9lrTL7fO9dG X-Received: by 10.36.160.75 with SMTP id o72mr4701771ite.119.1497650091100; Fri, 16 Jun 2017 14:54:51 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id p80sm2525096itp.6.2017.06.16.14.54.49 for <24543@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Jun 2017 14:54:49 -0700 (PDT) In-Reply-To: <87d1jrzufs.fsf@gmail.com> (Alex's message of "Sun, 25 Sep 2016 12:49:11 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133673 Archived-At: --=-=-= Content-Type: text/plain Alex 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Properly-show-faces-in-describe-symbol-Bug-24543.patch Content-Description: fix >From 9a3196624d3a24beb3a0625e8a2a74751368c112 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-lisp-help-mode.el-describe-symbol-backends-Reorder-e.patch Content-Description: reorder >From 9ec7945fd45af4999a315f2ceba9bbc61cbf0710 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak 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 --=-=-=--