From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: Question about font-lock faces Date: Thu, 01 Mar 2007 15:48:58 +0100 Message-ID: <45E6E7DA.2070307@gmail.com> References: <874pp6fi9j.fsf@gmail.com> <87tzx6qoyp.fsf@comcast.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1172761869 30683 80.91.229.12 (1 Mar 2007 15:11:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Mar 2007 15:11:09 +0000 (UTC) Cc: 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:53 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 1HMmap-0002ko-Js for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Mar 2007 15:49:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMmar-0002SG-Ah for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Mar 2007 09:49:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HMmae-0002SB-Ry for help-gnu-emacs@gnu.org; Thu, 01 Mar 2007 09:49:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HMmad-0002Rz-MM for help-gnu-emacs@gnu.org; Thu, 01 Mar 2007 09:49:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMmad-0002Rw-Ew for help-gnu-emacs@gnu.org; Thu, 01 Mar 2007 09:49:03 -0500 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HMmac-0006fK-T0 for help-gnu-emacs@gnu.org; Thu, 01 Mar 2007 09:49:03 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:63723 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HMmaa-0001jw-4c for help-gnu-emacs@gnu.org; Thu, 01 Mar 2007 15:49:01 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 In-Reply-To: X-Antivirus: avast! (VPS 000719-0, 2007-02-28), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HMmaa-0001jw-4c. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1HMmaa-0001jw-4c ac9349fd571263dd2e5feb9c58856eb0 X-detected-kernel: Linux 2.6? (barebone, rare!) 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:41557 Archived-At: Chris McMahan wrote: > 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)))) Nice, but (point) should be pos in the code above.