unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] emacs-25 d0d9f55: Allow newlines inside cl function arglists
Date: Wed, 11 May 2016 03:39:16 +0300	[thread overview]
Message-ID: <5c4c53a1-8861-8550-1d65-7536aa0be865@yandex.ru> (raw)
In-Reply-To: <a63e4b3b-f837-1663-a77b-c428e1cbb172@yandex.ru>

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

  \f
  (provide 'help)




  reply	other threads:[~2016-05-11  0:39 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160509235343.17047.73943@vcs.savannah.gnu.org>
     [not found] ` <20160509235343.759D0220128@vcs.savannah.gnu.org>
2016-05-10  1:34   ` [Emacs-diffs] emacs-25 d0d9f55: Allow newlines inside cl function arglists Stefan Monnier
2016-05-10 10:11     ` Dmitry Gutov
2016-05-10 10:21       ` Andreas Schwab
2016-05-10 10:31         ` Dmitry Gutov
2016-05-10 11:27           ` Andreas Schwab
2016-05-10 11:33             ` Dmitry Gutov
2016-05-10 11:57               ` Andreas Schwab
2016-05-10 12:01                 ` Dmitry Gutov
2016-05-10 12:36                   ` Andreas Schwab
2016-05-10 12:49                     ` Dmitry Gutov
2016-05-10 21:14                       ` Stefan Monnier
2016-05-10 21:26                         ` Dmitry Gutov
2016-05-11  0:39                           ` Dmitry Gutov [this message]
2016-05-11 22:40                             ` Dmitry Gutov
2016-05-11  1:47   ` John Wiegley
2016-05-12 19:23     ` Eli Zaretskii
2016-05-12 21:23       ` John Wiegley
2016-05-13  8:47         ` Eli Zaretskii
2016-05-13 16:26           ` John Wiegley
2016-05-12 21:35     ` Removing bugs from the blockers Dmitry Gutov
2016-05-13  8:36       ` Eli Zaretskii
2016-05-13 10:30         ` Lars Ingebrigtsen
2016-05-13 14:12           ` Eli Zaretskii
2016-05-13 16:28             ` John Wiegley
2016-05-13 20:20             ` Lars Ingebrigtsen
2016-05-16 17:51               ` Eli Zaretskii
2016-05-13 12:48         ` Dmitry Gutov
2016-05-13 16:33         ` John Wiegley
2016-06-09 13:04         ` Nix
2016-06-09 21:09           ` bug#21182 (was Removing bugs from the blockers) Mike Kupfer
2016-06-10 11:33             ` Nix
2016-05-13 11:30       ` Removing bugs from the blockers Kaushal Modi
2016-05-13 11:38         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c4c53a1-8861-8550-1d65-7536aa0be865@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).