GNU bug report logs - #21839
25.0.50; can't use newlines in defaults in cl functions

Previous Next

Package: emacs;

Reported by: "Paul M. Rodriguez" <paulmrodriguez <at> gmail.com>

Date: Thu, 5 Nov 2015 23:25:02 UTC

Severity: normal

Merged with 18039

Found in versions 24.5, 24.3, 25.0.50

Fixed in version 25.0.94

Done: Dmitry Gutov <dgutov <at> yandex.ru>

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 21839 in the body.
You can then email your comments to 21839 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#21839; Package emacs. (Thu, 05 Nov 2015 23:25:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Paul M. Rodriguez" <paulmrodriguez <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 05 Nov 2015 23:25:03 GMT) Full text and rfc822 format available.

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

From: "Paul M. Rodriguez" <paulmrodriguez <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; can't use newlines in defaults in cl functions
Date: Thu, 05 Nov 2015 23:08:34 -0006
Defining a function using the `cl' package with an optional argument
whose default contains a newline causes an error with the message
"Unrecognized usage format".

Example:


(require 'cl-lib)
(cl-defun example (&optional (separator "\n"))
 ())
;; Unrecognized usage format


The problem appears to be due to a change to `help-add-fundoc-usage'
introduced in this commit:

https://lists.gnu.org/archive/html/emacs-diffs/2015-10/msg00365.html

Paul Rodriguez.


In GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8)
of 2015-11-03
Windowing system distributor 'The X.Org Foundation', version 
11.0.11600000
System Description:	Ubuntu 14.04.3 LTS

Configured using:
'configure --build=x86_64-linux-gnu --prefix=/usr
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
'--libdir=${prefix}/lib/x86_64-linux-gnu'
'--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
--disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
--program-suffix=-snapshot --with-x=yes --with-x-toolkit=gtk3
'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security' CPPFLAGS=-D_FORTIFY_SOURCE=2
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
 value of $LANG: en_US.UTF-8
 locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
 tooltip-mode: t
 global-eldoc-mode: t
 electric-indent-mode: t
 mouse-wheel-mode: t
 tool-bar-mode: t
 menu-bar-mode: t
 file-name-shadow-mode: t
 global-font-lock-mode: t
 font-lock-mode: t
 blink-cursor-mode: t
 auto-composition-mode: t
 auto-encryption-mode: t
 auto-compression-mode: t
 line-number-mode: t
 transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Type C-x 1 to delete the help window.
Scanning for dabbrevs...done
user-error: No dynamic expansion for ‘user-mail-add’ found

"pmr <at> ruricolist.com"
Quit [4 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils cl-extra dabbrev help-fns help-mode
easymenu cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 81136 4848)
(symbols 48 19075 0)
(miscs 40 48 85)
(strings 32 12781 5416)
(string-bytes 1 371247)
(vectors 16 10746)
(vector-slots 8 412657 7275)
(floats 8 136 182)
(intervals 56 257 16)
(buffers 976 12)
(heap 1024 32881 1060))







Added indication that bug 21839 blocks19759 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 05 Nov 2015 23:40:03 GMT) Full text and rfc822 format available.

Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Mon, 09 May 2016 23:56:02 GMT) Full text and rfc822 format available.

Notification sent to "Paul M. Rodriguez" <paulmrodriguez <at> gmail.com>:
bug acknowledged by developer. (Mon, 09 May 2016 23:56:02 GMT) Full text and rfc822 format available.

Message #12 received at 21839-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: "Paul M. Rodriguez" <paulmrodriguez <at> gmail.com>, 21839-done <at> debbugs.gnu.org
Subject: Re: bug#21839: 25.0.50; can't use newlines in defaults in cl functions
Date: Tue, 10 May 2016 02:54:59 +0300
Hi Paul,

Thanks for the report. I've pushed the attached patch to emacs-25.

Not sure it's the best approach (I don't like seeing the unescaped 
newline in the resulting Help buffer), but it might have to do.

Closing.

diff --git a/lisp/help.el b/lisp/help.el
index 061daac..7289375 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1395,7 +1395,7 @@ help-add-fundoc-usage
 		(if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "")
 	      "\n\n")
 	    (if (stringp arglist)
-                (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist)
+                (if (string-match "\\`[^ ]+\\(\\(?:.\\|\n\\)*\\))\\'" 
arglist)
                     (concat "(fn" (match-string 1 arglist) ")")
                   (error "Unrecognized usage format"))
 	      (help--make-usage-docstring 'fn arglist)))))






Merged 18039 21839. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Thu, 02 Jun 2016 18:05:01 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 25.0.94. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sun, 26 Jun 2016 05:41:01 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, 24 Jul 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 334 days ago.

Previous Next


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