#+PROPERTY: header-args:emacs-lisp :tangle don-configuration.el
#+OPTIONS: auto-id:f
+
+* General Notes
+
+** Delight
+To look up options for symbols for delight, check out https://en.wikipedia.org/wiki/Emoji#Unicode_blocks
+
* Load debugger
# if for some reason, things get pear-shaped, we want to be able to
* Paths
** Update PATH
#+BEGIN_SRC emacs-lisp
- (add-to-list 'exec-path '"/usr/local/bin")
- (add-to-list 'exec-path '"~/bin/")
+(add-to-list 'exec-path '"/usr/local/bin")
+(add-to-list 'exec-path '"~/bin/")
#+END_SRC
** Add library paths
#+BEGIN_SRC emacs-lisp
-(eval-and-compile
- (let ((default-directory "~/lib/emacs_el/"))
- (normal-top-level-add-subdirs-to-load-path))
- )
-(eval-and-compile
- (let ((default-directory "~/var/emacs/elpa"))
- (normal-top-level-add-subdirs-to-load-path))
- )
-(eval-and-compile
- (add-to-list 'load-path '"~/lib/emacs_el")
- )
-(eval-and-compile
- (setq package-user-dir "~/var/emacs/elpa")
-)
+(let ((default-directory "~/lib/emacs_el/"))
+ (normal-top-level-add-subdirs-to-load-path))
+;; (eval-and-compile
+;; (let ((default-directory "~/var/emacs/elpa"))
+;; (normal-top-level-add-subdirs-to-load-path))
+;; )
+(add-to-list 'load-path '"~/lib/emacs_el")
+(setq package-user-dir "~/var/emacs/elpa")
#+END_SRC
* Initial startup stuff
** Disable startup screen
#+BEGIN_SRC emacs-lisp
- (setq inhibit-startup-screen t)
+(setq inhibit-startup-screen t)
#+END_SRC
** Disable cluter
#+BEGIN_SRC emacs-lisp
- ; (if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
- (if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
- (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
+; (if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
+(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
+(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
#+END_SRC
** Fullscreen
#+BEGIN_SRC emacs-lisp
- (setq frame-resize-pixelwise t)
- (add-to-list 'default-frame-alist '(fullscreen . maximixed))
+(setq frame-resize-pixelwise t)
+(add-to-list 'default-frame-alist '(fullscreen . maximixed))
#+END_SRC
* Package management
+** Bootstrap straight.el
+#+BEGIN_SRC emacs-lisp
+(defvar bootstrap-version)
+(setq straight-base-dir '"~/var/emacs/")
+(let ((bootstrap-file
+ (expand-file-name "straight/repos/straight.el/bootstrap.el" straight-base-dir))
+ (bootstrap-version 6))
+ (unless (file-exists-p bootstrap-file)
+ (with-current-buffer
+ (url-retrieve-synchronously
+ "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
+ 'silent 'inhibit-cookies)
+ (goto-char (point-max))
+ (eval-print-last-sexp)))
+ (load bootstrap-file nil 'nomessage))
+#+END_SRC
** package repositories and package manager
#+BEGIN_SRC emacs-lisp
-(require 'use-package)
-(setq use-package-always-ensure t)
+(straight-use-package 'use-package)
+(setq straight-use-package-by-default t)
+(setq use-package-verbose (not (bound-and-true-p byte-compile-current-file)))
(require 'gnutls)
(add-to-list 'gnutls-trustfiles "/etc/ssl/ca-global/ca-certificates.crt")
-(use-package package
- :init
-(setq package-enable-at-startup nil)
-(setq package--init-file-ensured t)
-(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
- ("melpa" . "https://melpa.org/packages/")
- ("org" . "http://orgmode.org/elpa/")))
-(setq use-package-verbose (not (bound-and-true-p byte-compile-current-file)))
-)
#+END_SRC
** Paradox
#+BEGIN_SRC emacs-lisp
(use-package paradox
- :ensure paradox
+ ;:ensure paradox
:commands (paradox-upgrade-packages paradox-list-packages)
:config
(setq paradox-execute-asynchronously t)
** Flycheck
#+begin_src emacs-lisp :tangle yes
(use-package flycheck
- :ensure t
:delight 🦋
:if (version<= "24.4" emacs-version)
:commands flycheck-mode
)
;; Other pkgs
(use-package flycheck-tip
- :ensure t
:commands 'flycheck-tip-cycle
:after flycheck
:bind (:map flycheck-mode-map
("C-c C-n" . flycheck-tip-cycle)))
-(use-package flycheck-package
- :ensure t)
+(use-package flycheck-package)
(use-package flycheck-checkpatch
- :ensure t
:config (flycheck-checkpatch-setup)
:config (setq flycheck-checkers (delete 'checkpatch
flycheck-checkers))
#+BEGIN_SRC emacs-lisp
;; load tinyprocmail
(use-package tinyprocmail
- :defer t
- :load-path "~/lib/emacs_el/tiny-tools/lisp/tiny"
+ :straight (tinytools :type git :type git :host github :repo "jaalto/project--emacs-tiny-tools")
+ ; :load-path "~/lib/emacs_el/tiny-tools/lisp/tiny"
:mode (".procmailrc" . turn-on-tinyprocmail-mode)
)
#+END_SRC
)
(use-package magit-annex
:defer t
- :load-path "~/lib/emacs_el/magit-annex/"
)
(use-package magit-vcsh
:defer t
** Perl
#+BEGIN_SRC emacs-lisp
(use-package cperl-mode
- :ensure t
:config
(progn
;; Use c-mode for perl .xs files
#+BEGIN_SRC emacs-lisp
; load sql-indent when sql is loaded
(use-package sql-indent
- :defer t
:hook sql-mode
)
(use-package sql
- :defer t
:mode (("\\.sql\\'" . sql-mode))
)
#+END_SRC
** Ediff
#+BEGIN_SRC emacs-lisp
(use-package ediff
- :defer t
:commands ediff ediff3
:config
;; ediff configuration
(use-package vcl-mode
:mode "\\.vcl\\'"
)
-
#+END_SRC
** Vertico
#+BEGIN_SRC emacs-lisp
:custom
(vertico-grid-separator " ")
(vertico-grid-lookahead 50)
+)
+(use-package vertico-multiform
+ :straight nil
+ :load-path "~/var/emacs/straight/build/vertico/extensions/"
+ :after vertico
:config
- (require 'vertico-multiform)
(setq vertico-multiform-categories
'((file reverse)
(consult-grep buffer)
)
(vertico-multiform-mode)
)
+
(use-package vertico-grid
- :ensure nil
+ :straight nil
:after vertico
)
(use-package vertico-reverse
- :ensure nil
+ :straight nil
:after vertico
)
(use-package vertico-indexed
- :ensure nil
+ :straight nil
:after vertico
)
(use-package vertico-buffer
- :ensure nil
+ :straight nil
:after vertico
)
+
;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist
:demand t
;; relevant when you use the default completion UI.
:hook (completion-list-mode . consult-preview-at-point-mode)
+ :commands (consult-xref)
+
;; The :init configuration is always executed (Not lazy)
:init
;; Configure other variables and modes in the :config section,
;; after lazily loading the package.
:config
-
;; Optionally configure preview. The default value
;; is 'any, such that any key triggers the preview.
;; (setq consult-preview-key 'any)
** Zap to char
#+BEGIN_SRC emacs-lisp
(use-package avy-zap
- :ensure t
:bind ("M-z" . avy-zap-up-to-char-dwim))
#+END_SRC
** Hydra
#+BEGIN_SRC emacs-lisp
- (use-package hydra
- :bind (("C-c 2" . my/hydra-orgmodes/body)
- ("C-c @" . my/hydra-orgmodes/body)
- ("C-c #" . my/hydra-outline/body)
- ("C-c 3" . my/hydra-outline/body)
- )
- :config
- (defhydra my/hydra-orgmodes (:color blue :hint nil)
- "
- _n_: notes _c_: chaim _w_: wildman _o_: ool
- _u_: uddin _s_: steve _r_: refile _f_: fh
- _p_: read papers _R_: paper notes
- _h_: hpcbio
- _q_: quit
- _z_: quit
+(use-package hydra
+ :bind (("C-c 2" . my/hydra-orgmodes/body)
+ ("C-c @" . my/hydra-orgmodes/body)
+ ("C-c #" . my/hydra-outline/body)
+ ("C-c 3" . my/hydra-outline/body)
+ )
+ :config
+ (defhydra my/hydra-orgmodes (:color blue :hint nil)
"
- ("n" (find-file "~/projects/org-notes/notes.org"))
- ("c" (find-file "~/projects/org-notes/chaim.org"))
- ("w" (find-file "~/projects/org-notes/wildman.org"))
- ("u" (find-file "~/projects/org-notes/uddin.org"))
- ("o" (find-file "~/projects/org-notes/ool.org"))
- ("f" (find-file "~/projects/org-notes/fh.org"))
- ("s" (find-file "~/projects/org-notes/sndservers.org"))
- ("r" (find-file my/org-refile-file))
- ("p" (find-file "~/projects/research/papers_to_read.org"))
- ("R" (find-file "~/projects/research/paper_notes.org"))
- ("h" (find-file "~/projects/org-notes/hpcbio.org"))
- ("q" nil "quit")
- ("z" nil "quit")
- )
-
- ;; from https://github.com/abo-abo/hydra/wiki/Emacs
- (defhydra my/hydra-outline (:color pink :hint nil)
- "
- ^Hide^ ^Show^ ^Move
- ^^^^^^------------------------------------------------------
- _q_: sublevels _a_: all _u_: up
- _t_: body _e_: entry _n_: next visible
- _o_: other _i_: children _p_: previous visible
- _c_: entry _k_: branches _f_: forward same level
- _l_: leaves _s_: subtree _b_: backward same level
- _d_: subtree
+_n_: notes _c_: chaim _w_: wildman _o_: ool
+_u_: uddin _s_: steve _r_: refile _f_: fh
+_p_: read papers _R_: paper notes
+_h_: hpcbio
+_q_: quit
+_z_: quit
+"
+ ("n" (find-file "~/projects/org-notes/notes.org"))
+ ("c" (find-file "~/projects/org-notes/chaim.org"))
+ ("w" (find-file "~/projects/org-notes/wildman.org"))
+ ("u" (find-file "~/projects/org-notes/uddin.org"))
+ ("o" (find-file "~/projects/org-notes/ool.org"))
+ ("f" (find-file "~/projects/org-notes/fh.org"))
+ ("s" (find-file "~/projects/org-notes/sndservers.org"))
+ ("r" (find-file my/org-refile-file))
+ ("p" (find-file "~/projects/research/papers_to_read.org"))
+ ("R" (find-file "~/projects/research/paper_notes.org"))
+ ("h" (find-file "~/projects/org-notes/hpcbio.org"))
+ ("q" nil "quit")
+ ("z" nil "quit")
+ )
+ ;; from https://github.com/abo-abo/hydra/wiki/Emacs
+ (defhydra my/hydra-outline (:color pink :hint nil)
"
- ;; Hide
- ("q" outline-hide-sublevels) ; Hide everything but the top-level headings
- ("t" outline-hide-body) ; Hide everything but headings (all body lines)
- ("o" outline-hide-other) ; Hide other branches
- ("c" outline-hide-entry) ; Hide this entry's body
- ("l" outline-hide-leaves) ; Hide body lines in this entry and sub-entries
- ("d" outline-hide-subtree) ; Hide everything in this entry and sub-entries
- ;; Show
- ("a" outline-show-all) ; Show (expand) everything
- ("e" outline-show-entry) ; Show this heading's body
- ("i" outline-show-children) ; Show this heading's immediate child sub-headings
- ("k" outline-show-branches) ; Show all sub-headings under this heading
- ("s" outline-show-subtree) ; Show (expand) everything in this heading & below
- ;; Move
- ("u" outline-up-heading) ; Up
- ("n" outline-next-visible-heading) ; Next
- ("p" outline-previous-visible-heading) ; Previous
- ("f" outline-forward-same-level) ; Forward - same level
- ("b" outline-backward-same-level) ; Backward - same level
- ("z" nil "leave"))
- )
+^Hide^ ^Show^ ^Move
+^^^^^^------------------------------------------------------
+_q_: sublevels _a_: all _u_: up
+_t_: body _e_: entry _n_: next visible
+_o_: other _i_: children _p_: previous visible
+_c_: entry _k_: branches _f_: forward same level
+_l_: leaves _s_: subtree _b_: backward same level
+_d_: subtree
+
+"
+ ;; Hide
+ ("q" outline-hide-sublevels) ; Hide everything but the top-level headings
+ ("t" outline-hide-body) ; Hide everything but headings (all body lines)
+ ("o" outline-hide-other) ; Hide other branches
+ ("c" outline-hide-entry) ; Hide this entry's body
+ ("l" outline-hide-leaves) ; Hide body lines in this entry and sub-entries
+ ("d" outline-hide-subtree) ; Hide everything in this entry and sub-entries
+ ;; Show
+ ("a" outline-show-all) ; Show (expand) everything
+ ("e" outline-show-entry) ; Show this heading's body
+ ("i" outline-show-children) ; Show this heading's immediate child sub-headings
+ ("k" outline-show-branches) ; Show all sub-headings under this heading
+ ("s" outline-show-subtree) ; Show (expand) everything in this heading & below
+ ;; Move
+ ("u" outline-up-heading) ; Up
+ ("n" outline-next-visible-heading) ; Next
+ ("p" outline-previous-visible-heading) ; Previous
+ ("f" outline-forward-same-level) ; Forward - same level
+ ("b" outline-backward-same-level) ; Backward - same level
+ ("z" nil "leave"))
+)
#+END_SRC
** Tramp
#+BEGIN_SRC emacs-lisp
(use-package tex
:defer t
- :ensure auctex
+ :straight auctex
+ :mode "\\.tex\\'"
:config
; (add-to-list 'TeX-style-path '"/home/don/lib/emacs_el/auctex/style")
;; REFTEX (much enhanced management of cross-ref, labels, etc)
"latex"
'(add-to-list 'LaTeX-fill-excluded-macros
'("Sexpr")))
-
- (use-package font-latex
- :config
- (setq font-latex-match-reference-keywords
- '(
- ("fref" "{")
- ("Fref" "{")
- ("citep" "{")
- ("citet" "{")
- ("acs" "{")
- ("acsp" "{")
- ("ac" "{")
- ("acp" "{")
- ("acl" "{")
- ("aclp" "{")
- ("acsu" "{")
- ("aclu" "{")
- ("acused" "{")
- ("DLA" "{")
- ("RZ" "{")
- ("OM" "{")
- ("DL" "{")
- ("fixme" "{"))
- )
- )
+
+ (setq font-latex-match-reference-keywords
+ '(
+ ("fref" "{")
+ ("Fref" "{")
+ ("citep" "{")
+ ("citet" "{")
+ ("acs" "{")
+ ("acsp" "{")
+ ("ac" "{")
+ ("acp" "{")
+ ("acl" "{")
+ ("aclp" "{")
+ ("acsu" "{")
+ ("aclu" "{")
+ ("acused" "{")
+ ("DLA" "{")
+ ("RZ" "{")
+ ("OM" "{")
+ ("DL" "{")
+ ("fixme" "{"))
+ )
(setq font-latex-fontify-script nil)
(setq font-latex-fontify-sectioning (quote color))
(setq font-latex-script-display (quote (nil)))
#+END_SRC
** Outlining
-*** Outline magic
+*** outline minor mode
#+BEGIN_SRC emacs-lisp
-; this package doesn't really do exactly what we want it to do
-; (use-package outline-magic)
+(use-package outline
+ :ensure f
+ :delight
+ :config
+ (setq outline-minor-mode-prefix "C-c C-2")
+)
#+END_SRC
-*** Outline mode
+*** outshine (outlining) integration
#+BEGIN_SRC emacs-lisp
-;; change the outline mode prefix from C-c @ to C-c C-2
-(setq outline-minor-mode-prefix "C-c C-2")
-;;(add-hook 'outline-minor-mode-hook
-;; (lambda () (local-set-key (kbd "C-c C-2")
-;; outline-mode-prefix-map)))
-
+(use-package outshine
+ :after outline
+ :hook (outline-minor-mode . outshine-mode)
+)
#+END_SRC
** Writeroom Mode
#+BEGIN_SRC emacs-lisp
** Web Mode
#+BEGIN_SRC emacs-lisp
(use-package web-mode
- :load-path "/home/don/projects/web-mode/"
:mode ("\\.\\(tx|tmpl\\)\\'" . web-mode)
:config
(add-to-list 'auto-mode-alist '("\\.tmpl\\'" . web-mode))
** Spamassassin Mode
#+BEGIN_SRC emacs-lisp
(use-package spamassassin-mode
+ :straight nil
+ :load-path "~/lib/emacs_el"
:commands spamassassin-mode
)
#+END_SRC
** CSS mode
#+BEGIN_SRC emacs-lisp
(use-package css
+ :straight css-mode
:mode "\\.css'"
:config
;; fix up css mode to not be silly
** Abbrev Mode
#+BEGIN_SRC emacs-lisp
(use-package abbrev
+ :straight nil
:delight abbrev-mode
:config
;; load abbreviations from
(quietly-read-abbrev-file))
;; for now, use abbrev mode everywhere
+ :init
(setq default-abbrev-mode t))
#+END_SRC
** Debugging (realgud)
#+BEGIN_SRC emacs-lisp
(use-package realgud
+ :commands (realgud:pdb realgud:gdb)
)
#+END_SRC
** Python Programming
#+BEGIN_SRC emacs-lisp
(use-package python-mode
- :delight 🐍
+ :delight Py 🐍
:hook
(python-mode . pyenv-mode)
(python-mode . flycheck-mode)
#+END_SRC
*** Black
#+begin_src emacs-lisp :tangle yes
- (use-package python-black
- :demand t
- :after python)
+(use-package python-black
+ :demand t
+ :after python)
#+end_src
*** Sphinx Documentation
#+begin_src emacs-lisp :tangle yes
(use-package numpydoc
- :ensure t
:after python
:bind (:map python-mode-map
("C-c C-n" . numpydoc-generate)))
(use-package sphinx-doc
- :ensure t
:config
(sphinx-doc-mode t)
(setq sphinx-doc-include-types t)
- :after python)
+ :after python
+ :hook (python-mode . sphinx-doc)
+ )
(use-package python-docstring
- :ensure t
+ :delight
:after python
- :hook
- (python-mode . python-docstring-mode)
+ :hook (python-mode . python-docstring-mode)
)
#+end_src
** Go language
** Beancount
#+BEGIN_SRC emacs-lisp
(use-package beancount
+ :straight nil
:load-path "~/lib/emacs_el/beancount-mode/"
- :ensure f
:mode "\\.beancount\\'"
)
*** Message-mode
#+BEGIN_SRC emacs-lisp
(use-package message
+ :straight nil
:delight (message "✉")
:delight (message-mode "✉")
:mode ("muttng-[a-z0-9]+-[0-9]+-" . message-mode)
#+END_SRC
*** Muttrc mode
#+BEGIN_SRC emacs-lisp
-(use-package muttrc-mode
+(use-package mutt-mode
:mode "muttngrc"
:mode "muttrc"
)
#+END_SRC
*** Mail aliases
#+BEGIN_SRC emacs-lisp
-(use-package
- :straight t
- :hook message
- :config
- (setq mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
-)
+; (use-package
+; :straight t
+; :hook message
+; :config
+; (setq mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
+; )
#+END_SRC
* Base emacs
** Reverting buffers
#+END_SRC
** LaTeX configuration
#+BEGIN_SRC emacs-lisp
-(use-package org-plus-contrib
+(use-package org-contrib
:no-require t
:after org
:config
)
-#+END_SRC
-** outshine (outlining) integration
-#+BEGIN_SRC emacs-lisp
-(use-package outshine
- :ensure t
- :hook (outline-minor-mode . outshine-hook-function)
-)
#+END_SRC
** End use-package
#+BEGIN_SRC emacs-lisp
#+END_SRC
** Goto line
#+BEGIN_SRC emacs-lisp
- (global-unset-key "\M-g")
- (global-set-key (kbd "M-g l") 'goto-line)
+ ; (global-unset-key "\M-g")
+ ; (global-set-key (kbd "M-g l") 'goto-line)
#+END_SRC
* Debian
** debian-changelog
#+BEGIN_SRC emacs-lisp
- (use-package debian-changelog-mode
- :mode "debian/changelog"
- :config
- (setq debian-changelog-mailing-address "don@debian.org")
- (setq debian-changelog-full-name "Don Armstrong"))
+(use-package debian-changelog-mode
+ :mode "debian/changelog"
+ :ensure debian-el
+ :config
+ (setq debian-changelog-mailing-address "don@debian.org")
+ (setq debian-changelog-full-name "Don Armstrong"))
#+END_SRC
* Misc (uncharacterized)
#+BEGIN_SRC emacs-lisp
If the envvar EMACS_SERVER_NAME is set, consider this a separate
emacs, and use a different desktop file to restore history
#+BEGIN_SRC emacs-lisp
- (use-package desktop
- :demand
- :config
- (setq desktop-base-file-name
- (convert-standard-filename
- (concat ".emacs"
- (or (getenv "EMACS_SERVER_NAME")
- "")
- ".desktop")
- ))
- (setq desktop-base-lock-name
- (convert-standard-filename
- (concat desktop-base-file-name
- ".lock")))
- (setq desktop-auto-save-timeout 60)
- (setq desktop-restore-eager 5)
- (setq desktop-lazy-verbose nil)
- (desktop-save-mode 1)
- ; (desktop-read)
- )
+(use-package desktop
+ :demand
+ :config
+ (setq desktop-base-file-name
+ (convert-standard-filename
+ (concat ".emacs"
+ (or (getenv "EMACS_SERVER_NAME")
+ "")
+ ".desktop")
+ ))
+ (setq desktop-base-lock-name
+ (convert-standard-filename
+ (concat desktop-base-file-name
+ ".lock")))
+ (setq desktop-auto-save-timeout 60)
+ (setq desktop-restore-eager 5)
+ (setq desktop-lazy-verbose nil)
+ (desktop-save-mode 1)
+ ; (desktop-read)
+)
#+END_SRC
** Misc (Uncharacterized)
#+BEGIN_SRC emacs-lisp