diff options
| author | Glenn Morris | 2018-03-15 12:32:22 -0400 |
|---|---|---|
| committer | Glenn Morris | 2018-03-15 12:32:22 -0400 |
| commit | 86aaf45e3040eb7255f859346b99c45549533468 (patch) | |
| tree | 65fa9989b7ade68a287580a43cc32c83b782a01f /lisp | |
| parent | d6e04a6d1c3f73a62c1001674a9837cac7715546 (diff) | |
| download | emacs-86aaf45e3040eb7255f859346b99c45549533468.tar.gz emacs-86aaf45e3040eb7255f859346b99c45549533468.zip | |
* lisp/pcomplete.el (pcomplete-here): Move before first reference.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/pcomplete.el | 66 |
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. | ||
| 277 | If completion is to be done here, evaluate FORM to generate the completion | ||
| 278 | table which will be used for completion purposes. If STUB is a | ||
| 279 | string, use it as the completion stub instead of the default (which is | ||
| 280 | the entire text of the current argument). | ||
| 281 | |||
| 282 | For an example of when you might want to use STUB: if the current | ||
| 283 | argument text is `long-path-name/', you don't want the completions | ||
| 284 | list display to be cluttered by `long-path-name/' appearing at the | ||
| 285 | beginning of every alternative. Not only does this make things less | ||
| 286 | intelligible, but it is also inefficient. Yet, if the completion list | ||
| 287 | does not begin with this string for every entry, the current argument | ||
| 288 | won't complete correctly. | ||
| 289 | |||
| 290 | The solution is to specify a relative stub. It allows you to | ||
| 291 | substitute a different argument from the current argument, almost | ||
| 292 | always for the sake of efficiency. | ||
| 293 | |||
| 294 | If PARING is nil, this argument will be pared against previous | ||
| 295 | arguments using the function `file-truename' to normalize them. | ||
| 296 | PARING may be a function, in which case that function is used for | ||
| 297 | normalization. If PARING is t, the argument dealt with by this | ||
| 298 | call will not participate in argument paring. If it is the | ||
| 299 | integer 0, all previous arguments that have been seen will be | ||
| 300 | cleared. | ||
| 301 | |||
| 302 | If FORM-ONLY is non-nil, only the result of FORM will be used to | ||
| 303 | generate 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. | ||
| 1019 | If completion is to be done here, evaluate FORM to generate the completion | ||
| 1020 | table which will be used for completion purposes. If STUB is a | ||
| 1021 | string, use it as the completion stub instead of the default (which is | ||
| 1022 | the entire text of the current argument). | ||
| 1023 | |||
| 1024 | For an example of when you might want to use STUB: if the current | ||
| 1025 | argument text is `long-path-name/', you don't want the completions | ||
| 1026 | list display to be cluttered by `long-path-name/' appearing at the | ||
| 1027 | beginning of every alternative. Not only does this make things less | ||
| 1028 | intelligible, but it is also inefficient. Yet, if the completion list | ||
| 1029 | does not begin with this string for every entry, the current argument | ||
| 1030 | won't complete correctly. | ||
| 1031 | |||
| 1032 | The solution is to specify a relative stub. It allows you to | ||
| 1033 | substitute a different argument from the current argument, almost | ||
| 1034 | always for the sake of efficiency. | ||
| 1035 | |||
| 1036 | If PARING is nil, this argument will be pared against previous | ||
| 1037 | arguments using the function `file-truename' to normalize them. | ||
| 1038 | PARING may be a function, in which case that function is used for | ||
| 1039 | normalization. If PARING is t, the argument dealt with by this | ||
| 1040 | call will not participate in argument paring. If it is the | ||
| 1041 | integer 0, all previous arguments that have been seen will be | ||
| 1042 | cleared. | ||
| 1043 | |||
| 1044 | If FORM-ONLY is non-nil, only the result of FORM will be used to | ||
| 1045 | generate 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." |