Skip to content

Commit

Permalink
Clarify error message regarding key configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Feb 4, 2023
1 parent 07b6a91 commit 982ec0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ The result can be passed as :state argument to `consult--read'." type)
(if (key-valid-p key)
(setq key (key-parse key))
;; TODO: Remove compatibility code, throw error.
(message "Invalid preview key: %S" key)))
(message "Invalid preview key according to `key-valid-p': %S" key)))
(push (cons key debounce) keys))
(pop preview-key)))
keys))
Expand Down Expand Up @@ -1685,14 +1685,14 @@ The default is twice the `consult-narrow-key'."
(if (key-valid-p consult-widen-key)
(key-parse consult-widen-key)
;; TODO: Remove compatibility code, throw error.
(message "Invalid `consult-widen-key': %S" consult-widen-key)
(message "Invalid `consult-widen-key' according to `key-valid-p': %S" consult-widen-key)
consult-widen-key))
(consult-narrow-key
(let ((key consult-narrow-key))
(if (key-valid-p key)
(setq key (key-parse key))
;; TODO: Remove compatibility code, throw error.
(message "Invalid `consult-narrow-key': %S" key))
(message "Invalid `consult-narrow-key' according to `key-valid-p': %S" key))
(vconcat key key)))))

(defun consult-narrow (key)
Expand Down Expand Up @@ -1769,7 +1769,7 @@ to make it available for commands with narrowing."
(if (key-valid-p key)
(setq key (key-parse key))
;; TODO: Remove compatibility code, throw error.
(message "Invalid `consult-narrow-key': %S" key))
(message "Invalid `consult-narrow-key' according to `key-valid-p': %S" key))
(dolist (pair consult--narrow-keys)
(define-key map (vconcat key (vector (car pair)))
(cons (cdr pair) #'consult-narrow))))
Expand Down

0 comments on commit 982ec0b

Please sign in to comment.