Questions tagged «local-functions»

1
Emacs束手无策的建议
我想在一段代码中临时重写一个函数。 例如,以下内容: (defun nadvice/load-quiet (args) (cl-destructuring-bind (file &optional noerror nomessage nosuffix must-suffix) args (list file noerror t nosuffix must-suffix))) (defun nadvice/idle-require-quiet (old-fun &rest args) (advice-add 'load :filter-args #'nadvice/load-quiet) (apply old-fun args) (advice-remove #'load #'nadvice/load-quiet)) (advice-add 'idle-require-load-next :around #'nadvice/idle-require-quiet) 什么不起作用: 这个。如果我可以避免手动启用和禁用建议,并相信Emacs的单线程性质来处理事务,那将更加干净。 cl-letf不会让我引用原始函数,因此我无法实现:filter-args通常会执行的操作。 cl-flet 无法覆盖其他功能中的功能。 noflet是一个外部软件包,我想避免。(做的比我需要的要多得多)
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.