all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* etc/TODO item: describe-face sample text
@ 2006-10-30 15:33 Yoni Rabkin Katzenell
  2006-10-30 21:13 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Yoni Rabkin Katzenell @ 2006-10-30 15:33 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 735 bytes --]


Hello,

I sent this patch on 2006-10-15. Drew Adams commented on it but no-one
else has since, so I'm re-sending it.

I hope that I'm not being too hasty in re-sending, because of the
pretest there must be lot to do. But I'm guessing that since this is
listed as a TODO item, it would be OK.

If it would be better that I resend this after 22 is out, please say so.

The following is my original email:

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: describe_face.patch --]
[-- Type: text/x-patch, Size: 1462 bytes --]

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	16 Oct 2006 19:52:28 -0000
@@ -32,6 +32,9 @@
   ;; Warning suppression -- can't require x-win in batch:
   (autoload 'xw-defined-colors "x-win"))
 
+(defvar faces-sample-overlay nil
+  "Overlay for showing an example of a face.")
+
 (defvar help-xref-stack-item)
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1253,6 +1256,17 @@
 	    (setq faces (cdr faces)))))))
 
 
+(defun faces-sample-overlay (face)
+  "Insert sample text with FACE.
+
+If FACE is not a face or nil, use the default face."
+  (let ((f (if (facep face) face 'default))
+	(start (+ (point) 2))) ;; skip face and paren
+    (insert " (sample)")
+    (setq faces-sample-overlay (make-overlay start (1- (point))))
+    (overlay-put faces-sample-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 +1307,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)

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: etc/TODO item: describe-face sample text
  2006-10-30 15:33 etc/TODO item: describe-face sample text Yoni Rabkin Katzenell
@ 2006-10-30 21:13 ` Eli Zaretskii
  2006-11-01  2:13   ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2006-10-30 21:13 UTC (permalink / raw)
  Cc: emacs-devel

> From: Yoni Rabkin Katzenell <yoni-r@actcom.com>
> Date: Mon, 30 Oct 2006 17:33:21 +0200
> 
> I sent this patch on 2006-10-15. Drew Adams commented on it but no-one
> else has since, so I'm re-sending it.

Richard asked me to install it, but he requested that I change it to
use text properties instead of overlays.  I didn't yet have time to
rework it to use text properties.

If you could re-submit a similar patch that uses text properties, it
will make my job much easier.

TIA

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: etc/TODO item: describe-face sample text
  2006-10-30 21:13 ` Eli Zaretskii
@ 2006-11-01  2:13   ` Richard Stallman
  2006-11-01  4:26     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2006-11-01  2:13 UTC (permalink / raw)
  Cc: yoni-r, emacs-devel

    Richard asked me to install it, but he requested that I change it to
    use text properties instead of overlays.  I didn't yet have time to
    rework it to use text properties.

I had forgotten about that issue.
Would someone please make this change?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: etc/TODO item: describe-face sample text
  2006-11-01  2:13   ` Richard Stallman
@ 2006-11-01  4:26     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2006-11-01  4:26 UTC (permalink / raw)
  Cc: yoni-r, emacs-devel

> From: Richard Stallman <rms@gnu.org>
> CC: yoni-r@actcom.com, emacs-devel@gnu.org
> Date: Tue, 31 Oct 2006 21:13:00 -0500
> 
>     Richard asked me to install it, but he requested that I change it to
>     use text properties instead of overlays.  I didn't yet have time to
>     rework it to use text properties.
> 
> I had forgotten about that issue.
> Would someone please make this change?

There's no need: Yoni already sent me a reworked patch, and I will
install it soon.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-01  4:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-30 15:33 etc/TODO item: describe-face sample text Yoni Rabkin Katzenell
2006-10-30 21:13 ` Eli Zaretskii
2006-11-01  2:13   ` Richard Stallman
2006-11-01  4:26     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.