GNU bug report logs - #15251
24.3.50; do-auto-fill "continues" comment from inside a string

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Tue, 3 Sep 2013 01:28:01 UTC

Severity: normal

Found in version 24.3.50

Fixed in version 24.4

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 15251-done <at> debbugs.gnu.org
Subject: bug#15251: 24.3.50; do-auto-fill "continues" comment from inside a string
Date: Tue, 01 Oct 2013 20:32:06 -0400
>> We should probably rework the code to merge comment-use-syntax and
>> comment-use-global-state.

> I wonder what modes have the former variable set to t, but the latter to
> nil, and which situation this combination handles.

> Maybe enhance the check in `comment-normalize-vars' and set
> comment-use-syntax' to nil when the syntax table values are not good enough
> for `comment-use-global-state'?

> Then make `comment-use-global-state' an obsolete alias for
> comment-use-syntax'.

Maybe a better way to do it is:
- Change code that uses comment-use-global-state to use (and
  comment-use-syntax comment-use-global-state) instead.
- Set comment-use-global-state to t by default.
- Major modes where comment-use-global-state is problematic (if those
  exist) can then set comment-use-global-state to nil.
- Maybe make comment-use-global-state obsolete.

Context: the problem with syntax-ppss is not so much performance as
correctness, because syntax-ppss can get confused if you use several
syntax-tables in the same buffer (e.g. via font-lock-syntax-table), or
if you use narrowing.

As time goes on, more and more code relies on syntax-ppss so more and
more code gets rewritten to avoid font-lock-syntax-table (or at least
use it in "harmless" ways, e.g. only changing syntax from symbol to
word) and narrowing.  In turn, this makes syntax-ppss more robust and
more attractive.


        Stefan




This bug report was last modified 11 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.