[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb 269a8a8 363/449: New function gnorb-install-defau

From: Stefan Monnier
Subject: [elpa] externals/gnorb 269a8a8 363/449: New function gnorb-install-defaults
Date: Fri, 27 Nov 2020 23:16:12 -0500 (EST)

branch: externals/gnorb
commit 269a8a82216a1e7309891b2e0af0e0d5dc879442
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    New function gnorb-install-defaults
    * packages/gnorb/gnorb-utils.el (gnorb-install-defaults): A function
      for setting up basic default variable settings and keybindings for
 gnorb-utils.el | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnorb-utils.el b/gnorb-utils.el
index ce3f7fd..43ff5fc 100644
--- a/gnorb-utils.el
+++ b/gnorb-utils.el
@@ -611,5 +611,48 @@ registry be in use, and should be called after the call to
      (add-hook 'org-capture-prepare-finalize-hook 
      (setq gnorb-tracking-enabled t))))
+(defun gnorb-install-defaults ()
+  "Set up sane Gnorb customizations and keybindings."
+  (interactive)
+  (global-set-key (kbd "C-c A") 'gnorb-restore-layout)
+  (eval-after-load "gnorb-bbdb"
+    '(progn
+       (define-key bbdb-mode-map (kbd "C-c S") #'gnorb-bbdb-mail-search)
+       (define-key bbdb-mode-map (kbd "C-c l") #'gnorb-bbdb-open-link)
+       (define-key bbdb-mode-map [remap bbdb-mail] #'gnorb-bbdb-mail)
+       (eval-after-load "gnorb-org"
+        (org-defkey org-mode-map (kbd "C-c C") #'gnorb-org-contact-link))))
+  (eval-after-load "gnorb-org"
+    '(progn
+       (org-defkey org-mode-map (kbd "C-c t") #'gnorb-org-handle-mail)
+       (org-defkey org-mode-map (kbd "C-c v") #'gnorb-org-view)
+       (org-defkey org-mode-map (kbd "C-c E") #'gnorb-org-email-subtree)
+       (setq gnorb-org-agenda-popup-bbdb t)
+       (eval-after-load "org-agenda"
+         '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") 
+                 (org-defkey org-agenda-mode-map (kbd "C-c v") 
+  (eval-after-load "gnorb-gnus"
+    '(progn
+       (define-key gnus-summary-mime-map "a" #'gnorb-gnus-article-org-attach)
+       (define-key gnus-summary-mode-map (kbd "C-c t") 
+       (define-key gnus-summary-mode-map (kbd "C-c v") #'gnorb-gnus-view)
+       (setq gnorb-gnus-capture-always-attach t)
+       (push '("attach to org heading" . gnorb-gnus-mime-org-attach)
+             gnus-mime-action-alist)
+       ;; The only way to add mime button command keys is by redefining
+       ;; gnus-mime-button-map, possibly not ideal. Ideal would be a
+       ;; setter function in gnus itself.
+       (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading")
+             gnus-mime-button-commands)
+       (setq gnus-mime-button-map
+             (let ((map (make-sparse-keymap)))
+               (dolist (c gnus-mime-button-commands)
+                 (define-key map (cadr c) (car c)))
+               map))))
+  (eval-after-load "message"
+    '(progn
+       (define-key message-mode-map (kbd "C-c t") 
 (provide 'gnorb-utils)
 ;;; gnorb-utils.el ends here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]