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: HELP, PLEASE! Syntax problem! Date: Wed, 25 Nov 2009 12:58:10 +0000 Message-ID: <20091125125810.GA4734@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259153599 22483 80.91.229.12 (25 Nov 2009 12:53:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2009 12:53:19 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 25 13:53:12 2009 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 1NDHMt-0000UL-Ks for ged-emacs-devel@m.gmane.org; Wed, 25 Nov 2009 13:53:11 +0100 Original-Received: from localhost ([127.0.0.1]:36096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDHMt-00065o-8v for ged-emacs-devel@m.gmane.org; Wed, 25 Nov 2009 07:53:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDHMo-00065P-49 for emacs-devel@gnu.org; Wed, 25 Nov 2009 07:53:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDHMi-00064E-N1 for emacs-devel@gnu.org; Wed, 25 Nov 2009 07:53:04 -0500 Original-Received: from [199.232.76.173] (port=42469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDHMi-00064B-Hn for emacs-devel@gnu.org; Wed, 25 Nov 2009 07:53:00 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:3954 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 1NDHMi-0000RT-4m for emacs-devel@gnu.org; Wed, 25 Nov 2009 07:53:00 -0500 Original-Received: (qmail 75093 invoked by uid 3782); 25 Nov 2009 12:52:56 -0000 Original-Received: from acm.muc.de (pD9E5269C.dip.t-dialin.net [217.229.38.156]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 25 Nov 2009 13:52:55 +0100 Original-Received: (qmail 5381 invoked by uid 1000); 25 Nov 2009 12:58:10 -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-operating-system: 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:117741 Archived-At: Hello Stefan, Hello Emacs, In the following fragment of code: 1 int a = foo ( 2 1); 3 #define X(A, B) \ 4 do { \ 5 printf (A, B); \ 6 } while (0) 7 int a = foo ( 8 1); , there is a C macro between lines 3 and 6. The syntax-table properties here have been manipulated (see below). Putting point at the "(" in L5 and doing C-M-n takes point to after ")" ON LINE 8. Similar things happen with C-M-p, C-M-u from various places inside the macro Evidently, all syntactic properties inside the macro have been suppressed. This is not wanted. The manipulation is as follows: (i) Every paren/brace/bracket inside the macro has a category text property 'c-{}-syntax-in-cpp. This symbol has a syntax table property, value '(1), i.e. "punctuation syntax". This is intended to make the paren invisible to scan-lists, etc. It does this. But... (ii) Over the entire macro is an overlay with a 'syntax-table property. This overlay should prevail over the text property, since overlays always do. The value of this 'syntax-table property is the actual syntax table currently in use. The effect of this should be that all characters in the macro should appear to have their normal syntax. [The purpose of this is to assist a low level parsing routine in CC Mode which needs to ignore parens inside macros, except for the macro currently containing point.] So, what am I doing wrong, that the syntax of the parens is invisible? The parens are equally invisible to parse-partial-sexp. Alternatively, could it be that scan-lists is neglecting to take account of the overlay? Thanks in advance for the help! -- Alan Mackenzie (Nuremberg, Germany).