GNU bug report logs - #2929
filling of multi-line comments

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tassilo <at> member.fsf.org>

Date: Wed, 8 Apr 2009 10:15:03 UTC

Severity: minor

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2929 in the body.
You can then email your comments to 2929 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2929; Package emacs. (Wed, 08 Apr 2009 10:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tassilo Horn <tassilo <at> member.fsf.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 08 Apr 2009 10:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.92; Broken auto-filling in message-mode
Date: Wed, 08 Apr 2009 12:06:51 +0200
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I use this message-mode setup:

--8<---------------cut here---------------start------------->8---
(defun th-message-mode-init ()
  (setq fill-column 72)
  (turn-on-auto-fill))

(add-hook 'message-mode-hook 'th-message-mode-init)
--8<---------------cut here---------------end--------------->8---

When I follow up to a message and write some text longer than
fill-column it is wrapped, but comment chars are inserted.  Here's an
example:

--8<---------------cut here---------------start------------->8---
--text follows this line--
Tim Landscheidt <tim <at> tim-landscheidt.de> writes:

>   Wenn aber Gnus ein www.gnus.org "erkennt", dann wird die
> Benutzererwartung (hoffentlich :-)) mit dem übereinstimmen,
> was Gnus darin gesehen hat; nur muss Gnus das dann halt noch
> browse-*url* mitteilen.

foo bar baz bece bec,g imtcp.cm muitmui mit.pm mtim.p kmtekm kmcteik */
> ketm 
-- 
Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it. 
--8<---------------cut here---------------end--------------->8---

