浏览代码

Make a copy of minibuffer-setup-hook for falling back

It's possible that the original hook gets modified in place, which
means saving a reference to the head of the list won't work.
Ryan C. Thompson 7 年之前
父节点
当前提交
451ad9efcd
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      ido-completing-read+.el

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

@@ -480,10 +480,13 @@ completion for them."
          (ido-cr+-orig-completing-read-args
           (list prompt collection predicate require-match
                 initial-input hist def inherit-input-method))
-         ;; Need to save this since activating the minibuffer once will
-         ;; clear out any temporary minibuffer hooks, which need to get
-         ;; restored before falling back.
-         (orig-minibuffer-setup-hook minibuffer-setup-hook)
+         ;; Need to save a copy of this since activating the
+         ;; minibuffer once will clear out any temporary minibuffer
+         ;; hooks, which need to get restored before falling back so
+         ;; that they will trigger again when the fallback function
+         ;; uses the minibuffer. We make a copy in case the original
+         ;; list gets modified in place.
+         (orig-minibuffer-setup-hook (cl-copy-list minibuffer-setup-hook))
          ;; Need just the string part of INITIAL-INPUT
          (initial-input-string
           (cond