浏览代码

Ignore errors in indirect-function

This is necessary for Emacs 24 compatibility, since indirect-function
throws an error rather than returning nil on a symbol with no
function.
Ryan C. Thompson 8 年之前
父节点
当前提交
47b565bf6f
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      ido-completing-read+.el

+ 7 - 2
ido-completing-read+.el

@@ -352,8 +352,13 @@ https://github.com/DarwinAwardWinner/ido-ubiquitous/issues"
        ;; Symbol: Compare names and function definitions
        ;; Symbol: Compare names and function definitions
        ((symbolp entry)
        ((symbolp entry)
         (or (eq entry fun)
         (or (eq entry fun)
-            (eq (indirect-function entry)
-                (indirect-function fun))))
+            (let ((entry-def (ignore-errors (indirect-function entry)))
+                  (fun-def (ignore-errors (indirect-function fun))))
+              (and
+               fun-def entry-def
+               (eq
+                (indirect-function entry-def)
+                (indirect-function fun-def))))))
        ;; String: Do regexp matching against function name if it is a
        ;; String: Do regexp matching against function name if it is a
        ;; symbol
        ;; symbol
        ((stringp entry)
        ((stringp entry)