aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2018-03-15 12:32:22 -0400
committerGlenn Morris2018-03-15 12:32:22 -0400
commit86aaf45e3040eb7255f859346b99c45549533468 (patch)
tree65fa9989b7ade68a287580a43cc32c83b782a01f /lisp
parentd6e04a6d1c3f73a62c1001674a9837cac7715546 (diff)
downloademacs-86aaf45e3040eb7255f859346b99c45549533468.tar.gz
emacs-86aaf45e3040eb7255f859346b99c45549533468.zip
* lisp/pcomplete.el (pcomplete-here): Move before first reference.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/pcomplete.el66
1 files changed, 33 insertions, 33 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index e7d12c63414..6bdea68c0b9 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -272,6 +272,39 @@ to all arguments, such as variable names after a $."
272 "Complete amongst a list of directories and executables." 272 "Complete amongst a list of directories and executables."
273 (pcomplete-entries regexp 'file-executable-p)) 273 (pcomplete-entries regexp 'file-executable-p))
274 274
275(defmacro pcomplete-here (&optional form stub paring form-only)
276 "Complete against the current argument, if at the end.
277If completion is to be done here, evaluate FORM to generate the completion
278table which will be used for completion purposes. If STUB is a
279string, use it as the completion stub instead of the default (which is
280the entire text of the current argument).
281
282For an example of when you might want to use STUB: if the current
283argument text is `long-path-name/', you don't want the completions
284list display to be cluttered by `long-path-name/' appearing at the
285beginning of every alternative. Not only does this make things less
286intelligible, but it is also inefficient. Yet, if the completion list
287does not begin with this string for every entry, the current argument
288won't complete correctly.
289
290The solution is to specify a relative stub. It allows you to
291substitute a different argument from the current argument, almost
292always for the sake of efficiency.
293
294If PARING is nil, this argument will be pared against previous
295arguments using the function `file-truename' to normalize them.
296PARING may be a function, in which case that function is used for
297normalization. If PARING is t, the argument dealt with by this
298call will not participate in argument paring. If it is the
299integer 0, all previous arguments that have been seen will be
300cleared.
301
302If FORM-ONLY is non-nil, only the result of FORM will be used to
303generate the completions list. This means that the hook
304`pcomplete-try-first-hook' will not be run."
305 (declare (debug t))
306 `(pcomplete--here (lambda () ,form) ,stub ,paring ,form-only))
307
275(defcustom pcomplete-command-completion-function 308(defcustom pcomplete-command-completion-function
276 (function 309 (function
277 (lambda () 310 (lambda ()
@@ -1014,39 +1047,6 @@ See the documentation for `pcomplete-here'."
1014 ;; byte-compiled with the older code. 1047 ;; byte-compiled with the older code.
1015 (eval form))))) 1048 (eval form)))))
1016 1049
1017(defmacro pcomplete-here (&optional form stub paring form-only)
1018 "Complete against the current argument, if at the end.
1019If completion is to be done here, evaluate FORM to generate the completion
1020table which will be used for completion purposes. If STUB is a
1021string, use it as the completion stub instead of the default (which is
1022the entire text of the current argument).
1023
1024For an example of when you might want to use STUB: if the current
1025argument text is `long-path-name/', you don't want the completions
1026list display to be cluttered by `long-path-name/' appearing at the
1027beginning of every alternative. Not only does this make things less
1028intelligible, but it is also inefficient. Yet, if the completion list
1029does not begin with this string for every entry, the current argument
1030won't complete correctly.
1031
1032The solution is to specify a relative stub. It allows you to
1033substitute a different argument from the current argument, almost
1034always for the sake of efficiency.
1035
1036If PARING is nil, this argument will be pared against previous
1037arguments using the function `file-truename' to normalize them.
1038PARING may be a function, in which case that function is used for
1039normalization. If PARING is t, the argument dealt with by this
1040call will not participate in argument paring. If it is the
1041integer 0, all previous arguments that have been seen will be
1042cleared.
1043
1044If FORM-ONLY is non-nil, only the result of FORM will be used to
1045generate the completions list. This means that the hook
1046`pcomplete-try-first-hook' will not be run."
1047 (declare (debug t))
1048 `(pcomplete--here (lambda () ,form) ,stub ,paring ,form-only))
1049
1050 1050
1051(defmacro pcomplete-here* (&optional form stub form-only) 1051(defmacro pcomplete-here* (&optional form stub form-only)
1052 "An alternate form which does not participate in argument paring." 1052 "An alternate form which does not participate in argument paring."