From f7766360c4f6decb8472b0e66be9c5bf6277c7a0 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Sat, 5 Nov 2011 16:34:43 +0100 Subject: [PATCH] * anything-config.el (anything-ff-before-action-hook-fn): Improve error message. --- anything-config.el | 9 +++++---- anything.el | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/anything-config.el b/anything-config.el index 4d960d6..e006839 100644 --- a/anything-config.el +++ b/anything-config.el @@ -3646,10 +3646,11 @@ purpose." (defun anything-ff-before-action-hook-fn () "Exit anything when user try to execute action on an invalid tramp fname." - (when (and (anything-file-completion-source-p) - (anything-ff-invalid-tramp-name-p (anything-get-selection)) - (anything-ff-invalid-tramp-name-p)) - (error "[Invalid tramp file name]"))) + (let ((cand (anything-get-selection))) + (when (and (anything-file-completion-source-p) + (anything-ff-invalid-tramp-name-p cand) ; Check candidate. + (anything-ff-invalid-tramp-name-p)) ; check anything-pattern. + (error "Error: Unknow file or directory `%s'" cand)))) (add-hook 'anything-before-action-hook 'anything-ff-before-action-hook-fn) (defun* anything-ff-invalid-tramp-name-p (&optional (pattern anything-pattern)) diff --git a/anything.el b/anything.el index e4cf476..2d53e45 100644 --- a/anything.el +++ b/anything.el @@ -1966,7 +1966,7 @@ hooks concerned are `post-command-hook' and `minibuffer-setup-hook'." (let ((hooks '((post-command-hook anything-check-minibuffer-input) (minibuffer-setup-hook anything-print-error-messages)))) (if (eq setup-or-cleanup 'setup) - (dolist (args hooks) (apply #'(lambda (h f) (add-hook h f t)) args)) + (dolist (args hooks) (apply 'add-hook args)) (dolist (args (reverse hooks)) (apply 'remove-hook args))))) ;; (@* "Core: clean up") -- 2.11.4.GIT