瀏覽代碼

Disable workaround for Emacs bug #27807 in Emacs 27.1 and higher

Emacs Bug #27807 was fixed in version 27.1, so the workaround is not
necessary for this and later version, but it is still needed for
earlier versions. Hence a version check, while ugly, is now required.
Ryan C. Thompson 6 年之前
父節點
當前提交
eb4c8eb144
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      ido-completing-read+.el

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

@@ -695,10 +695,10 @@ completion for them."
             (signal 'ido-cr+-fallback
                     '("ido cannot handle the empty string as an option when `ido-enable-dot-prefix' is non-nil; see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26997")))
 
-          ;; Fix ido handling of cons-style INITIAL-INPUT. TODO add a
-          ;; version check after this bug is fixed:
-          ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27807
-          (when (consp initial-input)
+          ;; Fix ido's broken handling of cons-style INITIAL-INPUT on
+          ;; Emacsen older than 27.1.
+          (when (and (consp initial-input)
+                     (version< emacs-version "27.1"))
             ;; `completing-read' uses 0-based index while
             ;; `read-from-minibuffer' uses 1-based index.
             (cl-incf (cdr initial-input)))