Skip to content

Commit c5f0558

Browse files
Fix quoting in more lambdas
1 parent 5aeff88 commit c5f0558

13 files changed

+109
-108
lines changed

Diff for: helm-bookmark.el

+4-4
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ will be honored."
237237
(list (or (and (not (string= helm-pattern ""))
238238
helm-pattern)
239239
"Enter a bookmark name to record")))
240-
:action '(("Set bookmark" . (lambda (candidate)
241-
(if (string= helm-pattern "")
242-
(message "No bookmark name given for record")
243-
(bookmark-set candidate))))))
240+
:action `(("Set bookmark" . ,(lambda (candidate)
241+
(if (string= helm-pattern "")
242+
(message "No bookmark name given for record")
243+
(bookmark-set candidate))))))
244244
"See (info \"(emacs)Bookmarks\").")
245245

246246

Diff for: helm-color.el

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
(intern (car (split-string candidate)))
5050
'helm-describe-face))
5151
:persistent-help "Describe face"
52-
:action '(("Customize"
53-
. (lambda (line)
54-
(customize-face (intern (car (split-string line))))))
52+
:action `(("Customize"
53+
. ,(lambda (line)
54+
(customize-face (intern (car (split-string line))))))
5555
("Copy name"
56-
. (lambda (line)
57-
(kill-new (car (split-string line " " t)))))))
56+
. ,(lambda (line)
57+
(kill-new (car (split-string line " " t)))))))
5858
"See (info \"(emacs)Faces\")")
5959

6060
;;; Colors browser

Diff for: helm-elisp.el

+3-3
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,9 @@ is only used to test DEFAULT."
632632
. ,(lambda (candidate)
633633
(let ((sym (helm-symbolify candidate)))
634634
(set sym standard-value)))))))
635-
'(("Customize variable" .
636-
(lambda (candidate)
637-
(customize-option (helm-symbolify candidate)))))))
635+
`(("Customize variable"
636+
. ,(lambda (candidate)
637+
(customize-option (helm-symbolify candidate)))))))
638638
((and val (with-helm-current-buffer (ring-p (symbol-value sym))))
639639
(append actions
640640
'(("Clean ring" . helm-apropos-clean-ring))))

Diff for: helm-eval.el

+15-15
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ Should take one arg: the string to display."
106106
(error "Error"))))
107107
:nohighlight t
108108
:keymap helm-eval-expression-map
109-
:action '(("Copy result to kill-ring" . (lambda (candidate)
110-
(kill-new
111-
(replace-regexp-in-string
112-
"\n" "" candidate))
113-
(message "Result copied to kill-ring")))
114-
("copy sexp to kill-ring" . (lambda (_candidate)
115-
(kill-new helm-input)
116-
(message "Sexp copied to kill-ring"))))))
109+
:action `(("Copy result to kill-ring" . ,(lambda (candidate)
110+
(kill-new
111+
(replace-regexp-in-string
112+
"\n" "" candidate))
113+
(message "Result copied to kill-ring")))
114+
("copy sexp to kill-ring" . ,(lambda (_candidate)
115+
(kill-new helm-input)
116+
(message "Sexp copied to kill-ring"))))))
117117

