[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a20c196 336/399: counsel.el (counsel-set-variable): Better
From: |
Oleh Krehel |
Subject: |
[elpa] master a20c196 336/399: counsel.el (counsel-set-variable): Better annotations for options |
Date: |
Sat, 20 Jul 2019 14:57:52 -0400 (EDT) |
branch: master
commit a20c1961d7c2c57eac17c3e9cea544737a395399
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-set-variable): Better annotations for options
* counsel.el (counsel--setq-doconst): If the option is e.g.
(const :tag "Dotfiles and Lockfiles" "\\(?:\\`\\|[/\\]\\)\\(?:[#.]\\)")
Then display:
Dotfiles and Lockfiles: \(?:\`\|[/\]\)\(?:[#.]\)
Instead of previous:
\\(?:\\`\\|[/\\]\\)\\(?:[#.]\\)
Also, if the option's value is nil, but a :tag is present, display the
option.
---
counsel.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/counsel.el b/counsel.el
index 34f3fc1..fb36933 100644
--- a/counsel.el
+++ b/counsel.el
@@ -628,15 +628,19 @@ to `ivy-highlight-face'."
(defun counsel--setq-doconst (x)
"Return a cons of description and value for X.
X is an item of a radio- or choice-type defcustom."
- (let (y)
- (when (and (listp x)
- (consp (setq y (last x))))
- (unless (equal y '(function))
- (setq x (car y))
- (cons (prin1-to-string x)
- (if (symbolp x)
- (list 'quote x)
- x))))))
+ (when (listp x)
+ (let ((v (car-safe (last x)))
+ (tag (and (eq (car x) 'const)
+ (setq tag (plist-get (cdr x) :tag)))))
+ (when (and (or v tag) (not (eq v 'function)))
+ (cons
+ (concat
+ (when tag
+ (concat tag ": "))
+ (if (stringp v) v (prin1-to-string v)))
+ (if (symbolp v)
+ (list 'quote v)
+ v))))))
(declare-function lv-message "ext:lv")
(declare-function lv-delete-window "ext:lv")
- [elpa] master 15f8e10 330/399: .travis.yml: Add emacs-25.3 and emacs-26.2, (continued)
- [elpa] master 15f8e10 330/399: .travis.yml: Add emacs-25.3 and emacs-26.2, Oleh Krehel, 2019/07/20
- [elpa] master d752db5 333/399: counsel.el (counsel-find-file-extern-extensions): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master cfb8d49 335/399: counsel.el (counsel-find-file-ignore-regexp): Add lockfiles to dotfiles, Oleh Krehel, 2019/07/20
- [elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when window config changed, Oleh Krehel, 2019/07/20
- [elpa] master 8db9cc1 349/399: swiper.el (swiper--add-cursor-overlay): Avoid a very wide cursor on tab chars, Oleh Krehel, 2019/07/20
- [elpa] master 40d8114 338/399: counsel.el (counsel-shell-command-history): Remove obsolete command, Oleh Krehel, 2019/07/20
- [elpa] master f0a2341 337/399: counsel.el (counsel-rhythmbox): Add :require-match, Oleh Krehel, 2019/07/20
- [elpa] master 4de54f1 340/399: ivy.el (ivy-reverse-i-search-kill): Add and bind to "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 7201c0f 334/399: ivy-hydra.el (ivy-dispatching-done-hydra-exit-keys): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 935603e 310/399: ivy.el (ivy--done): Press "RET" or "C-m" to create a directory, Oleh Krehel, 2019/07/20
- [elpa] master a20c196 336/399: counsel.el (counsel-set-variable): Better annotations for options,
Oleh Krehel <=
- [elpa] master cea24b7 339/399: counsel.el (counsel-expression-history): Remove obsolete command, Oleh Krehel, 2019/07/20
- [elpa] master 9f6141f 345/399: counsel.el (counsel--browse-history): Allow to remove elements with "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 673c45e 342/399: ivy.el (ivy--minibuffer-setup): Set line-spacing to nil in the minibuffer, Oleh Krehel, 2019/07/20
- [elpa] master 8d7578f 346/399: counsel.el (counsel--browse-history): Better prompt, Oleh Krehel, 2019/07/20
- [elpa] master f9e8116 344/399: swiper.el (swiper-isearch-action): Fix outlines getting over-revealed, Oleh Krehel, 2019/07/20
- [elpa] master f29207f 324/399: Add ability to resume dynamic collections, Oleh Krehel, 2019/07/20
- [elpa] master 3b1a25b 331/399: ivy-test.el (counsel-find-file-with-dotfiles): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 8fc254f 341/399: counsel.el (counsel--setq-doconst): Fix compiler warning, Oleh Krehel, 2019/07/20
- [elpa] master 1c436f6 347/399: ivy.el (ivy-reverse-i-search): Don't call another ivy-reverse-i-search, Oleh Krehel, 2019/07/20
- [elpa] master 975c2af 348/399: ivy.el (ivy-reverse-i-search): Error when called from top-level, Oleh Krehel, 2019/07/20