Просмотр исходного кода

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 лет назад
Родитель
Сommit
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
        ((symbolp entry)
         (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
        ;; symbol
        ((stringp entry)