diff options
| author | Mauro Aranda | 2019-08-28 08:29:57 -0300 |
|---|---|---|
| committer | Noam Postavsky | 2019-09-06 17:02:08 -0400 |
| commit | 5b117511aa1b5c451773891b505a7098a67f9532 (patch) | |
| tree | 7e4ef2dd5346a18fe66ba9c359644834ef2bbe4b | |
| parent | ff0f4c731231b03d73cc35de9e042d1fc1b75f4e (diff) | |
| download | emacs-5b117511aa1b5c451773891b505a7098a67f9532.tar.gz emacs-5b117511aa1b5c451773891b505a7098a67f9532.zip | |
Improve file name completion in file and directory widgets (Bug#7779)
* lisp/wid-edit.el (widget 'file, widget 'directory): Respect the option
read-file-name-completion-ignore-case.
(widget 'directory): Filter the file names, to only perform directory name
completion.
| -rw-r--r-- | lisp/wid-edit.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index fdc16299c88..9bc7a076eec 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -3083,7 +3083,9 @@ as the value." | |||
| 3083 | (define-widget 'file 'string | 3083 | (define-widget 'file 'string |
| 3084 | "A file widget. | 3084 | "A file widget. |
| 3085 | It reads a file name from an editable text field." | 3085 | It reads a file name from an editable text field." |
| 3086 | :completions #'completion-file-name-table | 3086 | :completions (completion-table-case-fold |
| 3087 | #'completion-file-name-table | ||
| 3088 | (not read-file-name-completion-ignore-case)) | ||
| 3087 | :prompt-value 'widget-file-prompt-value | 3089 | :prompt-value 'widget-file-prompt-value |
| 3088 | :format "%{%t%}: %v" | 3090 | :format "%{%t%}: %v" |
| 3089 | ;; Doesn't work well with terminating newline. | 3091 | ;; Doesn't work well with terminating newline. |
| @@ -3118,6 +3120,11 @@ It reads a file name from an editable text field." | |||
| 3118 | (define-widget 'directory 'file | 3120 | (define-widget 'directory 'file |
| 3119 | "A directory widget. | 3121 | "A directory widget. |
| 3120 | It reads a directory name from an editable text field." | 3122 | It reads a directory name from an editable text field." |
| 3123 | :completions (apply-partially #'completion-table-with-predicate | ||
| 3124 | (completion-table-case-fold | ||
| 3125 | #'completion-file-name-table | ||
| 3126 | (not read-file-name-completion-ignore-case)) | ||
| 3127 | #'directory-name-p 'strict) | ||
| 3121 | :tag "Directory") | 3128 | :tag "Directory") |
| 3122 | 3129 | ||
| 3123 | (defvar widget-symbol-prompt-value-history nil | 3130 | (defvar widget-symbol-prompt-value-history nil |