summaryrefslogtreecommitdiff
path: root/helm-bookmark.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2015-10-09 18:00:46 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2015-10-09 18:00:46 +0200
commit3b3664937bbee7434198e9cb4eb532dc1178cb50 (patch)
tree3b1dd187a74c9dde1210d1fd1194782d387aedd1 /helm-bookmark.el
parent4910ffdf627a2d048a1c001e4456afe8770a843d (diff)
Fix mode-line error when no bookmarks present in buffer (#1207).
* helm-bookmark.el (helm-source-bookmark-set): Use a dummy candidate.
Diffstat (limited to 'helm-bookmark.el')
-rw-r--r--helm-bookmark.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/helm-bookmark.el b/helm-bookmark.el
index 8cb147f8..bd65eff0 100644
--- a/helm-bookmark.el
+++ b/helm-bookmark.el
@@ -224,7 +224,16 @@
;;; bookmark-set
;;
(defvar helm-source-bookmark-set
- (helm-build-dummy-source "Set Bookmark" :action 'bookmark-set)
+ (helm-build-dummy-source "Set Bookmark"
+ :filtered-candidate-transformer
+ (lambda (_candidates _source)
+ (list (or (and (not (string= helm-pattern ""))
+ helm-pattern)
+ "Enter a bookmark name to record")))
+ :action '(("Set bookmark" . (lambda (candidate)
+ (if (string= helm-pattern "")
+ (message "No bookmark name given for record")
+ (bookmark-set candidate))))))
"See (info \"(emacs)Bookmarks\").")