在添加建议时,如何匹配elisp函数中正文中的特定表达式?具体来说,在以下示例中,我建议使用$("#parent").html(Basic); //If you are using JQuery
代替find-file-noselect
的函数,即。
第find-file
行有效(find-file path)
。
(find-file-noselect path)
我宁愿把它作为(defun tst-fun (path line column)
(find-file path)
(goto-char (point-min))
(forward-line (1- line))
(forward-char column))
;; not sure how to structure this
(defadvice tst-fun (around noselect activate)
(find-file-noselect (ad-get-arg 0))
ad-do-it)
,但我想先让它先工作。
答案 0 :(得分:2)
您可以在建议中暂时将find-file
重新定义为find-file-noselect
。
(require 'cl)
(defadvice tst-fun (around noselect activate)
(flet ((find-file (&rest args)
(apply 'find-file-noselect args)))
ad-do-it))