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: Tue, 10 May 2016 15:49:33 +0300 Message-ID: <81d15425-67ce-0db7-3d84-6281b7061cbb@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> 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 1462884603 8575 80.91.229.3 (10 May 2016 12:50:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 May 2016 12:50:03 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 10 14:50:02 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 1b076u-0001Q2-8Z for ged-emacs-devel@m.gmane.org; Tue, 10 May 2016 14:50:00 +0200 Original-Received: from localhost ([::1]:46155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b076s-0001lX-EP for ged-emacs-devel@m.gmane.org; Tue, 10 May 2016 08:49:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b076e-0001ie-OS for emacs-devel@gnu.org; Tue, 10 May 2016 08:49:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b076Y-0004ws-It for emacs-devel@gnu.org; Tue, 10 May 2016 08:49:43 -0400 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:35566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b076Y-0004we-BU for emacs-devel@gnu.org; Tue, 10 May 2016 08:49:38 -0400 Original-Received: by mail-wm0-x22b.google.com with SMTP id e201so176591219wme.0 for ; Tue, 10 May 2016 05:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=NSPkgXYgnmcHdNK1dx4scGDxtnmW1vXF6gsm8yQqgPg=; b=HafaFtcs88tdoGuL8JND5UfcAl0/53ahlhDBH/wu381N89+jJBrxrKPbavQzsSfvla 2C1338/HJE+Td93t2TEMCWo8H67JusnlaWgv4NocenyUzqdN0QEo6+Ppe9y3ZSO/sQ1s AFkkUSktCrI11KHhoZFns3W5KzslhluWFNYcjZxlcTyRosenr4vGMHBBNkD3MVZKdskG mIJTKyHZ2WZgEbwOBSbiU2lVbzl66Bfni3mcqh2C1o/886krEIYqD9MUIN99xHw0TP7y DL0q6q8YcN/9fFbwFycSUiZUw/Dj2pF4VoM8GkNz+/oMm/FlKicDFl7cfhlTpAgP0Clt wi3g== 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:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=NSPkgXYgnmcHdNK1dx4scGDxtnmW1vXF6gsm8yQqgPg=; b=Gz3KVYneSAE9h8lCAmiBFMZ+boCci6hWoTRuKRPJo2TFpfr7cHru+5HVTl8GviWeqT pQFcfp82rbf7vYq/A4NfI15WfrBdQFfETuh2H6Xk/dsB3U3EEA/v44dJCJdXpzfLIN7y nCoHLNGyzM1GWTkXBGXpoQR4+VP59vo8UDb7styASvi5hk46V8s6d4UTPYaBjeMtx+BD 29tbx+/fxPuRDl1VFod8F+WGr6GJdQxTGCX4HhPVl0T6pBPxuZ6/otNRcT03gwXJwQ3F ftvlPeZZ0dchIPKNAqcH/MWQuKdKdkl7PFpHJyk3cSvoYhL0DY5G21/jE36ftlio9bAd 6eqQ== X-Gm-Message-State: AOPr4FUhqoZ8u6hx1fRkz66lO88akZYuUqgGO1KtKoycaATkKweQZRWGSZXXZklwQ5LX9g== X-Received: by 10.194.96.10 with SMTP id do10mr38589266wjb.132.1462884577246; Tue, 10 May 2016 05:49:37 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id p129sm2812954wmd.13.2016.05.10.05.49.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2016 05:49:36 -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::22b 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:203768 Archived-At: On 05/10/2016 03:36 PM, Andreas Schwab wrote: >> help-add-fundoc-usage does not currently use prin1. > > Yes, it does, via format. OK, it does, in the "else" branch. But what will we do in the (stringp arglist) case? format with %s does not use prin1, and we're back to the same problem: %S would add the unwanted quotes and escapes. Maybe if that case were to be eliminated in the callers... but that's not a change for emacs-25. To be clear, this is what doesn't work: diff --git a/lisp/help.el b/lisp/help.el index 7289375..5e66042 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1394,11 +1394,12 @@ help-add-fundoc-usage (if (string-match "\n?\n\\'" docstring) (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") "\n\n") - (if (stringp arglist) - (if (string-match "\\`[^ ]+\\(\\(?:.\\|\n\\)*\\))\\'" arglist) - (concat "(fn" (match-string 1 arglist) ")") - (error "Unrecognized usage format")) - (help--make-usage-docstring 'fn arglist))))) + (let ((print-escape-newlines t)) + (if (stringp arglist) + (if (string-match "\\`[^ ]+\\(\\(?:.\\|\n\\)*\\))\\'" arglist) + (format "(fn%s)" (match-string 1 arglist)) + (error "Unrecognized usage format")) + (help--make-usage-docstring 'fn arglist)))))) (defun help-function-arglist (def &optional preserve-names) "Return a formal argument list for the function DEF.