ido-ubiquitous.el 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. ;;; ido-ubiquitous.el --- Use ido (nearly) everywhere.
  2. ;; Author: Ryan C. Thompson
  3. ;; URL: https://github.com/DarwinAwardWinner/ido-ubiquitous
  4. ;; Version: 2.0
  5. ;; Created: 2011-09-01
  6. ;; Keywords: convenience
  7. ;; EmacsWiki: InteractivelyDoThings
  8. ;; This file is NOT part of GNU Emacs.
  9. ;;; Commentary:
  10. ;; You may have seen the `ido-everywhere' variable in ido.el and got
  11. ;; excited that you could use ido completion for everything. Then you
  12. ;; were probably disappointed when you realized that it only applied
  13. ;; to *file names* and nothing else. Well, ido-ubiquitous is here to
  14. ;; fulfill the original promise and let you use ido completion for
  15. ;; (almost) any command that uses `completing-read' to offer you a
  16. ;; choice of several alternatives.
  17. ;; This even works in M-x, but for that, you might prefer the "smex"
  18. ;; package instead.
  19. ;; As of version 0.7, this package also makes a small modification to
  20. ;; ido's behavior so as to support a strange corner case of
  21. ;; `completing-read' that some functions rely on. Since the goal of
  22. ;; this package is to replace `completing-read' everywhere instead of
  23. ;; just selectively (as ido itself does), compatibility with all the
  24. ;; quriks of `completing-read' is important here.
  25. ;; If you find a case where enabling ido-ubiquitous causes a command
  26. ;; not to work correctly, please report it by creating an issue on
  27. ;; GitHub: https://github.com/DarwinAwardWinner/ido-ubiquitous/issues
  28. ;;; License:
  29. ;; This program is free software; you can redistribute it and/or modify
  30. ;; it under the terms of the GNU General Public License as published by
  31. ;; the Free Software Foundation; either version 3, or (at your option)
  32. ;; any later version.
  33. ;;
  34. ;; This program is distributed in the hope that it will be useful,
  35. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  36. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  37. ;; GNU General Public License for more details.
  38. ;;
  39. ;; You should have received a copy of the GNU General Public License
  40. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  41. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  42. ;; Boston, MA 02110-1301, USA.
  43. ;;; Code:
  44. ;; Check for required feature
  45. (eval-when-compile
  46. (when (not (boundp 'completing-read-function))
  47. (error "Could not find variable `completing-read-function'. Are you using Emacs version 24 or higher? If you have Emacs 23 or lower, please downgrade to ido-ubiquitous version 1.6.")))
  48. (require 'ido)
  49. (require 'advice)
  50. (require 'cl-seq)
  51. ;;; Custom Declarations
  52. ;;;###autoload
  53. (defgroup ido-ubiquitous nil
  54. "Use ido for (almost) all completion."
  55. :group 'ido)
  56. ;;;###autoload
  57. (define-minor-mode ido-ubiquitous-mode
  58. "Use `ido-completing-read' instead of `completing-read' almost everywhere.
  59. This mode has no effect unles `ido-mode' is also enabled.
  60. If this mode causes problems for a function, you can force the
  61. function to use the original completing read by using the macro
  62. `ido-ubiquitous-disable-in'. For example, if a
  63. function `foo' cannot work with ido-style completion, evaluate
  64. the following (for example by putting it in your .emacs file):
  65. (ido-ubiquitous-disable-in foo)"
  66. nil
  67. :global t
  68. :group 'ido-ubiquitous
  69. ;; Handle warning about ido disabled
  70. (when ido-ubiquitous-mode
  71. (unless (bound-and-true-p ido-mode)
  72. (if after-init-time
  73. (ido-ubiquitous-warn-about-ido-disabled)
  74. (add-hook 'after-init-hook 'ido-ubiquitous-warn-about-ido-disabled))))
  75. ;; Ensure emacs 23 code disabled
  76. (ad-disable-advice 'completing-read 'around 'ido-ubiquitous-legacy)
  77. (ad-activate 'completing-read)
  78. ;; Actually enable/disable the mode
  79. (setq completing-read-function
  80. (if ido-ubiquitous-mode
  81. 'completing-read-ido
  82. ido-ubiquitous-fallback-completing-read-function)))
  83. ;;;###autoload
  84. (define-obsolete-variable-alias 'ido-ubiquitous
  85. 'ido-ubiquitous-mode "0.8")
  86. ;;;###autoload
  87. (define-obsolete-function-alias 'ido-ubiquitous
  88. 'ido-ubiquitous-mode "0.8")
  89. ;;;###autoload
  90. (defcustom ido-ubiquitous-fallback-completing-read-function
  91. ;; Initialize to the current value of `completing-read-function',
  92. ;; unless that is already set to the ido completer, in which case
  93. ;; use `completing-read-default'.
  94. (if (eq completing-read-function 'completing-read-ido)
  95. 'completing-read-default
  96. completing-read-function)
  97. "Alternate completing-read function to use when ido is not wanted.
  98. This will be used for functions that are incompatibile with ido
  99. or if ido cannot handle the completion arguments.
  100. If you turn off ido-ubiquitous mode, `completing-read-function' will be set to this."
  101. :type '(choice (const :tag "Standard emacs completion"
  102. completing-read-default)
  103. (function :tag "Other function"))
  104. :group 'ido-ubiquitous)
  105. ;;;###autoload
  106. (defcustom ido-ubiquitous-command-exceptions '()
  107. "List of commands that should not be affected by `ido-ubiquitous'.
  108. Even when `ido-ubiquitous' mode is enabled, these commands will
  109. continue to use `completing-read' instead of
  110. `ido-completing-read'.
  111. Only *interactive* commands should go here. To disable
  112. ido-ubiquitous in non-interactive functions, customize
  113. `ido-ubiquitous-function-exceptions'.
  114. Note: this feature depends on the variable `this-command' being
  115. properly set to the name of the currently executing command.
  116. Depending on how the command is onvoked, this may or may not
  117. happen, so this feature may simply not work in some cases."
  118. ;; This isn't actually a hook, but it is a list of functions, so
  119. ;; that's close enough.
  120. :type 'hook
  121. :group 'ido-ubiquitous)
  122. ;;;###autoload
  123. (define-obsolete-variable-alias 'ido-ubiquitous-exceptions
  124. 'ido-ubiquitous-command-exceptions "0.4")
  125. ;;;###autoload
  126. (defcustom ido-ubiquitous-function-exceptions
  127. ido-ubiquitous-default-function-exceptions
  128. "List of functions in which to disable ido-ubiquitous.
  129. If you need to add a function to this list, please also file a
  130. bug report at
  131. https://github.com/DarwinAwardWinner/ido-ubiquitous/issues
  132. Setting this variable directly has no effect. You must set it
  133. through Customize."
  134. :group 'ido-ubiquitous
  135. :type 'hook
  136. :options '(read-file-name
  137. read-file-name-internal
  138. read-buffer
  139. gnus-emacs-completing-read
  140. gnus-iswitchb-completing-read
  141. man
  142. grep-read-files)
  143. :set 'ido-ubiquitous-set-function-exceptions)
  144. ;;; Ido-ubiquitous core
  145. (defvar ido-ubiquitous-next-call-replaces-completing-read nil
  146. "If t, then the next call to ido-completing-read is by ido-ubiquitous.")
  147. (defvar ido-ubiquitous-this-call-replaces-completing-read nil
  148. "If t, then the current call to ido-completing-read is by ido-ubiquitous.")
  149. (defun completing-read-ido (prompt collection &optional predicate
  150. require-match initial-input
  151. hist def inherit-input-method)
  152. "Ido-based method for reading from the minibuffer with completion.
  153. See `completing-read' for the meaning of the arguments.
  154. This function is a wrapper for `ido-completing-read' designed to
  155. be used as the value of `completing-read-function'."
  156. (let ((comp-read-fun
  157. (cond
  158. (ido-ubiquitous-disable-for-one-command
  159. (prog1
  160. ido-ubiquitous-fallback-completing-read-function
  161. (setq ido-ubiquitous-disable-for-one-command nil)))
  162. ((or inherit-input-method ; Can't handle this arg
  163. (bound-and-true-p completion-extra-properties) ; Can't handle this
  164. (not ido-mode)
  165. (not ido-ubiquitous-mode)
  166. (memq this-command ido-ubiquitous-command-exceptions))
  167. ido-ubiquitous-fallback-completing-read-function)
  168. ((let ((allcomp (all-completions "" collection predicate)))
  169. ;; Only use ido completion if there are actually any completions
  170. ;; to offer.
  171. (if allcomp
  172. (prog1 'ido-ubiquitous-completing-read
  173. (setq collection allcomp
  174. predicate nil))
  175. ido-ubiquitous-fallback-completing-read-function))))))
  176. (funcall comp-read-fun
  177. prompt collection predicate
  178. require-match initial-input
  179. hist def inherit-input-method)))
  180. (defun ido-ubiquitous-completing-read (&rest args)
  181. "Wrapper for `ido-completing-read' that enables ido-ubiquitous features."
  182. (let ((ido-ubiquitous-next-call-replaces-completing-read t))
  183. (apply 'ido-completing-read args)))
  184. (defadvice ido-completing-read (around detect-replacing-cr activate)
  185. "Detect whether this call was done through ido-ubiquitous.
  186. If so enable, extra features for ido-ubiquitous that handle
  187. special cases that `ido-completing-read' needs to handle to more
  188. fully emulate `completing-read'. This allows ido-ubiquitous extra
  189. features to avoid interfering with the normal operation of ido."
  190. (let* ((ido-ubiquitous-this-call-replaces-completing-read ido-ubiquitous-next-call-replaces-completing-read)
  191. (ido-ubiquitous-next-call-replaces-completing-read nil))
  192. (when ido-ubiquitous-this-call-replaces-completing-read
  193. ;; If DEF is a list, prepend it to CHOICES and set DEF to just the
  194. ;; car of the default list.
  195. (when (and def (listp def))
  196. (setq choices (delete-dups (append def choices))
  197. def (car def)))
  198. ;; Work around a bug in ido when both INITIAL-INPUT and DEF are provided
  199. ;; More info: https://github.com/technomancy/ido-ubiquitous/issues/18
  200. (let ((initial (cond ((null initial-input) "")
  201. ((stringp initial-input) initial-input)
  202. ((consp initial-input) (car initial-input))
  203. (t initial-input)))
  204. (deflist (if (listp def)
  205. def
  206. (list def))))
  207. (when (and deflist initial
  208. (stringp initial)
  209. (not (string= initial "")))
  210. ;; Both default and initial input were provided. So keep the
  211. ;; initial input and preprocess the choices list to put the
  212. ;; default at the head, then proceed with default = nil.
  213. (setq choices (delete-dups (append deflist (remove def choices)))
  214. def nil))))
  215. ad-do-it))
  216. ;;; Ido-ubiquitous interactive command exceptions
  217. (defvar ido-ubiquitous-disable-for-one-command nil
  218. "If t, disable ido-ubiquitous for the next command.")
  219. ;; The following advices should allow ido-ubiquitous to apply to the
  220. ;; interactive forms of commands as well as their bodies.
  221. (defadvice call-interactively (around ido-ubiquitous-command-exceptions activate)
  222. (let ((ido-ubiquitous-disable-for-one-command
  223. (memq function ido-ubiquitous-command-exceptions)))
  224. ad-do-it))
  225. (defadvice command-execute (around ido-ubiquitous-command-exceptions activate)
  226. (let ((ido-ubiquitous-disable-for-one-command
  227. (and (commandp cmd t)
  228. (memq cmd ido-ubiquitous-command-exceptions))))
  229. ad-do-it))
  230. ;;; Ido-ubiquitous function exceptions
  231. (defmacro ido-ubiquitous-disable-in (func)
  232. "Disable ido-ubiquitous in FUNC."
  233. (put func 'ido-ubiquitous-disable t)
  234. (let ((docstring
  235. (format "Disable ido-ubiquitous in %s if its `idu-ubiquitous-disable' property is non-nil." func)))
  236. `(defadvice ,func (around disable-ido-ubiquitous activate)
  237. ,docstring
  238. (let ((ido-ubiquitous-mode
  239. (and ido-ubiquitous-mode
  240. (not (get ,func 'ido-ubiquitous-disable)))))
  241. ad-do-it))))
  242. (define-obsolete-function-alias
  243. 'disable-ido-ubiquitous-in
  244. 'ido-ubiquitous-disable-in
  245. "0.4")
  246. (defmacro ido-ubiquitous-enable-in (func)
  247. "Re-enable ido-ubiquitous in FUNC.
  248. This reverses the effect of a previous call to
  249. `ido-ubiquitous-disable-in' (if no such call was made, this is
  250. a no-op.)"
  251. `(when (get ,func 'ido-ubiquitous-disable)
  252. (put ,func 'ido-ubiquitous-disable nil)))
  253. (define-obsolete-function-alias
  254. 'enable-ido-ubiquitous-in
  255. 'ido-ubiquitous-enable-in
  256. "0.4")
  257. (defun ido-ubiquitous-set-function-exceptions (sym newval)
  258. ;; Loop through all functions, enabling or disabling ido-ubiquitous
  259. ;; as appropriate.
  260. (mapatoms
  261. (lambda (sym)
  262. (if (memq sym newval)
  263. (eval `(ido-ubiquitous-disable-in ,sym))
  264. (eval `(ido-ubiquitous-enable-in ,sym)))))
  265. ;; Set the new value
  266. (set-default sym newval))
  267. ;;; Ido-ubiquitous compatibility with old completing-read
  268. ;;;###autoload
  269. (defgroup ido-ubiquitous-compatibility nil
  270. "Use ido for (almost) all completion."
  271. :group 'ido-ubiquitous)
  272. (defcustom ido-ubiquitous-enable-compatibility-globally t
  273. "Allow ido to emulate a quirk of `completing-read'.
  274. From the `completing-read' docstring:
  275. > If the input is null, `completing-read' returns DEF, or the
  276. > first element of the list of default values, or an empty string
  277. > if DEF is nil, regardless of the value of REQUIRE-MATCH.
  278. If this variable is non-nil, then ido-ubiquitous will attempt to
  279. emulate this behavior. Specifically, if RET is pressed
  280. immediately upon entering completion, an empty string will be
  281. returned instead of the first element in the list. This behavior
  282. is only enabled when ido is being used as a substitute for
  283. `completing-read', and not when it is used directly.
  284. This odd behavior is required for compatibility with an old-style
  285. usage pattern whereby the default was requested by returning an
  286. empty string. In this mode, the caller receives the empty string
  287. and handles the default case manually, while `completing-read'
  288. never has any knowledge of the default. This is a problem for
  289. ido, which always returns the first element in the list when the
  290. input is empty. Without knowledge of the default, it cannot
  291. ensure that the default is first on the list, so returning the
  292. first item is not the correct behavior. Instead, it must return
  293. an empty string like `completing-read'.
  294. When this mode is enabled, you can still select the first item on
  295. the list by prefixing \"RET\" with \"C-u\".
  296. If you want to enable compatibility selectively for specific
  297. commands or functions, see the other options in the
  298. `ido-ubiquitous-compatibility' group."
  299. :type 'boolean
  300. :group 'ido-ubiquitous-compatibility)
  301. ;;;###autoload
  302. (defcustom ido-ubiquitous-command-compatibility-list '()
  303. "List of commands in which to enable old-style compatibility.
  304. See `ido-ubiquitous-enable-compatibility-globally' for a
  305. description of the compatibility behavior. If ido doesn't
  306. properly select the default for a command, try adding it to this
  307. list.
  308. Only *interactive* commands should go here. To disable
  309. compatibility mode in non-interactive functions, customize
  310. `ido-ubiquitous-function-compatibility-exceptions'."
  311. :type '(repeat (list ))
  312. :type 'hook(repeat (symbol :tag "Command"))
  313. :group 'ido-ubiquitous-compatibility)
  314. ;;;###autoload
  315. (defcustom ido-ubiquitous-function-compatibility-list
  316. '()
  317. "List of functions in which to enable old-style compatibility.
  318. See `ido-ubiquitous-enable-compatibility-globally' for a
  319. description of the compatibility behavior. If ido doesn't
  320. properly select the default selection for a function, try adding
  321. it to this list.
  322. If you need to add a function to this list, please also file a
  323. bug report at
  324. https://github.com/DarwinAwardWinner/ido-ubiquitous/issues"
  325. :group 'ido-ubiquitous-compatibility
  326. :type 'hook
  327. :set 'ido-ubiquitous-set-function-compatibility-list)
  328. (defmacro ido-ubiquitous-enable-compatibility-in (func)
  329. "Enable ido-ubiquitous old-style compatibility in FUNC."
  330. (let ((docstring
  331. (format "Enable ido-ubiquitous old-style compatibility in %s if its `idu-ubiquitous-enable-compatibility' property is non-nil." func)))
  332. `(progn
  333. (defadvice ,func (around disable-ido-ubiquitous activate)
  334. ,docstring
  335. (let ((ido-ubiquitous-enable-compatibility-globally
  336. (or ido-ubiquitous-enable-compatibility-globally
  337. (get ,func 'ido-ubiquitous-enable-compatibility))))
  338. ad-do-it))
  339. (put func 'ido-ubiquitous-enable-compatibility t))))
  340. (defmacro ido-ubiquitous-disable-compatibility-in (func)
  341. "Enable ido-ubiquitous old-style compatibility in FUNC.
  342. This reverses the effect of a previous call to
  343. `ido-ubiquitous-enable-compatibility-in' (if no such call was
  344. made, this is a no-op.)"
  345. `(when (get ,func 'ido-ubiquitous-enable-compatibility)
  346. (put ,func 'ido-ubiquitous-enable-compatibility nil)))
  347. (defun ido-ubiquitous-set-function-compatibility-list (sym newval)
  348. ;; Loop through all functions, enabling or disabling ido-ubiquitous
  349. ;; as appropriate.
  350. (mapatoms
  351. (lambda (sym)
  352. (if (memq sym newval)
  353. (eval `(ido-ubiquitous-enable-compatibility-in ,sym))
  354. (eval `(ido-ubiquitous-disable-compatibility-in ,sym)))))
  355. ;; Set the new value
  356. (set-default sym newval))
  357. (defvar ido-ubiquitous-initial-item nil
  358. "The first item selected when ido starts.")
  359. (defadvice ido-read-internal (before clear-initial-item activate)
  360. (setq ido-ubiquitous-initial-item nil))
  361. (defadvice ido-make-choice-list (after set-initial-item activate)
  362. (when (and ad-return-value (listp ad-return-value))
  363. (setq ido-ubiquitous-initial-item (car ad-return-value))))
  364. (defadvice ido-next-match (after clear-initial-item activate)
  365. (setq ido-ubiquitous-initial-item nil))
  366. (defadvice ido-prev-match (after clear-initial-item activate)
  367. (setq ido-ubiquitous-initial-item nil))
  368. (defadvice ido-exit-minibuffer (around compatibility activate)
  369. "Emulate a quirk of `completing-read'.
  370. > If the input is null, `completing-read' returns DEF, or the
  371. > first element of the list of default values, or an empty string
  372. > if DEF is nil, regardless of the value of REQUIRE-MATCH.
  373. See `ido-ubiquitous-enable-compatibility-globally', which
  374. controls whether this advice has any effect."
  375. (if (and (eq ido-cur-item 'list)
  376. ;; Only enable if we are replacing `completing-read'
  377. ido-ubiquitous-this-call-replaces-completing-read
  378. ;; Compatibiliy enabled
  379. (or ido-ubiquitous-enable-compatibility-globally
  380. (memq this-command ido-ubiquitous-command-compatibility-list))
  381. ;; Input is empty
  382. (string= ido-text "")
  383. ;; Default is nil
  384. (null ido-default-item)
  385. ;; Prefix disables compatibility
  386. (not current-prefix-arg)
  387. (string= (car ido-cur-list)
  388. ido-ubiquitous-initial-item))
  389. (ido-select-text)
  390. ad-do-it)
  391. (setq ido-ubiquitous-initial-item nil))
  392. (defadvice call-interactively (around ido-ubiquitous-oldstyle-compatibility activate)
  393. (let ((ido-ubiquitous-enable-compatibility-globally
  394. (or ido-ubiquitous-enable-compatibility-globally
  395. (memq function ido-ubiquitous-command-compatibility-list))))
  396. ad-do-it))
  397. (defadvice command-execute (around ido-ubiquitous-oldstyle-compatibility activate)
  398. (let ((ido-ubiquitous-enable-compatibility-globally
  399. (or ido-ubiquitous-enable-compatibility-globally
  400. (memq function ido-ubiquitous-command-compatibility-list))))
  401. ad-do-it))
  402. (defmacro ido-ubiquitous-disable-compatibility-in (func)
  403. "Disable ido-ubiquitous compatibility mode in FUNC."
  404. (let ((docstring
  405. (format "Disable ido-ubiquitous in %s" func)))
  406. `(defadvice ,func (around disable-ido-ubiquitous-compatibility activate)
  407. ,docstring
  408. (let (ido-ubiquitous-enable-compatibility) ad-do-it))))
  409. (defmacro ido-ubiquitous-enable-compatibility-in (func)
  410. "Re-enable ido-ubiquitous comaptibility mode in FUNC.
  411. This reverses the effect of a previous call to
  412. `ido-ubiquitous-disable-compatibility-in'."
  413. `(when (ad-find-advice ',func 'around 'disable-ido-ubiquitous-compatibility)
  414. (ad-disable-advice ',func 'around 'disable-ido-ubiquitous-compatibility)
  415. (ad-activate ',func)))
  416. (defun ido-ubiquitous-set-function-compatibility-exceptions (sym newval)
  417. (let* ((oldval (when (boundp sym) (eval sym))))
  418. ;; Re-enable compatibility on all old functions, in case they
  419. ;; were removed from the list.
  420. (dolist (oldfun oldval)
  421. (eval `(ido-ubiquitous-enable-compatibility-in ,oldfun)))
  422. ;; Set the new value
  423. (set-default sym newval)
  424. ;; Disable compatibility on all new functions
  425. (dolist (newfun newval)
  426. (eval `(ido-ubiquitous-disable-compatibility-in ,newfun)))))
  427. ;;; Other
  428. (defun ido-ubiquitous-initialize ()
  429. "Do initial setup for ido-ubiquitous.
  430. This only needs to be called once when the file is first loaded."
  431. ;; Clean up old versions of ido-ubiquitous that defined advice on
  432. ;; `completing-read' instead of modifying
  433. ;; `completing-read-function'.
  434. (when (ad-find-advice 'completing-read 'around 'ido-ubiquitous)
  435. (ad-remove-advice 'completing-read 'around 'ido-ubiquitous)
  436. (ad-activate 'completing-read))
  437. ;; Make sure all exceptions are activated
  438. (ido-ubiquitous-set-function-exceptions
  439. 'ido-ubiquitous-function-exceptions
  440. ido-ubiquitous-function-exceptions)
  441. (ido-ubiquitous-set-function-compatibility-exceptions
  442. 'ido-ubiquitous-function-compatibility-exceptions
  443. ido-ubiquitous-function-compatibility-exceptions)
  444. ;; Make sure the mode is turned on/off as specified by the value of
  445. ;; the mode variable
  446. (ido-ubiquitous-mode (if ido-ubiquitous-mode 1 0)))
  447. (ido-ubiquitous-initialize)
  448. (defun ido-ubiquitous-warn-about-ido-disabled ()
  449. "Warn if ido-ubiquitous is enabled without ido.
  450. Don't warn if emacs is still initializing, since ido-ubiquitous
  451. could be enabled first during init."
  452. (if (and after-init-time
  453. (not (bound-and-true-p ido-mode)))
  454. (warn "Ido-ubiquitous-mode enabled without ido mode. Ido-ubiquitous requires ido mode to be enabled.")))
  455. (provide 'ido-ubiquitous) ;;; ido-ubiquitous.el ends here