[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 8c0c831605 1/3: Fix very dumb bug in ebdb-read-str
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 8c0c831605 1/3: Fix very dumb bug in ebdb-read-string |
Date: |
Wed, 19 Jan 2022 14:25:02 -0500 (EST) |
branch: externals/ebdb
commit 8c0c831605fb8d771872eef70ba4a71f5d4c8c0a
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Fix very dumb bug in ebdb-read-string
Thanks to Mohsin Kaleem for the report.
* ebdb.el (ebdb-read-string): Function should signal 'ebdb-empty on an
empty string no matter how we go about reading the string!
---
ebdb.el | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 2278156e2f..13685c2f55 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -4993,25 +4993,27 @@ same meaning as in `completing-read'."
(concat str " " (downcase prompt)))
(_ prompt))
": "))
- (ebdb-string-trim
- (if collection
- ;; Hack: In `minibuffer-local-completion-map' remove
- ;; the binding of SPC to `minibuffer-complete-word'
- ;; and of ? to `minibuffer-completion-help'.
- (let ((completion-ignore-case ebdb-completion-ignore-case))
- (minibuffer-with-setup-hook
- (lambda ()
- (use-local-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (current-local-map))
- (define-key map " " nil)
- (define-key map "?" nil)
- map)))
- (completing-read prompt collection nil require-match init)))
- (let ((string (read-string prompt init)))
- (if (string-blank-p string)
- (signal 'ebdb-empty (list prompt))
- string)))))
+ (let ((string
+ (ebdb-string-trim
+ (if collection
+ ;; Hack: In `minibuffer-local-completion-map' remove
+ ;; the binding of SPC to `minibuffer-complete-word'
+ ;; and of ? to `minibuffer-completion-help'.
+ (let ((completion-ignore-case ebdb-completion-ignore-case))
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (use-local-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map (current-local-map))
+ (define-key map " " nil)
+ (define-key map "?" nil)
+ map)))
+ (completing-read
+ prompt collection nil require-match init)))
+ (read-string prompt init)))))
+ (if (string-blank-p string)
+ (signal 'ebdb-empty (list prompt))
+ string)))
;; FIXME: Get rid of this add-job and eval-spec stuff.
(defsubst ebdb-add-job (spec record string)