Skip to content

Commit

Permalink
fix: symbol-name should not call on quote
Browse files Browse the repository at this point in the history
  • Loading branch information
laishulu committed Dec 28, 2024
1 parent cee7e94 commit 58b1ab5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sis.el
Original file line number Diff line number Diff line change
Expand Up @@ -1308,11 +1308,11 @@ If POSITION is not provided, then default to be the current position."
(unless sis--context-triggers-adviced
(setq sis--context-triggers-adviced t)
(dolist (trigger sis-context-triggers)
(let* ((trigger-fn-symbol (nth 0 trigger))
(let* ((trigger-fn-q (nth 0 trigger))
(pre-detector (nth 1 trigger))
(post-detector (nth 2 trigger))
(advice-name (format "sis--context-trigger-advice-%s"
(symbol-name trigger-fn-symbol))))
(symbol-name (eval trigger-fn-q)))))
;; dynamically create the advice
(defalias (intern advice-name)
`(lambda (fn &rest args)
Expand All @@ -1327,16 +1327,15 @@ If POSITION is not provided, then default to be the current position."
(apply fn args))))
;; Add special property to the advice, so it can be easily removed
(put (intern advice-name) 'sis--context-trigger-advice t)
(advice-add (symbol-function trigger-fn-symbol)
:around (intern advice-name)))))))
(advice-add (eval trigger-fn-q) :around (intern advice-name)))))))
(; turn off the mode
(not sis-context-mode)
(dolist (buf (buffer-list))
(with-current-buffer buf
(dolist (hook sis-context-hooks)
(remove-hook hook #'sis-context nil))))
(dolist (trigger sis-context-triggers)
(let ((trigger-fn (symbol-function (nth 0 trigger))))
(let ((trigger-fn (eval (nth 0 trigger))))
;; delete advices with property of 'sis--context-trigger-advice
(advice-mapc
(lambda (advice _)
Expand Down

0 comments on commit 58b1ab5

Please sign in to comment.