浏览代码

Explain rationale for doing advice the way it's done

Ryan C. Thompson 13 年之前
父节点
当前提交
ae68d2c737
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      ido-ubiquitous.el

+ 6 - 0
ido-ubiquitous.el

@@ -103,6 +103,12 @@ continue to use `completing-read' instead of
   "Re-enable ido-ubiquitous in FUNC.
   "Re-enable ido-ubiquitous in FUNC.
 
 
   This reverses the effect of `disable-ido-ubiquitous-in-function'."
   This reverses the effect of `disable-ido-ubiquitous-in-function'."
+  ;; In my experience, simply using `ad-remove-advice' or
+  ;; `ad-disable-advice' doesn't work correctly (in Emacs 23).
+  ;; Instead, I've found that one must redefine the advice under the
+  ;; same name ("disable-ido-ubiquitous") to simply call the original
+  ;; function with no modifications. This has the same effect
+  ;; (disables the advice), but is presumably less efficient.
   `(defadvice ,func (around disable-ido-ubiquitous activate)
   `(defadvice ,func (around disable-ido-ubiquitous activate)
      ad-do-it))
      ad-do-it))