about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-08-10 15:57:01 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-08-10 15:57:01 +0100
commitf146c7028a2c4919f51649ec14c439006865dea6 (patch)
tree588d818817b01b63056f175565c66b89366a95ef
parenta8811cd27450964bf507602a6ce76294e12415cf (diff)
downloaddotfiles-f146c7028a2c4919f51649ec14c439006865dea6.tar.gz
Bind fancy-dabbrev-backward when popup is active
-rw-r--r--.emacs.d/lisp/init-completion.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-completion.el b/.emacs.d/lisp/init-completion.el
index 862ee71..4c42716 100644
--- a/.emacs.d/lisp/init-completion.el
+++ b/.emacs.d/lisp/init-completion.el
@@ -39,6 +39,12 @@
   :diminish
   :config
   (global-fancy-dabbrev-mode)
+  (defun fancy-dabbrev-popup-advice (_next)
+    (local-set-key (kbd "C-M-/") #'fancy-dabbrev-backward))
+  (defun fancy-dabbrev-popup-exit-advice ()
+    (local-unset-key (kbd "C-M-/")))
+  (advice-add #'fancy-dabbrev--expand-again :before #'fancy-dabbrev-popup-advice)
+  (advice-add #'fancy-dabbrev--on-exit :after #'fancy-dabbrev-popup-exit-advice)
   :bind ("M-/" . fancy-dabbrev-expand))
 
 (use-package emacs