unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: 2 character comment starter bug
Date: Wed, 23 Mar 2005 18:10:45 -0500	[thread overview]
Message-ID: <jwvoedaj7i4.fsf-monnier+inbox@gnu.org> (raw)
In-Reply-To: <7D10EFE37E7CBF4288CAFDFAD3C7932C3466E2@msgswbmnmsp04.wellsfargo.com> (Richard G. Bielawski's message of "Wed, 23 Mar 2005 11:28:38 -0800")

[ 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

       reply	other threads:[~2005-03-23 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7D10EFE37E7CBF4288CAFDFAD3C7932C3466E2@msgswbmnmsp04.wellsfargo.com>
2005-03-23 23:10 ` Stefan Monnier [this message]
2005-03-24  2:28 2 character comment starter bug Bielawski, Richard G.
2005-03-24 13:03 ` Stefan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvoedaj7i4.fsf-monnier+inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).