From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Tury Newsgroups: gmane.emacs.help Subject: identifiing strings and comments in program source files (to skip them over) Date: Tue, 25 Apr 2006 23:14:34 +0200 Organization: T-Online Internet Hungary Message-ID: <11laoqnlgqlxp.80dh81qx3xik.dlg@40tude.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1146001252 15579 80.91.229.2 (25 Apr 2006 21:40:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2006 21:40:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 25 23:40:51 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FYVGn-0008Nw-0a for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Apr 2006 23:40:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYVGm-0006pd-Kd for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Apr 2006 17:40:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!news.in2p3.fr!in2p3.fr!kanaga.switch.ch!switch.ch!news.bme.hu!news.t-online.hu!newsfeed.matavnet.hu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 16 Original-NNTP-Posting-Host: dsl51b79c20.pool.t-online.hu Original-X-Trace: namru.matavnet.hu 1145999674 4856 81.183.156.32 (25 Apr 2006 21:14:34 GMT) Original-X-Complaints-To: newsmaster@matavnet.hu Original-NNTP-Posting-Date: Tue, 25 Apr 2006 21:14:34 +0000 (UTC) User-Agent: 40tude_Dialog/2.0.15.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:139032 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34652 Archived-At: Hi, isn't it a good idea to use the face property (get-text-property (point) 'face) to decide if the point is after a string or comment? I have a mode what uses font-lock-mode and highlights everything nicely. I think I could use this (= the face set by font-lock-mode) for identifiing if e.g. a search stopped in a string or comment. (I know font-lock-mode must be enabled for this.) This way I could omit reparsing the buffer (with parse-partial-sexp) e.g. in a function what searches something "real" (= strings and comments should be skipped). What do you think: can a robust solution be built using this approach? Thanks, P