* How to show (text-properties-at (point)) in minibuffer?
@ 2014-05-15 5:18 dont.spam.earl
2014-05-15 9:47 ` Michael Heerdegen
0 siblings, 1 reply; 5+ messages in thread
From: dont.spam.earl @ 2014-05-15 5:18 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
I'm customizing my shell mode and noticing some regions have unexpected faces. To debug this, I want the minibuffer to list the faces at the current point (from 'text-properties-at) and automatically update as the point moves. I've tried this a few ways but haven't gotten it to work.
I tried customizing the mode-line-format variable, yielding this line in my .emacs file. It didn't work:
'(mode-line-format (quote ("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces (:eval (text-properties-at (point))))))
This also doesn't work:
(setq global-mode-string
(append global-mode-string
(list '(:eval (text-properties-at (point))))))
Any suggestions on how to do this?
Thanks!
Earl
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to show (text-properties-at (point)) in minibuffer?
2014-05-15 5:18 How to show (text-properties-at (point)) in minibuffer? dont.spam.earl
@ 2014-05-15 9:47 ` Michael Heerdegen
2014-05-15 12:26 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2014-05-15 9:47 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
you already know that C-u C-x = lists text properties at point?
The mode-line might not be such a superb place to show them, the list
can be quite longish.
Anyway, in your code, the :eval construct should evaluate to a string,
e.g.
(setq-default
mode-line-format
(cons '(:eval (format "%s" (text-properties-at (point))))
(default-value 'mode-line-format)))
Note that the mode-line isn't necessarily recomputed after every
command.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to show (text-properties-at (point)) in minibuffer?
2014-05-15 9:47 ` Michael Heerdegen
@ 2014-05-15 12:26 ` Stefan Monnier
2014-05-15 13:35 ` Michael Heerdegen
[not found] ` <mailman.1401.1400160984.1147.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2014-05-15 12:26 UTC (permalink / raw)
To: help-gnu-emacs
> (cons '(:eval (format "%s" (text-properties-at (point))))
^^^^
"%S"
"%s" is only really useful for strings; for general Elisp objects, %S
is the better choice.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to show (text-properties-at (point)) in minibuffer?
2014-05-15 12:26 ` Stefan Monnier
@ 2014-05-15 13:35 ` Michael Heerdegen
[not found] ` <mailman.1401.1400160984.1147.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2014-05-15 13:35 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > (cons '(:eval (format "%s" (text-properties-at (point))))
> ^^^^
> "%S"
Thanks. An old bad habit of mine.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to show (text-properties-at (point)) in minibuffer?
[not found] ` <mailman.1401.1400160984.1147.help-gnu-emacs@gnu.org>
@ 2014-05-15 17:33 ` dont.spam.earl
0 siblings, 0 replies; 5+ messages in thread
From: dont.spam.earl @ 2014-05-15 17:33 UTC (permalink / raw)
To: help-gnu-emacs
Michael, Stefan, that worked. I did not know about C-u C-x =. Thanks for the tips!
On Thursday, May 15, 2014 6:35:56 AM UTC-7, Michael Heerdegen wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>
>
> > > (cons '(:eval (format "%s" (text-properties-at (point))))
>
> > ^^^^
>
> > "%S"
>
>
>
> Thanks. An old bad habit of mine.
>
>
>
> Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-15 17:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 5:18 How to show (text-properties-at (point)) in minibuffer? dont.spam.earl
2014-05-15 9:47 ` Michael Heerdegen
2014-05-15 12:26 ` Stefan Monnier
2014-05-15 13:35 ` Michael Heerdegen
[not found] ` <mailman.1401.1400160984.1147.help-gnu-emacs@gnu.org>
2014-05-15 17:33 ` dont.spam.earl
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).