Browse Source

Don't use "blacklist" or "whitelist" in variable/function names

Obsolete aliases are retained for backward compatibility.

Fixes #173.
Ryan C. Thompson 4 years ago
parent
commit
3dbe308fc4

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2021-03-30  Ryan C. Thompson  <rct@thompsonclan.org>
+
+	* ido-completing-read+.el (ido-cr+-disable-list): Rename from
+	ido-cr+-function-blacklist. Related functions and variables are
+	likewise renamed.
+	(ido-cr+-allow-list): Rename from ido-cr+-function-whitelist.
+	Related functions and variables are likewise renamed.
+
 2021-02-06  Ryan C. Thompson  <rct@thompsonclan.org>
 
 	* ido-completing-read+.el (ido-cr+-function-blacklist): Disable

+ 14 - 14
README.md

@@ -19,8 +19,8 @@ merged into ido-completing-read+, which now provides all the features
 of both packages. The distinction between "new" and "old" default
 selection styles has been eliminated and replaced by a new variable
 `ido-cr+-nil-def-alternate-behavior-list` (see [FAQ][1] for details),
-and the override system has been accordingly simplified into just a
-blacklist and a whitelist. If you have previously customized any
+and the override system has been accordingly simplified into just an
+allow list and a disable list. If you have previously customized any
 ido-ubiquitous options, be sure to check out
 
     `M-x customize-group ido-completing-read+`
@@ -139,10 +139,10 @@ way whenever it detects that these features might be used by a given
 call to `completing-read`. Furthermore, it's not always possible to
 detect based on the arguments to `completing-read` whether such
 ido-incompatible features are being used or not, so
-ido-completing-read+ also comes with a blacklist of functions that are
-known not to work with ido. You can inspect this blacklist using
+ido-completing-read+ also comes with a list of functions that are
+known not to work with ido. You can inspect this list using
 
-    M-x describe-variable ido-cr+-function-blacklist
+    M-x describe-variable ido-cr+-disable-list
 
 If you want to know why a certain command isn't getting ido
 completion, you can enable `ido-cr+-debug-mode` and then run the
@@ -198,22 +198,22 @@ or code that you are having trouble with, and when the completion
 prompt appears, make a selection to complete the process. Then,
 examine the Messages buffer, where ido-completing-read+ will explain
 which mode of operation it selected and why. Based on this, you can
-add an entry to `ido-cr+-function-blacklist`, or take some other
+add an entry to `ido-cr+-disable-list`, or take some other
 appropriate action.
 
-Updates to ido-completing-read+ may include new blacklist entries, but
-Emacs will not edit your override variables if you have already
+Updates to ido-completing-read+ may include new disable list entries,
+but Emacs will not edit your override variables if you have already
 customized them. So, if you have recently upgraded
-ido-completing-read+, remember to invoke `ido-cr+-update-blacklist` to
-add in any new overrides. By default, ido-completing-read+ will remind
-you to do this whenever a new version adds to the blacklist. For more
-information, see:
+ido-completing-read+, remember to invoke `ido-cr+-update-disable-list`
+to add in any new overrides. By default, ido-completing-read+ will
+remind you to do this whenever a new version adds to the list. For
+more information, see:
 
-    M-x describe-variable ido-cr+-auto-update-blacklist
+    M-x describe-variable ido-cr+-auto-update-disable-list
 
 ## Where can I report bugs? ##
 
-If you end up adding any blacklist entries, please report them at
+If you end up adding any disable list entries, please report them at
 https://github.com/DarwinAwardWinner/ido-ubiquitous/issues so I can
 incorporate them into the defaults for future versions. You can also
 report any bugs you find in ido-completing-read+.

+ 154 - 121
ido-completing-read+.el

@@ -5,7 +5,7 @@
 ;; Filename: ido-completing-read+.el
 ;; Author: Ryan C. Thompson <rct@thompsonclan.org>
 ;; Created: Sat Apr  4 13:41:20 2015 (-0700)
-;; Version: 4.13
+;; Version: 4.14
 ;; Package-Requires: ((emacs "24.4") (seq "0.5") (cl-lib "0.5") (memoize "1.1"))
 ;; URL: https://github.com/DarwinAwardWinner/ido-completing-read-plus
 ;; Keywords: ido, completion, convenience
@@ -48,7 +48,7 @@
 ;; this mode is enabled. Some other functions have ido disabled in
 ;; them because their packages already provide support for ido via
 ;; other means (for example, magit). See `M-x describe-variable
-;; ido-cr+-function-blacklist' for more information.
+;; ido-cr+-disable-list' for more information.
 
 ;; ido-completing-read+ version 4.0 is a major update. The formerly
 ;; separate package ido-ubiquitous has been subsumed into
@@ -77,7 +77,7 @@
 ;;
 ;;; Code:
 
-(defconst ido-completing-read+-version "4.13"
+(defconst ido-completing-read+-version "4.14"
   "Currently running version of ido-completing-read+.
 
 Note that when you update ido-completing-read+, this variable may
@@ -307,7 +307,7 @@ disable fallback based on collection size, set this to nil."
                         widget)))))
   :group 'ido-completing-read-plus)
 
-(defcustom ido-cr+-function-blacklist
+(defcustom ido-cr+-disable-list
   '(read-file-name-internal
     read-buffer
     internal-complete-buffer
@@ -341,10 +341,10 @@ fall back specifically for the named function. A regular
 expression means to fall back for any function whose name matches
 that regular expression. When ido-cr+ is called through
 `completing-read', if any function in the call stack of the
-current command matches any of the blacklist entries, ido-cr+
+current command matches any of the disable list entries, ido-cr+
 will be disabled for that command. Additionally, if the
