From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Hong Xu Newsgroups: gmane.emacs.bugs Subject: bug#25069: [PATCH] Improve the doc of eshell-cmpl-* custom variables Date: Tue, 29 Nov 2016 15:17:27 -0800 Message-ID: <1480461447-15639-1-git-send-email-hong@topbug.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1480461495 2468 195.159.176.226 (29 Nov 2016 23:18:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 23:18:15 +0000 (UTC) To: 25069@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 30 00:18:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBrf9-0007sq-KL for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Nov 2016 00:18:11 +0100 Original-Received: from localhost ([::1]:39694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBrfB-0001T9-Pz for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Nov 2016 18:18:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBrf3-0001Sx-CV for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:18:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBrf0-0000HE-7r for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:18:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBrf0-0000H9-3c for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cBrez-0004cN-Sl for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2016 23:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25069 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148046147117722 (code B ref -1); Tue, 29 Nov 2016 23:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Nov 2016 23:17:51 +0000 Original-Received: from localhost ([127.0.0.1]:46618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBrep-0004bm-D8 for submit@debbugs.gnu.org; Tue, 29 Nov 2016 18:17:51 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBren-0004bX-Pf for submit@debbugs.gnu.org; Tue, 29 Nov 2016 18:17:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBreh-0000CW-9J for submit@debbugs.gnu.org; Tue, 29 Nov 2016 18:17:44 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43066) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBreh-0000CS-5c for submit@debbugs.gnu.org; Tue, 29 Nov 2016 18:17:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBref-0001Jf-Nf for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:17:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBrec-0000BK-IU for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:17:41 -0500 Original-Received: from sender163-mail.zoho.com ([74.201.84.163]:21379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBrec-00009n-8q for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 18:17:38 -0500 Original-Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1480461452325716.2808861741111; Tue, 29 Nov 2016 15:17:32 -0800 (PST) X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:126276 Archived-At: * lisp/eshell/em-cmpl.el (eshell-cmpl--custom-variable-docstring): Add a new function to generate the docstring for custom variables derived from pcomplete-* variables. --- The current eshell-cmpl-* documentation sometimes made me confused -- they actually show the documentation of pcomplete-*. For example, eshell-cmpl-cycle-completions even has pcomplete-cycle-completions in its doc without explaining the relationship between them. This patch makes the relationship clearer. lisp/eshell/em-cmpl.el | 55 ++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 47467678a68a..e01948cad454 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -136,75 +136,71 @@ eshell-command-completions-alist :type '(repeat (cons string regexp)) :group 'eshell-cmpl) +(defun eshell-cmpl--custom-variable-docstring (pcomplete-var) + "Generate the docstring of a variable derived from a pcomplete-* variable." + (format "%s\n\nIts value is assigned to `%s' locally +after eshell starts." + (documentation-property pcomplete-var + 'variable-documentation) + (symbol-name pcomplete-var))) + (defcustom eshell-cmpl-file-ignore "~\\'" - (documentation-property 'pcomplete-file-ignore - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-file-ignore) :type (get 'pcomplete-file-ignore 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'" - (documentation-property 'pcomplete-dir-ignore - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-dir-ignore) :type (get 'pcomplete-dir-ignore 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-ignore-case (eshell-under-windows-p) - (documentation-property 'pcomplete-ignore-case - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-ignore-case) :type (get 'pcomplete-ignore-case 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-autolist nil - (documentation-property 'pcomplete-autolist - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-autolist) :type (get 'pcomplete-autolist 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-suffix-list (list ?/ ?:) - (documentation-property 'pcomplete-suffix-list - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-suffix-list) :type (get 'pcomplete-suffix-list 'custom-type) :group 'pcomplete) (defcustom eshell-cmpl-recexact nil - (documentation-property 'pcomplete-recexact - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-recexact) :type (get 'pcomplete-recexact 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-man-function 'man - (documentation-property 'pcomplete-man-function - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-man-function) :type (get 'pcomplete-man-function 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-compare-entry-function 'file-newer-than-file-p - (documentation-property 'pcomplete-compare-entry-function - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-compare-entry-function) :type (get 'pcomplete-compare-entry-function 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-expand-before-complete nil - (documentation-property 'pcomplete-expand-before-complete - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-expand-before-complete) :type (get 'pcomplete-expand-before-complete 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-cycle-completions t - (documentation-property 'pcomplete-cycle-completions - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-cycle-completions) :type (get 'pcomplete-cycle-completions 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-cycle-cutoff-length 5 - (documentation-property 'pcomplete-cycle-cutoff-length - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-cycle-cutoff-length) :type (get 'pcomplete-cycle-cutoff-length 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-restore-window-delay 1 - (documentation-property 'pcomplete-restore-window-delay - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-restore-window-delay) :type (get 'pcomplete-restore-window-delay 'custom-type) :group 'eshell-cmpl) @@ -212,15 +208,13 @@ eshell-command-completion-function (function (lambda () (pcomplete-here (eshell-complete-commands-list)))) - (documentation-property 'pcomplete-command-completion-function - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-command-completion-function) :type (get 'pcomplete-command-completion-function 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-command-name-function 'eshell-completion-command-name - (documentation-property 'pcomplete-command-name-function - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-command-name-function) :type (get 'pcomplete-command-name-function 'custom-type) :group 'eshell-cmpl) @@ -231,13 +225,12 @@ eshell-default-completion-function (pcomplete-dirs-or-entries (cdr (assoc (funcall eshell-cmpl-command-name-function) eshell-command-completions-alist))))))) - (documentation-property 'pcomplete-default-completion-function - 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-default-completion-function) :type (get 'pcomplete-default-completion-function 'custom-type) :group 'eshell-cmpl) (defcustom eshell-cmpl-use-paring t - (documentation-property 'pcomplete-use-paring 'variable-documentation) + (eshell-cmpl--custom-variable-docstring 'pcomplete-use-paring) :type (get 'pcomplete-use-paring 'custom-type) :group 'eshell-cmpl) -- 2.1.4