From 409b68589121c4d2e402410abf2a60ddb38d1d58 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Thu, 8 Dec 2011 08:27:05 +0100 Subject: [PATCH] * anything-config.el (anything-c-read-file-name): Partial fix require-match handling, confirm* works partially. --- anything-config.el | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/anything-config.el b/anything-config.el index 09186bd..e04dc68 100644 --- a/anything-config.el +++ b/anything-config.el @@ -4655,19 +4655,22 @@ INITIAL-INPUT is a valid path, TEST is a predicate that take one arg." (not (minibuffer-window-active-p (minibuffer-window)))) anything-same-window (hist (and history (anything-comp-read-get-candidates - history nil nil alistp)))) - ;; (minibuffer-completion-confirm (unless (eq must-match t) - ;; must-match)) - ;; (keymap (when must-match minibuffer-local-must-match-map)) - ;; (anything-map (make-composed-keymap - ;; ;; Merge some anything bindings - ;; ;; that clash with minibuffer ones. - ;; (list '(keymap - ;; (7 . anything-keyboard-quit) - ;; (up . anything-previous-line) - ;; (down . anything-next-line)) - ;; keymap) - ;; anything-c-read-file-map))) + history nil nil alistp))) + (minibuffer-completion-table nil) + (minibuffer-completing-file-name t) + (minibuffer-completion-predicate (or test 'file-exists-p)) + (minibuffer-completion-confirm (unless (eq must-match t) + must-match)) + (keymap (when must-match minibuffer-local-must-match-map)) + (anything-map (make-composed-keymap + ;; Merge some anything bindings + ;; that clash with minibuffer ones. + (list '(keymap + (7 . anything-keyboard-quit) + (up . anything-previous-line) + (down . anything-next-line)) + keymap) + anything-c-read-file-map))) (or (anything :sources @@ -4691,10 +4694,8 @@ INITIAL-INPUT is a valid path, TEST is a predicate that take one arg." (mode-line . anything-read-file-name-mode-line-string) (candidates . (lambda () (let ((seq (anything-find-files-get-candidates must-match))) - (if test - (loop for fname in seq - when (funcall test fname) collect fname) - seq)))) + (setq minibuffer-completion-table + (all-completions "" seq test))))) (filtered-candidate-transformer anything-c-find-files-transformer) (persistent-action . ,persistent-action) (candidate-number-limit . 9999) @@ -4706,7 +4707,6 @@ INITIAL-INPUT is a valid path, TEST is a predicate that take one arg." :prompt prompt :resume 'noresume :buffer buffer - :keymap anything-c-read-file-map :preselect preselect) (when (and (not (string= anything-pattern "")) (eq anything-exit-status 0) -- 2.11.4.GIT