emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how do I find out the syntactic status of a location?


From: Sam Steingold
Subject: how do I find out the syntactic status of a location?
Date: Thu, 15 Mar 2012 12:44:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]