From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: drkm Newsgroups: gmane.emacs.devel Subject: Re: defface location in describe-face Date: Wed, 05 Jan 2005 05:34:15 +0100 Organization: None Message-ID: References: <20050104020643.92136.qmail@web25808.mail.ukl.yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1104899968 677 80.91.229.6 (5 Jan 2005 04:39:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2005 04:39:28 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 05 05:39:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cm2wv-0002f6-00 for ; Wed, 05 Jan 2005 05:39:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cm38A-0008GD-3i for ged-emacs-devel@m.gmane.org; Tue, 04 Jan 2005 23:50:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cm375-0007TA-BL for emacs-devel@gnu.org; Tue, 04 Jan 2005 23:49:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cm373-0007RK-49 for emacs-devel@gnu.org; Tue, 04 Jan 2005 23:49:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cm372-0007QK-Pl for emacs-devel@gnu.org; Tue, 04 Jan 2005 23:49:36 -0500 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cm2s6-0007eP-A8 for emacs-devel@gnu.org; Tue, 04 Jan 2005 23:34:10 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Cm2s5-0000Wm-00 for ; Wed, 05 Jan 2005 05:34:09 +0100 Original-Received: from 123-233.242.81.adsl.skynet.be ([81.242.233.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jan 2005 05:34:09 +0100 Original-Received: from darkman_spam by 123-233.242.81.adsl.skynet.be with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jan 2005 05:34:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 83 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 123-233.242.81.adsl.skynet.be User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:ClD7IdazPtOcbAwHLR3Vvz0AIno= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:31873 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31873 Richard Stallman writes: > I generalized find-func.el to handle faces in a cleaner way. > I did not do anything about describe-face, though. What do you think of the following? --drkm *** cus-face.el.orig Thu Dec 23 07:01:56 2004 --- cus-face.el Tue Jan 4 01:25:46 2005 *************** *** 53,58 **** --- 53,59 ---- (when (and doc (null (face-documentation face))) (set-face-documentation face (purecopy doc))) (custom-handle-all-keywords face args 'custom-face) + (push (cons 'defface face) current-load-list) (run-hooks 'custom-define-hook)) face) *** faces.el.orig Thu Dec 23 07:01:58 2004 --- faces.el Wed Jan 5 05:12:04 2005 *************** *** 1244,1255 **** (insert "Documentation: " (or (face-documentation f) "Not documented as a face.") ! "\n\n") (with-current-buffer standard-output (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) ! (help-xref-button 1 'help-customize-face f))) (dolist (a attrs) (let ((attr (face-attribute f (car a) frame))) (insert (make-string (- max-width (length (cdr a))) ?\ ) --- 1244,1267 ---- (insert "Documentation: " (or (face-documentation f) "Not documented as a face.") ! "\n") (with-current-buffer standard-output (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) ! (help-xref-button 1 'help-customize-face f)) ! ;; Make a hyperlink to the library if appropriate. ! (let ((file-name (symbol-file f 'defface))) ! (when file-name ! (princ "Defined in `") ! (princ file-name) ! (princ "'.\n") ! (with-current-buffer standard-output ! (save-excursion ! (re-search-backward "`\\([^`']+\\)'" nil t) ! (help-xref-button 1 'help-face-def ! f file-name)))) ! (terpri))) (dolist (a attrs) (let ((attr (face-attribute f (car a) frame))) (insert (make-string (- max-width (length (cdr a))) ?\ ) *** help-mode.el.orig Thu Dec 23 07:01:58 2004 --- help-mode.el Tue Jan 4 02:16:48 2005 *************** *** 169,174 **** --- 169,182 ---- (goto-char (cdr location)))) 'help-echo (purecopy"mouse-2, RET: find variable's definition")) + (define-button-type 'help-face-def + :supertype 'help-xref + 'help-function (lambda (face &optional file) + (let ((location (find-face-noselect face file))) + (pop-to-buffer (car location)) + (goto-char (cdr location)))) + 'help-echo (purecopy "mouse-2, RET: find face's definition")) + ;;;###autoload (defun help-mode ()