unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21839: 25.0.50; can't use newlines in defaults in cl functions
@ 2015-11-05 23:14 Paul M. Rodriguez
  2016-05-09 23:54 ` Dmitry Gutov
  0 siblings, 1 reply; 2+ messages in thread
From: Paul M. Rodriguez @ 2015-11-05 23:14 UTC (permalink / raw)
  To: 21839

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@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))








^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#21839: 25.0.50; can't use newlines in defaults in cl functions
  2015-11-05 23:14 bug#21839: 25.0.50; can't use newlines in defaults in cl functions Paul M. Rodriguez
@ 2016-05-09 23:54 ` Dmitry Gutov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Gutov @ 2016-05-09 23:54 UTC (permalink / raw)
  To: Paul M. Rodriguez, 21839-done

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)))))







^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-09 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05 23:14 bug#21839: 25.0.50; can't use newlines in defaults in cl functions Paul M. Rodriguez
2016-05-09 23:54 ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).