From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: 2 character comment starter bug Date: Wed, 23 Mar 2005 18:10:45 -0500 Message-ID: References: <7D10EFE37E7CBF4288CAFDFAD3C7932C3466E2@msgswbmnmsp04.wellsfargo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111621186 24216 80.91.229.2 (23 Mar 2005 23:39:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2005 23:39:46 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 24 00:39:45 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DEFRr-0005AL-80 for ged-emacs-devel@m.gmane.org; Thu, 24 Mar 2005 00:39:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DEFjR-0004e1-PC for ged-emacs-devel@m.gmane.org; Wed, 23 Mar 2005 18:57:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DEFbe-0008WV-L3 for emacs-devel@gnu.org; Wed, 23 Mar 2005 18:49:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DEFbQ-0008S1-Ps for emacs-devel@gnu.org; Wed, 23 Mar 2005 18:49:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DEFbQ-0008IZ-8R for emacs-devel@gnu.org; Wed, 23 Mar 2005 18:49:32 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DEEzy-0006wz-S2 for emacs-devel@gnu.org; Wed, 23 Mar 2005 18:10:51 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 486A234000F; Wed, 23 Mar 2005 18:10:50 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 611802CC025; Wed, 23 Mar 2005 18:10:46 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 387DF156065; Wed, 23 Mar 2005 18:10:46 -0500 (EST) Original-To: "Bielawski, Richard G." In-Reply-To: <7D10EFE37E7CBF4288CAFDFAD3C7932C3466E2@msgswbmnmsp04.wellsfargo.com> (Richard G. Bielawski's message of "Wed, 23 Mar 2005 11:28:38 -0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.825, requis 5, autolearn=not spam, AWL 0.07, BAYES_00 -4.90) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:35073 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35073 [ Please keep the discussions on the mailing-list. ] >> > (modify-syntax-entry ?\= "_ b12" st) ; comment start == >> >> Yes, it seems the problem is that your 2-char comment sequence is made >> of symbol-chars, so there are cases where the code does things like "oh, >> here's a symbol, let's skip it" without checking whether some of the >> chars that compose the symbol happen to also be a comment-marker. >> >> Does your = char really need to have "symbol" syntax (i.e. "_") or >> could it have punctuation syntax instead (i.e. ".") ? > Punctuation syntax seems to cause all kinds of problems. The = > character is commonly used as the first character in in > filenames. But does it matter in such a case whether it has punctuation syntax or symbol syntax? Do you also give symbol syntax to the / directory separator as well? > It's also part of several operators such as := and ':=' and '=:' which > would behave quite oddly without proper syntax. Traditionally, punctuation syntax has been used specifically for things like the above. So, I'd say that punctuation *is* the proper syntax. If you use symbol syntax for those chars, things like M-C-f risk skipping over "foo:=bar" in "foo:=bar + 1", rather than just skipping over "foo". > It sounds like you are saying it might be a problem to fix the code. Yes: it might take a bit of work; it risks slowing down syntax-based operationd in all buffers; and it could introduce bugs in other languages where the current behavior is closer to what we want (after all, if you define your language using lex and you say that a symbol can be [a-z=_]+ and a comment starter is ==, your lexer will take `foo==' to be a symbol and won't see the comment starter in it). The current behavior is buggy (it doesn't behave consistently between things like forward-sexp, backward-sexp, and parse-partial-sexp). But before someone can convince me to try and fix these bugs, they should first make a good case that the way they setup their syntax-tables is well thought out. Stefan