unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2929: 23.0.92; Broken auto-filling in message-mode
@ 2009-04-08 10:06 Tassilo Horn
  2009-04-08 13:37 ` Stefan Monnier
  2021-12-04 21:18 ` bug#2929: filling of multi-line comments Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Tassilo Horn @ 2009-04-08 10:06 UTC (permalink / raw)
  To: emacs-pretest-bug


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@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@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@mx9.kjm2.de> going from nnml+Popmail:gmx to nil
20090408T114418.141> Registry: article <8815992.30750761239180429897@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. 






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: 23.0.92; Broken auto-filling in message-mode
  2009-04-08 10:06 bug#2929: 23.0.92; Broken auto-filling in message-mode Tassilo Horn
@ 2009-04-08 13:37 ` Stefan Monnier
  2009-04-08 15:21   ` Tassilo Horn
  2009-04-09 19:02   ` Glenn Morris
  2021-12-04 21:18 ` bug#2929: filling of multi-line comments Lars Ingebrigtsen
  1 sibling, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2009-04-08 13:37 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: 2929

> 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






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: 23.0.92; Broken auto-filling in message-mode
  2009-04-08 13:37 ` Stefan Monnier
@ 2009-04-08 15:21   ` Tassilo Horn
  2009-04-09 19:02   ` Glenn Morris
  1 sibling, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2009-04-08 15:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 2929

Stefan Monnier <monnier@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.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: 23.0.92; Broken auto-filling in message-mode
  2009-04-08 13:37 ` Stefan Monnier
  2009-04-08 15:21   ` Tassilo Horn
@ 2009-04-09 19:02   ` Glenn Morris
  2009-04-10 17:45     ` Stefan Monnier
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2009-04-09 19:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 2929, Tassilo Horn

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.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: 23.0.92; Broken auto-filling in message-mode
  2009-04-09 19:02   ` Glenn Morris
@ 2009-04-10 17:45     ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2009-04-10 17:45 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 2929, Tassilo Horn

> 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






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: filling of multi-line comments
  2009-04-08 10:06 bug#2929: 23.0.92; Broken auto-filling in message-mode Tassilo Horn
  2009-04-08 13:37 ` Stefan Monnier
@ 2021-12-04 21:18 ` Lars Ingebrigtsen
  2021-12-04 21:37   ` Tassilo Horn
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-04 21:18 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: 2929

Tassilo Horn <tassilo@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: filling of multi-line comments
  2021-12-04 21:18 ` bug#2929: filling of multi-line comments Lars Ingebrigtsen
@ 2021-12-04 21:37   ` Tassilo Horn
  2021-12-04 21:48     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2021-12-04 21:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 2929

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#2929: filling of multi-line comments
  2021-12-04 21:37   ` Tassilo Horn
@ 2021-12-04 21:48     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-04 21:48 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: 2929

Tassilo Horn <tsdh@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-04 21:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-08 10:06 bug#2929: 23.0.92; Broken auto-filling in message-mode Tassilo Horn
2009-04-08 13:37 ` Stefan Monnier
2009-04-08 15:21   ` Tassilo Horn
2009-04-09 19:02   ` Glenn Morris
2009-04-10 17:45     ` Stefan Monnier
2021-12-04 21:18 ` bug#2929: filling of multi-line comments Lars Ingebrigtsen
2021-12-04 21:37   ` Tassilo Horn
2021-12-04 21:48     ` Lars Ingebrigtsen

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).