Skip to content

Commit

Permalink
fix: advice not cleaned when disabling context mode
Browse files Browse the repository at this point in the history
  • Loading branch information
laishulu committed Dec 29, 2024
1 parent e0c780b commit fa12ae7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sis.el
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,7 @@ If POSITION is not provided, then default to be the current position."
;;;###autoload
(define-minor-mode sis-context-mode
"Switch input source smartly according to context."
:global nil
:init-value nil
(cond
(; turn on the mode
Expand Down Expand Up @@ -1323,9 +1324,11 @@ If POSITION is not provided, then default to be the current position."
(let ((trigger-fn (eval (nth 0 trigger))))
;; delete advices with property of 'sis--context-trigger-advice
(advice-mapc (lambda (advice _)
(when (get (intern advice) 'sis--context-trigger-advice)
(advice-remove trigger-fn advice)))
trigger-fn))))))
(when (get advice 'sis--context-trigger-advice)
(advice-remove trigger-fn advice)
(unintern advice nil)))
trigger-fn)))
(setq sis--context-triggers-adviced nil))))

;;;###autoload
(define-globalized-minor-mode
Expand Down

0 comments on commit fa12ae7

Please sign in to comment.