118118
(defun helm-eval-new-line-and-indent ()
119119
(interactive)
@@ -174,13 +174,13 @@ Should take one arg: the string to display."
174174
result))
175175
(error (cdr err)))))
176176
:nohighlight t
177-
:action '(("Copy result to kill-ring" . (lambda (candidate)
178-
(kill-new candidate)
179-
(message "Result \"%s\" copied to kill-ring"
180-
candidate)))
181-
("Copy operation to kill-ring" . (lambda (_candidate)
182-
(kill-new helm-input)
183-
(message "Calculation copied to kill-ring"))))))
177+
:action `(("Copy result to kill-ring" . ,(lambda (candidate)
178+
(kill-new candidate)
179+
(message "Result \"%s\" copied to kill-ring"
180+
candidate)))
181+
("Copy operation to kill-ring" . ,(lambda (_candidate)
182+
(kill-new helm-input)
183+
(message "Calculation copied to kill-ring"))))))
184184

185185
;;;###autoload
186186
(defun helm-eval-expression (arg)

Diff for: helm-files.el

+3-3
Original file line numberDiff line numberDiff line change
@@ -5724,9 +5724,9 @@ Use it for non-interactive calls of `helm-find-files'."
57245724
(helm-append-at-nth
57255725
actions
57265726
`(("Find file to line number"
5727-
. (lambda (_candidate)
5728-
(find-file ,cand-no-linum)
5729-
(helm-goto-line (string-to-number ,linum) t))))
5727+
. ,(lambda (_candidate)
5728+
(find-file cand-no-linum)
5729+
(helm-goto-line (string-to-number linum) t))))
57305730
1))
57315731
(t actions))))
57325732

Diff for: helm-font.el

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@
7878
;; Save current font so it can be restored in cleanup
7979
(setq helm-previous-font (cdr (assq 'font (frame-parameters)))))
8080
:candidates 'helm-xfonts-cache
81-
:action '(("Copy font to kill ring" . (lambda (elm)
82-
(kill-new elm)))
83-
("Set font" . (lambda (elm)
84-
(kill-new elm)
85-
(set-frame-font elm 'keep-size)
86-
(message "Font copied to kill ring"))))
81+
:action `(("Copy font to kill ring" . ,(lambda (elm)
82+
(kill-new elm)))
83+
("Set font" . ,(lambda (elm)
84+
(kill-new elm)
85+
(set-frame-font elm 'keep-size)
86+
(message "Font copied to kill ring"))))
8787
:cleanup (lambda ()
8888
;; Restore previous font
8989
(set-frame-font helm-previous-font 'keep-size))

Diff for: helm-info.el

+4-4
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,10 @@ a prefix arg."
360360
(helm-build-sync-source "Info Pages"
361361
:init #'helm-info-pages-init
362362
:candidates (lambda () helm-info--pages-cache)
363-
:action '(("Show with Info" .
364-
(lambda (node-str)
365-
(info (replace-regexp-in-string
366-
"^[^:]+: " "" node-str)))))
363+
:action `(("Show with Info"
364+
. ,(lambda (node-str)
365+
(info (replace-regexp-in-string
366+
"^[^:]+: " "" node-str)))))
367367
:requires-pattern 2)
368368
"Helm source for Info pages.")
369369

Diff for: helm-misc.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
:type 'string)
4444

4545
(defcustom helm-timezone-actions
46-
'(("Set timezone env (TZ)" . (lambda (candidate)
47-
(setenv "TZ" candidate))))
46+
`(("Set timezone env (TZ)" . ,(lambda (candidate)
47+
(setenv "TZ" candidate))))
4848
"Actions for helm-timezone."
4949
:group 'helm-misc
5050
:type '(alist :key-type string :value-type function))

Diff for: helm-mode.el

+9-9
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,10 @@ that use `helm-comp-read'. See `helm-M-x' for example."
819819
;; whatever (bug #2527).
820820
(setq must-match t))
821821
(let ((action-fn `(("Sole action (Identity)"
822-
. (lambda (candidate)
823-
(if ,marked-candidates
824-
(helm-marked-candidates)
825-
(identity candidate)))))))
822+
. ,(lambda (candidate)
823+
(if marked-candidates
824+
(helm-marked-candidates)
825+
(identity candidate)))))))
826826
(let* ((minibuffer-completion-predicate test)
827827
(minibuffer-completion-table
828828
(or minibuffer-completion-table collection))
@@ -2057,11 +2057,11 @@ Keys description:
20572057
'(helm-ff-update-when-only-one-matched
20582058
helm-ff-auto-expand-to-home-or-root))
20592059
(let* ((action-fn `(("Sole action (Identity)"
2060-
. (lambda (candidate)
2061-
(if ,marked-candidates
2062-
(helm-marked-candidates
2063-
:with-wildcard t :all-sources ,all-marked)
2064-
(identity candidate))))))
2060+
. ,(lambda (candidate)
2061+
(if marked-candidates
2062+
(helm-marked-candidates
2063+
:with-wildcard t :all-sources all-marked)
2064+
(identity candidate))))))
20652065
;; Be sure we don't erase the underlying minibuffer if some.
20662066
(helm-ff-auto-update-initial-value
20672067
(and helm-ff-auto-update-initial-value

Diff for: helm-net.el

+20-19
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,28 @@ This is a format string, don't forget the `%s'."
117117
:group 'helm-net)
118118

119119
(defcustom helm-google-suggest-actions
120-
'(("Google Search" . helm-google-suggest-action)
121-
("Wikipedia" . (lambda (candidate)
122-
(helm-search-suggest-perform-additional-action
123-
helm-search-suggest-action-wikipedia-url
124-
candidate)))
125-
("Youtube" . (lambda (candidate)
120+
(helm-make-actions
121+
"Google Search" 'helm-google-suggest-action
122+
"Wikipedia" (lambda (candidate)
123+
(helm-search-suggest-perform-additional-action
124+
helm-search-suggest-action-wikipedia-url
125+
candidate))
126+
"Youtube" (lambda (candidate)
127+
(helm-search-suggest-perform-additional-action
128+
helm-search-suggest-action-youtube-url
129+
candidate))
130+
"IMDb" (lambda (candidate)
131+
(helm-search-suggest-perform-additional-action
132+
helm-search-suggest-action-imdb-url
133+
candidate))
134+
"Google Maps" (lambda (candidate)
126135
(helm-search-suggest-perform-additional-action
127-
helm-search-suggest-action-youtube-url
136+
helm-search-suggest-action-google-maps-url
137+
candidate))
138+
"Google News" (lambda (candidate)
139+
(helm-search-suggest-perform-additional-action
140+
helm-search-suggest-action-google-news-url
128141
candidate)))
129-
("IMDb" . (lambda (candidate)
130-
(helm-search-suggest-perform-additional-action
131-
helm-search-suggest-action-imdb-url
132-
candidate)))
133-
("Google Maps" . (lambda (candidate)
134-
(helm-search-suggest-perform-additional-action
135-
helm-search-suggest-action-google-maps-url
136-
candidate)))
137-
("Google News" . (lambda (candidate)
138-
(helm-search-suggest-perform-additional-action
139-
helm-search-suggest-action-google-news-url
140-
candidate))))
141142
"List of actions for google suggest sources."
142143
:group 'helm-net
143144
:type '(alist :key-type string :value-type function))

Diff for: helm-packages.el

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
(find-file-target :initform #'helm-packages-quit-an-find-file)
3838
(filtered-candidate-transformer
3939
:initform
40-
'(helm-packages-transformer
41-
(lambda (candidates _source)
42-
(sort candidates #'helm-generic-sort-fn))))
40+
`(helm-packages-transformer
41+
,(lambda (candidates _source)
42+
(sort candidates #'helm-generic-sort-fn))))
4343
(update :initform #'helm-packages--refresh-contents))
4444
"A class to define `helm-packages' sources.")
4545

@@ -307,9 +307,9 @@ Arg PACKAGES is a list of strings."
307307
'global (helm-fast-remove-dups
308308
(helm-finder--list-matches candidate))))
309309
:filtered-candidate-transformer
310-
(list #'helm-packages-transformer
311-
(lambda (candidates _source)
312-
(sort candidates #'helm-generic-sort-fn)))
310+
`(helm-packages-transformer
311+
,(lambda (candidates _source)
312+
(sort candidates #'helm-generic-sort-fn)))
313313
:action-transformer
314314
(lambda (actions candidate)
315315
(if (package-installed-p candidate)

Diff for: helm-sys.el

+20-20
Original file line numberDiff line numberDiff line change
@@ -221,26 +221,26 @@ Return empty string for non--valid candidates."
221221
Show actions only on line starting by a PID."
222222
(let ((disp (helm-get-selection nil t)))
223223
(cond ((string-match "\\` *[0-9]+" disp)
224-
(list '("kill (SIGTERM)" . (lambda (_pid)
225-
(helm-top-sh "TERM" (helm-top--marked-pids))))
226-
'("kill (SIGKILL)" . (lambda (_pid)
227-
(helm-top-sh "KILL" (helm-top--marked-pids))))
228-
'("kill (SIGINT)" . (lambda (_pid)
229-
(helm-top-sh "INT" (helm-top--marked-pids))))
230-
'("kill (Choose signal)"
231-
. (lambda (_pid)
232-
(let ((pids (helm-top--marked-pids)))
233-
(helm-top-sh
234-
(helm-comp-read (format "Kill %d pids with signal: "
235-
(length pids))
236-
'("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL"
237-
"PROF" "TERM" "USR1" "USR2" "VTALRM"
238-
"STKFLT" "PWR" "WINCH" "CHLD" "URG"
239-
"TSTP" "TTIN" "TTOU" "STOP" "CONT"
240-
"ABRT" "FPE" "ILL" "QUIT" "SEGV"
241-
"TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ")
242-
:must-match t)
243-
pids))))))
224+
`(("kill (SIGTERM)" . ,(lambda (_pid)
225+
(helm-top-sh "TERM" (helm-top--marked-pids))))
226+
("kill (SIGKILL)" . ,(lambda (_pid)
227+
(helm-top-sh "KILL" (helm-top--marked-pids))))
228+
("kill (SIGINT)" . ,(lambda (_pid)
229+
(helm-top-sh "INT" (helm-top--marked-pids))))
230+
("kill (Choose signal)"
231+
. ,(lambda (_pid)
232+
(let ((pids (helm-top--marked-pids)))
233+
(helm-top-sh
234+
(helm-comp-read (format "Kill %d pids with signal: "
235+
(length pids))
236+
'("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL"
237+
"PROF" "TERM" "USR1" "USR2" "VTALRM"
238+
"STKFLT" "PWR" "WINCH" "CHLD" "URG"
239+
"TSTP" "TTIN" "TTOU" "STOP" "CONT"
240+
"ABRT" "FPE" "ILL" "QUIT" "SEGV"
241+
"TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ")
242+
:must-match t)
243+
pids))))))
244244
(t actions))))
245245

246246
(defun helm-top--marked-pids ()

Diff for: helm-types.el

+12-12
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,18 @@
300300
"A class to define helm type timers.")
301301

302302
(defcustom helm-type-timers-actions
303-
'(("Cancel Timer" . (lambda (_timer)
304-
(let ((mkd (helm-marked-candidates)))
305-
(cl-loop for timer in mkd
306-
do (cancel-timer timer)))))
307-
("Describe Function" . (lambda (tm)
308-
(describe-function (timer--function tm))))
309-
("Find Function" . (lambda (tm)
310-
(helm-aif (timer--function tm)
311-
(if (or (byte-code-function-p it)
312-
(helm-subr-native-elisp-p it))
313-
(message "Can't find anonymous function `%s'" it)
314-
(find-function it))))))
303+
`(("Cancel Timer" . ,(lambda (_timer)
304+
(let ((mkd (helm-marked-candidates)))
305+
(cl-loop for timer in mkd
306+
do (cancel-timer timer)))))
307+
("Describe Function" . ,(lambda (tm)
308+
(describe-function (timer--function tm))))
309+
("Find Function" . ,(lambda (tm)
310+
(helm-aif (timer--function tm)
311+
(if (or (byte-code-function-p it)
312+
(helm-subr-native-elisp-p it))
313+
(message "Can't find anonymous function `%s'" it)
314+
(find-function it))))))
315315
"Default actions for type timers."
316316
:group 'helm-elisp
317317
:type '(alist :key-type string :value-type function))

0 commit comments

Comments
 (0)