瀏覽代碼

Call fallback function on original arguments

The advice to "ido-completing-read" can fall back to non-ido completion
if the setup fails. However, the setup code modifies the arguments, and
if it fails those arguments may not be set properly. So now we save the
initial argument list and use that for the fallback case.
Ryan C. Thompson 10 年之前
父節點
當前提交
01222e7c56
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      ido-ubiquitous.el

+ 5 - 5
ido-ubiquitous.el

@@ -470,7 +470,9 @@ This advice implements the logic required for
 `ido-completing-read' is called through
 `ido-ubiquitous-completing-read', so other packages that use
 `ido-completing-read', such as `smex', will not be affected."
-  (let* ((ido-ubiquitous-this-call-replaces-completing-read ido-ubiquitous-next-call-replaces-completing-read)
+  (let* ((orig-args (ad-get-args 0))
+         (ido-ubiquitous-this-call-replaces-completing-read
+          ido-ubiquitous-next-call-replaces-completing-read)
          (ido-ubiquitous-next-call-replaces-completing-read nil)
          (error-during-setup nil))
     (when ido-ubiquitous-this-call-replaces-completing-read
@@ -509,10 +511,8 @@ This advice implements the logic required for
     (if (not error-during-setup)
         ad-do-it
       (setq ad-return-value
-            (funcall
-             ido-ubiquitous-fallback-completing-read-function
-             prompt choices predicate require-match initial-input
-             hist def inherit-input-method)))))
+            (apply ido-ubiquitous-fallback-completing-read-function
+                   orig-args)))))
 
 (defun completing-read-ido (prompt collection &optional predicate
                                    require-match initial-input