No longer define comments in the syntax table

* lisp/org.el (org-mode): Set `comment-start' instead of changing the
syntax of the `#' character.

Leo writes:

> Setting a comment starter without a corresponding comment ender is
> problematic and the # creeps in mysteriously under auto-fill. For
> example, in my current running emacs, this happens almost certainly in
> all org files that has # in their header. The only (temporary) solution
> seems to reboot emacs (which is painful and disruptive).
>
> If you try eval (forward-comment 1) at the beginning of an org file that
> has some "#+..." it will move to the end of file (the whole file is
> regarded as one single comment). So when auto-fill a long text, it will
> find the common prefix to be #.
>
> In addition, I don't think org mode has clear comment syntax or ideas on
> what to do with it.
>
> I can't see any gain from (modify-syntax-entry ?# "<") so I am proposing
> removing it entirely and get rid of this mysterious and annoying bug
> once and for all.
>
> The attached patch may (though I think it is quite safe) cause some bugs
> but those will be fixable unlike the one mentioned above.
>
> Best wishes,
>
> Leo
This commit is contained in:
Carsten Dominik 2010-06-18 09:10:44 +02:00
parent c201da51b8
commit 42ea7d35b7
1 changed files with 1 additions and 3 deletions

View File

@ -4571,10 +4571,8 @@ The following commands are available:
'org-block-todo-from-checkboxes))
;; Comment characters
;; (org-set-local 'comment-start "#")
(org-set-local 'comment-start "#")
(org-set-local 'comment-padding " ")
(modify-syntax-entry ?# "<")
;; (modify-syntax-entry ?\n ">")
;; Align options lines
(org-set-local