aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-04-06 11:40:50 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-04-06 11:40:50 +0200
commitd527f8338613dd9ff7a43328e25065d1f3d7436e (patch)
tree908116b720c64d35bd251e18ef38d5d0d2c04e9d
parent6db34dc77d10fc9b8c925e79b4e0e21d9f78ac5c (diff)
magit-read-module-path: Add Helm kludge
Predicates are evaluate with the minibuffer as the current buffer. Unlike for other completion frameworks, Helm does not ensure that the value of `default-directory' in that buffer is the same as in the buffer from which completion was invoked, making it necessary to explicitly reinforce the expected value. Closes #5546.
-rw-r--r--lisp/magit-git.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index dec96fc..8c75e56 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2987,8 +2987,16 @@ out. Only existing branches can be selected."
(magit-get-remote))))
(defun magit-read-module-path (prompt &optional predicate)
+ ;; Predicates are evaluate with the minibuffer as the current buffer.
+ ;; Unlike for other completion frameworks, Helm does not ensure that
+ ;; the value of `default-directory' in that buffer is the same as in
+ ;; the buffer from which completion was invoked.
(magit-completing-read prompt (magit-list-module-paths)
- predicate t nil nil
+ (let ((dir default-directory))
+ (lambda (module)
+ (let ((default-directory dir))
+ (funcall predicate module))))
+ t nil nil
(magit-module-at-point predicate)))
(defun magit-module-confirm (verb &optional predicate)