From e81c7cd4fecdf9d04f687922ccaea85454a23f2d Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Wed, 21 Aug 2019 20:18:14 -0400 Subject: [PATCH 01/16] emacs: gnus: fix regexp for lists.sr.ht lists omitting one dot if present. e.g., ~sircmpwn/sr.ht-dev@lists.sr.ht => l.~sircmpwn.srht-dev --- .emacs.d/init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d3f8850..0d23dfe 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1599,8 +1599,9 @@ For disabling the behaviour for certain buffers and/or modes." ;; (: gnus-group-split-fancy "INBOX" t "INBOX") ;; gnu (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1") - ;; *@lists.sr.ht - (list ".*<~\\(.*\\)/\\(.*\\)@lists.sr.ht>" "l.~\\1.\\2") + ;; *@lists.sr.ht, omitting one dot if present + ;; add more \\.?\\([^.@]*\\) if needed + (list ".*<~\\(.*\\)/\\([^.@]*\\)\\.?\\([^.@]*\\)@lists.sr.ht>.*" "l.~\\1.\\2\\3") ;; webmasters (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters") ;; other -- 2.20.1 From d56befc377fda77b92672bfe814ab628900a5fac Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Thu, 22 Aug 2019 01:05:02 -0400 Subject: [PATCH 02/16] guix: bump guix to latest master --- .config/guix/channels.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/guix/channels.scm b/.config/guix/channels.scm index c887326..bf297a6 100644 --- a/.config/guix/channels.scm +++ b/.config/guix/channels.scm @@ -2,7 +2,7 @@ (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit - "d51f20f9b8ec2f60afde58e1b0a10fe25ab68e79")) + "3251c628f754eaceaa0515fadffcf8e64e1ca66e")) (channel (name 'guix-bandali) (url "https://git.sr.ht/~bandali/guix-bandali") -- 2.20.1 From a23fd4a0bbff7f5085ee0c14acaf9d2dcf0675b5 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Sun, 25 Aug 2019 00:10:15 -0400 Subject: [PATCH 03/16] emacs: update custom, fix haskell-cafe directory name --- .emacs.d/etc/custom.el | 105 +++++++++++++++++++++++++++-------------- .emacs.d/init.el | 2 +- 2 files changed, 70 insertions(+), 37 deletions(-) diff --git a/.emacs.d/etc/custom.el b/.emacs.d/etc/custom.el index a79127b..132c5ff 100644 --- a/.emacs.d/etc/custom.el +++ b/.emacs.d/etc/custom.el @@ -3,40 +3,48 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(auth-sources '("~/.authinfo.gpg")) + '(abbrev-file-name "/home/bandali/.emacs.d/var/abbrev.el") + '(auth-sources (quote ("~/.authinfo.gpg"))) '(company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]") '(company-dabbrev-downcase nil) '(company-dabbrev-ignore-case nil) '(company-minimum-prefix-length 1) '(company-selection-wrap-around t) '(ebdb-gnus-window-configuration - '(article + (quote + (article (vertical 1.0 (summary 0.25 point) (horizontal 1.0 (article 1.0) - (ebdb-gnus 0.3))))) - '(ediff-split-window-function 'split-window-horizontally t) - '(ediff-window-setup-function 'ediff-setup-windows-plain t) - '(erc-fill-function 'erc-fill-static) + (ebdb-gnus 0.3)))))) + '(ediff-split-window-function (quote split-window-horizontally) t) + '(ediff-window-setup-function (quote ediff-setup-windows-plain) t) + '(epa-pinentry-mode (quote loopback)) + '(epg-gpg-program "/home/bandali/.guix-profile/bin/gpg") + '(epg-pinentry-mode (quote loopback) t) + '(erc-fill-function (quote erc-fill-static)) '(erc-fill-static-center 18) - '(erc-join-buffer 'bury) - '(erc-lurker-hide-list '("JOIN" "PART" "QUIT")) - '(erc-nick "bandali") + '(erc-join-buffer (quote bury) t) + '(erc-lurker-hide-list (quote ("JOIN" "PART" "QUIT")) t) + '(erc-nick "bandali" t) '(erc-pcomplete-nick-postfix ",") - '(erc-rename-buffers t) - '(erc-server-reconnect-attempts 5) - '(erc-server-reconnect-timeout 3) + '(erc-rename-buffers t t) + '(erc-server-reconnect-attempts 5 t) + '(erc-server-reconnect-timeout 3 t) '(erc-track-enable-keybindings nil) '(erc-track-exclude-types - '("JOIN" "MODE" "NICK" "PART" "QUIT" "324" "329" "332" "333" "353" "477")) - '(erc-track-priority-faces-only 'all) + (quote + ("JOIN" "MODE" "NICK" "PART" "QUIT" "324" "329" "332" "333" "353" "477"))) + '(erc-track-priority-faces-only (quote all)) '(erc-track-shorten-function nil) - '(eshell-hist-ignoredups t) - '(eshell-input-filter 'eshell-input-filter-initial-space) + '(eshell-directory-name "/home/bandali/.emacs.d/var/eshell/") + '(eshell-hist-ignoredups t t) + '(eshell-input-filter (quote eshell-input-filter-initial-space) t) '(flycheck-mode-line-prefix "flyc") '(ibuffer-formats - '((mark modified read-only locked " " + (quote + ((mark modified read-only locked " " (name 18 18 :left :elide) " " (size-h 9 -1 :right) @@ -45,9 +53,10 @@ " " filename-and-process) (mark " " (name 16 -1) - " " filename))) + " " filename)))) '(ibuffer-saved-filter-groups - '(("default" + (quote + (("default" ("dired" (mode . dired-mode)) ("org" @@ -90,39 +99,63 @@ (name . "^\\*scratch\\*$") (name . "^\\*Messages\\*$"))) ("erc" - (mode . erc-mode))))) - '(ls-lisp-dirs-first t) - '(magit-display-buffer-function 'magit-display-buffer-fullframe-status-v1) + (mode . erc-mode)))))) + '(ls-lisp-dirs-first t t) + '(magit-display-buffer-function (quote magit-display-buffer-fullframe-status-v1)) '(mml-secure-key-preferences - '((OpenPGP + (quote + ((OpenPGP (sign) (encrypt ("ineiev@gnu.org" "BD9D4DEE7B2FF1CBEF2EE0C4E0ACD3E0CBE7874A"))) (CMS (sign) - (encrypt)))) + (encrypt))))) '(mml-secure-openpgp-encrypt-to-self t) '(mml-secure-openpgp-sign-with-sender t) '(org-agenda-files - '("~/usr/org/todos/personal.org" "~/usr/org/todos/masters.org")) + (quote + ("~/usr/org/todos/personal.org" "~/usr/org/todos/habits.org" "~/src/git/masters-thesis/todo.org"))) '(org-agenda-start-on-weekday 0) - '(org-latex-packages-alist '(("" "listings") ("" "color"))) - '(page-break-lines-max-width 70) - '(projectile-completion-system 'ivy) + '(org-agenda-time-leading-zero t) + '(org-habit-graph-column 44) + '(org-latex-packages-alist (quote (("" "listings") ("" "color")))) + '(org-pretty-entities t) + '(page-break-lines-max-width 70 t) + '(projectile-completion-system (quote ivy)) '(projectile-mode-line-prefix " proj") + '(recentf-max-saved-items 2000) + '(recentf-save-file "/home/bandali/.emacs.d/var/recentf-save.el") '(safe-local-variable-values - '((eval modify-syntax-entry 43 "'") + (quote + ((org-export-allow-bind-keywords . t) + (eval load-file "thesis.el") + (eval modify-syntax-entry 43 "'") (eval modify-syntax-entry 36 "'") (eval modify-syntax-entry 126 "'") - (eval require 'org-ref) + (eval require + (quote org-ref)) (eval when - (featurep 'typo - (typo-mode -1))) - (eval add-hook 'after-save-hook #'a/async-babel-tangle 'append 'local) - (eval add-hook 'after-save-hook 'org-beamer-export-to-latex t t) + (featurep + (quote typo) + (typo-mode -1))) + (eval add-hook + (quote after-save-hook) + (function a/async-babel-tangle) + (quote append) + (quote local)) + (eval add-hook + (quote after-save-hook) + (quote org-beamer-export-to-latex) + t t) (eval setq org-latex-prefer-user-labels t) - (eval add-hook 'after-save-hook 'org-latex-export-to-latex t t))) - '(unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")) + (eval add-hook + (quote after-save-hook) + (quote org-latex-export-to-latex) + t t)))) + '(save-place-file "/home/bandali/.emacs.d/var/save-place.el" t) + '(savehist-file "/home/bandali/.emacs.d/var/savehist.el" t) + '(unkillable-buffers (quote ("^\\*scratch\\*$" "^\\*Messages\\*$"))) '(which-key-add-column-padding 5) '(which-key-max-description-length 32)) (custom-set-faces diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0d23dfe..2d0d8f9 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1608,7 +1608,7 @@ For disabling the behaviour for certain buffers and/or modes." (list ".*atreus.freelists.org" "l.atreus") (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec") ;; (list ".*haskell-art.we.lurk.org" "l.haskell.art") ;d - (list ".*haskell-cafe.haskell.org" "l.haskell.cafe") + (list ".*haskell-cafe.haskell.org" "l.haskell-cafe") ;; (list ".*notmuch.notmuchmail.org" "l.notmuch") ;u ;; (list ".*dev.lists.parabola.nu" "l.parabola-dev") ;u ;; ---------------------------------- -- 2.20.1 From 66ec16e48108b28355cb1ad0f83ae5aeb96868e4 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Sun, 25 Aug 2019 00:10:47 -0400 Subject: [PATCH 04/16] emacs: temporary fix for org-link-email-description-format --- .emacs.d/init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 2d0d8f9..82d1afe 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -471,6 +471,9 @@ For disabling the behaviour for certain buffers and/or modes." org-startup-folded 'content org-catch-invisible-edits 'show-and-error org-log-done 'time) + (when (version< org-version "9.3") + (setq org-email-link-description-format + org-link-email-description-format)) (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t) (add-to-list 'org-modules 'org-habit) :bind -- 2.20.1 From fd3836399762bb83d939c996108114e0cd10bf5b Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Sun, 25 Aug 2019 14:14:18 -0400 Subject: [PATCH 05/16] msmtp: update shemshak tls fingerprint --- .config/msmtp/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/msmtp/config b/.config/msmtp/config index 2f17793..d928ec7 100644 --- a/.config/msmtp/config +++ b/.config/msmtp/config @@ -8,8 +8,8 @@ logfile ~/.msmtp.log account shemshak host mail.shemshak.org -# use `msmtp -a amin --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint -tls_fingerprint 2F:48:C6:F4:BA:AB:3F:52:84:06:56:33:4B:29:57:84:0F:74:1B:DB:C1:83:25:03:67:05:9A:D4:2A:CE:D4:00 +# use `msmtp -a shemshak --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint +tls_fingerprint 6D:40:59:A6:F0:D9:28:2A:80:C3:D9:53:5D:D6:4F:2A:A2:B7:43:F5:1C:00:A3:A4:B6:F2:B9:5F:7E:55:A2:4E tls_starttls on from amin@shemshak.org user amin@shemshak.org -- 2.20.1 From 90dc3a58921a41297b3f3169854e1e6af5fad16d Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 19:41:37 -0400 Subject: [PATCH 06/16] emacs: gnus: fix se212 folder name in split rules --- .emacs.d/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 82d1afe..eb634df 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1630,8 +1630,8 @@ For disabling the behaviour for certain buffers and/or modes." (nnimap-split-fancy (| ;; (: gnus-registry-split-fancy-with-parent) ;; se212-f19 - ("subject" "SE\\s-?212" "course.se463-s19") - (from "SE\\s-?212" "course.se463-s19") + ("subject" "SE\\s-?212" "course.se212-f19") + (from "SE\\s-?212" "course.se212-f19") ;; catch-all "INBOX"))) (nnimap "csc" -- 2.20.1 From 057a83828a8bf86b27a70031f41c9a99d333bf56 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 19:42:19 -0400 Subject: [PATCH 07/16] emacs: better buffer-switching bindings --- .emacs.d/init.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index eb634df..d0d5307 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -626,12 +626,12 @@ For disabling the behaviour for certain buffers and/or modes." :delight :bind (([remap execute-extended-command] . counsel-M-x) ([remap find-file] . counsel-find-file) - ("C-c x" . counsel-M-x) + ("C-c b b" . ivy-switch-buffer) ("C-c f ." . counsel-find-file) ("C-c f l" . counsel-find-library) ("C-c f r" . counsel-recentf) + ("C-c x" . counsel-M-x) ("s-." . counsel-find-file) - ("s-r" . ivy-switch-buffer) :map minibuffer-local-map ("C-r" . counsel-minibuffer-history)) :config @@ -2062,7 +2062,7 @@ https://csclub.uwaterloo.ca/~abandali") ;;; IRC (with ERC and ZNC) (use-package erc - :bind (("C-c a e b" . erc-switch-to-buffer) + :bind (("C-c b e" . erc-switch-to-buffer) :map erc-mode-map ("M-a" . erc-track-switch-buffer)) :custom -- 2.20.1 From 9a5ffb3364a8d0704cbcd4eb96ce31010fcbe065 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 19:42:37 -0400 Subject: [PATCH 08/16] emacs: add reftex --- .emacs.d/init.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d0d5307..6c17967 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1564,6 +1564,23 @@ For disabling the behaviour for certain buffers and/or modes." (use-package biblio) +(use-package reftex + :hook (latex-mode . reftex-mode)) + +(use-package reftex-cite + :after reftex + :disabled ; enable to disable + ; reftex-cite's default choice + ; of previous word + :config + (defun reftex-get-bibkey-default () + "If the cursor is in a citation macro, return the word before the macro." + (let* ((macro (reftex-what-macro 1))) + (save-excursion + (when (and macro (string-match "cite" (car macro))) + (goto-char (cdr macro))) + (reftex-this-word))))) + ;;; Email (with Gnus) -- 2.20.1 From fcd365285366e1f465751d365757bcfd257e96d5 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 19:43:09 -0400 Subject: [PATCH 09/16] emacs: ivy: properly ignore erc-, magit-, and dired-mode buffers --- .emacs.d/init.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 6c17967..4c69e2a 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -608,6 +608,19 @@ For disabling the behaviour for certain buffers and/or modes." ivy-use-virtual-buffers t ivy-virtual-abbreviate 'abbreviate ivy-count-format "%d/%d ") + + (defvar b/ivy-ignore-buffer-modes '(magit-mode erc-mode dired-mode)) + (defun b/ivy-ignore-buffer-p (str) + "Return non-nil if str names a buffer with a major mode +derived from one of `b/ivy-ignore-buffer-modes'. + +This function is intended for use with `ivy-ignore-buffers'." + (let* ((buf (get-buffer str)) + (mode (and buf (buffer-local-value 'major-mode buf)))) + (and mode + (apply #'provided-mode-derived-p mode b/ivy-ignore-buffer-modes)))) + (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p) + (ivy-mode 1) ;; :custom-face ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold)))) @@ -2091,9 +2104,6 @@ https://csclub.uwaterloo.ca/~abandali") (erc-server-reconnect-attempts 5) (erc-server-reconnect-timeout 3) :config - (with-eval-after-load 'ivy - ;; ignore channel buffer names - (add-to-list 'ivy-ignore-buffers "^#")) (defun erc-cmd-OPME () "Request chanserv to op me." (erc-message "PRIVMSG" -- 2.20.1 From 2e81c51ad88d5ea21b5f85fdf1ab6cf585e830ef Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 23:34:45 -0400 Subject: [PATCH 10/16] emacs: overhaul bindings to be more C-based rather than s-based --- .emacs.d/init.el | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 4c69e2a..08af872 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -480,8 +480,7 @@ For disabling the behaviour for certain buffers and/or modes." (("C-c a o a" . org-agenda) :map org-mode-map ("M-L" . org-insert-last-stored-link) - ("M-O" . org-toggle-link-display) - ("s-T" . org-todo)) + ("M-O" . org-toggle-link-display)) :hook ((org-mode . org-indent-mode) (org-mode . auto-fill-mode) (org-mode . flyspell-mode)) @@ -560,9 +559,10 @@ For disabling the behaviour for certain buffers and/or modes." ;; *the* right way to do git (use-package magit :defer 0.5 - :bind (("C-x g" . magit-status) - ("s-g s" . magit-status) - ("s-g l" . magit-log-buffer-file)) + :bind (("C-x g g" . magit-status) + ("C-x g s" . magit-status) + ("C-x g b" . magit-blame-addition) + ("C-x g l" . magit-log-buffer-file)) :config (magit-add-section-hook 'magit-status-sections-hook 'magit-insert-modules @@ -644,7 +644,6 @@ This function is intended for use with `ivy-ignore-buffers'." ("C-c f l" . counsel-find-library) ("C-c f r" . counsel-recentf) ("C-c x" . counsel-M-x) - ("s-." . counsel-find-file) :map minibuffer-local-map ("C-r" . counsel-minibuffer-history)) :config @@ -660,7 +659,6 @@ This function is intended for use with `ivy-ignore-buffers'." ("C-x C-b" . helm-buffers-list) ("C-x C-f" . helm-find-files) ("C-h r" . helm-info-emacs) - ("s-r" . helm-recentf) ("C-s-r" . helm-resume) :map helm-map ("" . helm-execute-persistent-action) @@ -777,6 +775,7 @@ This function is intended for use with `ivy-ignore-buffers'." :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default")))) (use-package outline + :disabled :hook (prog-mode . outline-minor-mode) :delight (outline-minor-mode " outl") :bind @@ -1224,8 +1223,8 @@ This function is intended for use with `ivy-ignore-buffers'." 'org-mode b/org-mode-font-lock-keywords t)) (bind-keys - ("s-t d" . b/lights-off) - ("s-t l" . b/lights-on)) + ("C-c t d" . b/lights-off) + ("C-c t l" . b/lights-on)) ;;; Emacs enhancements & auxiliary packages @@ -1254,11 +1253,7 @@ This function is intended for use with `ivy-ignore-buffers'." "C-c a e" "erc" "C-c a o" "org" "C-c a s" "shells" - "C-c p" "package-management" - ;; "C-c p e" "package-management/epkg" - "C-c p s" "straight.el" - "C-c psa" "all" - "C-c psp" "package" + "C-c b" "buffers" "C-c c" "compile-and-comments" "C-c e" "eval" "C-c f" "files" @@ -1270,9 +1265,9 @@ This function is intended for use with `ivy-ignore-buffers'." "C-c P x" "projectile/execute" "C-c P 4" "projectile/other-window" "C-c q" "boxquote" - "s-g" "magit" - "s-O" "outline" - "s-t" "themes") + "C-c t" "themes" + ;; "s-O" "outline" + "C-x g" "magit") ;; prefixes for major modes (which-key-add-major-mode-key-based-replacements 'message-mode @@ -1544,25 +1539,25 @@ This function is intended for use with `ivy-ignore-buffers'." (use-package window :bind - (("s-o" . other-window) - ("s-/ ." . split-window-right) - ("s-/ ," . split-window-below) - ("s-/ 0" . delete-window) - ("s-q" . delete-window)) + (("C-c w " . split-window-right) + ("C-c w " . split-window-below) + ("C-c w s l" . split-window-right) + ("C-c w s j" . split-window-below) + ("C-c w q" . quit-window)) :custom (split-width-threshold 150)) (use-package windmove :defer 0.6 :bind - (("s-h" . windmove-left) - ("s-j" . windmove-down) - ("s-k" . windmove-up) - ("s-l" . windmove-right) - ("s-H" . windmove-swap-states-left) - ("s-J" . windmove-swap-states-down) - ("s-K" . windmove-swap-states-up) - ("s-L" . windmove-swap-states-right))) + (("C-c w h" . windmove-left) + ("C-c w j" . windmove-down) + ("C-c w k" . windmove-up) + ("C-c w l" . windmove-right) + ("C-c w H" . windmove-swap-states-left) + ("C-c w J" . windmove-swap-states-down) + ("C-c w K" . windmove-swap-states-up) + ("C-c w L" . windmove-swap-states-right))) (use-package pass :commands pass @@ -1607,8 +1602,10 @@ This function is intended for use with `ivy-ignore-buffers'." read-mail-command 'gnus) (use-package gnus - :bind (("s-m" . gnus) - ("s-M" . gnus-unplugged)) + :bind (("s-m" . gnus) + ("s-M" . gnus-unplugged) + ("C-c a m" . gnus) + ("C-c a M" . gnus-unplugged)) :init (setq gnus-select-method '(nnnil "") @@ -2206,6 +2203,8 @@ updates of `erc-lurker-state'." (use-package erc-track :after erc + :bind (("C-c a e t d" . erc-track-disable) + ("C-c a e t e" . erc-track-enable)) :custom (erc-track-enable-keybindings nil) (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT" -- 2.20.1 From a33abe1445864ed5b044d0bca938ee9b44430a5d Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 26 Aug 2019 23:48:44 -0400 Subject: [PATCH 11/16] emacs: yasnippet: bind SPC to yas-maybe-expand in yas-minor-mode-map --- .emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 08af872..cc01a13 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1512,6 +1512,7 @@ This function is intended for use with `ivy-ignore-buffers'." (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) (yas-reload-all) (setq yas-verbosity yas-verbosity-cur) + (define-key yas-minor-mode-map (kbd "SPC") yas-maybe-expand) (yas-global-mode)) (use-package debbugs) -- 2.20.1 From 9a5905d6b1cec2417777f66570466c81cd14a903 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 27 Aug 2019 00:18:43 -0400 Subject: [PATCH 12/16] emacs: disable typo-mode in tex-mode --- .emacs.d/init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index cc01a13..26d0a0f 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1394,7 +1394,8 @@ This function is intended for use with `ivy-ignore-buffers'." :delight " typo" :config (typo-global-mode 1) - :hook ((text-mode erc-mode) . typo-mode)) + :hook (((text-mode erc-mode) . typo-mode) + (tex-mode . (lambda ()(typo-mode -1))))) ;; highlight TODOs in buffers (use-package hl-todo -- 2.20.1 From ef6c487c6028c49fc4d6d238b63ef840451e5077 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 27 Aug 2019 00:41:44 -0400 Subject: [PATCH 13/16] emacs: magit: add magit-insert-ignored-files, use C-c g --- .emacs.d/init.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 26d0a0f..e316de7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -559,15 +559,19 @@ For disabling the behaviour for certain buffers and/or modes." ;; *the* right way to do git (use-package magit :defer 0.5 - :bind (("C-x g g" . magit-status) - ("C-x g s" . magit-status) - ("C-x g b" . magit-blame-addition) - ("C-x g l" . magit-log-buffer-file)) + :bind (("C-c g g" . magit-status) + ("C-c g s" . magit-status) + ("C-c g b" . magit-blame-addition) + ("C-c g l" . magit-log-buffer-file)) :config (magit-add-section-hook 'magit-status-sections-hook 'magit-insert-modules 'magit-insert-stashes 'append) + (magit-add-section-hook 'magit-status-sections-hook + 'magit-insert-ignored-files + 'magit-insert-untracked-files + 'append) (setq magit-repository-directories '(("~/" . 0) ("~/src/git/" . 1))) (nconc magit-section-initial-visibility-alist @@ -1258,6 +1262,7 @@ This function is intended for use with `ivy-ignore-buffers'." "C-c e" "eval" "C-c f" "files" "C-c F" "frames" + "C-c g" "magit" "C-S-h" "help(ful)" "C-c m" "multiple-cursors" "C-c P" "projectile" @@ -1267,7 +1272,7 @@ This function is intended for use with `ivy-ignore-buffers'." "C-c q" "boxquote" "C-c t" "themes" ;; "s-O" "outline" - "C-x g" "magit") + ) ;; prefixes for major modes (which-key-add-major-mode-key-based-replacements 'message-mode -- 2.20.1 From 3b3615f5761d8949046d65906d3f324eec9b18e8 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 27 Aug 2019 00:45:35 -0400 Subject: [PATCH 14/16] =?utf8?q?emacs:=20magit:=20don=E2=80=99t=20show=20i?= =?utf8?q?gnored=20files=20for=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .emacs.d/init.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e316de7..4002d9a 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -568,10 +568,10 @@ For disabling the behaviour for certain buffers and/or modes." 'magit-insert-modules 'magit-insert-stashes 'append) - (magit-add-section-hook 'magit-status-sections-hook - 'magit-insert-ignored-files - 'magit-insert-untracked-files - 'append) + ;; (magit-add-section-hook 'magit-status-sections-hook + ;; 'magit-insert-ignored-files + ;; 'magit-insert-untracked-files + ;; 'append) (setq magit-repository-directories '(("~/" . 0) ("~/src/git/" . 1))) (nconc magit-section-initial-visibility-alist -- 2.20.1 From 2b3c93ec75a0c69ba421bd11260cd46cac70b536 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 27 Aug 2019 00:46:57 -0400 Subject: [PATCH 15/16] emacs: yasnippet: add some convenience snippets for latex-mode --- .emacs.d/etc/yasnippet/snippets/latex-mode/cite | 5 +++++ .emacs.d/etc/yasnippet/snippets/latex-mode/emph | 5 +++++ .emacs.d/etc/yasnippet/snippets/latex-mode/enumerate | 7 +++++++ .emacs.d/etc/yasnippet/snippets/latex-mode/item | 5 +++++ .emacs.d/etc/yasnippet/snippets/latex-mode/item-li | 6 ++++++ .emacs.d/etc/yasnippet/snippets/latex-mode/itemize | 7 +++++++ .emacs.d/etc/yasnippet/snippets/latex-mode/label | 5 +++++ .emacs.d/etc/yasnippet/snippets/latex-mode/newcommand | 5 +++++ .emacs.d/etc/yasnippet/snippets/latex-mode/section | 8 ++++++++ .emacs.d/etc/yasnippet/snippets/latex-mode/subsection | 8 ++++++++ .emacs.d/etc/yasnippet/snippets/latex-mode/textbf | 5 +++++ .emacs.d/etc/yasnippet/snippets/latex-mode/usepackage | 5 +++++ 12 files changed, 71 insertions(+) create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/cite create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/emph create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/enumerate create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/item create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/item-li create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/itemize create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/label create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/newcommand create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/section create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/subsection create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/textbf create mode 100644 .emacs.d/etc/yasnippet/snippets/latex-mode/usepackage diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/cite b/.emacs.d/etc/yasnippet/snippets/latex-mode/cite new file mode 100644 index 0000000..058bd2b --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/cite @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cite +# key: c +# -- +${1:~}\cite{${2:$$(unless yas-modified-p (mapconcat 'identity (reftex-citation 'dont-insert) ","))}} $0 \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/emph b/.emacs.d/etc/yasnippet/snippets/latex-mode/emph new file mode 100644 index 0000000..36b19d7 --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/emph @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: emph +# key: e +# -- +\emph{$1}$0 \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate b/.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate new file mode 100644 index 0000000..df51892 --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: enumerate +# key: ol +# -- +\begin{enumerate} +$0 +\end{enumerate} \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/item b/.emacs.d/etc/yasnippet/snippets/latex-mode/item new file mode 100644 index 0000000..d4773f5 --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/item @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: item +# key: - +# -- +\item $0 \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li b/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li new file mode 100644 index 0000000..1bc93b5 --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: item-li +# key: li +# type: command +# -- +(yas-expand-snippet (yas-lookup-snippet "item")) \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/itemize b/.emacs.d/etc/yasnippet/snippets/latex-mode/itemize new file mode 100644 index 0000000..eb97984 --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/itemize @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: itemize +# key: ul +# -- +\begin{itemize} +$0 +\end{itemize} \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/label b/.emacs.d/etc/yasnippet/snippets/latex-mode/label new file mode 100644 index 0000000..8a98d7e --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/label @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: label +# key: lbl +# -- +\label{$0} \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/newcommand b/.emacs.d/etc/yasnippet/snippets/latex-mode/newcommand new file mode 100644 index 0000000..e9e03ca --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/newcommand @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: newcommand +# key: cmd +# -- +\newcommand{\\${1:name}}${2:[${3:0}]}{$0} \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/section b/.emacs.d/etc/yasnippet/snippets/latex-mode/section new file mode 100644 index 0000000..88faeab --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/section @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: section +# key: sec +# -- +\section{${1:name}} +\label{sec:${2:label}} + +$0 \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/subsection b/.emacs.d/etc/yasnippet/snippets/latex-mode/subsection new file mode 100644 index 0000000..0bb1c5b --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/subsection @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: subsection +# key: ssec +# -- +\subsection{${1:name}} +\label{subsec:${2:label}} + +$0 \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/textbf b/.emacs.d/etc/yasnippet/snippets/latex-mode/textbf new file mode 100644 index 0000000..84171d7 --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/textbf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: textbf +# key: b +# -- +\textbf{$1}$0 \ No newline at end of file diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/usepackage b/.emacs.d/etc/yasnippet/snippets/latex-mode/usepackage new file mode 100644 index 0000000..2afd38b --- /dev/null +++ b/.emacs.d/etc/yasnippet/snippets/latex-mode/usepackage @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: usepackage +# key: pkg +# -- +\usepackage{$0} \ No newline at end of file -- 2.20.1 From 5b185efac27892a4c7bc567820442085045d2a8a Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 27 Aug 2019 01:34:03 -0400 Subject: [PATCH 16/16] =?utf8?q?emacs:=20yasnippet:=20don=E2=80=99t=20expa?= =?utf8?q?nd=20on=20SPC=20in=20git-commit-mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit guix provides snippets like ‘add’ [0] which would get auto-expanded in git-commit-mode with SPC, super annoying. [0]: https://git.savannah.gnu.org/cgit/guix.git/tree/etc/snippets/text-mode/guix-commit-message-add-package --- .emacs.d/init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 4002d9a..6210f90 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1518,7 +1518,16 @@ This function is intended for use with `ivy-ignore-buffers'." (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) (yas-reload-all) (setq yas-verbosity yas-verbosity-cur) - (define-key yas-minor-mode-map (kbd "SPC") yas-maybe-expand) + + (defun b/yas--maybe-expand-key-filter (cmd) + (when (and (yas--maybe-expand-key-filter cmd) + (not (bound-and-true-p git-commit-mode))) + cmd)) + (defconst b/yas-maybe-expand + '(menu-item "" yas-expand :filter b/yas--maybe-expand-key-filter)) + (define-key yas-minor-mode-map + (kbd "SPC") b/yas-maybe-expand) + (yas-global-mode)) (use-package debbugs) -- 2.20.1