From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#20759: 25.0.50; pcase doc: (=?UTF-8?Q?=E2=80=98?= QPAT) instead of (` QPAT) Date: Fri, 12 Jun 2015 16:34:09 -0700 Organization: UCLA Computer Science Department Message-ID: <557B6C71.8070507@cs.ucla.edu> References: <874mmjh6f8.fsf@web.de> <5579C761.1070505@cs.ucla.edu> <87eglh6ru4.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080006060502090501000807" X-Trace: ger.gmane.org 1434152127 30336 80.91.229.3 (12 Jun 2015 23:35:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Jun 2015 23:35:27 +0000 (UTC) Cc: 20759@debbugs.gnu.org, Dmitry Gutov To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 13 01:35:16 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Z3YTj-0007Ew-S4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jun 2015 01:35:16 +0200 Original-Received: from localhost ([::1]:54339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3YTi-0006iX-KA for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jun 2015 19:35:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3YTe-0006iP-SE for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 19:35:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3YTY-0003nG-28 for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 19:35:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3YTX-0003mk-Ut for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 19:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z3YTX-0001Oh-Fx for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 19:35:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jun 2015 23:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20759 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20759-submit@debbugs.gnu.org id=B20759.14341520625278 (code B ref 20759); Fri, 12 Jun 2015 23:35:03 +0000 Original-Received: (at 20759) by debbugs.gnu.org; 12 Jun 2015 23:34:22 +0000 Original-Received: from localhost ([127.0.0.1]:52165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3YSr-0001N4-QB for submit@debbugs.gnu.org; Fri, 12 Jun 2015 19:34:22 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:52739) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3YSp-0001Ml-Oe for 20759@debbugs.gnu.org; Fri, 12 Jun 2015 19:34:20 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9308B1607BA; Fri, 12 Jun 2015 16:34:13 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id kz7Ag7gmdgPt; Fri, 12 Jun 2015 16:34:12 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8F2D61607BB; Fri, 12 Jun 2015 16:34:12 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mpPBu_PYK-63; Fri, 12 Jun 2015 16:34:12 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 726A01607BA; Fri, 12 Jun 2015 16:34:12 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <87eglh6ru4.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103875 Archived-At: This is a multi-part message in MIME format. --------------080006060502090501000807 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 06/12/2015 05:20 AM, Michael Heerdegen wrote: > Thinking again about this, maybe `PAT would be didactically better, in > this special case of the pcase doc. Sure, that's doable. For consistency, the usage string computed automatically by "C-h f `" should be "`STRUCTURE", not "(\` STRUCTURE)". I installed the attached. --------------080006060502090501000807 Content-Type: text/x-patch; name="0001-Document-X-as-X-not-as-X.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Document-X-as-X-not-as-X.patch" >From 8f79b74f37e6787d27b69cac14091ec25b03a89e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 12 Jun 2015 16:27:42 -0700 Subject: [PATCH] Document `X as "`X", not as "(` X)" * lisp/help.el (help-split-fundoc, help--make-usage-docstring): Document (backquote FOO) as "`FOO", not as "(` FOO)" (Bug#20759). --- lisp/help.el | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index b766cd0..d24fbfd 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1368,18 +1368,21 @@ DEF is the function whose usage we're looking for in DOCSTRING." ;; In cases where `function' has been fset to a subr we can't search for ;; function's name in the doc string so we use `fn' as the anonymous ;; function name instead. - (when (and docstring (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring)) + (when (and docstring + (string-match "\n\n(fn\\(\\( +\\([^\n ]+\\( .*\\)?\\)?\\)?)\\)\\'" + docstring)) (let ((doc (unless (zerop (match-beginning 0)) - (substring docstring 0 (match-beginning 0)))) - (usage-tail (match-string 1 docstring))) - (cons (format "(%s%s" - ;; Replace `fn' with the actual function name. - (if (symbolp def) - (help--docstring-quote - (substring (format "%S" (list def)) 1 -1)) - 'anonymous) - usage-tail) - doc)))) + (substring docstring 0 (match-beginning 0))))) + (cons (if (and (eq def '\`) (match-beginning 3) (not (match-beginning 4))) + (concat "\\=`" (match-string 3 docstring)) + (let ((usage-tail (match-string 1 docstring))) + (format "(%s%s" + ;; Replace `fn' with the actual function name. + (if (symbolp def) + (help--docstring-quote (format "%S" def)) + 'anonymous) + usage-tail))) + doc)))) (defun help-add-fundoc-usage (docstring arglist) "Add the usage info to DOCSTRING. @@ -1467,7 +1470,9 @@ the same names as used in the original source code, when possible." (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)))) + (help--docstring-quote + (let ((print-quoted (eq fn '\`))) + (format "%S" (help--make-usage fn arglist))))) (provide 'help) -- 2.1.0 --------------080006060502090501000807--