GNU bug report logs - #13670
24.3.50; `autoload-generate-file-autoloads' off-by-one bug

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 10 Feb 2013 00:04:02 UTC

Severity: minor

Found in version 24.3.50

Done: Drew Adams <drew.adams <at> oracle.com>

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 13670 in the body.
You can then email your comments to 13670 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#13670; Package emacs. (Sun, 10 Feb 2013 00:04:02 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. (Sun, 10 Feb 2013 00:04:02 GMT) Full text and rfc822 format available.

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

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3.50; `autoload-generate-file-autoloads' off-by-one bug
Date: Sat, 9 Feb 2013 16:03:30 -0800
This source code line of `autoload-generate-file-autoloads':
 
 (if (= (char-after (1+ (point))) ? )
 
should be replaced by this:
 
 (if (= (char-after (point)) ? )
 
The aim is to preserve the whitespace that occurs after a separating
whitespace character, not to preserve also that separating character.
 
`;;;###autoload' cannot be followed by normal text, or else the cookie
is not recognized as such.  But you can follow it by a space and then
the text that you want.  The space is not part of the text to be
copied to the output file; it is only a separator for parsing the
cookie.
 
E.g. Suppose you want to have a multiline doc string, such as this:
 
"Icicle mode: Toggle minibuffer input completion and cycling.
Non-nil prefix ARG turns mode on if ARG > 0, else off.
It is a global minor mode.  It binds minibuffer keys."
 
You can use cookies like this:
 
;;;###autoload (autoload 'icicle-mode "icicles" 
;;;###autoload"Icicle mode: Toggle minibuffer input completion and cycling.
;;;###autoload Non-nil prefix ARG turns mode on if ARG > 0, else off.
;;;###autoload It is a global minor mode.  It binds minibuffer keys."
;;;###autoload t nil)
 
But with the bugged code that preserves the space separator as if it
were part of the doc string, the result is this:
 
(autoload 'icicle-mode "icicles" 
"Icicle mode: Toggle minibuffer input completion and cycling.
 Non-nil prefix ARG turns mode on if ARG > 0, else off.
 It is a global minor mode.  It binds minibuffer keys."
 t nil)
 
which gives the erroneous doc string:
 
"Icicle mode: Toggle minibuffer input completion and cycling.
 Non-nil prefix ARG turns mode on if ARG > 0, else off.
 It is a global minor mode.  It binds minibuffer keys."
 
With the fix, the result is correct:
 
(autoload 'icicle-mode "icicles" 
"Icicle mode: Toggle minibuffer input completion and cycling.
Non-nil prefix ARG turns mode on if ARG > 0, else off.
It is a global minor mode.  It binds minibuffer keys."
t nil)
 
Doc string:
 
"Icicle mode: Toggle minibuffer input completion and cycling.
Non-nil prefix ARG turns mode on if ARG > 0, else off.
It is a global minor mode.  It binds minibuffer keys."
 
However, I see that this bug (as I see it) dates back to at least
Emacs 20.7.  So if I am wrong that this is a bug, please explain
how to get proper multiline doc strings.
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-02-08 on VBOX-W7
Bzr revision: 111700 monnier <at> iro.umontreal.ca-20130208174209-vpjpdh4qipaceoh5
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/emacs/libs/libXpm-3.5.10/include -IC:/emacs/libs/libXpm-3.5.10/src
 -IC:/emacs/libs/libpng-dev_1.4.3-1_win32/include
 -IC:/emacs/libs/zlib-dev_1.2.5-2_win32/include
 -IC:/emacs/libs/giflib-4.1.4-1-lib/include
 -IC:/emacs/libs/jpeg-6b-4-lib/include
 -IC:/emacs/libs/tiff-3.8.2-1-lib/include
 -IC:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2
 -IC:/emacs/libs/gnutls-3.1.5-w32/include
 -IC:/emacs/libs/libiconv-1.14-2-mingw32-dev/include'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13670; Package emacs. (Thu, 28 Apr 2016 22:30:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 13670 <at> debbugs.gnu.org
