aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHong Xu2016-11-29 15:17:27 -0800
committerNoam Postavsky2017-11-02 20:38:09 -0400
commitac0bb9a192f1e5de4ddc938b71e5a49d36e48a2d (patch)
tree3138da86aaa13335120e25181d9d42df6e5536dc
parent36400c7dc9c8d46f956f42d4bdbb6fe7b3f8c30a (diff)
downloademacs-ac0bb9a192f1e5de4ddc938b71e5a49d36e48a2d.tar.gz
emacs-ac0bb9a192f1e5de4ddc938b71e5a49d36e48a2d.zip
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.
-rw-r--r--lisp/eshell/em-cmpl.el54
1 files changed, 23 insertions, 31 deletions
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index c64c2df3427..89826bebb76 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -136,75 +136,70 @@ to writing a completion function."
136 :type '(repeat (cons string regexp)) 136 :type '(repeat (cons string regexp))
137 :group 'eshell-cmpl) 137 :group 'eshell-cmpl)
138 138
139(defun eshell-cmpl--custom-variable-docstring (pcomplete-var)
140 "Generate the docstring of a variable derived from a pcomplete-* variable."
141 (format "%s\n\nIts value is assigned to `%s' locally after eshell starts."
142 (documentation-property pcomplete-var
143 'variable-documentation t)
144 (symbol-name pcomplete-var)))
145
139(defcustom eshell-cmpl-file-ignore "~\\'" 146(defcustom eshell-cmpl-file-ignore "~\\'"
140 (documentation-property 'pcomplete-file-ignore 147 (eshell-cmpl--custom-variable-docstring 'pcomplete-file-ignore)
141 'variable-documentation)
142 :type (get 'pcomplete-file-ignore 'custom-type) 148 :type (get 'pcomplete-file-ignore 'custom-type)
143 :group 'eshell-cmpl) 149 :group 'eshell-cmpl)
144 150
145(defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'" 151(defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'"
146 (documentation-property 'pcomplete-dir-ignore 152 (eshell-cmpl--custom-variable-docstring 'pcomplete-dir-ignore)
147 'variable-documentation)
148 :type (get 'pcomplete-dir-ignore 'custom-type) 153 :type (get 'pcomplete-dir-ignore 'custom-type)
149 :group 'eshell-cmpl) 154 :group 'eshell-cmpl)
150 155
151(defcustom eshell-cmpl-ignore-case (eshell-under-windows-p) 156(defcustom eshell-cmpl-ignore-case (eshell-under-windows-p)
152 (documentation-property 'pcomplete-ignore-case 157 (eshell-cmpl--custom-variable-docstring 'pcomplete-ignore-case)
153 'variable-documentation)
154 :type (get 'pcomplete-ignore-case 'custom-type) 158 :type (get 'pcomplete-ignore-case 'custom-type)
155 :group 'eshell-cmpl) 159 :group 'eshell-cmpl)
156 160
157(defcustom eshell-cmpl-autolist nil 161(defcustom eshell-cmpl-autolist nil
158 (documentation-property 'pcomplete-autolist 162 (eshell-cmpl--custom-variable-docstring 'pcomplete-autolist)
159 'variable-documentation)
160 :type (get 'pcomplete-autolist 'custom-type) 163 :type (get 'pcomplete-autolist 'custom-type)
161 :group 'eshell-cmpl) 164 :group 'eshell-cmpl)
162 165
163(defcustom eshell-cmpl-suffix-list (list ?/ ?:) 166(defcustom eshell-cmpl-suffix-list (list ?/ ?:)
164 (documentation-property 'pcomplete-suffix-list 167 (eshell-cmpl--custom-variable-docstring 'pcomplete-suffix-list)
165 'variable-documentation)
166 :type (get 'pcomplete-suffix-list 'custom-type) 168 :type (get 'pcomplete-suffix-list 'custom-type)
167 :group 'pcomplete) 169 :group 'pcomplete)
168 170
169(defcustom eshell-cmpl-recexact nil 171(defcustom eshell-cmpl-recexact nil
170 (documentation-property 'pcomplete-recexact 172 (eshell-cmpl--custom-variable-docstring 'pcomplete-recexact)
171 'variable-documentation)
172 :type (get 'pcomplete-recexact 'custom-type) 173 :type (get 'pcomplete-recexact 'custom-type)
173 :group 'eshell-cmpl) 174 :group 'eshell-cmpl)
174 175
175(defcustom eshell-cmpl-man-function 'man 176(defcustom eshell-cmpl-man-function 'man
176 (documentation-property 'pcomplete-man-function 177 (eshell-cmpl--custom-variable-docstring 'pcomplete-man-function)
177 'variable-documentation)
178 :type (get 'pcomplete-man-function 'custom-type) 178 :type (get 'pcomplete-man-function 'custom-type)
179 :group 'eshell-cmpl) 179 :group 'eshell-cmpl)
180 180
181(defcustom eshell-cmpl-compare-entry-function 'file-newer-than-file-p 181(defcustom eshell-cmpl-compare-entry-function 'file-newer-than-file-p
182 (documentation-property 'pcomplete-compare-entry-function 182 (eshell-cmpl--custom-variable-docstring 'pcomplete-compare-entry-function)
183 'variable-documentation)
184 :type (get 'pcomplete-compare-entry-function 'custom-type) 183 :type (get 'pcomplete-compare-entry-function 'custom-type)
185 :group 'eshell-cmpl) 184 :group 'eshell-cmpl)
186 185
187(defcustom eshell-cmpl-expand-before-complete nil 186(defcustom eshell-cmpl-expand-before-complete nil
188 (documentation-property 'pcomplete-expand-before-complete 187 (eshell-cmpl--custom-variable-docstring 'pcomplete-expand-before-complete)
189 'variable-documentation)
190 :type (get 'pcomplete-expand-before-complete 'custom-type) 188 :type (get 'pcomplete-expand-before-complete 'custom-type)
191 :group 'eshell-cmpl) 189 :group 'eshell-cmpl)
192 190
193(defcustom eshell-cmpl-cycle-completions t 191(defcustom eshell-cmpl-cycle-completions t
194 (documentation-property 'pcomplete-cycle-completions 192 (eshell-cmpl--custom-variable-docstring 'pcomplete-cycle-completions)
195 'variable-documentation)
196 :type (get 'pcomplete-cycle-completions 'custom-type) 193 :type (get 'pcomplete-cycle-completions 'custom-type)
197 :group 'eshell-cmpl) 194 :group 'eshell-cmpl)
198 195
199(defcustom eshell-cmpl-cycle-cutoff-length 5 196(defcustom eshell-cmpl-cycle-cutoff-length 5
200 (documentation-property 'pcomplete-cycle-cutoff-length 197 (eshell-cmpl--custom-variable-docstring 'pcomplete-cycle-cutoff-length)
201 'variable-documentation)
202 :type (get 'pcomplete-cycle-cutoff-length 'custom-type) 198 :type (get 'pcomplete-cycle-cutoff-length 'custom-type)
203 :group 'eshell-cmpl) 199 :group 'eshell-cmpl)
204 200
205(defcustom eshell-cmpl-restore-window-delay 1 201(defcustom eshell-cmpl-restore-window-delay 1
206 (documentation-property 'pcomplete-restore-window-delay 202 (eshell-cmpl--custom-variable-docstring 'pcomplete-restore-window-delay)
207 'variable-documentation)
208 :type (get 'pcomplete-restore-window-delay 'custom-type) 203 :type (get 'pcomplete-restore-window-delay 'custom-type)
209 :group 'eshell-cmpl) 204 :group 'eshell-cmpl)
210 205
@@ -212,15 +207,13 @@ to writing a completion function."
212 (function 207 (function
213 (lambda () 208 (lambda ()
214 (pcomplete-here (eshell-complete-commands-list)))) 209 (pcomplete-here (eshell-complete-commands-list))))
215 (documentation-property 'pcomplete-command-completion-function 210 (eshell-cmpl--custom-variable-docstring 'pcomplete-command-completion-function)
216 'variable-documentation)
217 :type (get 'pcomplete-command-completion-function 'custom-type) 211 :type (get 'pcomplete-command-completion-function 'custom-type)
218 :group 'eshell-cmpl) 212 :group 'eshell-cmpl)
219 213
220(defcustom eshell-cmpl-command-name-function 214(defcustom eshell-cmpl-command-name-function
221 'eshell-completion-command-name 215 'eshell-completion-command-name
222 (documentation-property 'pcomplete-command-name-function 216 (eshell-cmpl--custom-variable-docstring 'pcomplete-command-name-function)
223 'variable-documentation)
224 :type (get 'pcomplete-command-name-function 'custom-type) 217 :type (get 'pcomplete-command-name-function 'custom-type)
225 :group 'eshell-cmpl) 218 :group 'eshell-cmpl)
226 219
@@ -231,13 +224,12 @@ to writing a completion function."
231 (pcomplete-dirs-or-entries 224 (pcomplete-dirs-or-entries
232 (cdr (assoc (funcall eshell-cmpl-command-name-function) 225 (cdr (assoc (funcall eshell-cmpl-command-name-function)
233 eshell-command-completions-alist))))))) 226 eshell-command-completions-alist)))))))
234 (documentation-property 'pcomplete-default-completion-function 227 (eshell-cmpl--custom-variable-docstring 'pcomplete-default-completion-function)
235 'variable-documentation)
236 :type (get 'pcomplete-default-completion-function 'custom-type) 228 :type (get 'pcomplete-default-completion-function 'custom-type)
237 :group 'eshell-cmpl) 229 :group 'eshell-cmpl)
238 230
239(defcustom eshell-cmpl-use-paring t 231(defcustom eshell-cmpl-use-paring t
240 (documentation-property 'pcomplete-use-paring 'variable-documentation) 232 (eshell-cmpl--custom-variable-docstring 'pcomplete-use-paring)
241 :type (get 'pcomplete-use-paring 'custom-type) 233 :type (get 'pcomplete-use-paring 'custom-type)
242 :group 'eshell-cmpl) 234 :group 'eshell-cmpl)
243 235