-collection in the call to `completing-read' matches any of the
-blacklist entries, ido-cr+ will be disabled.
+collection in the call to `completing-read' is a function name
+that matches any of the entries, ido-cr+ will be disabled.
 
 Note that using specific function names is generally preferable
 to regular expressions, because the associated function
@@ -355,23 +355,33 @@ regular expressions, only name-based matching is possible."
   :type '(repeat (choice (symbol :tag "Function or command name")
                          (string :tag "Regexp"))))
 
-(defcustom ido-cr+-function-whitelist
+(define-obsolete-variable-alias
+  'ido-cr+-function-blacklist
+  'ido-cr+-disable-list
+  "ido-completing-read+ 4.14")
+
+(defcustom ido-cr+-allow-list
   nil
-  "Functions & commands for which ido-cr+ should be enabled.
+  "If non-nil, limit ido-cr+ only to the specified commands & functions.
 
-If this variable is nil, the whitelist will not be used, and
-ido-cr+ will be allowed in all functions/commands not listed in
-`ido-cr+-function-backlist'.
+If this variable is nil, the ido-cr+ will be enabled for all
+commands and functions not specified in all commands/functions
+not specified in `ido-cr+-function-backlist'.
 
-If this variable is non-nil, ido-cr+'s whitelisting mode will be
+If this variable is non-nil, ido-cr+'s limited mode will be
 enabled, and ido-cr+ will be disabled for *all* functions unless
-they match one of the entries. Matching is done in the same
-manner as `ido-cr+-function-blacklist', and blacklisting takes
-precedence over whitelisting."
+they match one of the entries in this variable. Matching is done
+in the same manner as `ido-cr+-disable-list', and the disable
+list also takes precedence over the allow list."
   :group 'ido-completing-read-plus
   :type '(repeat (choice (symbol :tag "Function or command name")
                          (string :tag "Regexp"))))
 
+(define-obsolete-variable-alias
+  'ido-cr+-function-whitelist
+  'ido-cr+-allow-list
+  "ido-completing-read+ 4.14")
+
 (defcustom ido-cr+-nil-def-alternate-behavior-list
   '("\\`describe-\\(function\\|variable\\)\\'"
     "\\`wl-"
@@ -394,16 +404,16 @@ precedence over whitelisting."
     )
   "Functions & commands with alternate behavior when DEF is nil.
 
-This variable has the same format as
-`ido-cr+-function-blacklist'. When `ido-completing-read+` is
-called through `completing-read' by/with any command, function,
-or collection matched by entries in this list, it will behave
-differently when DEF is nil. Instead of using the empty string as
-the default value, it will use the first element of COLLECTION.
+This variable has the same format as `ido-cr+-disable-list'. When
+`ido-completing-read+` is called through `completing-read'
+by/with any command, function, or collection matched by entries
+in this list, it will behave differently when DEF is nil. Instead
+of using the empty string as the default value, it will use the
+first element of COLLECTION.
 
 This is needed for optimal compatibility with commands written
-under the assumption that REQUIRE-MATCH means that a match is
-required."
+under the reasonable but wrong assumption that REQUIRE-MATCH
+means that a match is required."
   :group 'ido-completing-read-plus
   :type '(repeat (choice (symbol :tag "Function or command name")
                          (string :tag "Regexp"))))
@@ -446,8 +456,12 @@ case, the DATA part of the signal is used as the message."
     (when (and (listp arg)
                (eq (car arg) 'ido-cr+-fallback))
       (setq arg (cadr arg)))
-    (ido-cr+--debug-message "Falling back to `%s' because %s."
-                            ido-cr+-fallback-function arg)))
+    (ido-cr+--debug-message
+     "Falling back to `%s' because %s."
+     (if (symbolp ido-cr+-fallback-function)
+         ido-cr+-fallback-function
+       "ido-cr+-fallback-function")
+     arg)))
 
 ;;;###autoload
 (defsubst ido-cr+-active ()
@@ -462,9 +476,9 @@ case, the DATA part of the signal is used as the message."
 (defmacro ido-cr+-function-is-in-list (fun fun-list &optional list-name)
   "Return non-nil if FUN matches an entry in FUN-LIST.
 
-This is used to check for matches to `ido-cr+-function-blacklist'
-and `ido-cr+-function-whitelist'. Read those docstrings to see
-how the matching is done.
+This is used to check for matches to `ido-cr+-disable-list' and
+`ido-cr+-allow-list'. Read those docstrings to see how
+the matching is done.
 
 This is declared as macro only in order to extract the variable
 name used for the second argument so it can be used in a debug
@@ -496,26 +510,36 @@ information manually if it is known."
         ((stringp entry)
          (and (symbolp ,fun)
               (string-match-p entry (symbol-name ,fun))))
-        ;; Anything else: invalid blacklist entry
+        ;; Anything else: invalid list entry
         (t
          (ido-cr+--debug-message "Ignoring invalid entry in %s: `%S'" ,list-name entry)
          nil))
     return entry
-    ;; If no blacklist entry matches, return nil
+    ;; If no list entry matches, return nil
     finally return nil))
 
