From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yoni Rabkin Katzenell Newsgroups: gmane.emacs.devel Subject: describe-face should show an example of text in the face. Date: Sun, 15 Oct 2006 20:15:42 +0200 Message-ID: <87bqodmomp.fsf@actcom.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1160944702 4844 80.91.229.2 (15 Oct 2006 20:38:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2006 20:38:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 15 22:38:16 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GZCkN-0008Az-Mu for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 22:38:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZCkN-0005an-5x for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 16:38:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GZAV1-0005Q0-Iz for emacs-devel@gnu.org; Sun, 15 Oct 2006 14:14:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GZAV0-0005Nv-4C for emacs-devel@gnu.org; Sun, 15 Oct 2006 14:14:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZAUz-0005Nj-Va for emacs-devel@gnu.org; Sun, 15 Oct 2006 14:14:10 -0400 Original-Received: from [192.114.47.66] (helo=smtp4.actcom.co.il) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GZAdw-0004wG-6a for emacs-devel@gnu.org; Sun, 15 Oct 2006 14:23:24 -0400 Original-Received: from localhost.localdomain.actcom.com (line134-129.adsl.actcom.co.il [192.115.134.129]) by smtp4.actcom.co.il (8.13.6/8.13.6) with ESMTP id k9FIE1TI001558 for ; Sun, 15 Oct 2006 20:14:04 +0200 Original-To: emacs-devel@gnu.org X-Ethics: Use GNU User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) X-Mailman-Approved-At: Sun, 15 Oct 2006 16:37:22 -0400 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: news.gmane.org gmane.emacs.devel:60769 Archived-At: --=-=-= Hello, I'm using GNU Emacs 22.0.50.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2006-10-15 on ardbeg emacs/etc/TODO says: "describe-face should show an example of text in the face." The attached patch against `faces.el' adds the word "sample", rendered in the appropriate face, to the top row of the `describe-face' pop-up buffer. An example result can be seen in this screenshot: http://yrk.nfshost.com/images/faces-sample.png --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=describe_face.patch Index: faces.el =================================================================== RCS file: /sources/emacs/emacs/lisp/faces.el,v retrieving revision 1.354 diff -u -r1.354 faces.el --- faces.el 14 Sep 2006 23:54:44 -0000 1.354 +++ faces.el 15 Oct 2006 18:01:00 -0000 @@ -32,6 +32,8 @@ ;; Warning suppression -- can't require x-win in batch: (autoload 'xw-defined-colors "x-win")) +(defvar faces-example-overlay nil) + (defvar help-xref-stack-item) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1253,6 +1255,14 @@ (setq faces (cdr faces))))))) +(defun faces-sample-overlay (face) + (let ((f (if (facep face) face 'default)) + (start (point))) + (insert " sample") + (setq faces-example-overlay (make-overlay start (point))) + (overlay-put faces-example-overlay 'face f))) + + (defun describe-face (face &optional frame) "Display the properties of face FACE on FRAME. Interactively, FACE defaults to the faces of the character after point @@ -1293,6 +1303,7 @@ (insert " undefined face.\n") (let ((customize-label "customize this face") file-name) + (faces-sample-overlay f) (princ (concat " (" customize-label ")\n")) (insert "Documentation: " (or (face-documentation f) --=-=-= -- "Cut your own wood and it will warm you twice" --=-=-= 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 --=-=-=--