about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2024-12-13 13:46:46 +0000
committerDavid Morgan <djm_uk@protonmail.com>2024-12-13 13:46:46 +0000
commitd0e51811a4ae029c420683baabcdb0c2746008d2 (patch)
treed54b902207e852df99a875c00ac06347e6bcde45 /.emacs.d
parentac04afe0e8789c271d3fd065e112249fcfb6c9de (diff)
downloaddotfiles-d0e51811a4ae029c420683baabcdb0c2746008d2.tar.gz
Make sure hippie-expand advice is defined HEAD master
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-completion.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/.emacs.d/lisp/init-completion.el b/.emacs.d/lisp/init-completion.el
index f7e07de..36a5680 100644
--- a/.emacs.d/lisp/init-completion.el
+++ b/.emacs.d/lisp/init-completion.el
@@ -56,12 +56,12 @@
                                       try-expand-line
                                       try-complete-lisp-symbol-partially
                                       try-complete-lisp-symbol))
-  :config
-  ;; Modified from https://www.emacswiki.org/emacs/HippieExpand#h5o-9
-  (define-advice he-substitute-string (:after (str &optional trans-case) he-paredit-fix)
-    "Remove extra bracket when expanding line in paredit/smartparents mode."
-    (if (and (or smartparens-mode paredit-mode) (string-match "[]})]$" str))
-        (progn (backward-delete-char 1) (forward-char))))
+  :hook (elpaca-after-init . (lambda ()
+                               ;; Modified from https://www.emacswiki.org/emacs/HippieExpand#h5o-9
+                               (define-advice he-substitute-string (:after (str &optional trans-case) he-paredit-fix)
+                                 "Remove extra bracket when expanding line in paredit/smartparents mode."
+                                 (if (and (or smartparens-mode paredit-mode) (string-match "[]})]$" str))
+                                     (progn (backward-delete-char 1) (forward-char))))))
   :bind
   ("C-M-/" . hippie-expand))