diff options
author | Mauro Aranda <maurooaranda@gmail.com> | 2019-08-28 08:29:57 -0300 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2019-09-06 17:02:08 -0400 |
commit | 5b117511aa1b5c451773891b505a7098a67f9532 (patch) | |
tree | 7e4ef2dd5346a18fe66ba9c359644834ef2bbe4b /lisp | |
parent | ff0f4c731231b03d73cc35de9e042d1fc1b75f4e (diff) | |
download | emacs-5b117511aa1b5c451773891b505a7098a67f9532.tar.gz emacs-5b117511aa1b5c451773891b505a7098a67f9532.tar.bz2 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.
Diffstat (limited to 'lisp')
-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." (define-widget 'file 'string "A file widget. It reads a file name from an editable text field." - :completions #'completion-file-name-table + :completions (completion-table-case-fold + #'completion-file-name-table + (not read-file-name-completion-ignore-case)) :prompt-value 'widget-file-prompt-value :format "%{%t%}: %v" ;; Doesn't work well with terminating newline. @@ -3118,6 +3120,11 @@ It reads a file name from an editable text field." (define-widget 'directory 'file "A directory widget. It reads a directory name from an editable text field." + :completions (apply-partially #'completion-table-with-predicate + (completion-table-case-fold + #'completion-file-name-table + (not read-file-name-completion-ignore-case)) + #'directory-name-p 'strict) :tag "Directory") (defvar widget-symbol-prompt-value-history nil |