branch: elpa/helm
commit e1442071ae9a59a9fa649072fcda21c9f6f4e4ad
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Provide help in several read-answer's
---
helm-epa.el | 20 +++++++++++++++-----
helm-files.el | 13 ++++++++-----
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/helm-epa.el b/helm-epa.el
index dc6c431e4a..5df8aa2c9e 100644
--- a/helm-epa.el
+++ b/helm-epa.el
@@ -108,13 +108,23 @@
(replace-regexp-in-string "\\.[\t ]*\\'" "" (cadr split)))
(format "%s: " (replace-regexp-in-string "\\.[\t ]*\\'" "" (car
split))))))
+(defun helm-epa--read-signature-type-help ()
+ (with-temp-buffer
+ (save-excursion
+ (insert
+ "n: Create a normal signature)\n"
+ "c: Create a cleartext signature)\n"
+ "d: Create a detached signature)"))
+ (while (re-search-forward "^\\(.\\):" nil t)
+ (helm-add-face-text-properties (match-beginning 1) (match-end 1)
+ 'font-lock-variable-name-face))
+ (buffer-string)))
+
(defun helm-epa--read-signature-type ()
"A helm replacement for `epa--read-signature-type'."
- (let ((answer (helm-read-answer "Signature type:
-(n - Create a normal signature)
-(c - Create a cleartext signature)
-(d - Create a detached signature)"
- '("n" "c" "d"))))
+ (let ((answer (helm-read-answer "Signature type? [n,c,d,h]"
+ '("n" "c" "d")
+ #'helm-epa--read-signature-type-help)))
(helm-acase answer
("n" 'normal)
("c" 'clear)
diff --git a/helm-files.el b/helm-files.el
index 73e1c111ce..54f0378d84 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -2339,10 +2339,11 @@ This doesn't replace inside the files, only modify
filenames."
(file-name-extension new t))))
(unless (string= query "!")
(setq query (helm-read-answer (format
- "Replace `%s' by `%s'
[!,y,n,q]"
+ "Replace `%s' by `%s'
[!,y,n,q,h]"
(helm-basename old)
(helm-basename new))
- '("y" "n" "!" "q"))))
+ '("y" "n" "!" "q")
+
#'helm-read-answer-default-help-fn)))
(when (string= query "q")
(cl-return (message "Operation aborted")))
(unless (string= query "n")
@@ -6194,9 +6195,11 @@ is nil."
;; is a bug).
(if (or helm-ff-allow-recursive-deletes trash)
(delete-directory file 'recursive trash)
- (helm-acase (helm-read-answer (format "Recursive delete of
`%s'? [y,n,!,q]"
- (abbreviate-file-name
file))
- '("y" "n" "!" "q"))
+ (helm-acase (helm-read-answer
+ (format "Recursive delete of `%s'? [y,n,!,q,h]"
+ (abbreviate-file-name file))
+ '("y" "n" "!" "q")
+ #'helm-read-answer-default-help-fn)
("y" (delete-directory file 'recursive trash))
("!" (setq helm-ff-allow-recursive-deletes t)
(delete-directory file 'recursive trash))