diff options
| author | Michael Albinus | 2023-08-20 09:41:07 +0200 |
|---|---|---|
| committer | Michael Albinus | 2023-08-20 09:41:07 +0200 |
| commit | efb276fef1f580eafa8458fc262a4b35eb3abd5e (patch) | |
| tree | 19e136ceadfb718a8d6ff09b0dee749ce777071d | |
| parent | fd1479a0af1ba896ae194c9fc91ec7dd49416d9b (diff) | |
| download | emacs-efb276fef1f580eafa8458fc262a4b35eb3abd5e.tar.gz emacs-efb276fef1f580eafa8458fc262a4b35eb3abd5e.zip | |
New user option pcomplete-remote-file-ignore
* etc/NEWS: Mention pcomplete-remote-file-ignore.
* lisp/pcomplete.el (pcomplete-remote-file-ignore):
New user option.
(pcomplete--entries): Use it.
* lisp/shell.el (shell-completion-vars):
Set 'pcomplete-remote-file-ignore'.
| -rw-r--r-- | etc/NEWS | 8 | ||||
| -rw-r--r-- | lisp/pcomplete.el | 13 | ||||
| -rw-r--r-- | lisp/shell.el | 2 |
3 files changed, 21 insertions, 2 deletions
| @@ -357,6 +357,14 @@ to load the edited aliases. | |||
| 357 | Running 'rgrep' in Eshell now uses the Emacs grep facility instead of | 357 | Running 'rgrep' in Eshell now uses the Emacs grep facility instead of |
| 358 | calling external rgrep. | 358 | calling external rgrep. |
| 359 | 359 | ||
| 360 | ** Pcomplete | ||
| 361 | |||
| 362 | --- | ||
| 363 | *** New user option 'pcomplete-remote-file-ignore'. | ||
| 364 | When this option is non-nil, remote file names are not completed by | ||
| 365 | Pcomplete. Packages, like 'shell-mode', could set this in order to | ||
| 366 | suppress remote file name completion at all. | ||
| 367 | |||
| 360 | ** Shell Mode | 368 | ** Shell Mode |
| 361 | 369 | ||
| 362 | +++ | 370 | +++ |
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index c7ec228c1db..3d8a4e7edaa 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el | |||
| @@ -138,6 +138,11 @@ | |||
| 138 | "A regexp of names to be disregarded during directory completion." | 138 | "A regexp of names to be disregarded during directory completion." |
| 139 | :type '(choice regexp (const :tag "None" nil))) | 139 | :type '(choice regexp (const :tag "None" nil))) |
| 140 | 140 | ||
| 141 | (defcustom pcomplete-remote-file-ignore nil | ||
| 142 | "Whether to ignore remote file names." | ||
| 143 | :version "30.1" | ||
| 144 | :type 'boolean) | ||
| 145 | |||
| 141 | (define-obsolete-variable-alias 'pcomplete-ignore-case 'completion-ignore-case | 146 | (define-obsolete-variable-alias 'pcomplete-ignore-case 'completion-ignore-case |
| 142 | "28.1") | 147 | "28.1") |
| 143 | 148 | ||
| @@ -924,7 +929,10 @@ this is `comint-dynamic-complete-functions'." | |||
| 924 | (sort comps pcomplete-compare-entry-function))) | 929 | (sort comps pcomplete-compare-entry-function))) |
| 925 | ,@(cdr (completion-file-name-table s p a))) | 930 | ,@(cdr (completion-file-name-table s p a))) |
| 926 | (let ((completion-ignored-extensions nil) | 931 | (let ((completion-ignored-extensions nil) |
| 927 | (completion-ignore-case completion-ignore-case)) | 932 | (completion-ignore-case completion-ignore-case) |
| 933 | (tramp-mode (and tramp-mode (not pcomplete-remote-file-ignore))) | ||
| 934 | (non-essential (not (file-remote-p s))) | ||
| 935 | (minibuffer-completing-file-name (file-remote-p s)))) | ||
| 928 | (completion-table-with-predicate | 936 | (completion-table-with-predicate |
| 929 | #'comint-completion-file-name-table pred 'strict s p a)))))) | 937 | #'comint-completion-file-name-table pred 'strict s p a)))))) |
| 930 | 938 | ||
| @@ -1322,7 +1330,8 @@ If specific documentation can't be given, be generic." | |||
| 1322 | "Sort and remove multiples in SEQUENCE. | 1330 | "Sort and remove multiples in SEQUENCE. |
| 1323 | Sequence should be a vector or list of strings." | 1331 | Sequence should be a vector or list of strings." |
| 1324 | (sort (seq-uniq sequence) #'string-lessp)) | 1332 | (sort (seq-uniq sequence) #'string-lessp)) |
| 1325 | (define-obsolete-function-alias 'pcomplete-uniqify-list #'pcomplete-uniquify-list "27.1") | 1333 | (define-obsolete-function-alias |
| 1334 | 'pcomplete-uniqify-list #'pcomplete-uniquify-list "27.1") | ||
| 1326 | 1335 | ||
| 1327 | (defun pcomplete-process-result (cmd &rest args) | 1336 | (defun pcomplete-process-result (cmd &rest args) |
| 1328 | "Call CMD using `call-process' and return the simplest result." | 1337 | "Call CMD using `call-process' and return the simplest result." |
diff --git a/lisp/shell.el b/lisp/shell.el index 7ea9d1c2ead..b554ee5add9 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -595,6 +595,8 @@ Shell buffers. It implements `shell-completion-execonly' for | |||
| 595 | ;; Don't use pcomplete's defaulting mechanism, rely on | 595 | ;; Don't use pcomplete's defaulting mechanism, rely on |
| 596 | ;; shell-dynamic-complete-functions instead. | 596 | ;; shell-dynamic-complete-functions instead. |
| 597 | (setq-local pcomplete-default-completion-function #'ignore) | 597 | (setq-local pcomplete-default-completion-function #'ignore) |
| 598 | ;; Do not expand remote file names. | ||
| 599 | (setq-local pcomplete-remote-file-ignore t) | ||
| 598 | (setq-local comint-input-autoexpand shell-input-autoexpand) | 600 | (setq-local comint-input-autoexpand shell-input-autoexpand) |
| 599 | ;; Not needed in shell-mode because it's inherited from comint-mode, but | 601 | ;; Not needed in shell-mode because it's inherited from comint-mode, but |
| 600 | ;; placed here for read-shell-command. | 602 | ;; placed here for read-shell-command. |