From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Problems with syntax-ppss Date: Fri, 4 Apr 2008 17:26:27 +0000 Message-ID: <20080404172627.GB4804@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207329078 11527 80.91.229.12 (4 Apr 2008 17:11:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2008 17:11:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 04 19:11:50 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JhpS8-0003KA-Ab for ged-emacs-devel@m.gmane.org; Fri, 04 Apr 2008 19:11:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhpRV-0000FT-L0 for ged-emacs-devel@m.gmane.org; Fri, 04 Apr 2008 13:11:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JhpQq-0008DJ-UZ for emacs-devel@gnu.org; Fri, 04 Apr 2008 13:10:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JhpQp-0008BV-Bo for emacs-devel@gnu.org; Fri, 04 Apr 2008 13:10:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhpQp-0008BJ-7O for emacs-devel@gnu.org; Fri, 04 Apr 2008 13:10:27 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JhpQo-0003cV-ND for emacs-devel@gnu.org; Fri, 04 Apr 2008 13:10:27 -0400 Original-Received: (qmail 14619 invoked by uid 3782); 4 Apr 2008 17:10:21 -0000 Original-Received: from acm.muc.de (p57AF4BDA.dip.t-dialin.net [87.175.75.218]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 04 Apr 2008 19:10:19 +0200 Original-Received: (qmail 9180 invoked by uid 1000); 4 Apr 2008 17:26:27 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94356 Archived-At: Hi, Emacs! I've just encountered a rather knotty problem in CC Mode for which syntax-ppss ought to be a solution; I need to find out, RAPIDLY, whether a particular buffer position is inside a string or comment. Unfortunately (for me), ...... syntax-ppss does it's parsing from (point-min), not from BOB. So if the buffer is currently narrowed, this function will return an meaningless value for the envisaged use. But if I widen the buffer first, what happens to syntax-ppss's cache? Is this just discarded, or are perhaps two caches maintained (one from BOB, the other from the current (or most recent) (point-min)? Advice, please! Forgive me at this point for not reading the fine source code - it's over 150 lines and looks rather forbidding. It would be nice if the the Elisp manual could be more explicit on such points. (Hey, tell me how it is, and I'll expand the manual!) I think the doc-string for the function is inadequate - it fails to state that parsing starts at (point-min) rather than BOB. Thanks in advance! -- Alan Mackenzie (Nuremberg, Germany).