Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize advice definition using advice-add #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions evil-iedit-state.el
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,14 @@ If INTERACTIVE is non-nil then COMMAND is called interactively."
;; force expand-region temporary overlay map exit
(setq overriding-terminal-local-map nil))

(defadvice er/prepare-for-more-expansions-internal
(around iedit/prepare-for-more-expansions-internal activate)
ad-do-it
(let ((default-msg (car ad-return-value))
(default-bindings (cdr ad-return-value)))
(setq ad-return-value
(cons (concat default-msg ", e to edit")
(add-to-list 'default-bindings
'("e" evil-iedit-state/iedit-mode-from-expand-region))))))))
(advice-add 'er/prepare-for-more-expansions-internal :around
(lambda (orig-fun &rest args)
(let ((result (apply orig-fun args)))
(let ((default-msg (car result))
(default-bindings (cdr result)))
(cons (concat default-msg ", e to edit")
(add-to-list 'default-bindings
'("e" evil-iedit-state/iedit-mode-from-expand-region)))))))))

;; redefine iedit-done to prevent iedit from putting the occurrence on the
;; kill-ring for no useful reason.
Expand Down