Improve the doc of eshell-cmpl-* custom variables (Bug#25069)

* lisp/eshell/em-cmpl.el (eshell-cmpl--custom-variable-docstring): New
function to generate the docstring for custom variables derived from
pcomplete-* variables.
(eshell-cmpl-file-ignore, eshell-cmpl-dir-ignore)
(eshell-cmpl-ignore-case, eshell-cmpl-autolist)
(eshell-cmpl-suffix-list, eshell-cmpl-recexact)
(eshell-cmpl-man-function, eshell-cmpl-compare-entry-function)
(eshell-cmpl-expand-before-complete, eshell-cmpl-cycle-completions)
(eshell-cmpl-cycle-cutoff-length, eshell-cmpl-restore-window-delay)
(eshell-command-completion-function, eshell-cmpl-command-name-function)
(eshell-default-completion-function, eshell-cmpl-use-paring): Use it
to set the docstring.
This commit is contained in:
Hong Xu 2016-11-29 15:17:27 -08:00 committed by Noam Postavsky
parent 36400c7dc9
commit ac0bb9a192

View file

@ -136,75 +136,70 @@ to writing a completion function."
:type '(repeat (cons string regexp)) :type '(repeat (cons string regexp))
:group 'eshell-cmpl) :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 t)
(symbol-name pcomplete-var)))
(defcustom eshell-cmpl-file-ignore "~\\'" (defcustom eshell-cmpl-file-ignore "~\\'"
(documentation-property 'pcomplete-file-ignore (eshell-cmpl--custom-variable-docstring 'pcomplete-file-ignore)
'variable-documentation)
:type (get 'pcomplete-file-ignore 'custom-type) :type (get 'pcomplete-file-ignore 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'" (defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'"
(documentation-property 'pcomplete-dir-ignore (eshell-cmpl--custom-variable-docstring 'pcomplete-dir-ignore)
'variable-documentation)
:type (get 'pcomplete-dir-ignore 'custom-type) :type (get 'pcomplete-dir-ignore 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-ignore-case (eshell-under-windows-p) (defcustom eshell-cmpl-ignore-case (eshell-under-windows-p)
(documentation-property 'pcomplete-ignore-case (eshell-cmpl--custom-variable-docstring 'pcomplete-ignore-case)
'variable-documentation)
:type (get 'pcomplete-ignore-case 'custom-type) :type (get 'pcomplete-ignore-case 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-autolist nil (defcustom eshell-cmpl-autolist nil
(documentation-property 'pcomplete-autolist (eshell-cmpl--custom-variable-docstring 'pcomplete-autolist)
'variable-documentation)
:type (get 'pcomplete-autolist 'custom-type) :type (get 'pcomplete-autolist 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-suffix-list (list ?/ ?:) (defcustom eshell-cmpl-suffix-list (list ?/ ?:)
(documentation-property 'pcomplete-suffix-list (eshell-cmpl--custom-variable-docstring 'pcomplete-suffix-list)
'variable-documentation)
:type (get 'pcomplete-suffix-list 'custom-type) :type (get 'pcomplete-suffix-list 'custom-type)
:group 'pcomplete) :group 'pcomplete)
(defcustom eshell-cmpl-recexact nil (defcustom eshell-cmpl-recexact nil
(documentation-property 'pcomplete-recexact (eshell-cmpl--custom-variable-docstring 'pcomplete-recexact)
'variable-documentation)
:type (get 'pcomplete-recexact 'custom-type) :type (get 'pcomplete-recexact 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-man-function 'man (defcustom eshell-cmpl-man-function 'man
(documentation-property 'pcomplete-man-function (eshell-cmpl--custom-variable-docstring 'pcomplete-man-function)
'variable-documentation)
:type (get 'pcomplete-man-function 'custom-type) :type (get 'pcomplete-man-function 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-compare-entry-function 'file-newer-than-file-p (defcustom eshell-cmpl-compare-entry-function 'file-newer-than-file-p
(documentation-property 'pcomplete-compare-entry-function (eshell-cmpl--custom-variable-docstring 'pcomplete-compare-entry-function)
'variable-documentation)
:type (get 'pcomplete-compare-entry-function 'custom-type) :type (get 'pcomplete-compare-entry-function 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-expand-before-complete nil (defcustom eshell-cmpl-expand-before-complete nil
(documentation-property 'pcomplete-expand-before-complete (eshell-cmpl--custom-variable-docstring 'pcomplete-expand-before-complete)
'variable-documentation)
:type (get 'pcomplete-expand-before-complete 'custom-type) :type (get 'pcomplete-expand-before-complete 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-cycle-completions t (defcustom eshell-cmpl-cycle-completions t
(documentation-property 'pcomplete-cycle-completions (eshell-cmpl--custom-variable-docstring 'pcomplete-cycle-completions)
'variable-documentation)
:type (get 'pcomplete-cycle-completions 'custom-type) :type (get 'pcomplete-cycle-completions 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-cycle-cutoff-length 5 (defcustom eshell-cmpl-cycle-cutoff-length 5
(documentation-property 'pcomplete-cycle-cutoff-length (eshell-cmpl--custom-variable-docstring 'pcomplete-cycle-cutoff-length)
'variable-documentation)
:type (get 'pcomplete-cycle-cutoff-length 'custom-type) :type (get 'pcomplete-cycle-cutoff-length 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-restore-window-delay 1 (defcustom eshell-cmpl-restore-window-delay 1
(documentation-property 'pcomplete-restore-window-delay (eshell-cmpl--custom-variable-docstring 'pcomplete-restore-window-delay)
'variable-documentation)
:type (get 'pcomplete-restore-window-delay 'custom-type) :type (get 'pcomplete-restore-window-delay 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
@ -212,15 +207,13 @@ to writing a completion function."
(function (function
(lambda () (lambda ()
(pcomplete-here (eshell-complete-commands-list)))) (pcomplete-here (eshell-complete-commands-list))))
(documentation-property 'pcomplete-command-completion-function (eshell-cmpl--custom-variable-docstring 'pcomplete-command-completion-function)
'variable-documentation)
:type (get 'pcomplete-command-completion-function 'custom-type) :type (get 'pcomplete-command-completion-function 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-command-name-function (defcustom eshell-cmpl-command-name-function
'eshell-completion-command-name 'eshell-completion-command-name
(documentation-property 'pcomplete-command-name-function (eshell-cmpl--custom-variable-docstring 'pcomplete-command-name-function)
'variable-documentation)
:type (get 'pcomplete-command-name-function 'custom-type) :type (get 'pcomplete-command-name-function 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
@ -231,13 +224,12 @@ to writing a completion function."
(pcomplete-dirs-or-entries (pcomplete-dirs-or-entries
(cdr (assoc (funcall eshell-cmpl-command-name-function) (cdr (assoc (funcall eshell-cmpl-command-name-function)
eshell-command-completions-alist))))))) eshell-command-completions-alist)))))))
(documentation-property 'pcomplete-default-completion-function (eshell-cmpl--custom-variable-docstring 'pcomplete-default-completion-function)
'variable-documentation)
:type (get 'pcomplete-default-completion-function 'custom-type) :type (get 'pcomplete-default-completion-function 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)
(defcustom eshell-cmpl-use-paring t (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) :type (get 'pcomplete-use-paring 'custom-type)
:group 'eshell-cmpl) :group 'eshell-cmpl)