diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-11-10 17:07:39 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-11-10 17:15:29 +0100 |
commit | d6dfb8f1e3a7b476e2ac0a413c34ecd8fd6d2d50 (patch) | |
tree | f30c4f7c818dff41d1b8e797a53c3ffb6c735c29 | |
parent | 091ffe843674480ea1cc7b0ed389ee79a92baa3c (diff) |
Ensure action is available before running it
and bind helm-bookmark-jump-other-frame to helm-only.
* helm.el (helm-exit-and-execute-action): Do it.
* helm-bookmark.el (helm-bookmark-find-files-map): No need now to bind
action to ignore.
-rw-r--r-- | helm-bookmark.el | 2 | ||||
-rw-r--r-- | helm.el | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/helm-bookmark.el b/helm-bookmark.el index a3c0bb8b..0c7af085 100644 --- a/helm-bookmark.el +++ b/helm-bookmark.el @@ -451,7 +451,6 @@ than `w3m-browse-url' use it." (defvar helm-bookmark-find-files-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-bookmark-map) - (define-key map (kbd "C-c o") 'ignore) (define-key map (kbd "C-x C-d") 'helm-bookmark-run-browse-project) map)) @@ -676,6 +675,7 @@ words from the buffer into the new bookmark name." (interactive) (with-helm-alive-p (helm-exit-and-execute-action 'helm-bookmark-jump-other-frame))) +(put 'helm-bookmark-run-jump-other-frame 'helm-only t) (defun helm-bookmark-run-jump-other-window () "Jump to bookmark from keyboard." @@ -1899,6 +1899,12 @@ and part of the actions of current source. Use this on commands invoked from key-bindings, but not on action functions invoked as action from the action menu, i.e functions called with RET." + ;; If ACTION is not an action available in source action attribute, + ;; return an error. + (let ((actions (helm-attr 'action nil t))) + (when actions + (cl-assert (or (eq action actions) (rassq action actions)) + nil "No such action `%s' for this source" action))) (setq helm-saved-action action) (setq helm-saved-selection (or (helm-get-selection) "")) (setq helm--executing-helm-action t) |