help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about font-lock faces


From: Robert D. Crawford
Subject: Re: Question about font-lock faces
Date: Wed, 28 Feb 2007 09:30:38 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

Hadron <hadronquark@gmail.com> writes:

> Is it possible to interactively query whyt "face" a certain word is
> using in a font-lock mode?

This should work.  I adapted it from a function in emacspeak and have
tested it several times.

(defun rdc-show-face-at-point ()
  "Show value of property faceat point."
  (interactive )
  (let ((f (get-text-property (point) 'face))
        (o
         (delq nil
               (mapcar
                #'(lambda (overlay)
                    (overlay-get overlay 'face))
                (overlays-at (point))))))
    (message "Face %s" f
             (if o
                 o
               " "))))


There might be a better way to do it or there might be a way built into
emacs.  

rdc
-- 
Robert D. Crawford                                      rdc1x@comcast.net

Van Roy's Law:
        An unbreakable toy is useful for breaking other toys.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]