[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
33/38: emacs: Return nil instead of "" in completing readers.
From: |
Alex Kost |
Subject: |
33/38: emacs: Return nil instead of "" in completing readers. |
Date: |
Sat, 02 Jan 2016 14:27:27 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit dc690c445e4b483e6ce2a88f6c23dd19685057cc
Author: Alex Kost <address@hidden>
Date: Fri Dec 11 12:36:56 2015 +0300
emacs: Return nil instead of "" in completing readers.
* emacs/guix-utils.el (guix-completing-read): New procedure.
(guix-define-readers): Use it.
---
emacs/guix-utils.el | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/emacs/guix-utils.el b/emacs/guix-utils.el
index 4f5c69c..98a408f 100644
--- a/emacs/guix-utils.el
+++ b/emacs/guix-utils.el
@@ -214,6 +214,15 @@ If NO-MESSAGE? is non-nil, do not display a message about
it."
See also `guix-copy-as-kill'."
(guix-copy-as-kill (guix-command-string args) no-message?))
+(defun guix-completing-read (prompt table &optional predicate
+ require-match initial-input
+ hist def inherit-input-method)
+ "Same as `completing-read' but return nil instead of an empty string."
+ (let ((res (completing-read prompt table predicate
+ require-match initial-input
+ hist def inherit-input-method)))
+ (unless (string= "" res) res)))
+
(defun guix-completing-read-multiple (prompt table &optional predicate
require-match initial-input
hist def inherit-input-method)
@@ -460,7 +469,7 @@ keywords are available:
`(defvar ,completions-var nil))
,(when single-reader
- `(guix-define-reader ,single-reader completing-read
+ `(guix-define-reader ,single-reader guix-completing-read
,completions ,single-prompt))
,(when multiple-reader
- 23/38: emacs: Generalize buffer reverting., (continued)
- 23/38: emacs: Generalize buffer reverting., Alex Kost, 2016/01/02
- 19/38: emacs: Split 'guix-param-titles' variable., Alex Kost, 2016/01/02
- 25/38: emacs: info: Buttonize package name heading., Alex Kost, 2016/01/02
- 22/38: emacs: Generalize buffer redisplaying., Alex Kost, 2016/01/02
- 21/38: emacs: Split 'guix-root-map' keymap., Alex Kost, 2016/01/02
- 27/38: emacs: info: Get rid of syntactic fontification., Alex Kost, 2016/01/02
- 24/38: emacs: Improve messages for packages found by ID., Alex Kost, 2016/01/02
- 18/38: emacs: info: Split 'guix-info-format' variable., Alex Kost, 2016/01/02
- 32/38: emacs: Add 'guix-list-get-display-entries'., Alex Kost, 2016/01/02
- 17/38: emacs: Factorize macros for defining interfaces., Alex Kost, 2016/01/02
- 33/38: emacs: Return nil instead of "" in completing readers.,
Alex Kost <=
- 31/38: emacs: Add 'list-single' variables., Alex Kost, 2016/01/02
- 29/38: emacs: Reorganize 'readers' code., Alex Kost, 2016/01/02
- 26/38: emacs: Generalize buffer naming., Alex Kost, 2016/01/02
- 35/38: emacs: Add 'guix-ui-read-profile'., Alex Kost, 2016/01/02
- 37/38: emacs: Use "B" key in "Package List" to display latest builds., Alex Kost, 2016/01/02
- 34/38: emacs: Add hierarchy of customization groups., Alex Kost, 2016/01/02
- 38/38: Update NEWS., Alex Kost, 2016/01/02
- 16/38: emacs: info: Generalize inserting and formatting., Alex Kost, 2016/01/02
- 36/38: emacs: Add Hydra interface., Alex Kost, 2016/01/02
- 28/38: emacs: Generalize buffer interface., Alex Kost, 2016/01/02