anything-find-file で 1 キーストロークで上のディレクトリに移動できるようにする
anything-complete.el で定義されている anything-find-file で M-p で上のディレクトリに移動できるようにする。
(when (require 'anything-complete nil t) (defun anything-find-file-follow-directory (sel) "Follow directory in 'sel'." (interactive) ;; These variables are bound by `arfn-sources' or `anything-find-file'. (declare (special prompt default-filename require-match predicate additional-attrs)) (setq arfn-followed t) (let ((f (expand-file-name sel arfn-dir))) (cond ((and (file-directory-p f) (not (string-match "/\\.$" sel))) (with-selected-window (minibuffer-window) (delete-minibuffer-contents)) (setq anything-pattern "") ;;(setq arfn-dir f) (anything-set-sources (arfn-sources prompt f default-filename require-match nil predicate additional-attrs)) (anything-update)) ((string-match "^\\(.+\\)/\\([^/]+\\)$" sel) (with-selected-window (minibuffer-window) (delete-minibuffer-contents) (insert (match-string 2 sel))) (anything-set-sources (arfn-sources prompt (expand-file-name (match-string 1 sel) arfn-dir) nil require-match (match-string 2 sel) predicate additional-attrs)) (anything-update))))) (defun anything-find-file-move-parent-directory () (interactive) (anything-find-file-follow-directory "..")) (define-key (anything-read-file-name-map) (kbd "M-p") 'anything-find-file-move-parent-directory) )
anything-read-file-name-follow-directory からパクってきて、ちょっと編集しただけ。