From d0e51811a4ae029c420683baabcdb0c2746008d2 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Fri, 13 Dec 2024 13:46:46 +0000 Subject: Make sure hippie-expand advice is defined --- .emacs.d/lisp/init-completion.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '.emacs.d') 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)) -- cgit 1.4.1-2-gfad0