dot/emacs: Cope with `ido-completing-read+' configuration differences.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 17:01:18 +0000 (18:01 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 17:01:18 +0000 (18:01 +0100)
The old `ido-ubiquitous-command-overrides' doesn't exist any more,
so (a) configuring it won't do any good, and (b) extending it doesn't
work because the variable is unbound.  Instead, apply the same
configuration to `ido-cr+-function-blacklist' (which has a different --
but simpler -- format).

dot/emacs

index 79d7438..9dd28f2 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
       (require 'ido-completing-read+)
       (unless (fboundp 'ido-ubiquitous-mode) (require 'ido-ubiquitous))
       (ido-ubiquitous-mode 1)
-      (setq ido-cr+-max-items nil
-           ido-ubiquitous-command-overrides
-           (append ido-ubiquitous-command-overrides
-                   `((enable-old regexp ,(concat "\\`"
-                                                 "gtags-find-"
-                                                 "\\("    "tag"
-                                                       "\\|file"
-                                                       "\\|rtag"
-                                                       "\\|symbol"
-                                                 "\\)"
-                                                 "\\(" "\\|-other-window"
-                                                 "\\)"
-                                                 "\\'")))))
+      (setq ido-cr+-max-items nil)
+      (let ((excludes `(,(concat "\\`"
+                                "gtags-find-"
+                                "\\("    "tag"
+                                      "\\|file"
+                                      "\\|rtag"
+                                      "\\|symbol"
+                                "\\)"
+                                "\\("  "\\|-other-window"
+                                "\\)"
+                                "\\'"))))
+       (if (boundp 'ido-ubiquitous-command-overrides)
+           (setq ido-ubiquitous-command-overrides
+                 (append ido-ubiquitous-command-overrides
+                         (mapcar (lambda (exclude)
+                                   (if (symbolp exclude)
+                                       `(enable-old exact
+                                                    ,(symbol-name exclude))
+                                     `(enable-old regexp ,exclude)))
+                                 excludes)))
+         (setq ido-cr+-function-blacklist
+               (append ido-cr+-function-blacklist excludes))))
       (setq magit-completing-read-function 'magit-ido-completing-read)
       (require 'smex) (smex-initialize) (global-set-key [?\M-x] 'smex))