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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Paul M. Rodriguez" <paulmrodriguez <at> gmail.com>
Subject: bug#21839: closed (Re: bug#21839: 25.0.50; can't use newlines in
 defaults in cl functions)
Date: Mon, 09 May 2016 23:56:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#21839: 25.0.50; can't use newlines in defaults in cl functions

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 21839 <at> debbugs.gnu.org.

-- 
21839: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21839
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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)))))



[Message part 3 (message/rfc822, inline)]
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))






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

Previous Next


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