-(defun ido-cr+-function-is-blacklisted (fun)
-  "Return non-nil if FUN is blacklisted.
+(defsubst ido-cr+-disabled-in-function-p (fun)
+  "Return non-nil if ido-cr+ is disabled for FUN.
+
+See `ido-cr+-disable-list'."
+  (ido-cr+-function-is-in-list fun ido-cr+-disable-list))
 
-See `ido-cr+-function-blacklist'."
-  (ido-cr+-function-is-in-list fun ido-cr+-function-blacklist))
+(define-obsolete-function-alias
+  'ido-cr+-function-is-blacklisted
+  'ido-cr+-disabled-in-function-p
+  "ido-completing-read+ 4.14")
 
-(defun ido-cr+-function-is-whitelisted (fun)
-  "Return non-nil if FUN is whitelisted.
+(defsubst ido-cr+-allowed-in-function-p (fun)
+  "Return non-nil if ido-cr+ is allowed for FUN.
 
-See `ido-cr+-function-whitelist'."
-  (or (null ido-cr+-function-whitelist)
-      (ido-cr+-function-is-in-list fun ido-cr+-function-whitelist)))
+See `ido-cr+-allow-list'."
+  (or (null ido-cr+-allow-list)
+      (ido-cr+-function-is-in-list fun ido-cr+-allow-list)))
+
+(define-obsolete-function-alias
+  'ido-cr+-function-is-whitelisted
+  'ido-cr+-allowed-in-function-p
+  "ido-completing-read+ 4.14")
 
 ;;;###autoload
 (defun ido-completing-read+ (prompt collection &optional predicate
@@ -571,8 +595,8 @@ See `completing-read' for the meaning of the arguments."
           (if (and ido-cr+-dynamic-collection (featurep 'memoize))
               (memoize (indirect-function 'all-completions))
             'all-completions))
-         ;; If the whitelist is empty, everything is whitelisted
-         (whitelisted (not ido-cr+-function-whitelist))
+         ;; If the allow list is empty, everything is allowed
+         (ido-cr+-allowed (not ido-cr+-allow-list))
          ;; If non-nil, we need alternate nil DEF handling
          (alt-nil-def nil))
     (condition-case sig
@@ -582,23 +606,23 @@ See `completing-read' for the meaning of the arguments."
             (signal 'ido-cr+-fallback
                     '("ido cannot handle alternate input methods")))
 
-          ;; Check for black/white-listed collection function
+          ;; Check for allow/disable-listed collection function
           (when (functionp collection)
-            ;; Blacklist
-            (when (ido-cr+-function-is-blacklisted collection)
+            ;; Disable list
+            (when (ido-cr+-disabled-in-function-p collection)
               (if (symbolp collection)
                   (signal 'ido-cr+-fallback
-                          (list (format "collection function `%S' is blacklisted" collection)))
+                          (list (format "collection function `%S' is disabled" collection)))
                 (signal 'ido-cr+-fallback
-                        (list "collection function is blacklisted"))))
-            ;; Whitelist
-            (when (and (not whitelisted)
-                       (ido-cr+-function-is-whitelisted collection))
+                        (list "collection function is disabled"))))
+            ;; Allow list
+            (when (and (not ido-cr+-allowed)
+                       (ido-cr+-allowed-in-function-p collection))
               (ido-cr+--debug-message
                (if (symbolp collection)
-                   (format "Collection function `%S' is whitelisted" collection)
-                 "Collection function is whitelisted"))
-              (setq whitelisted t))
+                   (format "Collection function `%S' is allowed" collection)
+                 "Collection function is allowed"))
+              (setq ido-cr+-allowed t))
             ;; nil DEF list
             (when (and
                    require-match (null def)
@@ -631,21 +655,21 @@ See `completing-read' for the meaning of the arguments."
                       ido-cr+-max-items))))
 
           ;; If called from `completing-read', check for
-          ;; black/white-listed commands/callers
+          ;; disabled/allowed commands/callers
           (when (ido-cr+--called-from-completing-read)
             ;; Check calling command and `ido-cr+-current-command'
             (cl-loop
              for cmd in (list this-command ido-cr+-current-command)
 
-             if (ido-cr+-function-is-blacklisted cmd)
+             if (ido-cr+-disabled-in-function-p cmd)
              do (signal 'ido-cr+-fallback
-                        (list "calling command `%S' is blacklisted" cmd))
+                        (list "calling command `%S' is disabled" cmd))
 
-             if (and (not whitelisted)
-                     (ido-cr+-function-is-whitelisted cmd))
+             if (and (not ido-cr+-allowed)
+                     (ido-cr+-allowed-in-function-p cmd))
              do (progn
-                  (ido-cr+--debug-message "Command `%S' is whitelisted" cmd)
-                  (setq whitelisted t))
+                  (ido-cr+--debug-message "Command `%S' is allowed" cmd)
+                  (setq ido-cr+-allowed t))
 
              if (and
                  require-match (null def) (not alt-nil-def)
@@ -670,20 +694,20 @@ See `completing-read' for the meaning of the arguments."
                                       '(internal--funcall-interactively
                                         (indirect-function 'call-interactively))))
 
-                     if (ido-cr+-function-is-blacklisted caller)
+                     if (ido-cr+-disabled-in-function-p caller)
                      do (signal 'ido-cr+-fallback
                                 (list (if (symbolp caller)
-                                          (format "calling function `%S' is blacklisted" caller)
-                                        "a calling function is blacklisted")))
+                                          (format "calling function `%S' is disabled" caller)
+                                        "a calling function is disabled")))
 
