branch: elpa/helm commit c5f055826a9d711a97a73096a9585a5fbd6c7b16 Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Fix quoting in more lambdas --- helm-bookmark.el | 8 ++++---- helm-color.el | 10 +++++----- helm-elisp.el | 6 +++--- helm-eval.el | 30 +++++++++++++++--------------- helm-files.el | 6 +++--- helm-font.el | 12 ++++++------ helm-info.el | 8 ++++---- helm-misc.el | 4 ++-- helm-mode.el | 18 +++++++++--------- helm-net.el | 39 ++++++++++++++++++++------------------- helm-packages.el | 12 ++++++------ helm-sys.el | 40 ++++++++++++++++++++-------------------- helm-types.el | 24 ++++++++++++------------ 13 files changed, 109 insertions(+), 108 deletions(-) diff --git a/helm-bookmark.el b/helm-bookmark.el index 0243fda325..bebba08670 100644 --- a/helm-bookmark.el +++ b/helm-bookmark.el @@ -237,10 +237,10 @@ will be honored." (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)))))) + :action `(("Set bookmark" . ,(lambda (candidate) + (if (string= helm-pattern "") + (message "No bookmark name given for record") + (bookmark-set candidate)))))) "See (info \"(emacs)Bookmarks\").") diff --git a/helm-color.el b/helm-color.el index ad54768812..8a0b6e898b 100644 --- a/helm-color.el +++ b/helm-color.el @@ -49,12 +49,12 @@ (intern (car (split-string candidate))) 'helm-describe-face)) :persistent-help "Describe face" - :action '(("Customize" - . (lambda (line) - (customize-face (intern (car (split-string line)))))) + :action `(("Customize" + . ,(lambda (line) + (customize-face (intern (car (split-string line)))))) ("Copy name" - . (lambda (line) - (kill-new (car (split-string line " " t))))))) + . ,(lambda (line) + (kill-new (car (split-string line " " t))))))) "See (info \"(emacs)Faces\")") ;;; Colors browser diff --git a/helm-elisp.el b/helm-elisp.el index a19f804af7..3ad1ea369c 100644 --- a/helm-elisp.el +++ b/helm-elisp.el @@ -632,9 +632,9 @@ is only used to test DEFAULT." . ,(lambda (candidate) (let ((sym (helm-symbolify candidate))) (set sym standard-value))))))) - '(("Customize variable" . - (lambda (candidate) - (customize-option (helm-symbolify candidate))))))) + `(("Customize variable" + . ,(lambda (candidate) + (customize-option (helm-symbolify candidate))))))) ((and val (with-helm-current-buffer (ring-p (symbol-value sym)))) (append actions '(("Clean ring" . helm-apropos-clean-ring)))) diff --git a/helm-eval.el b/helm-eval.el index 37fffef6f6..c03b67adde 100644 --- a/helm-eval.el +++ b/helm-eval.el @@ -106,14 +106,14 @@ Should take one arg: the string to display." (error "Error")))) :nohighlight t :keymap helm-eval-expression-map - :action '(("Copy result to kill-ring" . (lambda (candidate) - (kill-new - (replace-regexp-in-string - "\n" "" candidate)) - (message "Result copied to kill-ring"))) - ("copy sexp to kill-ring" . (lambda (_candidate) - (kill-new helm-input) - (message "Sexp copied to kill-ring")))))) + :action `(("Copy result to kill-ring" . ,(lambda (candidate) + (kill-new + (replace-regexp-in-string + "\n" "" candidate)) + (message "Result copied to kill-ring"))) + ("copy sexp to kill-ring" . ,(lambda (_candidate) + (kill-new helm-input) + (message "Sexp copied to kill-ring")))))) (defun helm-eval-new-line-and-indent () (interactive) @@ -174,13 +174,13 @@ Should take one arg: the string to display." result)) (error (cdr err))))) :nohighlight t - :action '(("Copy result to kill-ring" . (lambda (candidate) - (kill-new candidate) - (message "Result \"%s\" copied to kill-ring" - candidate))) - ("Copy operation to kill-ring" . (lambda (_candidate) - (kill-new helm-input) - (message "Calculation copied to kill-ring")))))) + :action `(("Copy result to kill-ring" . ,(lambda (candidate) + (kill-new candidate) + (message "Result \"%s\" copied to kill-ring" + candidate))) + ("Copy operation to kill-ring" . ,(lambda (_candidate) + (kill-new helm-input) + (message "Calculation copied to kill-ring")))))) ;;;###autoload (defun helm-eval-expression (arg) diff --git a/helm-files.el b/helm-files.el index c7f999596a..33dc1909d4 100644 --- a/helm-files.el +++ b/helm-files.el @@ -5724,9 +5724,9 @@ Use it for non-interactive calls of `helm-find-files'." (helm-append-at-nth actions `(("Find file to line number" - . (lambda (_candidate) - (find-file ,cand-no-linum) - (helm-goto-line (string-to-number ,linum) t)))) + . ,(lambda (_candidate) + (find-file cand-no-linum) + (helm-goto-line (string-to-number linum) t)))) 1)) (t actions)))) diff --git a/helm-font.el b/helm-font.el index b166d274d8..6e3cef5d67 100644 --- a/helm-font.el +++ b/helm-font.el @@ -78,12 +78,12 @@ ;; Save current font so it can be restored in cleanup (setq helm-previous-font (cdr (assq 'font (frame-parameters))))) :candidates 'helm-xfonts-cache - :action '(("Copy font to kill ring" . (lambda (elm) - (kill-new elm))) - ("Set font" . (lambda (elm) - (kill-new elm) - (set-frame-font elm 'keep-size) - (message "Font copied to kill ring")))) + :action `(("Copy font to kill ring" . ,(lambda (elm) + (kill-new elm))) + ("Set font" . ,(lambda (elm) + (kill-new elm) + (set-frame-font elm 'keep-size) + (message "Font copied to kill ring")))) :cleanup (lambda () ;; Restore previous font (set-frame-font helm-previous-font 'keep-size)) diff --git a/helm-info.el b/helm-info.el index 3cab78cdcb..df0fd7b38a 100644 --- a/helm-info.el +++ b/helm-info.el @@ -360,10 +360,10 @@ a prefix arg." (helm-build-sync-source "Info Pages" :init #'helm-info-pages-init :candidates (lambda () helm-info--pages-cache) - :action '(("Show with Info" . - (lambda (node-str) - (info (replace-regexp-in-string - "^[^:]+: " "" node-str))))) + :action `(("Show with Info" + . ,(lambda (node-str) + (info (replace-regexp-in-string + "^[^:]+: " "" node-str))))) :requires-pattern 2) "Helm source for Info pages.") diff --git a/helm-misc.el b/helm-misc.el index 621bf73694..53d0505bd2 100644 --- a/helm-misc.el +++ b/helm-misc.el @@ -43,8 +43,8 @@ :type 'string) (defcustom helm-timezone-actions - '(("Set timezone env (TZ)" . (lambda (candidate) - (setenv "TZ" candidate)))) + `(("Set timezone env (TZ)" . ,(lambda (candidate) + (setenv "TZ" candidate)))) "Actions for helm-timezone." :group 'helm-misc :type '(alist :key-type string :value-type function)) diff --git a/helm-mode.el b/helm-mode.el index 284d5c7baf..1e271d2447 100644 --- a/helm-mode.el +++ b/helm-mode.el @@ -819,10 +819,10 @@ that use `helm-comp-read'. See `helm-M-x' for example." ;; whatever (bug #2527). (setq must-match t)) (let ((action-fn `(("Sole action (Identity)" - . (lambda (candidate) - (if ,marked-candidates - (helm-marked-candidates) - (identity candidate))))))) + . ,(lambda (candidate) + (if marked-candidates + (helm-marked-candidates) + (identity candidate))))))) (let* ((minibuffer-completion-predicate test) (minibuffer-completion-table (or minibuffer-completion-table collection)) @@ -2057,11 +2057,11 @@ Keys description: '(helm-ff-update-when-only-one-matched helm-ff-auto-expand-to-home-or-root)) (let* ((action-fn `(("Sole action (Identity)" - . (lambda (candidate) - (if ,marked-candidates - (helm-marked-candidates - :with-wildcard t :all-sources ,all-marked) - (identity candidate)))))) + . ,(lambda (candidate) + (if marked-candidates + (helm-marked-candidates + :with-wildcard t :all-sources all-marked) + (identity candidate)))))) ;; Be sure we don't erase the underlying minibuffer if some. (helm-ff-auto-update-initial-value (and helm-ff-auto-update-initial-value diff --git a/helm-net.el b/helm-net.el index 706b23f31d..98baa66755 100644 --- a/helm-net.el +++ b/helm-net.el @@ -117,27 +117,28 @@ This is a format string, don't forget the `%s'." :group 'helm-net) (defcustom helm-google-suggest-actions - '(("Google Search" . helm-google-suggest-action) - ("Wikipedia" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-wikipedia-url - candidate))) - ("Youtube" . (lambda (candidate) + (helm-make-actions + "Google Search" 'helm-google-suggest-action + "Wikipedia" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-wikipedia-url + candidate)) + "Youtube" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-youtube-url + candidate)) + "IMDb" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-imdb-url + candidate)) + "Google Maps" (lambda (candidate) (helm-search-suggest-perform-additional-action - helm-search-suggest-action-youtube-url + helm-search-suggest-action-google-maps-url + candidate)) + "Google News" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-google-news-url candidate))) - ("IMDb" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-imdb-url - candidate))) - ("Google Maps" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-google-maps-url - candidate))) - ("Google News" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-google-news-url - candidate)))) "List of actions for google suggest sources." :group 'helm-net :type '(alist :key-type string :value-type function)) diff --git a/helm-packages.el b/helm-packages.el index 4e2999d3d9..181c128fc6 100644 --- a/helm-packages.el +++ b/helm-packages.el @@ -37,9 +37,9 @@ (find-file-target :initform #'helm-packages-quit-an-find-file) (filtered-candidate-transformer :initform - '(helm-packages-transformer - (lambda (candidates _source) - (sort candidates #'helm-generic-sort-fn)))) + `(helm-packages-transformer + ,(lambda (candidates _source) + (sort candidates #'helm-generic-sort-fn)))) (update :initform #'helm-packages--refresh-contents)) "A class to define `helm-packages' sources.") @@ -307,9 +307,9 @@ Arg PACKAGES is a list of strings." 'global (helm-fast-remove-dups (helm-finder--list-matches candidate)))) :filtered-candidate-transformer - (list #'helm-packages-transformer - (lambda (candidates _source) - (sort candidates #'helm-generic-sort-fn))) + `(helm-packages-transformer + ,(lambda (candidates _source) + (sort candidates #'helm-generic-sort-fn))) :action-transformer (lambda (actions candidate) (if (package-installed-p candidate) diff --git a/helm-sys.el b/helm-sys.el index 7ced9b1aa0..e382bdd313 100644 --- a/helm-sys.el +++ b/helm-sys.el @@ -221,26 +221,26 @@ Return empty string for non--valid candidates." Show actions only on line starting by a PID." (let ((disp (helm-get-selection nil t))) (cond ((string-match "\\` *[0-9]+" disp) - (list '("kill (SIGTERM)" . (lambda (_pid) - (helm-top-sh "TERM" (helm-top--marked-pids)))) - '("kill (SIGKILL)" . (lambda (_pid) - (helm-top-sh "KILL" (helm-top--marked-pids)))) - '("kill (SIGINT)" . (lambda (_pid) - (helm-top-sh "INT" (helm-top--marked-pids)))) - '("kill (Choose signal)" - . (lambda (_pid) - (let ((pids (helm-top--marked-pids))) - (helm-top-sh - (helm-comp-read (format "Kill %d pids with signal: " - (length pids)) - '("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL" - "PROF" "TERM" "USR1" "USR2" "VTALRM" - "STKFLT" "PWR" "WINCH" "CHLD" "URG" - "TSTP" "TTIN" "TTOU" "STOP" "CONT" - "ABRT" "FPE" "ILL" "QUIT" "SEGV" - "TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ") - :must-match t) - pids)))))) + `(("kill (SIGTERM)" . ,(lambda (_pid) + (helm-top-sh "TERM" (helm-top--marked-pids)))) + ("kill (SIGKILL)" . ,(lambda (_pid) + (helm-top-sh "KILL" (helm-top--marked-pids)))) + ("kill (SIGINT)" . ,(lambda (_pid) + (helm-top-sh "INT" (helm-top--marked-pids)))) + ("kill (Choose signal)" + . ,(lambda (_pid) + (let ((pids (helm-top--marked-pids))) + (helm-top-sh + (helm-comp-read (format "Kill %d pids with signal: " + (length pids)) + '("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL" + "PROF" "TERM" "USR1" "USR2" "VTALRM" + "STKFLT" "PWR" "WINCH" "CHLD" "URG" + "TSTP" "TTIN" "TTOU" "STOP" "CONT" + "ABRT" "FPE" "ILL" "QUIT" "SEGV" + "TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ") + :must-match t) + pids)))))) (t actions)))) (defun helm-top--marked-pids () diff --git a/helm-types.el b/helm-types.el index 2caaab1a57..7c3547c000 100644 --- a/helm-types.el +++ b/helm-types.el @@ -300,18 +300,18 @@ "A class to define helm type timers.") (defcustom helm-type-timers-actions - '(("Cancel Timer" . (lambda (_timer) - (let ((mkd (helm-marked-candidates))) - (cl-loop for timer in mkd - do (cancel-timer timer))))) - ("Describe Function" . (lambda (tm) - (describe-function (timer--function tm)))) - ("Find Function" . (lambda (tm) - (helm-aif (timer--function tm) - (if (or (byte-code-function-p it) - (helm-subr-native-elisp-p it)) - (message "Can't find anonymous function `%s'" it) - (find-function it)))))) + `(("Cancel Timer" . ,(lambda (_timer) + (let ((mkd (helm-marked-candidates))) + (cl-loop for timer in mkd + do (cancel-timer timer))))) + ("Describe Function" . ,(lambda (tm) + (describe-function (timer--function tm)))) + ("Find Function" . ,(lambda (tm) + (helm-aif (timer--function tm) + (if (or (byte-code-function-p it) + (helm-subr-native-elisp-p it)) + (message "Can't find anonymous function `%s'" it) + (find-function it)))))) "Default actions for type timers." :group 'helm-elisp :type '(alist :key-type string :value-type function))