diff options
-rw-r--r-- | eshell-conf.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/eshell-conf.el b/eshell-conf.el index 3ee8352..12a35b6 100644 --- a/eshell-conf.el +++ b/eshell-conf.el @@ -342,7 +342,15 @@ candidates." candidates :test #'string= ;; In Haskell this woule be a simple function composition. - :key (function (lambda (ls) (file-truename (cdr ls))))))) + :key (function (lambda (ls) (file-truename (cdr ls)))))) + ;; Delete non-matching ones + (candidates + (delq + nil + (mapcar + (lambda (cand) + (cond ((string-match-p short-cut (cdr cand)) cand))) + candidates)))) (cond ((null candidates) (user-error "No candidates matching %s found" short-cut)) @@ -354,7 +362,8 @@ candidates." (assoc (let ((completion-regexp-list (cons short-cut completion-regexp-list))) - (completing-read "Choose a link: " candidates nil t)) + (completing-read + "Choose a link: " candidates nil t)) candidates #'string=)))))))) ;;; convenient ls |