mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
emacs: use closures instead of backquoted lambdas
This commit is contained in:
parent
d25dafb4c2
commit
27c8e377e4
3 changed files with 23 additions and 21 deletions
|
@ -869,15 +869,15 @@ Supports the following entries in OPTIONS as a plist:
|
||||||
(start (point)))
|
(start (point)))
|
||||||
(if is-hidden
|
(if is-hidden
|
||||||
(widget-create 'push-button
|
(widget-create 'push-button
|
||||||
:notify `(lambda (widget &rest _ignore)
|
:notify (lambda (&rest _ignore)
|
||||||
(setq notmuch-hello-hidden-sections
|
(setq notmuch-hello-hidden-sections
|
||||||
(delete ,title notmuch-hello-hidden-sections))
|
(delete title notmuch-hello-hidden-sections))
|
||||||
(notmuch-hello-update))
|
(notmuch-hello-update))
|
||||||
"show")
|
"show")
|
||||||
(widget-create 'push-button
|
(widget-create 'push-button
|
||||||
:notify `(lambda (widget &rest _ignore)
|
:notify (lambda (&rest _ignore)
|
||||||
(add-to-list 'notmuch-hello-hidden-sections
|
(add-to-list 'notmuch-hello-hidden-sections
|
||||||
,title)
|
title)
|
||||||
(notmuch-hello-update))
|
(notmuch-hello-update))
|
||||||
"hide"))
|
"hide"))
|
||||||
(widget-insert "\n")
|
(widget-insert "\n")
|
||||||
|
|
|
@ -50,11 +50,11 @@ fast way to jump to a saved search from anywhere in Notmuch."
|
||||||
(push (list key name
|
(push (list key name
|
||||||
(cond
|
(cond
|
||||||
((eq (plist-get saved-search :search-type) 'tree)
|
((eq (plist-get saved-search :search-type) 'tree)
|
||||||
`(lambda () (notmuch-tree ',query)))
|
(lambda () (notmuch-tree query)))
|
||||||
((eq (plist-get saved-search :search-type) 'unthreaded)
|
((eq (plist-get saved-search :search-type) 'unthreaded)
|
||||||
`(lambda () (notmuch-unthreaded ',query)))
|
(lambda () (notmuch-unthreaded query)))
|
||||||
(t
|
(t
|
||||||
`(lambda () (notmuch-search ',query ',oldest-first)))))
|
(lambda () (notmuch-search query oldest-first)))))
|
||||||
action-map)))))
|
action-map)))))
|
||||||
(setq action-map (nreverse action-map))
|
(setq action-map (nreverse action-map))
|
||||||
(if action-map
|
(if action-map
|
||||||
|
@ -168,8 +168,9 @@ buffer."
|
||||||
(pcase-dolist (`(,key ,_name ,fn) action-map)
|
(pcase-dolist (`(,key ,_name ,fn) action-map)
|
||||||
(when (= (length key) 1)
|
(when (= (length key) 1)
|
||||||
(define-key map key
|
(define-key map key
|
||||||
`(lambda () (interactive)
|
(lambda ()
|
||||||
(setq notmuch-jump--action ',fn)
|
(interactive)
|
||||||
|
(setq notmuch-jump--action fn)
|
||||||
(exit-minibuffer)))))
|
(exit-minibuffer)))))
|
||||||
;; By doing this in two passes (and checking if we already have a
|
;; By doing this in two passes (and checking if we already have a
|
||||||
;; binding) we avoid problems if the user specifies a binding which
|
;; binding) we avoid problems if the user specifies a binding which
|
||||||
|
@ -191,9 +192,10 @@ buffer."
|
||||||
action-submap)
|
action-submap)
|
||||||
(setq action-submap (nreverse action-submap))
|
(setq action-submap (nreverse action-submap))
|
||||||
(define-key map keystr
|
(define-key map keystr
|
||||||
`(lambda () (interactive)
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
(setq notmuch-jump--action
|
(setq notmuch-jump--action
|
||||||
',(apply-partially #'notmuch-jump
|
(apply-partially #'notmuch-jump
|
||||||
action-submap
|
action-submap
|
||||||
new-prompt))
|
new-prompt))
|
||||||
(exit-minibuffer)))))))
|
(exit-minibuffer)))))))
|
||||||
|
|
|
@ -553,7 +553,7 @@ and vice versa."
|
||||||
name)
|
name)
|
||||||
(mapconcat #'identity tag-change " "))))
|
(mapconcat #'identity tag-change " "))))
|
||||||
(push (list key name-string
|
(push (list key name-string
|
||||||
`(lambda () (,tag-function ',tag-change)))
|
(lambda () (funcall tag-function tag-change)))
|
||||||
action-map)))
|
action-map)))
|
||||||
(push (list notmuch-tag-jump-reverse-key
|
(push (list notmuch-tag-jump-reverse-key
|
||||||
(if reverse
|
(if reverse
|
||||||
|
|
Loading…
Reference in a new issue