unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Interrogating which face is being used
@ 2009-07-17 15:07 Tim Visher
  2009-07-17 15:11 ` Andy Stewart
  2009-07-17 15:49 ` Bastien
  0 siblings, 2 replies; 6+ messages in thread
From: Tim Visher @ 2009-07-17 15:07 UTC (permalink / raw)
  To: emacs

Hello Everyone,

I'm wondering if it's possible to interrogate the entity under point
to discover which face is currently being used to control its display.

Thanks!

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail




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

* Re: Interrogating which face is being used
  2009-07-17 15:07 Interrogating which face is being used Tim Visher
@ 2009-07-17 15:11 ` Andy Stewart
  2009-07-17 22:22   ` Tim Visher
  2009-07-17 15:49 ` Bastien
  1 sibling, 1 reply; 6+ messages in thread
From: Andy Stewart @ 2009-07-17 15:11 UTC (permalink / raw)
  To: help-gnu-emacs

Tim Visher <tim.visher@gmail.com> writes:

Hi Tim,
> Hello Everyone,
>
> I'm wondering if it's possible to interrogate the entity under point
> to discover which face is currently being used to control its display.
>
> Thanks!

(defun find-function-or-variable-at-point (&optional prefix)
  "Find function or variable define at current point."
  (interactive "P")
  (if (equal 0 (variable-at-point))     ;if have not variable at current point
      (if (function-called-at-point)    ;if have function call at current point
          (call-interactively (if (null prefix) 'find-function 'find-function-other-window))
        (if (face-at-point)             ;if have face define at current point
            (call-interactively (if (null prefix) 'find-face-definition 'find-face-definition-other-window))
          (message "Nothing at point.")))
    (call-interactively (if (null prefix) 'find-variable 'find-variable-other-window))))

(defun find-face-definition-other-window (face)
  "Find FACE definition at other window."
  (interactive (find-function-read 'defface))
  (find-function-do-it face 'defface 'switch-to-buffer-other-window))

Above is my smart function for find function, variable, face define
around point.

Just binding some key with function
`find-function-or-variable-at-point`.

Enjoy!

  -- Andy





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

* Re: Interrogating which face is being used
       [not found] <mailman.2698.1247843246.2239.help-gnu-emacs@gnu.org>
@ 2009-07-17 15:13 ` henry atting
  2009-07-17 16:02 ` Deepak Ramani
  1 sibling, 0 replies; 6+ messages in thread
From: henry atting @ 2009-07-17 15:13 UTC (permalink / raw)
  To: help-gnu-emacs

On Fr, Jul 17 2009, Tim Visher wrote:

> Hello Everyone,
>
> I'm wondering if it's possible to interrogate the entity under point
> to discover which face is currently being used to control its display.

M-x describe-face
of for the font
M-x describe-font

henry


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

* Re: Interrogating which face is being used
  2009-07-17 15:07 Interrogating which face is being used Tim Visher
  2009-07-17 15:11 ` Andy Stewart
@ 2009-07-17 15:49 ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien @ 2009-07-17 15:49 UTC (permalink / raw)
  To: Tim Visher; +Cc: emacs

Tim Visher <tim.visher@gmail.com> writes:

> I'm wondering if it's possible to interrogate the entity under point
> to discover which face is currently being used to control its display.

C-u C-x =

M-x customize-face RET

-- 
 Bastien




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

* Re: Interrogating which face is being used
       [not found] <mailman.2698.1247843246.2239.help-gnu-emacs@gnu.org>
  2009-07-17 15:13 ` henry atting
@ 2009-07-17 16:02 ` Deepak Ramani
  1 sibling, 0 replies; 6+ messages in thread
From: Deepak Ramani @ 2009-07-17 16:02 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 17 Jul 2009 11:07:18 -0400, Tim Visher wrote:

> I'm wondering if it's possible to interrogate the entity under point
> to discover which face is currently being used to control its display.

You might consider the following function, which you can bind to any key
you want:

(defun describe-face-at-point ()
  "Return face used at point."
  (interactive)
  (get-char-property (point) 'face))

-Deepak


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

* Re: Interrogating which face is being used
  2009-07-17 15:11 ` Andy Stewart
@ 2009-07-17 22:22   ` Tim Visher
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Visher @ 2009-07-17 22:22 UTC (permalink / raw)
  To: Andy Stewart; +Cc: help-gnu-emacs

Thanks for the tips, everyone.  They're all what I was lookin for.

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail




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

end of thread, other threads:[~2009-07-17 22:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-17 15:07 Interrogating which face is being used Tim Visher
2009-07-17 15:11 ` Andy Stewart
2009-07-17 22:22   ` Tim Visher
2009-07-17 15:49 ` Bastien
     [not found] <mailman.2698.1247843246.2239.help-gnu-emacs@gnu.org>
2009-07-17 15:13 ` henry atting
2009-07-17 16:02 ` Deepak Ramani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).