Subject: Re: bug#13670: 24.3.50;
 `autoload-generate-file-autoloads' off-by-one bug
Date: Fri, 29 Apr 2016 00:29:11 +0200
"Drew Adams" <drew.adams <at> oracle.com> writes:

> This source code line of `autoload-generate-file-autoloads':
>
>  (if (= (char-after (1+ (point))) ? )
>
> should be replaced by this:
>
>  (if (= (char-after (point)) ? )

[...]

> You can use cookies like this:
>
> ;;;###autoload (autoload 'icicle-mode "icicles" 
> ;;;###autoload"Icicle mode: Toggle minibuffer input completion and cycling.
> ;;;###autoload Non-nil prefix ARG turns mode on if ARG > 0, else off.
> ;;;###autoload It is a global minor mode.  It binds minibuffer keys."
> ;;;###autoload t nil)

If we make this change, then autoloads that want to have a single space
at the start of the string (and use this syntax to do that) would then
not have that space?

Have you examined the sources to see whether that's potentially a
problem?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13670; Package emacs. (Fri, 29 Apr 2016 16:12:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 13670 <at> debbugs.gnu.org
Subject: RE: bug#13670: 24.3.50; `autoload-generate-file-autoloads' off-by-one
 bug
Date: Fri, 29 Apr 2016 09:11:31 -0700 (PDT)
> If we make this change, then autoloads that want to have a single space
> at the start of the string (and use this syntax to do that) would then
> not have that space?

No.  See the bug report.  Only the first SPC should be used
as a separator.  If you want an initial SPC char included
then you use SPC SPC.

> Have you examined the sources to see whether that's potentially a
> problem?

No.  Do you see a problem with it?  Do you disagree that this
is a bug, regardless of whether you doubt the proposed solution?

How do you answer this from the bug report?

  if I am wrong that this is a bug, please explain
  how to get proper multiline doc strings.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13670; Package emacs. (Sun, 01 May 2016 15:35:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 13670 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#13670: 24.3.50;
 `autoload-generate-file-autoloads' off-by-one bug
Date: Sun, 01 May 2016 17:34:09 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> > If we make this change, then autoloads that want to have a single space
> > at the start of the string (and use this syntax to do that) would then
> > not have that space?
>
> No.  See the bug report.  Only the first SPC should be used
> as a separator.  If you want an initial SPC char included
> then you use SPC SPC.
>
> > Have you examined the sources to see whether that's potentially a
> > problem?
>
> No.  Do you see a problem with it?  Do you disagree that this
> is a bug, regardless of whether you doubt the proposed solution?

The emacs-25 version of `autoload-generate-file-autoloads' does not
contain a call to `char-after', so I think it has been rewritten in the
meantime.

Moreover, if I let Emacs generate file autoloads for a file with this
content:

#+begin_src emacs-lisp
;;;###autoload (autoload 'icicle-mode "icicles"
;;;###autoload"Icicle mode: Toggle minibuffer input completion and cycling.
;;;###autoloadNon-nil prefix ARG turns mode on if ARG > 0, else off.
;;;###autoloadIt is a global minor mode.  It binds minibuffer keys."
;;;###autoloadt nil)
#+end_src

(update-file-autoloads
  "/home/micha/today/test.el"
   nil
  "/home/micha/today/test-auto.el")

the result looks like this:

#+begin_src emacs-lisp
 (autoload 'icicle-mode "icicles"
"Icicle mode: Toggle minibuffer input completion and cycling.
Non-nil prefix ARG turns mode on if ARG > 0, else off.
It is a global minor mode.  It binds minibuffer keys."
 nil)
#+end_src

So this generates a sane docstring.

Is this acceptable?


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13670; Package emacs. (Sun, 01 May 2016 16:12:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 13670 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: RE: bug#13670: 24.3.50; `autoload-generate-file-autoloads' off-by-one
 bug
Date: Sun, 1 May 2016 08:11:17 -0800 (GMT-08:00)
> The emacs-25 version of `autoload-generate-file-autoloads' does not
> contain a call to `char-after', so I think it has been rewritten in the
> meantime.
> 
> Moreover, if I let Emacs generate file autoloads for a file with this
> content:
> 
> #+begin_src emacs-lisp
> ;;;###autoload (autoload 'icicle-mode "icicles"
> ;;;###autoload"Icicle mode: Toggle minibuffer input completion and
> cycling.
> ;;;###autoloadNon-nil prefix ARG turns mode on if ARG > 0, else off.
> ;;;###autoloadIt is a global minor mode.  It binds minibuffer keys."
> ;;;###autoloadt nil)
> #+end_src
> 
> (update-file-autoloads
>   "/home/micha/today/test.el"
>    nil
>   "/home/micha/today/test-auto.el")
> 
> the result looks like this:
> 
> #+begin_src emacs-lisp
>  (autoload 'icicle-mode "icicles"
> "Icicle mode: Toggle minibuffer input completion and cycling.
> Non-nil prefix ARG turns mode on if ARG > 0, else off.
> It is a global minor mode.  It binds minibuffer keys."
>  nil)
> #+end_src
> 
> So this generates a sane docstring.
> 
> Is this acceptable?

Absolutely.  Based on what you say, I'll close the bug.  Thx.




bug closed, send any further explanations to 13670 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Drew Adams <drew.adams <at> oracle.com> to control <at> debbugs.gnu.org. (Sun, 01 May 2016 16:21: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. (Mon, 30 May 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 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.