GNU bug report logs - #52969
Shortdoc "string" group leads to backtrace

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sun, 2 Jan 2022 23:10:02 UTC

Severity: normal

Fixed in version 29.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 52969 in the body.
You can then email your comments to 52969 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-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Sun, 02 Jan 2022 23:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Jan 2022 23:10:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: Shortdoc "string" group leads to backtrace
Date: Sun, 2 Jan 2022 18:09:37 -0500
On master, emacs -Q:

    M-x shortdoc-display-group RET string RET

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  split-string(nil "\n")
  shortdoc--display-function((truncate-string-to-width :eval
(truncate-string-to-width "foobar" 3) :eval (truncate-string-to-width
"你好bar" 5)))
  #f(compiled-function (data) #<bytecode
0x16a14e336dff84a8>)((truncate-string-to-width :eval
(truncate-string-to-width "foobar" 3) :eval (truncate-string-to-width
"你好bar" 5)))
  mapc(#f(compiled-function (data) #<bytecode 0x16a14e336dff84a8>)
("Making Strings" (make-string :args (length init) :eval "(make-string
5 ?x)") (string :eval "(string ?a ?b ?c)") (concat :eval (concat "foo"
"bar" "zot")) (string-join :no-manual t :eval (string-join '("foo"
"bar" "zot") " ")) (mapconcat :eval (mapconcat (lambda (a) (concat "["
a "]")) '("foo" "bar" "zot") " ")) (string-pad :eval (string-pad "foo"
5) :eval (string-pad "foobar" 5) :eval (string-pad "foo" 5 45 t))
(mapcar :eval (mapcar #'identity "123")) (format :eval (format "This
number is %d" 4)) "Manipulating Strings" (substring :eval (substring
"foobar" 0 3) :eval (substring "foobar" 3)) (string-limit :eval
(string-limit "foobar" 3) :eval (string-limit "foobar" 3 t) :eval
(string-limit "foobar" 10) :eval (string-limit "fo好" 3 nil 'utf-8))
(truncate-string-to-width :eval (truncate-string-to-width "foobar" 3)
:eval (truncate-string-to-width "你好bar" 5)) (split-string :eval
(split-string "foo bar") :eval (split-string "|foo|bar|" "|") :eval
(split-string "|foo|bar|" "|" t)) (split-string-and-unquote :eval
(split-string-and-unquote "foo \"bar zot\""))
(split-string-shell-command :eval (split-string-shell-command "ls
/tmp/'foo bar'")) (string-lines :eval (string-lines "foo\n\nbar")
:eval (string-lines "foo\n\nbar" t)) (string-replace :eval
(string-replace "foo" "bar" "foozot")) (replace-regexp-in-string :eval
(replace-regexp-in-string "[a-z]+" "_" "*foo*")) (string-trim :args
(string) :doc "Trim STRING of leading and trailing white space." :eval
(string-trim " foo ")) (string-trim-left :eval (string-trim-left
"oofoo" "o+")) (string-trim-right :eval (string-trim-right "barkss"
"s+")) (string-truncate-left :no-manual t :eval (string-truncate-left
"longstring" 8)) (string-remove-suffix :no-manual t :eval
(string-remove-suffix "bar" "foobar")) (string-remove-prefix
:no-manual t :eval (string-remove-prefix "foo" "foobar"))
(string-chop-newline :eval (string-chop-newline "foo\n"))
(string-clean-whitespace :eval (string-clean-whitespace " foo   bar
")) (string-fill :eval (string-fill "Three short words" 12) :eval
(string-fill "Long-word" 3)) (reverse :eval (reverse "foo"))
(substring-no-properties :eval (substring-no-properties (propertize
"foobar" 'face 'bold) 0 3)) (try-completion :eval (try-completion
"foo" '("foobar" "foozot" "gazonk"))) "Unicode Strings"
(string-glyph-split :eval (string-glyph-split "Hello,
👼🏻🧑🏼‍🤝‍🧑🏻")) (string-glyph-compose :eval (string-glyph-compose
"Å")) (string-glyph-decompose :eval (string-glyph-decompose "Å"))
"Predicates for Strings" (string-equal :eval (string-equal "foo"
"foo")) (eq :eval (eq "foo" "foo")) (eql :eval (eql "foo" "foo"))
(equal :eval (equal "foo" "foo")) (cl-equalp :eval (cl-equalp "Foo"
"foo")) (stringp :eval "(stringp ?a)") (string-empty-p :no-manual t
:eval (string-empty-p "")) (string-blank-p :no-manual t :eval
(string-blank-p " \n")) (string-lessp :eval (string-lessp "foo"
"bar")) (string-greaterp :eval (string-greaterp "foo" "bar"))
(string-version-lessp :eval (string-version-lessp "pic4.png"
"pic32.png")) (string-prefix-p :eval (string-prefix-p "foo" "foobar"))
(string-suffix-p :eval (string-suffix-p "bar" "foobar")) "Case
Manipulation" ...))
  shortdoc-display-group("string")
  funcall-interactively(shortdoc-display-group "string")
  command-execute(shortdoc-display-group record)
  execute-extended-command(nil "shortdoc-display-group" "short")
  funcall-interactively(execute-extended-command nil
"shortdoc-display-group" "short")
  command-execute(execute-extended-command)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 07:35:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 52969 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Mon, 3 Jan 2022 02:34:20 -0500
Stefan Kangas <stefan <at> marxist.se> writes:

> On master, emacs -Q:
>
>     M-x shortdoc-display-group RET string RET
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   split-string(nil "\n")
>   shortdoc--display-function((truncate-string-to-width :eval

We get nil here because on master, after emacs -Q:

    (documentation 'rx)
    => nil

Whereas on the emacs-28 branch:

    (documentation 'rx)
    => "Translate regular expressions REGEXPS ..."

Bisecting points to this commit:

    59732a83c8875c8986d2221600d559a24d8309cc is the first bad commit
    commit 59732a83c8875c8986d2221600d559a24d8309cc
    Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
    Date:   Thu Dec 30 23:17:45 2021 -0500

        Don't store docstrings of preloaded .el files in etc/DOC

This always works, even with that commit:

    (progn (rx "foo")
           (documentation 'rx))
    => "Translate regular expressions REGEXPS ..."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 18:57:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: 52969 <at> debbugs.gnu.org
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Mon, 3 Jan 2022 13:56:06 -0500
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> writes:

> On master, emacs -Q:
>
>     M-x shortdoc-display-group RET string RET

BTW, I will be happy to push this test once we can fix this bug:
[0001-New-test-shortdoc-all-groups-work.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 20:34:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 52969 <at> debbugs.gnu.org
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Mon, 03 Jan 2022 15:33:35 -0500
> We get nil here because on master, after emacs -Q:
>
>     (documentation 'rx)
>     => nil

Oh, indeed we now drop the docstrings from the autoloads in
`lisp/loaddefs.el`.  I see a few ways out of that:

1- Forget about autoloads's docstrings altogether (i.e. always load the
   autoload's target when we need the docstring).
2- Revert part of 59732a83c8 so that we still keep the docstrings of
   `lisp/loaddefs.el` in etc/DOC.
3- Byte-compile `lisp/loaddefs.el`.

I pushed a patch which does n°2.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 20:38:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 52969 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Mon, 03 Jan 2022 21:37:42 +0100
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> 1- Forget about autoloads's docstrings altogether (i.e. always load the
>    autoload's target when we need the docstring).
> 2- Revert part of 59732a83c8 so that we still keep the docstrings of
>    `lisp/loaddefs.el` in etc/DOC.
> 3- Byte-compile `lisp/loaddefs.el`.
>
> I pushed a patch which does n°2.

Are there any disadvantages to doing n°3?  I liked the simplifications
in 59732a83c8.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 20:39:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 21:06:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52969 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Mon, 03 Jan 2022 16:05:12 -0500
Lars Ingebrigtsen [2022-01-03 21:37:42] wrote:
> Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>> 1- Forget about autoloads's docstrings altogether (i.e. always load the
>>    autoload's target when we need the docstring).
>> 2- Revert part of 59732a83c8 so that we still keep the docstrings of
>>    `lisp/loaddefs.el` in etc/DOC.
>> 3- Byte-compile `lisp/loaddefs.el`.
>> I pushed a patch which does n°2.
> Are there any disadvantages to doing n°3?
> I liked the simplifications in 59732a83c8.

I haven't tried yet.  I installed n°2 because it's the "safe choice".
We can still choose n°3 and/or n°1 which both have a wider impact.
I liked the simplifications in 59732a83c8 as well, and we do keep some
of them.

As for disadvantages to n°3, I remember trying it out some months ago but
I can't remember why nor can I remember why I haven't kept this change
in my local hacks.  Sorry.

IOW, someone will have to try it.
Of course, there are the obvious disadvantages of spending time to
compile `loaddefs.el` and the added space used by `loaddefs.elc`, tho
a lot of it would be recovered by the space saved in etc/DOC.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Mon, 03 Jan 2022 21:21:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52969 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Mon, 03 Jan 2022 16:19:53 -0500
> As for disadvantages to n°3, I remember trying it out some months ago but
> I can't remember why nor can I remember why I haven't kept this change
> in my local hacks.  Sorry.

I seem to remember that one of the motivations for trying it out had to
do with having an `;;;###autoload` cookie on a piece of code which used an
autoloaded macro, so loading `loaddef.el` would cause (auto)loading the
package which provides the macro.

Byte compiling `loaddefs.el` was a way to fix this problem.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Wed, 05 Jan 2022 15:55:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 52969 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Wed, 05 Jan 2022 16:53:56 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> IOW, someone will have to try it.
> Of course, there are the obvious disadvantages of spending time to
> compile `loaddefs.el` and the added space used by `loaddefs.elc`, tho
> a lot of it would be recovered by the space saved in etc/DOC.

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> I seem to remember that one of the motivations for trying it out had to
> do with having an `;;;###autoload` cookie on a piece of code which used an
> autoloaded macro, so loading `loaddef.el` would cause (auto)loading the
> package which provides the macro.
>
> Byte compiling `loaddefs.el` was a way to fix this problem.

Right.  So I guess somebody just has to try it again and see whether
there's any reasons not to byte-compile the file.  I'll open a new bug
report.

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




bug marked as fixed in version 29.1, send any further explanations to 52969 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 05 Jan 2022 15:55:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52969; Package emacs. (Wed, 05 Jan 2022 15:56:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 52969 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#52969: Shortdoc "string" group leads to backtrace
Date: Wed, 05 Jan 2022 16:55:22 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Right.  So I guess somebody just has to try it again and see whether
> there's any reasons not to byte-compile the file.  I'll open a new bug
> report.

(And I'm closing this bug report.)

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




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

This bug report was last modified 2 years and 83 days ago.

Previous Next


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