Subject: bug#18039: 24.3; Broken docstring in cl-style functions

From: Michael Heerdegen <[email-masked]>
Date: Thu, 17 Jul 2014 02:31:17 +0200

Thorsten Jolitz <[email-masked]> writes:

> thus the bug seems to be in the combination of normal args
> 'key-val-strg and &key args with default values '(crlf "\n"). 

Indeed. Eval this in emacs -Q:

M-: (require 'cl)
M-: (cl-defun test (&key (c "\n")) "Test" nil)
M-: (symbol-function 'test)

==>

(lambda (&rest --cl-rest--) "Test

(fn 40 102 110 32 38 107 101 121 32 40 67 32 34 10 34 41 41) ...)

The newline character in the (printed) argument list makes a
difference in this expression in help-add-fundoc-usage:

    (if (and (stringp arglist)
	     (string-match "\\`([^ ]+\\(.*\\))\\'" arglist))
	(concat "(fn" (match-string 1 arglist) ")")
      (format "%S" (help-make-usage 'fn arglist)))

(help-make-usage doesn't seem to expect a stringp arglist).  Should the
regexp given to string-match be changed?

Michael.