-                     if (and (not whitelisted)
-                             (ido-cr+-function-is-whitelisted caller))
+                     if (and (not ido-cr+-allowed)
+                             (ido-cr+-allowed-in-function-p caller))
                      do (progn
                           (ido-cr+--debug-message
                            (if (symbolp caller)
-                               (format "Calling function `%S' is whitelisted" caller)
-                             "A calling function is whitelisted"))
-                          (setq whitelisted t))
+                               (format "Calling function `%S' is allowed" caller)
+                             "A calling function is allowed"))
+                          (setq ido-cr+-allowed t))
 
                      if (and require-match (null def) (not alt-nil-def)
                              (ido-cr+-function-is-in-list
@@ -695,9 +719,9 @@ See `completing-read' for the meaning of the arguments."
                              "Using alternate nil DEF handling for a calling function"))
                           (setq alt-nil-def t))))
 
-          (unless whitelisted
+          (unless ido-cr+-allowed
             (signal 'ido-cr+-fallback
-                    (list "no functions or commands matched the whitelist for this call")))
+                    (list "no functions or commands matched the allow list for this call")))
 
           (when (and require-match (null def))
             ;; Replace nil with "" for DEF if match is required, unless
@@ -1105,7 +1129,7 @@ This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
 
 If this mode causes problems for a function, you can customize
 when ido completion is or is not used by customizing
-`ido-cr+-function-blacklist'."
+`ido-cr+-disable-list'."
   nil
   :global t
   :group 'ido-completing-read-plus
@@ -1116,21 +1140,21 @@ when ido completion is or is not used by customizing
             #'ido-completing-read+
           ido-cr+-fallback-function)))
 
-(defcustom ido-cr+-auto-update-blacklist 'notify
+(defcustom ido-cr+-auto-update-disable-list 'notify
   "Whether to add new overrides when updating ido-cr+.
 
 This variable has 3 possible values, with the following meanings:
 
-  t: Auto-update the blacklist
+  t: Auto-update the disable list
   `notify': Notify you about updates but do not apply them
-  nil: Ignore all blacklist updates
+  nil: Ignore all disable list updates
 
-Ido-cr+ comes with a default blacklist for commands that are
-known to be incompatible with ido completion. New versions of
-ido-cr+ may come with updates to this blacklist as more
-incompatible commands are discovered. However, customizing your
-own overrides would normally prevent you from receiving these
-updates, since Emacs will not overwrite your customizations.
+Ido-cr+ comes with a default list of commands that are known to
+be incompatible with ido completion. New versions of ido-cr+ may
+come with updates to this \"disable list\" as more incompatible
+commands are discovered. However, customizing your own overrides
+would normally prevent you from receiving these updates, since
+Emacs will not overwrite your customizations.
 
 To resolve this problem, you can set this variable to t, and then
 ido-cr+ can automatically add any new built-in overrides whenever
@@ -1138,14 +1162,13 @@ it is updated. (Actually, the update will happen the next time
 Emacs is restarted after the update.) This allows you to add your
 own overrides but still receive updates to the default set.
 
-If you want ido-cr+ to just notify you about new default
-overrides instead of adding them itself, set this variable to
-`notify'. If you don't want this auto-update behavior at all, set
-it to nil.
+If you want ido-cr+ to just notify you about new defaults instead
+of adding them itself, set this variable to `notify'. If you
+don't want this auto-update behavior at all, set it to nil.
 
 \(Note that having this option enabled effectively prevents you
-from removing any of the built-in default blacklist entries,
-since they will simply be re-added the next time Emacs starts.)"
+from removing any of the built-in default entries, since they
+will simply be re-added the next time Emacs starts.)"
   :type '(choice :tag "When new overrides are available:"
                  (const :menu-tag "Auto-add"
                         :tag "Add them automatically"
@@ -1158,14 +1181,14 @@ since they will simply be re-added the next time Emacs starts.)"
                         nil))
   :group 'ido-completing-read-plus)
 
