From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matt Hodges Newsgroups: gmane.emacs.devel Subject: Re: info faces for strings and quotations Date: Wed, 06 Oct 2004 09:34:57 +0100 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <877jq4fdn2.fsf@dugong.chemistry.nottingham.ac.uk> References: Reply-To: Matt Hodges NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1097052648 17190 80.91.229.6 (6 Oct 2004 08:50:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Oct 2004 08:50:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 06 10:50:41 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CF7VR-0005ap-00 for ; Wed, 06 Oct 2004 10:50:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CF7c6-0003vU-QP for ged-emacs-devel@m.gmane.org; Wed, 06 Oct 2004 04:57:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CF7bt-0003tl-Ol for emacs-devel@gnu.org; Wed, 06 Oct 2004 04:57:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CF7bs-0003sm-Sn for emacs-devel@gnu.org; Wed, 06 Oct 2004 04:57:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CF7bs-0003sf-4M for emacs-devel@gnu.org; Wed, 06 Oct 2004 04:57:20 -0400 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CF7V1-0004K7-0f for emacs-devel@gnu.org; Wed, 06 Oct 2004 04:50:15 -0400 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CF7Ur-0001DW-00 for ; Wed, 06 Oct 2004 10:50:14 +0200 Original-Received: from 192.146.136.129 ([192.146.136.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Oct 2004 10:50:05 +0200 Original-Received: from MPHodges by 192.146.136.129 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Oct 2004 10:50:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 119 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 192.146.136.129 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:LD/Dslv3nt21m2ypplijkBJjo9U= 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27988 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27988 --=-=-= >>>>> Miles Bader writes: > Please do not use the suffix `-face' for face names -- they have > their own namespace, so it is redundant. Just use something like > (defface info-quoted-name ...) and (defface info-string ...). I was going to suggest that an apropos-face command might be useful, but I see that customize-apropos-faces already exists. This is quite slow, at least on my machine, so how about allowing a filter for list-faces-display? Something along the lines of the attached. Thanks, Matt --=-=-= Content-Disposition: attachment; filename=faces.el.diff Content-Description: Patch for faces.el. *** faces.el 15 Sep 2004 11:48:16 +0100 1.290 --- faces.el 06 Oct 2004 09:22:57 +0100 *************** *** 1136,1150 **** ;; conflict with Lucid, which uses that name differently. (defvar help-xref-stack) ! (defun list-faces-display () "List all faces, using the same sample text in each. The sample text is a string that comes from the variable ! `list-faces-sample-text'." ! (interactive) (let ((faces (sort (face-list) #'string-lessp)) - (face nil) (frame (selected-frame)) disp-frame window face-name) (with-output-to-temp-buffer "*Faces*" (save-excursion (set-buffer standard-output) --- 1136,1157 ---- ;; conflict with Lucid, which uses that name differently. (defvar help-xref-stack) ! (defun list-faces-display (&optional regexp) "List all faces, using the same sample text in each. The sample text is a string that comes from the variable ! `list-faces-sample-text'. With a prefix arg, limit faces to those ! matching REGEXP." ! (interactive (list (and current-prefix-arg ! (read-string "Filter by regexp: ")))) (let ((faces (sort (face-list) #'string-lessp)) (frame (selected-frame)) disp-frame window face-name) + ;; Perhaps filter by regexp + (when regexp + (setq faces (delq nil (mapcar (lambda (f) + (when (string-match regexp + (symbol-name f)) f)) + faces)))) (with-output-to-temp-buffer "*Faces*" (save-excursion (set-buffer standard-output) *************** *** 1157,1165 **** "\\[help-follow] on a face name to customize it\n" "or on its sample text for a description of the face.\n\n"))) (setq help-xref-stack nil) ! (while faces ! (setq face (car faces)) ! (setq faces (cdr faces)) (setq face-name (symbol-name face)) (insert (format "%25s " face-name)) ;; Hyperlink to a customization buffer for the face. Using --- 1164,1170 ---- "\\[help-follow] on a face name to customize it\n" "or on its sample text for a description of the face.\n\n"))) (setq help-xref-stack nil) ! (mapcar (lambda (face) (setq face-name (symbol-name face)) (insert (format "%25s " face-name)) ;; Hyperlink to a customization buffer for the face. Using *************** *** 1187,1192 **** --- 1192,1198 ---- (while (not (eobp)) (insert " ") (forward-line 1)))) + faces) (goto-char (point-min))) (print-help-return-message)) ;; If the *Faces* buffer appears in a different frame, *************** *** 1196,1205 **** (setq disp-frame (if window (window-frame window) (car (frame-list)))) (or (eq frame disp-frame) ! (let ((faces (face-list))) ! (while faces ! (copy-face (car faces) (car faces) frame disp-frame) ! (setq faces (cdr faces))))))) (defun describe-face (face &optional frame) "Display the properties of face FACE on FRAME. --- 1202,1210 ---- (setq disp-frame (if window (window-frame window) (car (frame-list)))) (or (eq frame disp-frame) ! (while faces ! (copy-face (car faces) (car faces) frame disp-frame) ! (setq faces (cdr faces)))))) (defun describe-face (face &optional frame) "Display the properties of face FACE on FRAME. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--