From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris McMahan Newsgroups: gmane.emacs.help Subject: Re: Question about font-lock faces Date: Thu, 01 Mar 2007 09:14:07 -0500 Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: References: <874pp6fi9j.fsf@gmail.com> <87tzx6qoyp.fsf@comcast.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172761871 30706 80.91.229.12 (1 Mar 2007 15:11:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Mar 2007 15:11:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 01 16:10:44 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HMmSp-0000rX-Dy for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Mar 2007 15:40:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMmSr-00061d-1e for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Mar 2007 09:41:01 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed-00.mathworks.com!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: panix5.panix.com Original-X-Trace: reader2.panix.com 1172758506 14736 166.84.1.5 (1 Mar 2007 14:15:06 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Thu, 1 Mar 2007 14:15:06 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (windows-nt) Cancel-Lock: sha1:AOXx8eruvhY3jJMddSTO7/jEItY= Original-Xref: shelby.stanford.edu gnu.emacs.help:145953 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41558 Archived-At: I've been using this one from Miles Bader for some time, and it works quite well. - Chris (defun what-face (pos) "Return the font-lock face information at the current point Thanks to Miles Bader for this (gnus.emacs.help)" (interactive "d") (let ((face (or (get-char-property (point) 'read-face-name) (get-char-property (point) 'face)))) (if face (message "Face: %s" face) (message "No face at %d" pos)))) "Robert D. Crawford" writes: > Hadron 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. -- (. .) =ooO=(_)=Ooo===================================== Chris McMahan | first_initiallastname@one.dot.net =================================================