Emacs 光标移动建议

Emacs 光标移动建议,emacs,elisp,advising-functions,defadvice,Emacs,Elisp,Advising Functions,Defadvice,我已经编写了一个次要模式,当光标在缓冲区周围移动时,它会突出显示缓冲区的各个部分。我通过建议这样的移动功能来实现这一点 ... (defadvice next-line (after showcss/advise-main) "Advice around cursor movement" (highlight-some-stuff)) (defadvice previous-line (after showcss/advise-main) "Advice around cursor

我已经编写了一个次要模式,当光标在缓冲区周围移动时,它会突出显示缓冲区的各个部分。我通过建议这样的移动功能来实现这一点

...
(defadvice next-line (after showcss/advise-main)
  "Advice around cursor movement"
  (highlight-some-stuff))
(defadvice previous-line (after showcss/advise-main)
  "Advice around cursor movement"
  (highlight-some-stuff))
(defadvice right-char (after showcss/advise-main)
  "Advice around cursor movement"
  (highlight-some-stuff))
(defadvice left-char (after showcss/advise-main)
  "Advice around cursor movement"
  (highlight-some-stuff))
(defadvice forward-word (after showcss/advise-main)
  "Advice around cursor movement"
  (highlight-some-stuff))
(defadvice backward-word (after showcss/advise-main)
  "Advice around cursor movement"
  (highlight-some-stuff))
...
但这似乎是错误的做法。我已经为光标移动寻找了一个钩子,但似乎没有


我是否缺少了一个可以用来代替建议一系列移动函数的钩子,或者有更好的方法来解决这个问题?

嗯。。。几天前我给你发了一封电子邮件,建议在GNU ELPA中包含showcss,我还建议你使用
post-command-hook
,而不是那些defadvice