From 621cb60e7565a155a9c752089ce5d5cce20dbef7 Mon Sep 17 00:00:00 2001 From: Nikita Bloshchanevich Date: Sat, 12 Dec 2020 12:41:05 +0100 Subject: [PATCH] Workaround: fix goto definition on modules `+emacs-lisp-lookup-definition' does not work when browsing the directory of a module, because, due to a possible bug in `counsel', the visited buffer is not immediately visible after calling `counsel-find-file' (unlike with `find-file'). As such, the backend should return `deferred' for that case. See abo-abo/swiper#2752. This should be removed once that PR is merged. --- modules/lang/emacs-lisp/autoload.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index b7257add7..d85ec57f6 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -61,7 +61,9 @@ to a pop up buffer." (defun +emacs-lisp-lookup-definition (_thing) "Lookup definition of THING." (if-let (module (+emacs-lisp--module-at-point)) - (doom/help-modules (car module) (cadr module) 'visit-dir) + ;; FIXME: this is probably a bug in `counsel'. See + ;; https://github.com/abo-abo/swiper/pull/2752. + (progn (doom/help-modules (car module) (cadr module) 'visit-dir) 'deferred) (call-interactively #'elisp-def))) ;;;###autoload