* problem with comment-start
@ 2004-09-17 14:33 Werner LEMBERG
2004-09-18 18:50 ` Stefan
0 siblings, 1 reply; 2+ messages in thread
From: Werner LEMBERG @ 2004-09-17 14:33 UTC (permalink / raw)
[emacs CVS 2004-08-22]
In plain text mode, setting the variable `comment-start' to, say, ">",
a long line like
This is a test with comment-start which starts on the >right side<, and which causes strange indentation
looks like this
This is a test with comment-start which starts on the >right side<,
>and which
>causes
>strange
>indentation
after pressing M-q.
Can this be improved? Right now these suggestions come to my mind:
. If `>' appears in column 12 or greater, don't treat it as
comment-start. This ad-hoc value should be customizable.
. If `>' appears in column 1-11, test the previous and next line
whether we also have `>' at the same position.
. Provide a new command within emacs, say, C-M-q, which is the same as
M-q in text mode, and which ignores `>'.
BTW, there isn't a single remark in the documentation of
`fill-paragraph' that it is influenced by the `comment-start'
variable.
Werner
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: problem with comment-start
2004-09-17 14:33 problem with comment-start Werner LEMBERG
@ 2004-09-18 18:50 ` Stefan
0 siblings, 0 replies; 2+ messages in thread
From: Stefan @ 2004-09-18 18:50 UTC (permalink / raw)
Cc: emacs-devel
> In plain text mode, setting the variable `comment-start' to, say, ">",
If you just set comment-start to ">", you're saying "a > anywhere on a line
starts a comment which ends at the next LF". Which implies that filling
a line like:
This is a test with comment-start which starts on the >right side<, and which causes strange indentation
should not result in
This is a test with comment-start which starts on the >right side<, and
which causes strange indentation
since that would means that fill-paragraph has moved "which causes strange
indentation" outside of the comment, thus completely changed the semantic
content of the buffer.
I.e. you get what you ask for. If that's not what you want, then set
comment-start-skip explicitly (rather than let the comment code guess it
based on comment-start) to something like "^> *" so as to make it clear that
a ">" only starts a comment if it's at the beginning of a line.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-18 18:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-17 14:33 problem with comment-start Werner LEMBERG
2004-09-18 18:50 ` Stefan
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.