-(defun ido-cr+-update-blacklist (&optional save quiet)
-  "Re-add any missing default blacklist entries.
+(defun ido-cr+-update-disable-list (&optional save quiet)
+  "Re-add any missing default entries to `ido-cr+-disable-list'.
 
 This is useful after an update of ido-ubiquitous that adds new
-default overrides. See `ido-cr+-auto-update-blacklist' for more
-information.
+default overrides. See `ido-cr+-auto-update-disable-list' for
+more information.
 
-If SAVE is non-nil, also save the new blacklist to the user's
+If SAVE is non-nil, also save the new disable list to the user's
 Custom file (but only if it was already customized beforehand).
 When called interactively, a prefix argument triggers a save.
 
@@ -1173,12 +1196,12 @@ Unless QUIET is non-nil, this function produces messages indicating
 all changes that were made.
 
 When called from Lisp code, this function returns non-nil if the
-blacklist was modified."
+disable list was modified."
   (interactive "P")
-  (let* ((var-state (custom-variable-state 'ido-cr+-function-blacklist
-                                           ido-cr+-function-blacklist))
-         (curval ido-cr+-function-blacklist)
-         (defval (eval (car (get 'ido-cr+-function-blacklist 'standard-value))))
+  (let* ((var-state (custom-variable-state 'ido-cr+-disable-list
+                                           ido-cr+-disable-list))
+         (curval ido-cr+-disable-list)
+         (defval (eval (car (get 'ido-cr+-disable-list 'standard-value))))
          (newval (delete-dups (append defval curval)))
          (new-entries (cl-set-difference defval curval :test #'equal))
          (modified nil)
@@ -1187,52 +1210,62 @@ blacklist was modified."
     (cl-case var-state
       (standard
        ;; Var is not customized, just set the new default
-       (ido-cr+--debug-message "Blacklist was not customized, so it has been updated to the new default value.")
-       (setq ido-cr+-function-blacklist defval
+       (ido-cr+--debug-message "Disable list was not customized, so it has been updated to the new default value.")
+       (setq ido-cr+-disable-list defval
              modified new-entries))
       ((saved set changed)
        ;; Var has been customized and saved by the user, so set the
        ;; new value and maybe save it
-       (ido-cr+--debug-message "Updating user-customized blacklist with new default entries.")
-       (setq ido-cr+-function-blacklist newval
+       (ido-cr+--debug-message "Updating user-customized disable list with new default entries.")
+       (setq ido-cr+-disable-list newval
              modified t)
        (when (and save (eq var-state 'saved))
-         (ido-cr+--debug-message "Saving new blacklist value to Custom file.")
-         (customize-save-variable 'ido-cr+-function-blacklist ido-cr+-function-blacklist)
+         (ido-cr+--debug-message "Saving new disable list value to Custom file.")
+         (customize-save-variable 'ido-cr+-disable-list ido-cr+-disable-list)
          (setq saved t)))
       (otherwise
-       (ido-cr+--debug-message "Customization status of blacklist is unknown. Not modifying it.")))
+       (ido-cr+--debug-message "Customization status of disable list is unknown. Not modifying it.")))
     (if (and modified (not quiet))
         (progn
-          (push (format "Added the following entries to `ido-cr+-function-blacklist': %S" new-entries)
+          (push (format "Added the following entries to `ido-cr+-disable-list': %S" new-entries)
                 message-lines)
           (if saved
-              (push "Saved the new value of `ido-cr+-function-blacklist' to your Custom file."
+              (push "Saved the new value of `ido-cr+-disable-list' to your Custom file."
                     message-lines)
-            (push "However, the new value of `ido-cr+-function-blacklist' has not yet been saved for future sessions. To save it. re-run this command with a prefix argument:  `C-u M-x ido-cr+-update-blacklist'; or else manually inspect and save the value using `M-x customize-variable ido-cr+-function-blacklist'."
+            (push "However, the new value of `ido-cr+-disable-list' has not yet been saved for future sessions. To save it. re-run this command with a prefix argument:  `C-u M-x ido-cr+-update-disable-list'; or else manually inspect and save the value using `M-x customize-variable ido-cr+-disable-list'."
                   message-lines)))
-      (push "No updates were required to `ido-cr+-function-blacklist'." message-lines))
+      (push "No updates were required to `ido-cr+-disable-list'." message-lines))
     (unless quiet
       (message (mapconcat #'identity (nreverse message-lines) "\n")))
     modified))
 
-(defun ido-cr+-maybe-update-blacklist ()
-  "Maybe call `ico-cr+-update-blacklist.
+(define-obsolete-function-alias
+  'ido-cr+-update-blacklist
+  'ido-cr+-update-disable-list
+  "ido-completing-read+ 4.14")
+
+(defun ido-cr+-maybe-update-disable-list ()
+  "Maybe call `ico-cr+-update-disable-list.
 
- See `ido-cr+-auto-update-blacklist' for more information."
-  (if ido-cr+-auto-update-blacklist
-      (let* ((curval ido-cr+-function-blacklist)
-             (defval (eval (car (get 'ido-cr+-function-blacklist 'standard-value))))
+ See `ido-cr+-auto-update-disable-list' for more information."
+  (if ido-cr+-auto-update-disable-list
+      (let* ((curval ido-cr+-disable-list)
+             (defval (eval (car (get 'ido-cr+-disable-list 'standard-value))))
              (new-entries (cl-set-difference defval curval :test #'equal)))
         (if new-entries
-            (if (eq ido-cr+-auto-update-blacklist 'notify)
-                (display-warning 'ido-completing-read+ (format "There are %s new blacklist entries available. Use `M-x ido-cr+-update-blacklist' to install them. (See `ido-cr+-auto-update-blacklist' for more information.)" (length new-entries)))
-              (ido-cr+--debug-message "Initiating blacklist update.")
-              (ido-cr+-update-blacklist t))
-          (ido-cr+--debug-message "No blacklist updates available.")))
-    (ido-cr+--debug-message "Skipping blacklist update by user request.")))
-
-(ido-cr+-maybe-update-blacklist)
+            (if (eq ido-cr+-auto-update-disable-list 'notify)
+                (display-warning 'ido-completing-read+ (format "There are %s new disable list entries available. Use `M-x ido-cr+-update-disable-list' to install them. (See `ido-cr+-auto-update-disable-list' for more information.)" (length new-entries)))
+              (ido-cr+--debug-message "Initiating disable list update.")
+              (ido-cr+-update-disable-list t))
+          (ido-cr+--debug-message "No disable list updates available.")))
+    (ido-cr+--debug-message "Skipping disable list update by user request.")))
+
+(define-obsolete-function-alias
+  'ido-cr+-maybe-update-blacklist
+  'ido-cr+-maybe-update-disable-list
+  "ido-completing-read+ 4.14")
+
+(ido-cr+-maybe-update-disable-list)
 
 (provide 'ido-completing-read+)
 

+ 10 - 10
ido-ubiquitous.el

@@ -4,11 +4,11 @@
 
 ;; Author: Ryan C. Thompson
 ;; URL: https://github.com/DarwinAwardWinner/ido-ubiquitous
-;; Version: 4.13
+;; Version: 4.14
 ;; Created: 2011-09-01
 ;; Keywords: convenience, completion, ido
 ;; EmacsWiki: InteractivelyDoThings
-;; Package-Requires: ((ido-completing-read+ "4.13"))
+;; Package-Requires: ((ido-completing-read+ "4.14"))
 ;; Filename: ido-ubiquitous.el
 
 ;; This file is NOT part of GNU Emacs.
@@ -39,7 +39,7 @@
 ;;
 ;;; Code:
 
-(defconst ido-ubiquitous-version "4.13"
+(defconst ido-ubiquitous-version "4.14"
   "Currently running version of ido-ubiquitous.
 
 Note that when you update ido-ubiquitous, this variable may not
@@ -52,28 +52,28 @@ https://github.com/DarwinAwardWinner/ido-ubiquitous#version-40-changes")
 
 (define-obsolete-function-alias 'completing-read-ido-ubiquitous 'ido-completing-read+
   "ido-completing-read+ 4.0")
-(define-obsolete-function-alias 'ido-ubiquitous-update-overrides 'ido-cr+-update-blacklist
+(define-obsolete-function-alias 'ido-ubiquitous-update-overrides 'ido-cr+-update-disable-list
   "ido-completing-read+ 4.0")
-(define-obsolete-function-alias 'ido-ubiquitous--maybe-update-overrides 'ido-cr+-maybe-update-blacklist
+(define-obsolete-function-alias 'ido-ubiquitous--maybe-update-overrides 'ido-cr+-maybe-update-disable-list
   "ido-completing-read+ 4.0")
-(define-obsolete-variable-alias 'ido-ubiquitous-auto-update-overrides 'ido-cr+-auto-update-blacklist
+(define-obsolete-variable-alias 'ido-ubiquitous-auto-update-overrides 'ido-cr+-auto-update-disable-list
   "ido-completing-read+ 4.0")
 
 (make-obsolete-variable
  'ido-ubiquitous-default-state
- "For the new variables to control which commands have ido completion, see `ido-cr+-function-blacklist' and `ido-cr+-function-whitelist'. For information on what happened to \"old-style\" default selection, See the FAQ."
+ "For the new variables to control which commands have ido completion, see `ido-cr+-disable-list' and `ido-cr+-allow-list'. For information on what happened to \"old-style\" default selection, See the FAQ."
  "ido-completing-read+ 4.0")
 (make-obsolete-variable
  'ido-ubiquitous-command-overrides
- "For the new variables to control which commands have ido completion, see `ido-cr+-function-blacklist' and `ido-cr+-function-whitelist'. For information on what happened to \"old-style\" default selection, See the FAQ."
+ "For the new variables to control which commands have ido completion, see `ido-cr+-disable-list' and `ido-cr+-allow-list'. For information on what happened to \"old-style\" default selection, See the FAQ."
  "ido-completing-read+ 4.0")
 (make-obsolete-variable
  'ido-ubiquitous-function-overrides
- "For the new variables to control which commands have ido completion, see `ido-cr+-function-blacklist' and `ido-cr+-function-whitelist'. For information on what happened to \"old-style\" default selection, See the FAQ."
+ "For the new variables to control which commands have ido completion, see `ido-cr+-disable-list' and `ido-cr+-allow-list'. For information on what happened to \"old-style\" default selection, See the FAQ."
  "ido-completing-read+ 4.0")
 (make-obsolete-variable
  'ido-ubiquitous-allow-on-functional-collection
- "Ido-cr+ now works with most dynamic completion tables (i.e. \"functional collections\"), so this variable is no longer necessary. If a specific command uses a dynamic completion table that conflicts with ido-cr+, add it to `ido-cr+-function-blacklist' instead."
+ "Ido-cr+ now works with most dynamic completion tables (i.e. \"functional collections\"), so this variable is no longer necessary. If a specific command uses a dynamic completion table that conflicts with ido-cr+, add it to `ido-cr+-disable-list' instead."
  "ido-completing-read+ 4.0")
 
 (provide 'ido-ubiquitous)

+ 1 - 1
setversion.sh

@@ -7,7 +7,7 @@ if [ -n "$TARGET_VERSION" ]; then
          -e "s/((?:defconst|defvar|setq).*-version\s+)\"[0-9.]+\"/\${1}\"$TARGET_VERSION\"/g;" \
          -e "s/(Package-Requires.*\(ido-completing-read\+\s+)\"[0-9.]+\"\)/\${1}\"${TARGET_VERSION}\")/g;" \
          -e "s/\(package \"ido-ubiquitous\" \"[0-9.]+\"/(package \"ido-ubiquitous\" \"${TARGET_VERSION}\"/g" \
-         *.el Cask
+         *.el
 else
     echo "Usage: $0 VERSION_NUMBER"
 fi

+ 3 - 3
tests-with-flx-ido/test-ido-completing-read+-with-flx-ido.el

@@ -127,11 +127,11 @@ also accept a quoted list for the sake of convenience."
      ((ido-mode t)
       (ido-ubiquitous-mode t)
       (ido-cr+-debug-mode t)
-      ido-cr+-auto-update-blacklist
+      ido-cr+-auto-update-disable-list
       ido-cr+-fallback-function
       ido-cr+-max-items
-      ido-cr+-function-blacklist
-      ido-cr+-function-whitelist
+      ido-cr+-disable-list
+      ido-cr+-allow-list
       ido-cr+-nil-def-alternate-behavior-list
       ido-cr+-replace-completely
       ido-confirm-unique-completion

+ 93 - 93
tests/test-ido-completing-read+.el

@@ -144,11 +144,11 @@ also accept a quoted list for the sake of convenience."
      ((ido-mode t)
       (ido-ubiquitous-mode t)
       (ido-cr+-debug-mode t)
-      ido-cr+-auto-update-blacklist
+      ido-cr+-auto-update-disable-list
       ido-cr+-fallback-function
       ido-cr+-max-items
-      ido-cr+-function-blacklist
-      ido-cr+-function-whitelist
+      ido-cr+-disable-list
+      ido-cr+-allow-list
       ido-cr+-nil-def-alternate-behavior-list
       ido-cr+-replace-completely
       ido-confirm-unique-completion
@@ -679,200 +679,200 @@ also accept a quoted list for the sake of convenience."
            (command-execute 'test-command)))
        :to-equal "g"))
 
-    (describe "with `ido-cr+-function-blacklist'"
+    (describe "with `ido-cr+-disable-list'"
       (before-all
-        (setf (symbol-function 'blacklisted-command)
+        (setf (symbol-function 'disabled-command)
               (lambda (arg)
                 (interactive (list (completing-read "Prompt: " '("blue" "yellow" "green"))))
                 arg)
-              (symbol-function 'blacklisted-function)
+              (symbol-function 'disabled-function)
               (lambda ()
                 (completing-read "Prompt: " '("blue" "yellow" "green")))
-              (symbol-function 'cmd-that-calls-blacklisted-function)
+              (symbol-function 'cmd-that-calls-disabled-function)
               (lambda ()
                 (interactive)
-                (funcall 'blacklisted-function))
-              (symbol-function 'blacklisted-collection)
+                (funcall 'disabled-function))
+              (symbol-function 'disabled-collection)
               (collection-as-function '("blue" "yellow" "green"))))
 
       (after-all
-        (setf (symbol-function 'blacklisted-command) nil
-              (symbol-function 'blacklisted-function) nil
-              (symbol-function 'cmd-that-calls-blacklisted-function) nil
-              (symbol-function 'blacklisted-collection) nil))
-      ;; First verify that they work normally before blacklisting them
-      (describe "when the specified functions are not blacklisted"
-
-        (it "should not affect a non-blacklisted command"
+        (setf (symbol-function 'disabled-command) nil
+              (symbol-function 'disabled-function) nil
+              (symbol-function 'cmd-that-calls-disabled-function) nil
+              (symbol-function 'disabled-collection) nil))
+      ;; First verify that they work normally before disabling them
+      (describe "when the specified functions are not disabled"
+
+        (it "should not affect a non-disabled command"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'blacklisted-command))
+             (call-interactively 'disabled-command))
            :to-equal "green"))
 
-        (it "should not affect a non-blacklisted function"
+        (it "should not affect a non-disabled function"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'cmd-that-calls-blacklisted-function))
+             (call-interactively 'cmd-that-calls-disabled-function))
            :to-equal "green"))
 
-        (it "should not affect a non-blacklisted collection"
+        (it "should not affect a non-disabled collection"
           (expect
            (with-simulated-input "g RET"
-             (ido-completing-read+ "Prompt: " 'blacklisted-collection))
+             (ido-completing-read+ "Prompt: " 'disabled-collection))
            :to-equal "green")))
 
-      (describe "when the specified functions are blacklisted"
+      (describe "when the specified functions are disabled"
         (before-each
-          (setq ido-cr+-function-blacklist
-                (append '(blacklisted-command
-                          blacklisted-function
-                          blacklisted-collection)
-                        ido-cr+-function-blacklist)))
+          (setq ido-cr+-disable-list
+                (append '(disabled-command
+                          disabled-function
+                          disabled-collection)
+                        ido-cr+-disable-list)))
 
-        (it "should prevent ido in a blacklisted command"
+        (it "should prevent ido in a disabled command"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'blacklisted-command))
+             (call-interactively 'disabled-command))
            :to-equal "g"))
 
-        (it "should prevent ido in a blacklisted function"
+        (it "should prevent ido in a disabled function"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'cmd-that-calls-blacklisted-function))
+             (call-interactively 'cmd-that-calls-disabled-function))
            :to-equal "g"))
 
-        (it "should prevent ido with a blacklisted collection"
+        (it "should prevent ido with a disabled collection"
           (expect
            (with-simulated-input "g RET"
-             (ido-completing-read+ "Prompt: " 'blacklisted-collection))
+             (ido-completing-read+ "Prompt: " 'disabled-collection))
            :to-equal "g")))
 
       (describe "when updating ido-cr+"
 
         (before-each
-          (spy-on 'ido-cr+-update-blacklist :and-call-through))
-
-        (it "should update the blacklist when `ido-cr+-auto-update-blacklist' is t"
-          (assume ido-cr+-function-blacklist)
-          (let ((orig-blacklist ido-cr+-function-blacklist))
-            (customize-set-variable 'ido-cr+-auto-update-blacklist t)
-            (customize-set-variable 'ido-cr+-function-blacklist nil)
-            (ido-cr+-maybe-update-blacklist)
-            (expect 'ido-cr+-update-blacklist :to-have-been-called)
-            (expect ido-cr+-function-blacklist :to-have-same-items-as orig-blacklist)))
-        (it "should not update the blacklist when `ido-cr+-auto-update-blacklist' is nil"
-          (assume ido-cr+-function-blacklist)
-          (let ((orig-blacklist ido-cr+-function-blacklist))
-            (customize-set-variable 'ido-cr+-auto-update-blacklist nil)
-            (customize-set-variable 'ido-cr+-function-blacklist nil)
-            (ido-cr+-maybe-update-blacklist)
-            (expect 'ido-cr+-update-blacklist :not :to-have-been-called)
-            (expect ido-cr+-function-blacklist :to-have-same-items-as nil)))
-
-        (it "should notify about blacklist updates when `ido-cr+-auto-update-blacklist' is `notify'"
-          (assume ido-cr+-function-blacklist)
+          (spy-on 'ido-cr+-update-disable-list :and-call-through))
+
+        (it "should update the disable list when `ido-cr+-auto-update-disable-list' is t"
+          (assume ido-cr+-disable-list)
+          (let ((orig-disable-list ido-cr+-disable-list))
+            (customize-set-variable 'ido-cr+-auto-update-disable-list t)
+            (customize-set-variable 'ido-cr+-disable-list nil)
+            (ido-cr+-maybe-update-disable-list)
+            (expect 'ido-cr+-update-disable-list :to-have-been-called)
+            (expect ido-cr+-disable-list :to-have-same-items-as orig-disable-list)))
+        (it "should not update the disable list when `ido-cr+-auto-update-disable-list' is nil"
+          (assume ido-cr+-disable-list)
+          (let ((orig-disable-list ido-cr+-disable-list))
+            (customize-set-variable 'ido-cr+-auto-update-disable-list nil)
+            (customize-set-variable 'ido-cr+-disable-list nil)
+            (ido-cr+-maybe-update-disable-list)
+            (expect 'ido-cr+-update-disable-list :not :to-have-been-called)
+            (expect ido-cr+-disable-list :to-have-same-items-as nil)))
+
+        (it "should notify about disable list updates when `ido-cr+-auto-update-disable-list' is `notify'"
+          (assume ido-cr+-disable-list)
           (spy-on 'display-warning)
-          (let ((orig-blacklist ido-cr+-function-blacklist))
-            (customize-set-variable 'ido-cr+-auto-update-blacklist 'notify)
-            (customize-set-variable 'ido-cr+-function-blacklist nil)
-            (ido-cr+-maybe-update-blacklist)
-            (expect 'ido-cr+-update-blacklist :not :to-have-been-called)
+          (let ((orig-disable-list ido-cr+-disable-list))
+            (customize-set-variable 'ido-cr+-auto-update-disable-list 'notify)
+            (customize-set-variable 'ido-cr+-disable-list nil)
+            (ido-cr+-maybe-update-disable-list)
+            (expect 'ido-cr+-update-disable-list :not :to-have-been-called)
             (expect 'display-warning :to-have-been-called)
-            (expect ido-cr+-function-blacklist :to-have-same-items-as nil)))))
+            (expect ido-cr+-disable-list :to-have-same-items-as nil)))))
 
-    (describe "with `ido-cr+-function-whitelist'"
+    (describe "with `ido-cr+-allow-list'"
       (before-all
-        (setf (symbol-function 'whitelisted-command)
+        (setf (symbol-function 'allowed-command)
               (lambda (arg)
                 (interactive
                  (list
                   (completing-read "Prompt: " '("blue" "yellow" "green"))))
                 arg)
-              (symbol-function 'whitelisted-function)
+              (symbol-function 'allowed-function)
               (lambda ()
                 (completing-read "Prompt: " '("blue" "yellow" "green")))
-              (symbol-function 'cmd-that-calls-whitelisted-function)
+              (symbol-function 'cmd-that-calls-allowed-function)
               (lambda ()
                 (interactive)
-                (funcall 'whitelisted-function))
-              (symbol-function 'whitelisted-collection)
+                (funcall 'allowed-function))
+              (symbol-function 'allowed-collection)
               (lambda (string pred action)
                 (complete-with-action action '("blue" "yellow" "green") string pred))))
 
       (after-all
-        (setf (symbol-function 'whitelisted-command) nil
-              (symbol-function 'whitelisted-function) nil
-              (symbol-function 'cmd-that-calls-whitelisted-function) nil
-              (symbol-function 'whitelisted-collection) nil))
+        (setf (symbol-function 'allowed-command) nil
+              (symbol-function 'allowed-function) nil
+              (symbol-function 'cmd-that-calls-allowed-function) nil
+              (symbol-function 'allowed-collection) nil))
 
-      (describe "when the whitelist is inactive (i.e. everything is whitelisted)"
+      (describe "when the allow list is inactive (i.e. everything is allowed)"
         (before-each
-          (setq ido-cr+-function-whitelist nil))
+          (setq ido-cr+-allow-list nil))
 
         (it "should enable ido in a command"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'whitelisted-command))
+             (call-interactively 'allowed-command))
            :to-equal "green"))
 
         (it "should enable ido in a function"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'cmd-that-calls-whitelisted-function))
+             (call-interactively 'cmd-that-calls-allowed-function))
            :to-equal "green"))
 
         (it "should enable ido for a collection"
           (expect
            (with-simulated-input "g RET"
-             (ido-completing-read+ "Prompt: " 'whitelisted-collection))
+             (ido-completing-read+ "Prompt: " 'allowed-collection))
            :to-equal "green")))
 
-      (describe "when the specified functions are whitelisted"
+      (describe "when the specified functions are allowed"
         (before-each
-          (setq ido-cr+-function-whitelist
-                (append '(whitelisted-command
-                          whitelisted-function
-                          whitelisted-collection)
-                        ido-cr+-function-whitelist)))
+          (setq ido-cr+-allow-list
+                (append '(allowed-command
+                          allowed-function
+                          allowed-collection)
+                        ido-cr+-allow-list)))
 
-        (it "should enable ido in a whitelisted command"
+        (it "should enable ido in an allowed command"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'whitelisted-command))
+             (call-interactively 'allowed-command))
            :to-equal "green"))
 
-        (it "should enable ido in a whitelisted function"
+        (it "should enable ido in an allowed function"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'cmd-that-calls-whitelisted-function))
+             (call-interactively 'cmd-that-calls-allowed-function))
            :to-equal "green"))
 
-        (it "should enable ido for a whitelisted collection"
+        (it "should enable ido for an allowed collection"
           (expect
            (with-simulated-input "g RET"
-             (ido-completing-read+ "Prompt: " 'whitelisted-collection))
+             (ido-completing-read+ "Prompt: " 'allowed-collection))
            :to-equal "green")))
 
-      (describe "when the whitelist is active but empty (i.e. nothing whitelisted)"
+      (describe "when the allow list is active but empty (i.e. nothing allowed)"
         (before-each
-          (setq ido-cr+-function-whitelist (list nil)))
+          (setq ido-cr+-allow-list (list nil)))
 
         (it "should prevent ido in a command"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'whitelisted-command))
+             (call-interactively 'allowed-command))
            :to-equal "g"))
 
         (it "should prevent ido in a function"
           (expect
            (with-simulated-input "g RET"
-             (call-interactively 'cmd-that-calls-whitelisted-function))
+             (call-interactively 'cmd-that-calls-allowed-function))
            :to-equal "g"))
 
         (it "should prevent ido for a collection"
           (expect
            (with-simulated-input "g RET"
-             (ido-completing-read+ "Prompt: " 'whitelisted-collection))
+             (ido-completing-read+ "Prompt: " 'allowed-collection))
            :to-equal "g"))))
 
     (describe "with `ido-cr+-nil-def-alternate-behavior-list'"