GNU bug report logs -
#7751
24.0.50; `fill-paragraph' on doc string with colons
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Tue, 28 Dec 2010 20:39:01 UTC
Severity: minor
Tags: fixed
Found in version 24.0.50
Fixed in version 26.1
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 7751 in the body.
You can then email your comments to 7751 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Tue, 28 Dec 2010 20:39:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 28 Dec 2010 20:39:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This is a regression introduced in Emacs 22.1. There is no such problem
in Emacs 20 or 21.
emacs -Q
Put this in *scratch* or an Emacs-Lisp mode buffer:
(defun foo ()
"WHAT'S WITH THIS?
The usual menu keywords are allowed: :enable, :visible, :keys, :filter,...."
42)
Put the cursor on the second sentence of the doc string and hit `M-q'.
The sentence gets wrapped this way:
The usual menu keywords are
allowed: :enable, :visible, :keys, :filter,...."
The line should instead be broken between ":keys" and ":filter", since
there is enough space for "... allowed: :enable, :visible, :keys,".
Remove the colon before ":enable" or add a space to get ": enable" and
the line gets broken as one would expect. But with the colons as they
are, and no matter how much space is between "allowed:" and ":enable",
the line is broken incorrectly.
The same problem occurs if you change "allowed:" to "allowed.",
"allowed!", "allowed?", "allowed,", or just "allowed", and no matter how
much space you leave after it. The same problem occurs if you remove
"allowed:" altogether, i.e., with "The usual menu keywords are :enable,
...".
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
of 2010-12-20 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Tue, 28 Dec 2010 21:30:04 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
Drew Adams wrote:
> This is a regression introduced in Emacs 22.1. There is no such problem
> in Emacs 20 or 21.
[...]
> The same problem occurs if you change "allowed:" to "allowed.",
> "allowed!", "allowed?", "allowed,", or just "allowed", and no matter how
> much space you leave after it. The same problem occurs if you remove
> "allowed:" altogether, i.e., with "The usual menu keywords are :enable,
> ...".
Here's an even more minimal test-case:
emacs -Q
(setq emacs-lisp-docstring-fill-column 30)
(insert "\"a word, another word and more :bar\"")
M-q
gives a break of:
| a word, another word and
| more :bar
whereas one would expect
| a word, another word and more
| :bar
The problem appears to be in the regexp used to define
paragraph-start in lisp-fill-paragraph:
...
(let ((paragraph-start (concat paragraph-start
"\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)"))
...
Removing the colon leads to "expected" line breaking.
FWIW, the colon was introduced by this commit:
commit cd3f5084abdd59a8392cedee90ddbaa096d61d55
Author: Dave Love <fx <at> gnu.org>
Date: Wed Mar 18 16:02:37 1998 +0000
(lisp-fill-paragraph): Adjust
paragraph-start in default filling case so that filling doc
strings works.
Cheers,
Lawrence
--
Lawrence Mitchell <wence <at> gmx.li>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Fri, 17 Feb 2012 12:58:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 7751 <at> debbugs.gnu.org (full text, mbox):
Following up open bugs...
Lawrence Mitchell wrote:
[...]
> Here's an even more minimal test-case:
> emacs -Q
> (setq emacs-lisp-docstring-fill-column 30)
> (insert "\"a word, another word and more :bar\"")
> M-q
> gives a break of:
> | a word, another word and
> | more :bar
> whereas one would expect
> | a word, another word and more
> | :bar
> The problem appears to be in the regexp used to define
> paragraph-start in lisp-fill-paragraph:
> ...
> (let ((paragraph-start (concat paragraph-start
> "\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)"))
> ...
> Removing the colon leads to "expected" line breaking.
[...]
Would a patch to do this be welcome?
Lawrence
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Fri, 17 Feb 2012 14:16:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 7751 <at> debbugs.gnu.org (full text, mbox):
Lawrence Mitchell <wence <at> gmx.li> writes:
>> The problem appears to be in the regexp used to define
>> paragraph-start in lisp-fill-paragraph:
>
>> (let ((paragraph-start (concat paragraph-start
>> "\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)"))
>
>> Removing the colon leads to "expected" line breaking.
>
> Would a patch to do this be welcome?
As explained in the comments in that file, the colon is there so that
forms like
(defcustom foo nil
:bar 3)
Don't get refilled to
(defcustom foo nil :bar 3)
when you type M-q. The effect on docstrings containing colons is
unfortunate, but simply removing the colon from the regexp would be
incorrect.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Fri, 17 Feb 2012 14:58:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 7751 <at> debbugs.gnu.org (full text, mbox):
> the colon is there so that forms like
> (defcustom foo nil
> :bar 3)
>
> Don't get refilled to
> (defcustom foo nil :bar 3)
>
> when you type M-q.
And just why is that important?
If there is room for it given the value of `fill-column', such filling makes
sense - a good thing, not a bad thing.
Sure, it would be best if a keyword and its value were always (`fill-column'
permitting) on the same line. But that's a nice-to-have - it should not be the
first priority or the reason for mangling filling of doc strings.
Anyway, the #7751 bug report is not about that, at all.
It's about using `M-q' on a _doc string_. It's not about using `M-q' on a sexp
such as you present above (which has no strings at all). Let's not take a
detour. If the current code does not distinguish the doc-string case, maybe it
should.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Mon, 17 Sep 2012 00:18:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 7751 <at> debbugs.gnu.org (full text, mbox):
ping
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#7751
; Package
emacs
.
(Thu, 28 Apr 2016 10:06:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 7751 <at> debbugs.gnu.org (full text, mbox):
Lawrence Mitchell <wence <at> gmx.li> writes:
> The problem appears to be in the regexp used to define
> paragraph-start in lisp-fill-paragraph:
>
> ...
> (let ((paragraph-start (concat paragraph-start
> "\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)"))
> ...
>
> Removing the colon leads to "expected" line breaking.
I've now removed the colon from that regexp when we're doing `M-q'
inside a string.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 28 Apr 2016 10:06:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.2, send any further explanations to
7751 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 28 Apr 2016 10:06: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
.
(Thu, 26 May 2016 11:24:04 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:02 GMT)
Full text and
rfc822 format available.
bug Marked as fixed in versions 26.1.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:02 GMT)
Full text and
rfc822 format available.
bug No longer marked as fixed in versions 25.2.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50: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, 01 Jan 2017 12:24:17 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 230 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.