From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: how do I find out the syntactic status of a location? Date: Thu, 15 Mar 2012 12:44:37 -0400 Organization: disorganization Message-ID: <873999ak5m.fsf@gnu.org> Reply-To: sds@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331829934 31476 80.91.229.3 (15 Mar 2012 16:45:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 16:45:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 15 17:45:33 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S8Dnx-0004wu-3B for ged-emacs-devel@m.gmane.org; Thu, 15 Mar 2012 17:45:33 +0100 Original-Received: from localhost ([::1]:37096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Dnw-0000oB-C6 for ged-emacs-devel@m.gmane.org; Thu, 15 Mar 2012 12:45:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DnW-0000Zi-JK for emacs-devel@gnu.org; Thu, 15 Mar 2012 12:45:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8DnQ-0007zQ-22 for emacs-devel@gnu.org; Thu, 15 Mar 2012 12:45:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DnP-0007zG-Ra for emacs-devel@gnu.org; Thu, 15 Mar 2012 12:44:59 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S8DnL-0004MY-44 for emacs-devel@gnu.org; Thu, 15 Mar 2012 17:44:55 +0100 Original-Received: from cl-pat-tr.clearspring.com ([8.18.54.254]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Mar 2012 17:44:55 +0100 Original-Received: from sds by cl-pat-tr.clearspring.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Mar 2012 17:44:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 18 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cl-pat-tr.clearspring.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Cancel-Lock: sha1:UWJ/stcbKR8b5wfdc2oUmQbS5EU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149087 Archived-At: 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.