[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master cd8a570 062/348: Escape `%` chars if present in the symbol
From: |
Oleh Krehel |
Subject: |
[elpa] master cd8a570 062/348: Escape `%` chars if present in the symbol value |
Date: |
Sat, 8 Apr 2017 11:03:25 -0400 (EDT) |
branch: master
commit cd8a570d70c157e50e38dd0e8a5a5b43dc110077
Author: Kaushal Modi <address@hidden>
Commit: Kaushal Modi <address@hidden>
Escape `%` chars if present in the symbol value
* counsel-set-variable: The current value of the variable to be modified
is displayed in the ivy prompt. If the symbol value has literal '%'
characters they need to be escaped to '%%' so that they are not
processed by `ivy--reset-state`.
---
counsel.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/counsel.el b/counsel.el
index 3d09b37..200e136 100644
--- a/counsel.el
+++ b/counsel.el
@@ -541,9 +541,11 @@ input corresponding to the chosen variable."
(setq cands '(("nil" . nil) ("t" . t))))
(t nil)))
(let* ((sym-val (symbol-value sym))
- (res (ivy-read (format "Set (%S <%s>): " sym sym-val)
- cands
- :preselect (prin1-to-string sym-val))))
+ ;; Escape '%' chars if present
+ (sym-val-str (replace-regexp-in-string "%" "%%" (format "%s"
sym-val)))
+ (res (ivy-read (format "Set (%S <%s>): " sym sym-val-str)
+ cands
+ :preselect (prin1-to-string sym-val))))
(when res
(setq res
(if (assoc res cands)
- [elpa] master c4775b6 031/348: ivy.el (ivy-action-wrap): New defcustom, (continued)
- [elpa] master c4775b6 031/348: ivy.el (ivy-action-wrap): New defcustom, Oleh Krehel, 2017/04/08
- [elpa] master ac1dc5b 034/348: counsel.el (counsel-company): New command, Oleh Krehel, 2017/04/08
- [elpa] master cba67e4 038/348: counsel.el (counsel-bookmark): Add require, Oleh Krehel, 2017/04/08
- [elpa] master 3d48093 027/348: counsel.el (counsel--gg-sentinel): Add a work around, Oleh Krehel, 2017/04/08
- [elpa] master ddb4681 025/348: counsel.el (counsel-git-grep-cmd-default): New defvar, Oleh Krehel, 2017/04/08
- [elpa] master cf38ceb 040/348: swiper.el (swiper-font-lock-exclude): Add forth-mode, Oleh Krehel, 2017/04/08
- [elpa] master ab55e03 055/348: counsel.el (counsel-set-variable): Add :preselect, Oleh Krehel, 2017/04/08
- [elpa] master f4ec789 056/348: counsel.el (counsel-set-variable): Fix 2nd preselect, Oleh Krehel, 2017/04/08
- [elpa] master 792b7b7 051/348: counsel.el (counsel-set-variable): New command, Oleh Krehel, 2017/04/08
- [elpa] master dc4a858 060/348: counsel.el (counsel-hydra-heads): New command, Oleh Krehel, 2017/04/08
- [elpa] master cd8a570 062/348: Escape `%` chars if present in the symbol value,
Oleh Krehel <=
- [elpa] master 97cf30d 063/348: Add multiple-cursors support to ivy-completion-in-region-action, Oleh Krehel, 2017/04/08
- [elpa] master 8c7a7fc 028/348: When reading file names, check preselect and initial-input compat, Oleh Krehel, 2017/04/08
- [elpa] master 5d0fec1 032/348: ivy.el: Fix some checkdoc warnings, Oleh Krehel, 2017/04/08
- [elpa] master 2e1cebc 036/348: counsel.el (counsel-bookmark): Add, Oleh Krehel, 2017/04/08
- [elpa] master a566403 044/348: ivy.el (ivy-read): Document all args, Oleh Krehel, 2017/04/08
- [elpa] master baf89c0 054/348: ivy-test.el (colir-color-parse): Add test, Oleh Krehel, 2017/04/08
- [elpa] master be24b57 049/348: Revert "ivy.el (ivy-completion-in-region): Fix double insert bug", Oleh Krehel, 2017/04/08
- [elpa] master 77fb030 052/348: ivy.el (ivy-completion-in-region): Fix common length longer than str, Oleh Krehel, 2017/04/08
- [elpa] master 7280e19 050/348: ivy.el (ivy-completion-common-length): Fix double insert bug, Oleh Krehel, 2017/04/08
- [elpa] master 288723e 065/348: counsel.el (counsel-set-variable): Allow new symbols, Oleh Krehel, 2017/04/08