The line starting with "foo bar baz" was entered by me and after
inserting a space after "ketm" the comment chars where inserted.
(`comment-start' is ">" and `comment-end' is "*/" in message-mode.)

I was able to reproduce that with emacs -Q by invoking M-x mail,
switching to message-mode, enabling auto-fill-mode, setting comment-end
to "*/", inserting the text above, and starting to write.

It seems to me that comment-end set to "*/" seems to trigger this
behavior.  When I do the emacs -Q procedure it's set to "" by default,
and then the bug doesn't occur.  So I guess message-mode should set it
to "" in order to avoid such strange effects.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.0.92/etc/DEBUG for instructions.


In GNU Emacs 23.0.92.1 (x86_64-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-04-06 on thinkpad
Windowing system distributor `The X.Org Foundation', version 11.0.10503000
configured using `configure  '--prefix=/usr' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--libdir=/usr/lib64' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-freetype' '--with-xft' '--with-libotf' '--with-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--build=x86_64-pc-linux-gnu' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-g -ggdb -O1 -pipe' 'LDFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  diff-auto-refine-mode: t
  gnus-topic-mode: t
  gnus-undo-mode: t
  shell-dirtrack-mode: t
  rcirc-track-minor-mode: t
  recentf-mode: t
  window-number-meta-mode: t
  window-number-mode: t
  savehist-mode: t
  exec-abbrev-cmd-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<tab> f u n <tab> <return> M-2 <down> <down> C-h f 
<return> M-2 M-1 M-2 <tab> <return> <down> <down> <down> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <f8> <C-f8> <C-f8> <C-f8> <C-f8> C-h 
f <return> M-2 <tab> <return> <down> <down> <down> 
<up> <up> <up> <down> <down> <down> <down> <down> <down> 
<down> <down> <up> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <up> <up> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> C-x k 
<return> C-x k <return> C-h v c o m m <tab> e n t <tab> 
<tab> s t <tab> a <tab> <return> C-h v c o m m <tab> 
e n <tab> e n <tab> <tab> <return> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <down> <return> <down> <down> 
<down> <down> <down> <down> C-c C-c c l s <return> 
c <return> c <return> c <return> c <return> v v s s 
C-g C-g # # B <backspace> y q l s M-x r e b <retur
n>

Recent messages:
20090408T114418.071> Deleting article 743 in gmx
20090408T114418.140> Registry: article <20090408105557.A890C23063A <at> mx9.kjm2.de> going from nnml+Popmail:gmx to nil
20090408T114418.141> Registry: article <8815992.30750761239180429897 <at> ecmessenger> going from nnml+Popmail:gmx to nil
20090408T114418.302> Exiting summary buffer and applying spam rules
20090408T114418.412> No more unread newsgroups
(No changes need to be saved)
20090408T114419.998> Saving /home/horn/.newsrc.eld...
Saving file /home/horn/.newsrc.eld...
Wrote /home/horn/.newsrc.eld
20090408T114420.055> Saving /home/horn/.newsrc.eld...done

-- 
Chuck Norris once shat blood - the blood of 11,940 natives he had killed and eaten. 




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2929; Package emacs. (Wed, 08 Apr 2009 13:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 08 Apr 2009 13:45:04 GMT) Full text and rfc822 format available.

Message #10 received at 2929 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tassilo Horn <tassilo <at> member.fsf.org>
Cc: 2929 <at> debbugs.gnu.org
Subject: Re: bug#2929: 23.0.92; Broken auto-filling in message-mode
Date: Wed, 08 Apr 2009 09:37:45 -0400
> behavior.  When I do the emacs -Q procedure it's set to "" by default,
> and then the bug doesn't occur.  So I guess message-mode should set it
> to "" in order to avoid such strange effects.

`comment-end' is "" by default.  Setting it globally to something else
will lead to errors in various major modes which assume that "not
setting comment-end" is the same as setting it to "".

I.e. the global setting of comment-end should not be change(able|d).

This said, your report probably points at another bug because the
"*/\n> " should not be added to lines which don't start with "> ".


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2929; Package emacs. (Wed, 08 Apr 2009 15:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tassilo Horn <tassilo <at> member.fsf.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 08 Apr 2009 15:30:06 GMT) Full text and rfc822 format available.

Message #15 received at 2929 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2929 <at> debbugs.gnu.org
Subject: Re: bug#2929: 23.0.92; Broken auto-filling in message-mode
Date: Wed, 08 Apr 2009 17:21:58 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

Hi Stefan,

>> behavior.  When I do the emacs -Q procedure it's set to "" by
>> default, and then the bug doesn't occur.  So I guess message-mode
>> should set it to "" in order to avoid such strange effects.
>
> `comment-end' is "" by default.  Setting it globally to something else
> will lead to errors in various major modes which assume that "not
> setting comment-end" is the same as setting it to "".

Hm, at least I do not set it globally to another value.  So it seems to
be the fault of some third party library I use. [Searching...]

Oh, indeed.  How awkward!  It's in a mode I've written myself!

> I.e. the global setting of comment-end should not be change(able|d).
>
> This said, your report probably points at another bug because the
> "*/\n> " should not be added to lines which don't start with "> ".

Right, so at least this report was no total user error.

Bye,
Tassilo
-- 
Richard Stallman wrote a program that divides by zero.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2929; Package emacs. (Thu, 09 Apr 2009 19:10:04 GMT) Full text and rfc822 format available.

Message #18 received at 2929 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2929 <at> debbugs.gnu.org, Tassilo Horn <tassilo <at> member.fsf.org>
Subject: Re: bug#2929: 23.0.92; Broken auto-filling in message-mode
Date: Thu, 09 Apr 2009 15:02:03 -0400
Stefan Monnier wrote:

> This said, your report probably points at another bug because the
> "*/\n> " should not be added to lines which don't start with "> ".

I'm not sure newcomment.el can be blamed much for this.

The buffer has:

comment-start = "> "
comment-end   = "*/"

The comment-end string never appears in the example buffer, but the
comment-start one does. So it looks to newcomment like the whole
buffer is one big comment.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2929; Package emacs. (Fri, 10 Apr 2009 17:50:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 10 Apr 2009 17:50:03 GMT) Full text and rfc822 format available.

Message #23 received at 2929 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 2929 <at> debbugs.gnu.org, Tassilo Horn <tassilo <at> member.fsf.org>
Subject: Re: bug#2929: 23.0.92; Broken auto-filling in message-mode
Date: Fri, 10 Apr 2009 13:45:40 -0400
> I'm not sure newcomment.el can be blamed much for this.

It can.

> The buffer has:

> comment-start = "> "
> comment-end   = "*/"

> The comment-end string never appears in the example buffer, but the
> comment-start one does. So it looks to newcomment like the whole
> buffer is one big comment.

Yes, if we consider a C file with the following content:

  /* blablabla
     blablabla
     blablabla long line to cut here

it's better for auto-fill-mdoe to do:

  /* blablabla
     blablabla
     blablabla long line to cut
     here

then

  /* blablabla
     blablabla
     blablabla long line to cut /*
  /* here

since the comment is obviously not using a "one comment per line"
style anyway.  That's why I said:

>> "*/\n> " should not be added to lines which don't start with "> ".


--  Stefan




Changed bug title to `filling of multi-line comments' from `23.0.92; Broken auto-filling in message-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Sat, 11 Apr 2009 02:10:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#2929; Package emacs. (Sat, 04 Dec 2021 21:19:01 GMT) Full text and rfc822 format available.

Message #28 received at 2929 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tassilo Horn <tassilo <at> member.fsf.org>
Cc: 2929 <at> debbugs.gnu.org
Subject: Re: bug#2929: filling of multi-line comments
Date: Sat, 04 Dec 2021 22:18:48 +0100
Tassilo Horn <tassilo <at> member.fsf.org> writes:

> The line starting with "foo bar baz" was entered by me and after
> inserting a space after "ketm" the comment chars where inserted.
> (`comment-start' is ">" and `comment-end' is "*/" in message-mode.)

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

In Emacs 29, `comment-end' is "" in `message-mode', and I'm not able to
reproduce the problem.

Are you still seeing this problem in recent Emacs versions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 21:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#2929; Package emacs. (Sat, 04 Dec 2021 21:41:01 GMT) Full text and rfc822 format available.

Message #33 received at 2929 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 2929 <at> debbugs.gnu.org
Subject: Re: bug#2929: filling of multi-line comments
Date: Sat, 04 Dec 2021 22:37:01 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi Lars,

>> The line starting with "foo bar baz" was entered by me and after
>> inserting a space after "ketm" the comment chars where inserted.
>> (`comment-start' is ">" and `comment-end' is "*/" in message-mode.)
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> In Emacs 29, `comment-end' is "" in `message-mode', and I'm not able
> to reproduce the problem.
>
> Are you still seeing this problem in recent Emacs versions?

No, I can't reproduce it.  And actually I don't quite understand what I
was doing.  Why did I explicitly set "*/" as `comment-end' in
`message-mode'? *shrugs*

Anyway, feel free to close that bug report.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#2929; Package emacs. (Sat, 04 Dec 2021 21:49:01 GMT) Full text and rfc822 format available.

Message #36 received at 2929 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 2929 <at> debbugs.gnu.org
Subject: Re: bug#2929: filling of multi-line comments
Date: Sat, 04 Dec 2021 22:48:10 +0100
Tassilo Horn <tsdh <at> gnu.org> writes:

> No, I can't reproduce it.  And actually I don't quite understand what I
> was doing.  Why did I explicitly set "*/" as `comment-end' in
> `message-mode'? *shrugs*

😁

> Anyway, feel free to close that bug report.

OK; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 2929 <at> debbugs.gnu.org and Tassilo Horn <tassilo <at> member.fsf.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 21:49:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Jan 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 168 days ago.

Previous Next


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