emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] emacs-25 d0d9f55: Allow newlines inside cl function ar


From: Dmitry Gutov
Subject: Re: [Emacs-diffs] emacs-25 d0d9f55: Allow newlines inside cl function arglists
Date: Wed, 11 May 2016 03:39:16 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1

On 05/11/2016 12:26 AM, Dmitry Gutov wrote:

Is there some place up the call
stack we could make sure the newlines are escaped when the arglist
string is constructed?

...and this was rather easy. Seems to work fine. Comments?

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index ae52e8b..68abe67 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -299,7 +299,8 @@ cl--transform-lambda
;; Be careful with make-symbol and (back)quote,
                                ;; see bug#12884.
                                (help--docstring-quote
-                                (let ((print-gensym nil) (print-quoted t))
+                                (let ((print-gensym nil) (print-quoted t)
+                                      (print-escape-newlines t))
(format "%S" (cons 'fn (cl--make-usage-args
                                                           orig-args))))))
                               header)))
diff --git a/lisp/help.el b/lisp/help.el
index 7289375..57f358b 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 "\\`[^ ]+\\(\\(?:.\\|\n\\)*\\))\\'" arglist)
+                (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist)
                     (concat "(fn" (match-string 1 arglist) ")")
                   (error "Unrecognized usage format"))
              (help--make-usage-docstring 'fn arglist)))))
@@ -1468,7 +1468,8 @@ help--make-usage
 (define-obsolete-function-alias 'help-make-usage 'help--make-usage "25.1")

 (defun help--make-usage-docstring (fn arglist)
-  (help--docstring-quote (format "%S" (help--make-usage fn arglist))))
+  (let ((print-escape-newlines t))
+    (help--docstring-quote (format "%S" (help--make-usage fn arglist)))))

 
 (provide 'help)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]