* how do I find out the syntactic status of a location?
@ 2012-03-15 16:44 Sam Steingold
2012-03-15 18:53 ` Davis Herring
0 siblings, 1 reply; 2+ messages in thread
From: Sam Steingold @ 2012-03-15 16:44 UTC (permalink / raw)
To: emacs-devel
I want to find out whether I am in a symbol, string, constant, comment
&c without knowing the details of the syntax of the specific mode, i.e.,
the code should work the same in, e.g., C and Lisp modes.
If font-lock is enabled, I can check that I am in a string or comment
using
(memq (plist-get (text-properties-at (point)) 'face)
'(font-lock-comment-face font-lock-string-face))
is there a better way?
thanks.
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://www.childpsy.net/ http://mideasttruth.com http://iris.org.il
http://jihadwatch.org http://camera.org http://www.PetitionOnline.com/tap12009/
What garlic is to food, insanity is to art.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: how do I find out the syntactic status of a location?
2012-03-15 16:44 how do I find out the syntactic status of a location? Sam Steingold
@ 2012-03-15 18:53 ` Davis Herring
0 siblings, 0 replies; 2+ messages in thread
From: Davis Herring @ 2012-03-15 18:53 UTC (permalink / raw)
To: emacs-devel
> is there a better way?
See `syntax-ppss' and friends.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-15 18:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 16:44 how do I find out the syntactic status of a location? Sam Steingold
2012-03-15 18:53 ` Davis Herring
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.