当建议返回nil时,如何防止建议的函数运行?
(defadvice beginning-of-line (before test activate)
nil)->根本没有运行beginning-of-line。
编辑:只是为了消除你的担忧,我不打算在beginning-of-line上使用它。
发布于 2013-02-19 19:43:26
您可以使用around建议,如下所示:
(defadvice foo (around test activate)
(if my-test
ad-do-it))构造ad-do-it对应于运行原始函数。
https://stackoverflow.com/questions/14956180
复制相似问题