diff options
-rw-r--r-- | attic/gnus.org (renamed from gnus.org) | 67 | ||||
-rw-r--r-- | email.org | 115 | ||||
-rw-r--r-- | org.org | 14 |
3 files changed, 96 insertions, 100 deletions
diff --git a/gnus.org b/attic/gnus.org index 26d477c..5631aec 100644 --- a/gnus.org +++ b/attic/gnus.org @@ -34,6 +34,31 @@ "Install hook when emacs exits before emacs asks to save this and that." (run-hooks 'before-kill-emacs-hook)) #+end_src +* Directories + #+begin_src emacs-lisp + (setq gnus-home-directory "~/.emacs.d/gnus" + gnus-directory gnus-home-directory) + + (defun jao-gnus-dir (dir) + (expand-file-name dir gnus-home-directory)) + + (setq smtpmail-queue-dir (jao-gnus-dir "Mail/queued-mail/")) + + (with-eval-after-load "gnus" + (setq mail-source-directory (jao-gnus-dir "Mail/") + message-auto-save-directory (jao-gnus-dir "Mail/drafts/") + message-directory (jao-gnus-dir "Mail/"))) + + (setq gnus-default-directory (expand-file-name "~") + gnus-startup-file (jao-gnus-dir "newsrc") + gnus-agent-directory (jao-gnus-dir "News/agent") + gnus-home-score-file (jao-gnus-dir "scores") + gnus-article-save-directory (jao-gnus-dir "saved/") + nntp-authinfo-file (jao-gnus-dir "authinfo") + nnmail-message-id-cache-file (jao-gnus-dir "nnmail-cache") + nndraft-directory (jao-gnus-dir "drafts") + nnrss-directory (jao-gnus-dir "rss")) + #+end_src * Looks *** Verbosity #+begin_src emacs-lisp @@ -217,6 +242,48 @@ '(setq message-draft-headers (remove 'Date message-draft-headers))) #+END_SRC * Add-ons +*** icalendar + #+begin_src emacs-lisp + (use-package gnus-icalendar + :demand t + :init (setq gnus-icalendar-org-capture-file + (expand-file-name "inbox.org" org-directory) + gnus-icalendar-org-capture-headline '("Appointments")) + :config (gnus-icalendar-org-setup)) + #+end_src +*** bbdb + #+begin_src emacs-lisp + (with-eval-after-load "bbdb" + (bbdb-initialize 'gnus 'message 'pgp 'mail) + (bbdb-mua-auto-update-init 'gnus) + (eval-after-load "gnus-sum" + '(progn + (define-key gnus-summary-mode-map ":" 'bbdb-mua-annotate-sender) + (define-key gnus-summary-mode-map ";" 'bbdb-mua-annotate-recipients)))) + #+end_src +*** randomsig + #+begin_src emacs-lisp + (with-eval-after-load "randomsig" + (with-eval-after-load "gnus-sum" + (define-key gnus-summary-save-map "-" + 'gnus/randomsig-summary-read-sig))) + #+end_src +*** notmuch -> gnus + #+begin_src emacs-lisp + (defun jao-notmuch-goto-message-in-gnus () + "Open a summary buffer containing the current notmuch article." + (interactive) + (let ((group (jao-maildir-file-to-group (notmuch-show-get-filename))) + (message-id (replace-regexp-in-string "^id:" + "" + (notmuch-show-get-message-id)))) + (if (and group message-id) + (org-gnus-follow-link group message-id) + (message "Couldn't get relevant infos for switching to Gnus.")))) + (eval-after-load "notmuch-show" + '(define-key notmuch-show-mode-map (kbd "C-c C-c") + #'jao-notmuch-goto-message-in-gnus)) + #+end_src *** gnus-recent #+begin_src emacs-lisp :load no (use-package gnus-recent @@ -145,12 +145,10 @@ (error "Message not sent"))))))) #+end_src *** Randomsig - #+BEGIN_SRC emacs-lisp + #+begin_src emacs-lisp (when (require 'randomsig nil t) (define-key message-mode-map (kbd "C-c s") 'randomsig-replace-sig) (define-key message-mode-map (kbd "C-c S") 'randomsig-select-sig) - (eval-after-load "gnus-sum" - '(define-key gnus-summary-save-map "-" 'gnus/randomsig-summary-read-sig)) (setq randomsig-dir (expand-file-name "~/etc/config/emacs")) (setq randomsig-files '("signatures.txt")) ;; or (setq randomsig-files (randomsig-search-sigfiles)) @@ -158,17 +156,17 @@ (setq message-signature 'randomsig-signature) (setq randomsig-delimiter-pattern "^%$" randomsig-delimiter "%")) - #+END_SRC + #+end_src *** Send mail hooks - #+BEGIN_SRC emacs-lisp + #+begin_src emacs-lisp (dolist (h '(jao-message-check-gcc jao-message-check-attachment jao-message-check-recipient jao-message-maybe-sign)) (add-hook 'message-send-hook h)) - #+END_SRC + #+end_src * sendmail/smtp - #+BEGIN_SRC emacs-lisp + #+begin_src emacs-lisp (require 'smtpmail) (defun jao-sendmail-gmail () @@ -181,36 +179,25 @@ (setq smtpmail-smtp-server "127.0.0.1") (setq smtpmail-smtp-service 25)) - ;; (jao-sendmail-gmail) (jao-sendmail-local) - #+END_SRC + #+end_src * mailcap - #+BEGIN_SRC emacs-lisp - (require 'mailcap) - - (add-to-list 'mailcap-mime-extensions '(".JPEG" . "image/jpeg")) - (add-to-list 'mailcap-mime-extensions '(".JPG" . "image/jpeg")) - - (let* ((apps (cdr (assoc "application" mailcap-mime-data))) - (apps (cl-remove-if (lambda (x) (string= (car x) "pdf")) apps))) - (setcdr (assoc "application" mailcap-mime-data) apps) - (mailcap-parse-mailcaps nil t)) - #+END_SRC -* frm #+begin_src emacs-lisp - (use-package jao-frm - :init (setq jao-frm-mail-command 'jao-open-gnus-frame)) - - (defun jao-frm--formatter (mbox n) - (apply #'format "%s/%s: %s" `(,@(last (split-string mbox "/") 2) ,n))) - - (defun jao-frm--show () - (interactive) - (jao-frm-show-mail-numbers #'jao-frm--formatter)) - - (global-set-key [(f12)] 'jao-frm--show) - (global-set-key [(f8)] 'jao-frm) + (use-package mailcap + :config + (add-to-list 'mailcap-mime-extensions '(".JPEG" . "image/jpeg")) + (add-to-list 'mailcap-mime-extensions '(".JPG" . "image/jpeg")) + + (defun jao-icalendar-import-buffer () + (let ((icalendar-import-format "%s%u%l")) + (icalendar-import-buffer diary-file)) + (kill-buffer)) + + :custom ((mailcap-user-mime-data + '((doc-view-mode "application/pdf" jao-browse-doc-use-emacs-p) + (jao-icalendar-import-buffer "application/ics") + ("zathura %s" "application/pdf"))))) #+end_src * bbdb #+begin_src emacs-lisp @@ -254,63 +241,18 @@ (add-hook 'bbdb-after-change-hook (lambda (arg) (bbdb-save))) (require 'bbdb-anniv) ;; BBDB 3.x this gets birthdays in org agenda ;; and diary - clever stuff - (add-hook 'diary-list-entries-hook 'bbdb-anniv-diary-entries) - (eval-after-load "gnus-sum" - '(progn - (define-key gnus-summary-mode-map ":" 'bbdb-mua-annotate-sender) - (define-key gnus-summary-mode-map ";" 'bbdb-mua-annotate-recipients)))) + (add-hook 'diary-list-entries-hook 'bbdb-anniv-diary-entries)) (require 'bbdb) - (bbdb-initialize 'gnus 'message 'pgp 'mail) - (bbdb-mua-auto-update-init 'gnus) - (setq bbdb-file (expand-file-name "bbdb" gnus-home-directory)) + (setq bbdb-file (expand-file-name "~/.emacs.d/bbdb")) + (bbdb-initialize 'message 'pgp 'mail) #+end_src * gnus -*** notmuch -> gnus - #+begin_src emacs-lisp - (defun jao-notmuch-goto-message-in-gnus () - "Open a summary buffer containing the current notmuch article." - (interactive) - (let ((group (jao-maildir-file-to-group (notmuch-show-get-filename))) - (message-id (replace-regexp-in-string "^id:" - "" - (notmuch-show-get-message-id)))) - (if (and group message-id) - (org-gnus-follow-link group message-id) - (message "Couldn't get relevant infos for switching to Gnus.")))) - #+end_src -*** gnus.el tangling - The core of Gnus's configuration is tangled to the usual ~gnus.el~ - from [[./gnus.org][gnus.org]]. - #+begin_src emacs-lisp - (defalias 'jao-open-gnus-frame 'jao-afio--goto-mail) - (setq gnus-init-file (jao-maybe-tangle "gnus")) + #+begin_src emacs-lisp + (setq gnus-init-file "~/.emacs.d/gnus.el" + gnus-home-directory "~/.emacs.d/gnus" + gnus-directory gnus-home-directory) #+end_src -*** Directories - #+begin_src emacs-lisp - (setq gnus-home-directory "~/.emacs.d/gnus" - gnus-directory gnus-home-directory) - - (defun jao-gnus-dir (dir) - (expand-file-name dir gnus-home-directory)) - - (setq smtpmail-queue-dir (jao-gnus-dir "Mail/queued-mail/")) - - (with-eval-after-load "gnus" - (setq mail-source-directory (jao-gnus-dir "Mail/") - message-auto-save-directory (jao-gnus-dir "Mail/drafts/") - message-directory (jao-gnus-dir "Mail/"))) - - (setq gnus-default-directory (expand-file-name "~") - gnus-startup-file (jao-gnus-dir "newsrc") - gnus-agent-directory (jao-gnus-dir "News/agent") - gnus-home-score-file (jao-gnus-dir "scores") - gnus-article-save-directory (jao-gnus-dir "saved/") - nntp-authinfo-file (jao-gnus-dir "authinfo") - nnmail-message-id-cache-file (jao-gnus-dir "nnmail-cache") - nndraft-directory (jao-gnus-dir "drafts") - nnrss-directory (jao-gnus-dir "rss")) - #+end_src * notmuch *** local path #+begin_src emacs-lisp @@ -575,8 +517,7 @@ (("h" . jao-notmuch-goto-index-buffer) ("i" . jao-notmuch-toggle-images) ("j" . jao-notmuch-saved-search-jump) - ("k" . jao-notmuch-tag-jump) - ("C-c C-c" . jao-notmuch-goto-message-in-gnus)))) + ("k" . jao-notmuch-tag-jump)))) #+end_src *** tree #+begin_src emacs-lisp @@ -23,7 +23,7 @@ '((gnus . (lambda (&optional x) (jao-open-gnus-frame))) (file . find-file-other-window)) org-log-done nil - org-modules '(bbdb bibtex gnus info eww eshell git-link) + org-modules '(bbdb bibtex info eww eshell git-link) org-odd-levels-only t org-outline-path-complete-in-steps nil org-refile-allow-creating-parent-nodes 'confirm @@ -87,16 +87,6 @@ (".*\\.djvu" . system) (t . emacs))) #+END_SRC -* Calendar - #+BEGIN_SRC emacs-lisp - (setq gnus-icalendar-org-capture-file - (expand-file-name "inbox.org" org-directory) - gnus-icalendar-org-capture-headline '("Appointments")) - (eval-after-load "gnus" - '(progn (require 'org-agenda) - (require 'gnus-icalendar) - (gnus-icalendar-org-setup))) - #+END_SRC * LaTeX #+begin_src emacs-lisp (use-package org-fragtog @@ -214,8 +204,6 @@ #+end_src * Links #+begin_src emacs-lisp - (require 'org-gnus nil t) - (require 'ol-gnus nil t) (require 'ol-eshell nil t) (require 'ol-bbdb nil t) (require 'ol-info nil t) |