Codebase list ido-ubiquitous / 0bac1bc
New upstream version 4.11 Lev Lamberov 5 years ago
5 changed file(s) with 50 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
88 - EMACS_VERSION=emacs-25.1
99 - EMACS_VERSION=emacs-25.2
1010 - EMACS_VERSION=emacs-25.3
11 - EMACS_VERSION=emacs-26-pretest
11 - EMACS_VERSION=emacs-26.1
1212 # For some reason emac-git-snapshot hangs forever
1313 # - EMACS_VERSION=emacs-git-snapshot
1414 - EMACS_VERSION=remacs-git-snapshot
1515
1616 matrix:
1717 allow_failures:
18 - env: EMACS_VERSION=emacs-26-pretest
1918 - env: EMACS_VERSION=remacs-git-snapshot
2019 - env: EMACS_VERSION=emacs-git-snapshot
2120
0 2018-06-27 Ryan C. Thompson <rct@thompsonclan.org>
1
2 * ido-completing-read+.el (ido-cr+-function-blacklist): Disable
3 ido completion in org-set-tags.
4
05 2018-04-24 Ryan C. Thompson <rct@thompsonclan.org>
16
27 * ido-completing-read+.el (ido-cr+-update-dynamic-collection):
44 ;; Filename: ido-completing-read+.el
55 ;; Author: Ryan Thompson
66 ;; Created: Sat Apr 4 13:41:20 2015 (-0700)
7 ;; Version: 4.10
7 ;; Version: 4.11
88 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (s "0.1") (memoize "1.1"))
99 ;; URL: https://github.com/DarwinAwardWinner/ido-completing-read-plus
1010 ;; Keywords: ido, completion, convenience
7676 ;;
7777 ;;; Code:
7878
79 (defconst ido-completing-read+-version "4.10"
79 (defconst ido-completing-read+-version "4.11"
8080 "Currently running version of ido-completing-read+.
8181
8282 Note that when you update ido-completing-read+, this variable may
8787 (require 'cl-lib)
8888 (require 'cus-edit)
8989 (require 's)
90 (require 'memoize)
90
91 ;; Optional dependency, only needed for optimization
92 (require 'memoize nil t)
9193
9294 ;; Silence some byte-compiler warnings
9395 (eval-when-compile
291293 ;; https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/39
292294 Info-read-node-name
293295 ;; https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/44
294 tmm-prompt)
296 tmm-prompt
297 ;; https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/156
298 org-tags-completion-function)
295299 "Functions & commands for which ido-cr+ should be disabled.
296300
297301 Each entry can be either a symbol or a string. A symbol means to
516520 (ido-cr+-last-dynamic-update-text nil)
517521 ;; Only memoize if the collection is dynamic.
518522 (ido-cr+-all-prefix-completions-memoized
519 (if ido-cr+-dynamic-collection
523 (if (and ido-cr+-dynamic-collection (featurep 'memoize))
520524 (memoize (indirect-function 'ido-cr+-all-prefix-completions))
521525 'ido-cr+-all-prefix-completions))
522526 (ido-cr+-all-completions-memoized
523 (if ido-cr+-dynamic-collection
527 (if (and ido-cr+-dynamic-collection (featurep 'memoize))
524528 (memoize (indirect-function 'all-completions))
525529 'all-completions))
526530 ;; If the whitelist is empty, everything is whitelisted
882886 for tortoise on x
883887 for hare on (cdr x) by #'cddr
884888 thereis (eq tortoise hare)))
885
886 (defun ido-cr+-maybe-chop (items elem)
887 "Like `ido-chop', but a no-op if ELEM is not in ITEMS.
888
889 Normal `ido-chop' hangs infinitely in this case."
890 (cl-loop
891 with new-tail = ()
892 for remaining on items
893 for next = (car remaining)
894 if (equal next elem)
895 return (nconc remaining new-tail)
896 else collect next into new-tail
897 finally return items))
898889
899890 (defun ido-cr+-update-dynamic-collection ()
900891 "Update the set of completions for a dynamic collection.
33
44 ;; Author: Ryan C. Thompson
55 ;; URL: https://github.com/DarwinAwardWinner/ido-ubiquitous
6 ;; Version: 4.10
6 ;; Version: 4.11
77 ;; Created: 2011-09-01
88 ;; Keywords: convenience, completion, ido
99 ;; EmacsWiki: InteractivelyDoThings
10 ;; Package-Requires: ((ido-completing-read+ "4.10") (cl-lib "0.5"))
10 ;; Package-Requires: ((ido-completing-read+ "4.11") (cl-lib "0.5"))
1111 ;; Filename: ido-ubiquitous.el
1212
1313 ;; This file is NOT part of GNU Emacs.
3838 ;;
3939 ;;; Code:
4040
41 (defconst ido-ubiquitous-version "4.10"
41 (defconst ido-ubiquitous-version "4.11"
4242 "Currently running version of ido-ubiquitous.
4343
4444 Note that when you update ido-ubiquitous, this variable may not
55 (require 'buttercup)
66 (require 'cl-lib)
77 (require 'with-simulated-input)
8
9 ;; Note: Currently unused, but potentially useful in the future
10 (defun ido-cr+-maybe-chop (items elem)
11 "Like `ido-chop', but a no-op if ELEM is not in ITEMS.
12
13 Normal `ido-chop' hangs infinitely in this case."
14 (cl-loop
15 with new-tail = ()
16 for remaining on items
17 for next = (car remaining)
18 if (equal next elem)
19 return (nconc remaining new-tail)
20 else collect next into new-tail
21 finally return items))
822
923 (defun collection-as-function (collection)
1024 "Return a function equivalent to COLLECTION.
187201 (with-simulated-input "C-j"
188202 (ido-completing-read+ "Prompt: " '("blue" "yellow" "green") nil t))
189203 :to-equal ""))
204
205 (it "should work with `minibuffer-electric-default-mode'"
206 (let ((eldef-was-showing nil))
207 ;; No REQUIRE-MATCH, so electric default should not show
208 (with-simulated-input
209 '("blu DEL DEL DEL"
210 (setq eldef-was-showing minibuf-eldef-showing-default-in-prompt)
211 "RET")
212 (ido-completing-read+ "Prompt (default green): " '("blue" "yellow" "green")))
213 (expect eldef-was-showing :not :to-be-truthy)
214 ;; With REQUIRE-MATCH, so electric default should show
215 (with-simulated-input
216 '("blu DEL DEL DEL"
217 (setq eldef-was-showing minibuf-eldef-showing-default-in-prompt)
218 "RET")
219 (ido-completing-read+ "Prompt (default green): " '("blue" "yellow" "green") nil t))
220 (expect eldef-was-showing :to-be-truthy)))
190221
191222 (it "should accept all the same forms of DEF as `completing-read-default'"
192223 ;; DEF in COLLECTION