(setq org-src-tab-acts-natively t
org-src-preserve-indentation nil
org-edit-src-content-indentation 0
+ org-email-link-description-format "Email %c: %s" ; %.30s
org-log-done 'time)
+ :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link))
:hook ((org-mode . org-indent-mode)
(org-mode . auto-fill-mode)
(org-mode . flyspell-mode))
(use-package ox-beamer)
-(use-package org-notmuch
- :after (:any org notmuch))
-
(use-package orgalist
:hook (message-mode . orgalist-mode))
#+end_src
("s-r" . counsel-recentf)
("C-c x" . counsel-M-x)
("C-c f ." . counsel-find-file)
- ("C-c f r" . counsel-recentf)
:map minibuffer-local-map
("C-r" . counsel-minibuffer-history))
:config
#+begin_src emacs-lisp
(eval-when-compile (defvar lean-mode-map))
(use-package lean-mode
- :defer 2
+ :defer 1
:bind (:map lean-mode-map
("S-SPC" . company-complete))
:config
(require 'lean-input)
- (setq default-input-method "Lean"))
+ (setq default-input-method "Lean"
+ lean-input-tweak-all '(lean-input-compose
+ (lean-input-prepend "/")
+ (lean-input-nonempty))
+ lean-input-user-translations '(("/" "/")))
+ (lean-input-setup))
#+end_src
** Haskell
*** meghanada
-#+begin_src emacs-lisp :tangle yes
+#+begin_src emacs-lisp :tangle no
(use-package meghanada
:bind
(:map meghanada-mode-map
*** lsp-java
+#+begin_comment
+dependencies:
+
+ace-window
+avy
+bui
+company-lsp
+dap-mode
+lsp-java
+lsp-mode
+lsp-ui
+pfuture
+tree-mode
+treemacs
+#+end_comment
+
#+begin_src emacs-lisp :tangle no
-(use-package treemacs)
+(use-package treemacs
+ :config (setq treemacs-never-persist t))
(use-package yasnippet
:config
:bind (("C-c d" . crux-duplicate-current-line-or-region)
("C-c M-d" . crux-duplicate-and-comment-current-line-or-region)
("C-c b K" . crux-kill-other-buffers)
- ("C-c f c" . crux-copy-file-preserve-attributes)
+ ("C-c f C" . crux-copy-file-preserve-attributes)
("C-c f D" . crux-delete-file-and-buffer)
("C-c f R" . crux-rename-file-and-buffer)
("C-S-j" . crux-top-join-line)
#+begin_src emacs-lisp
(use-package highlight-indent-guides
- :demand t
+ :defer 2
:hook ((prog-mode . highlight-indent-guides-mode)
;; (org-mode . highlight-indent-guides-mode)
)
** Gnus
-#+begin_src emacs-lisp :tangle yes
-(setq amin-gnus-init-file (no-littering-expand-etc-file-name "gnus"))
+#+begin_src emacs-lisp
+(setq
+ amin-gnus-init-file (no-littering-expand-etc-file-name "gnus")
+ mail-user-agent 'gnus-user-agent
+ read-mail-command 'gnus)
(use-package gnus
- :bind ("s-m" . gnus)
+ :bind (("s-m" . gnus)
+ ("s-M" . gnus-unplugged))
:init
(setq
- gnus-select-method
- '(nnimap "local"
- (nnimap-address "localhost")
- (nnimap-stream shell))
- nnimap-shell-program "/usr/lib/dovecot/imap -o mail_location=maildir:$MAILDIR/amin:LAYOUT=fs:INBOX=$MAILDIR/amin/Inbox"
- ;; gnus-init-file amin-gnus-init-file
+ gnus-select-method '(nnnil "")
+ gnus-secondary-select-methods
+ '((nnimap "amin"
+ (nnimap-stream plain)
+ (nnimap-address "127.0.0.1")
+ (nnimap-server-port 143)
+ (nnimap-authenticator plain)
+ (nnimap-user "amin@aminb.org"))
+ (nnimap "uwaterloo"
+ (nnimap-stream plain)
+ (nnimap-address "127.0.0.1")
+ (nnimap-server-port 143)
+ (nnimap-authenticator plain)
+ (nnimap-user "abandali@uwaterloo.ca")))
+ gnus-message-archive-group "nnimap:Sent"
+ gnus-parameters
+ '(("gnu.*"
+ (gcc-self . t)))
+ gnus-large-newsgroup 50
gnus-home-directory (no-littering-expand-var-file-name "gnus/")
- ;; gnus-directory (no-littering-expand-var-file-name "gnus/News/")
- ;; message-directory amin-maildir
+ gnus-directory (concat gnus-home-directory "news/")
+ message-directory (concat gnus-home-directory "mail/")
+ nndraft-directory (concat gnus-home-directory "drafts/")
gnus-save-newsrc-file nil
gnus-read-newsrc-file nil
gnus-interactive-exit nil
:config
(setq
gnus-visible-headers
- (concat gnus-visible-headers "\\|^List-Id:\\|^X-RT-Originator:")
+ (concat gnus-visible-headers "\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:")
gnus-sorted-header-list
'("^From:" "^Subject:" "^Summary:" "^Keywords:"
"^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
"^Newsgroups:" "List-Id:" "^Organization:"
- "^Date:")
+ "^User-Agent:" "^Date:")
;; local-lapsed article dates
;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
gnus-article-date-headers '(user-defined)
(lapsed (progn
(string-match " (.+" combined-lapsed)
(match-string 0 combined-lapsed))))
- (concat local lapsed)))))
+ (concat local lapsed))))
+ (bind-keys
+ :map gnus-article-mode-map
+ ("r" . gnus-article-reply-with-original)
+ ("R" . gnus-article-wide-reply-with-original)
+ ("M-L" . org-store-link)))
(use-package gnus-sum
+ :bind (:map gnus-summary-mode-map
+ :prefix-map amin--gnus-summary-prefix-map
+ :prefix "v"
+ ("r" . gnus-summary-reply)
+ ("w" . gnus-summary-wide-reply)
+ ("v" . gnus-summary-show-raw-article))
+ :config
+ (bind-keys
+ :map gnus-summary-mode-map
+ ("r" . gnus-summary-reply-with-original)
+ ("R" . gnus-summary-wide-reply-with-original)
+ ("M-L" . org-store-link)))
+
+(use-package gnus-msg
:config
- (setq gnus-extra-headers (append gnus-extra-headers
- '(List-Id X-RT-Originator))))
+ (setq gnus-posting-styles
+ '((".*"
+ (address "amin@aminb.org"))
+ ("gnu.*"
+ (address "bandali@gnu.org"))
+ ("nnimap\\+uwaterloo:.*"
+ (address "abandali@uwaterloo.ca")
+ (gcc "\"nnimap+uwaterloo:Sent Items\"")))))
+
+(use-package gnus-topic
+ :hook (gnus-group-mode . gnus-topic-mode))
+
+(use-package gnus-agent
+ :config
+ (setq gnus-agent-synchronize-flags 'ask)
+ :hook (gnus-group-mode . gnus-agent-mode))
-(use-package nnmail
+(use-package gnus-group
:config
- (setq nnmail-extra-headers (append nnmail-extra-headers
- '(List-Id X-RT-Originator))))
+ (setq gnus-permanently-visible-groups "\\((INBOX\\|gnu$\\)"))
(use-package mm-decode
:config
(setq mm-discouraged-alternatives '("text/html" "text/richtext")))
#+end_src
-# #+begin_src emacs-lisp :tangle (concat gnus-init-file ".el") :mkdirp yes
-#+begin_src emacs-lisp :tangle no
-(setq
- gnus-select-method
- '(nnimap "local"
- (nnimap-address "localhost")
- (nnimap-stream shell))
- nnimap-shell-program
- "/usr/lib/dovecot/imap -o maildir:$MAILDIR/amin:LAYOUT=fs:INBOX=$MAILDIR/amin/Inbox")
-#+end_src
-
** sendmail
#+begin_src emacs-lisp
(setq message-kill-buffer-on-exit t
message-send-mail-function 'message-send-mail-with-sendmail
message-sendmail-envelope-from 'header
- ;; message-directory "drafts"
+ message-dont-reply-to-names
+ "\\(\\(.*@aminb\\.org\\)\\|\\(\\(aminb?\\|mab\\|bandali\\)@gnu\\.org\\)\\|\\(\\(m\\|a\\(min\\.\\)?\\)bandali@uwaterloo\\.ca\\)\\)"
message-user-fqdn "aminb.org")
- ;; (add-hook 'message-mode-hook 'electric-quote-local-mode)
- (add-hook 'message-mode-hook
- (lambda () (setq fill-column 65
- message-fill-column 65)))
- (add-hook 'message-mode-hook
- #'flyspell-mode)
- ;; (add-hook 'message-setup-hook
- ;; #'mml-secure-message-sign-pgpmime)
+ :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
+ (message-mode . flyspell-mode)
+ (message-mode . (lambda () (setq fill-column 65
+ message-fill-column 65))))
:custom-face
- (message-header-subject ((t (:foreground "navy blue" :weight semi-bold))))
- (message-header-to ((t (:foreground "MidnightBlue" :weight semi-bold)))))
+ (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
+ (message-header-to ((t (:foreground "#111" :weight normal))))
+ (message-header-cc ((t (:foreground "#333" :weight normal)))))
(after! mml-sec
(setq mml-secure-openpgp-encrypt-to-self t
mml-secure-openpgp-sign-with-sender t))
#+end_src
-** [[https://notmuchmail.org][notmuch]]
+** footnote
-See [[notmuch:id:87muuqsvci.fsf@fencepost.gnu.org][bug follow-up]].
+Convenient footnotes in =message-mode=.
+
+#+begin_src emacs-lisp
+(use-package footnote
+ :after message
+ :bind
+ (:map message-mode-map
+ :prefix-map amin--footnote-prefix-map
+ :prefix "C-c f"
+ ("a" . footnote-add-footnote)
+ ("b" . footnote-back-to-message)
+ ("c" . footnote-cycle-style)
+ ("d" . footnote-delete-footnote)
+ ("g" . footnote-goto-footnote)
+ ("r" . footnote-renumber-footnotes)
+ ("s" . footnote-set-style))
+ :config
+ (setq footnote-start-tag ""
+ footnote-end-tag ""
+ footnote-style 'unicode))
+#+end_src
+
+** supercite
#+begin_src emacs-lisp :tangle no
+(use-package supercite
+ :commands sc-cite-original
+ :init
+ (add-hook 'mail-citation-hook 'sc-cite-original)
+
+ (defun sc-remove-existing-signature ()
+ (save-excursion
+ (goto-char (region-beginning))
+ (when (re-search-forward message-signature-separator (region-end) t)
+ (delete-region (match-beginning 0) (region-end)))))
+
+ (add-hook 'mail-citation-hook 'sc-remove-existing-signature)
+
+ (defun sc-remove-if-not-mailing-list ()
+ (unless (assoc "list-id" sc-mail-info)
+ (setq attribution sc-default-attribution
+ citation (concat sc-citation-delimiter
+ sc-citation-separator))))
+
+ (add-hook 'sc-attribs-postselect-hook 'sc-remove-if-not-mailing-list)
+
+ :config
+ (defun sc-fill-if-different (&optional prefix)
+ "Fill the region bounded by `sc-fill-begin' and point.
+Only fill if optional PREFIX is different than
+`sc-fill-line-prefix'. If `sc-auto-fill-region-p' is nil, do not
+fill region. If PREFIX is not supplied, initialize fill
+variables. This is useful for a regi `begin' frame-entry."
+ (if (not prefix)
+ (setq sc-fill-line-prefix ""
+ sc-fill-begin (line-beginning-position))
+ (if (and sc-auto-fill-region-p
+ (not (string= prefix sc-fill-line-prefix)))
+ (let ((fill-prefix sc-fill-line-prefix))
+ (unless (or (string= fill-prefix "")
+ (save-excursion
+ (goto-char sc-fill-begin)
+ (or (looking-at ">+ +")
+ (< (length
+ (buffer-substring (point)
+ (line-end-position)))
+ 65))))
+ (fill-region sc-fill-begin (line-beginning-position)))
+ (setq sc-fill-line-prefix prefix
+ sc-fill-begin (line-beginning-position)))))
+nil))
+#+end_src
+
+** COMMENT gnus-alias :ARCHIVE:
+
+#+begin_src emacs-lisp
+(use-package gnus-alias
+ :commands (gnus-alias-determine-identity
+ gnus-alias-select-identity)
+ :bind (:map message-mode-map
+ ("s-i" . gnus-alias-select-identity))
+ :config
+ (setq
+ gnus-alias-default-identity "amin"
+ gnus-alias-identity-alist
+ '(("amin"
+ nil ;; Does not refer to any other identity
+ "Amin Bandali <amin@aminb.org>"
+ nil ;; Organization
+ nil ;; extra headers
+ nil ;; extra body text
+ nil) ;; signature file
+ ("gnu"
+ nil
+ "Amin Bandali <bandali@gnu.org>"
+ nil
+ nil
+ nil
+ nil)
+ ("uw"
+ nil
+ "Amin Bandali <abandali@uwaterloo.ca>"
+ nil
+ (("Gcc" . "\"nnimap+uwaterloo:Sent Items\""))
+ nil
+ nil))
+ gnus-alias-identity-rules
+ '(("amin" ("Delivered-To" "<amin\\@aminb\\.org" both) "amin")
+ ("gnu" ("Delivered-To" "<gnu\\@aminb\\.org" both) "gnu")
+ ("uw" ("any" "<\\(.+\\)\\@uwaterloo\\.ca" both) "uw"))
+ gnus-alias-override-user-mail-address t)
+ :hook (message-setup . gnus-alias-determine-identity))
+#+end_src
+
+** COMMENT [[https://notmuchmail.org][notmuch]] :ARCHIVE:
+
+See [[notmuch:id:87muuqsvci.fsf@fencepost.gnu.org][bug follow-up]].
+
+#+begin_src emacs-lisp
(defun amin/notmuch ()
"Delete other windows, then launch `notmuch'."
(interactive
(after! notmuch-crypto
(setq notmuch-crypto-process-mime t))
-#+end_src
-
-** supercite
-
-#+begin_src emacs-lisp :tangle no
-(use-package supercite
- :commands sc-cite-original
- :init
- (add-hook 'mail-citation-hook 'sc-cite-original)
-
- (defun sc-remove-existing-signature ()
- (save-excursion
- (goto-char (region-beginning))
- (when (re-search-forward message-signature-separator (region-end) t)
- (delete-region (match-beginning 0) (region-end)))))
-
- (add-hook 'mail-citation-hook 'sc-remove-existing-signature)
-
- (defun sc-remove-if-not-mailing-list ()
- (unless (assoc "list-id" sc-mail-info)
- (setq attribution sc-default-attribution
- citation (concat sc-citation-delimiter
- sc-citation-separator))))
- (add-hook 'sc-attribs-postselect-hook 'sc-remove-if-not-mailing-list)
-
- :config
- (defun sc-fill-if-different (&optional prefix)
- "Fill the region bounded by `sc-fill-begin' and point.
-Only fill if optional PREFIX is different than
-`sc-fill-line-prefix'. If `sc-auto-fill-region-p' is nil, do not
-fill region. If PREFIX is not supplied, initialize fill
-variables. This is useful for a regi `begin' frame-entry."
- (if (not prefix)
- (setq sc-fill-line-prefix ""
- sc-fill-begin (line-beginning-position))
- (if (and sc-auto-fill-region-p
- (not (string= prefix sc-fill-line-prefix)))
- (let ((fill-prefix sc-fill-line-prefix))
- (unless (or (string= fill-prefix "")
- (save-excursion
- (goto-char sc-fill-begin)
- (or (looking-at ">+ +")
- (< (length
- (buffer-substring (point)
- (line-end-position)))
- 65))))
- (fill-region sc-fill-begin (line-beginning-position)))
- (setq sc-fill-line-prefix prefix
- sc-fill-begin (line-beginning-position)))))
-nil))
+(use-package org-notmuch
+ :after (:any org notmuch))
#+end_src
* Blogging