From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 d0d9f55: Allow newlines inside cl function arglists Date: Wed, 11 May 2016 03:39:16 +0300 Message-ID: <5c4c53a1-8861-8550-1d65-7536aa0be865@yandex.ru> References: <20160509235343.17047.73943@vcs.savannah.gnu.org> <20160509235343.759D0220128@vcs.savannah.gnu.org> <0fac0026-f372-d854-1464-ea09ff3c0179@yandex.ru> <2307950f-0a1b-3216-c1d9-ab5e4ecf383b@yandex.ru> <81d15425-67ce-0db7-3d84-6281b7061cbb@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1462927170 18511 80.91.229.3 (11 May 2016 00:39:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 May 2016 00:39:30 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 11 02:39:30 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b0IBV-00038S-EI for ged-emacs-devel@m.gmane.org; Wed, 11 May 2016 02:39:29 +0200 Original-Received: from localhost ([::1]:49728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0IBU-00049s-Ec for ged-emacs-devel@m.gmane.org; Tue, 10 May 2016 20:39:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0IBQ-00045U-1W for emacs-devel@gnu.org; Tue, 10 May 2016 20:39:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0IBL-00032q-Me for emacs-devel@gnu.org; Tue, 10 May 2016 20:39:22 -0400 Original-Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0IBL-00032k-FG for emacs-devel@gnu.org; Tue, 10 May 2016 20:39:19 -0400 Original-Received: by mail-wm0-x243.google.com with SMTP id e201so6154564wme.2 for ; Tue, 10 May 2016 17:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=F7uIhoN6VWCZLmF7KXY5ViY7bQvXJX+q4ClHORrXg3A=; b=MTrKbXWuamX3iALI0zmSkt47hbzVKiD8LCcHyhtC99GrdjXChrneJ//passZbRjMXt k/oNETYu5/EzxFTyP7J/Uf96M47RkgqzX2GuwxA81rN/daQE1E57B00etD5WZyCVRwCY JPxGYadWIEdAX9kWnuqO5HfigCVy59j50OlLq+NyN5nDOV7qHjO30HTaTbpLIa15CQ4J l2U/wjaKG7BNkIRd8BtPWpMJoFUWyeFGimmLkBy26j7tXGruBrd6TaqmDmfaGOiZcciy ppql3ZvgUZHagGfnJG3BpQra3bBLbEMugKR6RI9Sph8F3wPPg6lwYiU3o/8O20KTQpx1 tbYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=F7uIhoN6VWCZLmF7KXY5ViY7bQvXJX+q4ClHORrXg3A=; b=HJVOCDONK8vgwkeDkV35+32ZCq8QnDN8ykITZ3xXUAKdCg3HDxUoqzpA+X+nNe1/E9 hmrNupZEaeDIWdtT9hsooi/DMdj1nTHLpGMuFQUIhUZgoikRKyAVB6qlgQESY1mYGGD6 44k9+REvOeNX9nSWQzubzk/YI/IDzG49VBJevyo1cWLyH4b1Tg70I6DMEIXgGiwVmJi8 gNi84JA1nFb0STlnC8cXWcYJ08Q3NLFOqLBfWYKbfILJ298N4KtLCZw12WWXoTEC1t+3 VywDyCvbzXW8KQqOQObuT7qN2nqX1Ff+zOyvCFDZ34bcBPWlxROuJWELdd54nNToGb5i bO8g== X-Gm-Message-State: AOPr4FUk0IWqVYWs+IVZYfXmVjLSh3OmhjQ7KBMcJD7E2AMzDj56O54dQeiTwGnTSYNmZQ== X-Received: by 10.28.87.6 with SMTP id l6mr960798wmb.48.1462927158738; Tue, 10 May 2016 17:39:18 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id ip10sm5160926wjb.33.2016.05.10.17.39.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2016 17:39:17 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203776 Archived-At: 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)