Emacs 光标移动建议

4

我编写了一个小模式,当光标在缓冲区移动时,它会突出显示缓冲区的各个部分。我通过像这样建议移动函数来实现这一点。

...
(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))
...

但这似乎不是正确的方法。我已经寻找光标移动的钩子,但似乎没有找到。
我是否错过了可以使用的钩子,而不是建议一堆移动函数,或者有更好的方法来解决这个问题?
1个回答

1

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接