about summary refs log tree commit diff
path: root/tools/emacs/config/bindings.el
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-04-02T00·35+0100
committerVincent Ambo <tazjin@google.com>2020-04-02T00·35+0100
commit40d13cc87f2e35cab5c5428f259153690cd58733 (patch)
treedce80f8a66a36418e570f92a17542863c5a4b31f /tools/emacs/config/bindings.el
parent5aaeaa406a5d84b9408746988beb6a5d682d797f (diff)
feat(tools/emacs): Bindings for (un)collapsing notmuch subthreads r/608
Modifies notmuch-show-open-or-close-subthread to take a parameter
instead of using prefix to toggle the argument, and binds that
function to C-, and C-. in notmuch-show-mode-map to enable convenient
collapsing/uncollapsing of subthreads from point.
Diffstat (limited to 'tools/emacs/config/bindings.el')
-rw-r--r--tools/emacs/config/bindings.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/emacs/config/bindings.el b/tools/emacs/config/bindings.el
index e77af33895..f66a6ab551 100644
--- a/tools/emacs/config/bindings.el
+++ b/tools/emacs/config/bindings.el
@@ -41,4 +41,14 @@
 ;; Insert TODO comments
 (global-set-key (kbd "C-c t") 'insert-todo-comment)
 
+;; Add subthread collapsing to notmuch-show.
+;;
+;; C-, closes a thread, C-. opens a thread. This mirrors stepping
+;; in/out of definitions.
+(define-key notmuch-show-mode-map (kbd "C-,") 'notmuch-show-open-or-close-subthread)
+(define-key notmuch-show-mode-map (kbd "C-.")
+  (lambda ()
+    (interactive)
+    (notmuch-show-open-or-close-subthread t))) ;; open
+
 (provide 'bindings)