Explorar el Código

Fix issues raised by linters

Ryan C. Thompson hace 5 años
padre
commit
46202cf953
Se han modificado 2 ficheros con 42 adiciones y 25 borrados
  1. 3 0
      Eldev
  2. 39 25
      ido-completing-read+.el

+ 3 - 0
Eldev

@@ -11,3 +11,6 @@
 (eldev-add-extra-dependencies 'test 'flx-ido)
 (eldev-add-extra-dependencies 'test 'with-simulated-input)
 (eldev-add-extra-dependencies 'test 'undercover)
+
+;; Tell checkdoc not to demand two spaces after a period.
+(setq sentence-end-double-space nil)

+ 39 - 25
ido-completing-read+.el

@@ -6,7 +6,7 @@
 ;; Author: Ryan Thompson
 ;; Created: Sat Apr  4 13:41:20 2015 (-0700)
 ;; Version: 4.13
-;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (memoize "1.1"))
+;; 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
 
@@ -108,6 +108,10 @@ Debug info is printed to the *Messages* buffer."
   :group 'ido-completing-read-plus)
 
 (defsubst ido-cr+--debug-message (format-string &rest args)
+  "Emit a debug message for ido-cr+.
+
+This only has an effect when `ido-cr+-debug-mode' is non-nil.
+Arguments are identical to `message'."
   (when ido-cr+-debug-mode
     (apply #'message (concat "ido-completing-read+: " format-string) args)))
 
@@ -118,7 +122,7 @@ Debug info is printed to the *Messages* buffer."
 ;; ido.el.
 
 (defmacro define-ido-internal-var (symbol &optional initvalue docstring)
-  "Declare and initialize an ido internal variable.
+  "Declare and initialize SYMBOL an ido internal variable.
 
 This is used to suppress byte-compilation warnings about
 reference to free variables when ido-cr+ attempts to access
@@ -194,7 +198,7 @@ dynamically.")
   "Idle timer for updating dynamic completion list.")
 
 (defvar ido-cr+-exhibit-pending nil
-  "This is non-nil after calling `ido-tidy' until the next call to `ido-exhibit'.
+  "This is non-nil between calling `ido-tidy' and `ido-exhibit'.
 
 Typically this is non-nil while any command is running and nil at all
 other times, since those two functions are in `pre-command-hook'
@@ -248,7 +252,7 @@ pattern used to restrict.")
               ido-ubiquitous-completing-read))
       'completing-read-default
     completing-read-function)
-  "Alternate completing-read function to use when ido is not wanted.
+  "Alternate `completing-read-function' to use when ido is not wanted.
 
 This will be used for functions that are incompatible with ido
 or if ido cannot handle the completion arguments. It will also be
@@ -408,8 +412,10 @@ https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues"
 (define-error 'ido-cr+-fallback "ido-cr+-fallback")
 
 (defsubst ido-cr+--explain-fallback (arg)
-  ;; This function accepts a string, or an ido-cr+-fallback
-  ;; signal.
+  "Emit a debug message explaining the reason for falling back.
+
+ARG can be a string or an ido-cr+-fallback signal. In the latter
+case, the DATA part of the signal is used as the message."
   (when ido-cr+-debug-mode
     (when (and (listp arg)
                (eq (car arg) 'ido-cr+-fallback))
@@ -419,11 +425,11 @@ https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues"
 
 ;;;###autoload
 (defsubst ido-cr+-active ()
-  "Returns non-nil if ido-cr+ is currently using the minibuffer."
+  "Return non-nil if ido-cr+ is currently using the minibuffer."
   (>= ido-cr+-minibuffer-depth (minibuffer-depth)))
 
 (defun ido-cr+--called-from-completing-read ()
-  "Returns non-nil if the most recent call to ido-cr+ was from `completing-read'."
+  "Return non-nil if the most recent call to ido-cr+ was from `completing-read'."
   (equal (cadr (backtrace-frame 1 'ido-completing-read+))
          'completing-read))
 
@@ -436,7 +442,9 @@ 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
-message. It should be called as if it were a normal function."
+message. It should be called as if it were a normal function. The
+optional 3rd argument LIST-NAME can be used to provide this
+information manually if it is known."
   (when (null list-name)
     (if (symbolp fun-list)
         (setq list-name (symbol-name fun-list))
@@ -487,14 +495,16 @@ See `ido-cr+-function-whitelist'."
 (defun ido-completing-read+ (prompt collection &optional predicate
                                     require-match initial-input
                                     hist def inherit-input-method)
-  "ido-based method for reading from the minibuffer with completion.
+  "Ido-based method for reading from the minibuffer with completion.
 
 See `completing-read' for the meaning of the arguments.
 
 This function is a wrapper for `ido-completing-read' designed to
 be used as the value of `completing-read-function'. Importantly,
 it detects edge cases that ido cannot handle and uses normal
-completion for them."
+completion for them.
+
+See `completing-read' for the meaning of the arguments."
   (let* (;; Save the original arguments in case we need to do the
          ;; fallback
          (ido-cr+-orig-completing-read-args
@@ -814,10 +824,12 @@ called through ido-cr+."
             #'ido-select-text@ido-cr+-fix-require-match)
 
 (defun ido-tidy@ido-cr+-set-exhibit-pending (&rest _args)
+  "Advice to manage the value of `ido-cr+-exhibit-pending'."
   (setq ido-cr+-exhibit-pending t))
 (advice-add 'ido-tidy :after 'ido-tidy@ido-cr+-set-exhibit-pending)
 
 (defun ido-exhibit@ido-cr+-clear-exhibit-pending (&rest _args)
+  "Advice to manage the value of `ido-cr+-exhibit-pending'."
   (setq ido-cr+-exhibit-pending nil))
 (advice-add 'ido-exhibit :before 'ido-exhibit@ido-cr+-clear-exhibit-pending)
 
@@ -889,7 +901,7 @@ result."
      filtered-collection)))
 
 (defun ido-cr+-cyclicp (x)
-  "Returns non-nill if X is a list containing a circular reference."
+  "Return non-nill if X is a list containing a circular reference."
   (cl-loop
    for tortoise on x
    for hare on (cdr x) by #'cddr
@@ -1004,7 +1016,7 @@ This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
                                  #'ido-cr+-update-dynamic-collection)))))
 
 (defun ido-cr+-minibuffer-setup ()
-  "set up minibuffer `post-command-hook' for ido-cr+ "
+  "Set up minibuffer `post-command-hook' for ido-cr+."
   (when (ido-cr+-active)
     (add-hook 'post-command-hook
               'ido-cr+-schedule-dynamic-collection-update)))
@@ -1036,7 +1048,7 @@ This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
 ;; dynamically-added completions are also properly restricted.
 (defun ido-restrict-to-matches@ido-cr+-record-restriction
     (&optional removep)
-  "Record the restriction criterion for ido-cr+"
+  "Record the restriction criterion for ido-cr+."
   (ido-cr+--debug-message "Appending restriction %S to `ido-cr+-active-restrictions'"
                           (cons removep ido-text))
   (add-to-list 'ido-cr+-active-restrictions (cons removep ido-text) t))
@@ -1047,7 +1059,7 @@ This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
 ;; default when the input is empty and the empty string is the
 ;; selected choice
 (defun minibuf-eldef-update-minibuffer@ido-cr+-compat (orig-fun &rest args)
-  "This advice allows minibuffer-electric-default-mode to work with ido-cr+."
+  "This advice allows `minibuffer-electric-default-mode' to work with ido-cr+."
   (if (ido-cr+-active)
       (unless (eq minibuf-eldef-showing-default-in-prompt
                   (and (string= (car ido-cur-list) "")
@@ -1083,9 +1095,9 @@ when ido completion is or is not used by customizing
 
 This variable has 3 possible values, with the following meanings:
 
-  `t': Auto-update the blacklist
+  t: Auto-update the blacklist
   `notify': Notify you about updates but do not apply them
-  `nil': Ignore all blacklist updates
+  nil: Ignore all blacklist updates
 
 Ido-cr+ comes with a default blacklist for commands that are
 known to be incompatible with ido completion. New versions of
@@ -1094,19 +1106,18 @@ 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 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.
+To resolve this problem, you can set this variable to t, and then
+ido-cr+ can automatically add any new built-in overrides whenever
+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'.
+it to nil.
 
-(Note that having this option enabled effectively prevents you
+\(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.)"
   :type '(choice :tag "When new overrides are available:"
@@ -1132,6 +1143,9 @@ If SAVE is non-nil, also save the new blacklist to the user's
 Custom file (but only if it was already customized beforehand).
 When called interactively, a prefix argument triggers a save.
 
+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."
   (interactive "P")