From 953de5b7764a96ec1ab08fd5443cbe878893fbfb Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 14 Jun 2020 14:23:33 +0200 Subject: Switch to straight.el --- emacs-init.org | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) (limited to 'emacs-init.org') diff --git a/emacs-init.org b/emacs-init.org index 2f5e448..ba85711 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-init.el :results silent +#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-init.el :results silent :noweb yes * Overview ** About this document This files contains all the elisp code normally placed in the .emacs @@ -88,8 +88,10 @@ load this file here. This is the content of =init.el=. Notice the ~:tangle tangle/init.el~ header argument in the source code. #+begin_src emacs-lisp :tangle tangle/init.el -(require 'package) -(package-initialize) +<> + +;; package.el to enable use of list-packages +<> ;; (setq safe-local-variable-values (list (cons 'buffer-auto-save-file-name nil) ;; (cons 'header-line-format " "))) (setq vc-follow-symlinks t) @@ -116,22 +118,44 @@ Notable configs: - [[http://doc.norang.ca/org-mode.html][Bernt Hansen]] * Base settings -** Setup some paths +** Setup load path +Folder for additional lisp files I may want to load. #+BEGIN_SRC emacs-lisp (add-to-list 'load-path "~/.emacs.d/lisp") -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) -(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") nil) #+END_SRC ** Meta packages Packages that don't do anything by themselves, but can be used to help with other package definition and customization. +*** package.el +=package.el= setup. While I switched to [[id:eef88cd4-f2f5-4e4b-b7bb-75faac36dcb8][straight.el]], I keep =package.el= loaded for now to be able to browse ELPA/MELPA with ~M-x list-packages~. +#+BEGIN_SRC emacs-lisp :noweb-ref package.el :tangle no +(require 'package) +;; (package-initialize) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") nil) +#+END_SRC +*** straight.el +:PROPERTIES: +:ID: eef88cd4-f2f5-4e4b-b7bb-75faac36dcb8 +:END: +[[https://github.com/raxod502/straight.el][straight.el]] is a package manager for emacs, which in contrast to =package.el= keeps track of the current package versions and supports local development on packages. See the [[https://github.com/raxod502/straight.el#comparison-to-other-package-managers][github page]] for a detailed comparison with other package managers. +#+begin_src emacs-lisp :noweb-ref straight.el :tangle no +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) +#+end_src *** Use-package #+begin_src emacs-lisp -(unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package)) -(eval-when-compile - (require 'use-package)) +(straight-use-package 'use-package) #+end_src *** Hydra #+begin_src emacs-lisp -- cgit v1.2.3 From 55af7c75d1ddf8fdaccc897585d421c28d050d34 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 14 Jun 2020 14:28:06 +0200 Subject: Convert :ensure to :straight --- emacs-init.org | 112 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'emacs-init.org') diff --git a/emacs-init.org b/emacs-init.org index ba85711..d8500ce 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -160,12 +160,12 @@ with other package definition and customization. *** Hydra #+begin_src emacs-lisp (use-package hydra - :ensure t) + :straight t) #+end_src This package allows hydra definitions in use-package. #+begin_src emacs-lisp (use-package use-package-hydra - :ensure t) + :straight t) #+end_src *** which-key In Emacs you can press =?= or =C-h= after starting a key combination @@ -174,7 +174,7 @@ small popup, which I think is more handy. #+begin_src emacs-lisp (use-package which-key :delight - :ensure t + :straight t :custom (which-key-idle-delay 0.4) :config (which-key-mode 1)) #+end_src @@ -185,7 +185,7 @@ remove it. =Try= installs packages temporarily for this emacs session only. #+begin_src emacs-lisp (use-package try - :ensure t) + :straight t) #+end_src ** GUI Interface Disable most of the user interface. @@ -207,7 +207,7 @@ leaves a gap at the bottom. This removes it. *** Remove mode line clutter #+begin_src emacs-lisp (use-package delight - :ensure t + :straight t :after use-package) #+end_src If removing mode symbols with =delight= is not enough, the mode line @@ -218,7 +218,7 @@ mode-line not being redisplayed, when turning the mode off even though it calls ~force-mode-line-update~. #+begin_src emacs-lisp (use-package hide-mode-line - :ensure t + :straight t :hook (hide-mode-line-mode . redraw-display) (help-mode . hide-mode-line-mode)) @@ -1070,7 +1070,7 @@ are for now mostly copied from [[https://gitlab.com/protesilaos/dotemacs/][Prote #+BEGIN_SRC emacs-lisp :tangle no (use-package ido-completing-read+ - :ensure t + :straight t :after ido :config (ido-ubiquitous-mode 1)) @@ -1079,7 +1079,7 @@ are for now mostly copied from [[https://gitlab.com/protesilaos/dotemacs/][Prote Ido completion for =M-x=. #+BEGIN_SRC emacs-lisp :tangle no (use-package amx - :ensure t + :straight t :after (ido ido-completing-read+) :init (setq amx-backend 'ido) @@ -1187,7 +1187,7 @@ confines of word boundaries (e.g. multiple words)." (find-name-arg "-iname")) (use-package async - :ensure t) + :straight t) (use-package dired-async :after (dired async) @@ -1197,7 +1197,7 @@ confines of word boundaries (e.g. multiple words)." *** Narrowing #+BEGIN_SRC emacs-lisp (use-package dired-narrow - :ensure t + :straight t :after dired :bind (:map dired-mode-map ("SPC" . dired-narrow-regexp))) @@ -1222,7 +1222,7 @@ behaviour while inside a regular dired buffer. #+BEGIN_SRC emacs-lisp (use-package peep-dired - :ensure t + :straight t :after dired :bind (:map dired-mode-map ("P" . peep-dired)) @@ -1259,7 +1259,7 @@ target dir). #+BEGIN_SRC emacs-lisp (use-package dired-subtree - :ensure t + :straight t :after dired :bind (:map dired-mode-map ("" . dired-subtree-toggle) @@ -1271,7 +1271,7 @@ Open a small sidebar window showing the current directory. #+BEGIN_SRC emacs-lisp (use-package dired-sidebar :bind (("C-x C-n" . dired-sidebar-toggle-sidebar)) - :ensure t + :straight t :commands (dired-sidebar-toggle-sidebar) :hook (dired-sidebar-mode . (lambda () @@ -1287,7 +1287,7 @@ Recursive directory sizes. Toggle with =C-x M-r=. This will take a while for directories with lots of nested files. #+BEGIN_SRC emacs-lisp (use-package dired-du - :ensure t + :straight t :config (setq dired-du-size-format 't)) #+END_SRC ** Tramp @@ -1303,7 +1303,7 @@ of src_shell{getconf "PATH"}. See [[elisp:(describe-variable *** Magit #+BEGIN_SRC emacs-lisp (use-package magit - :ensure t + :straight t :custom (magit-completing-read-function 'magit-ido-completing-read) :init (global-magit-file-mode)) #+END_SRC @@ -1343,7 +1343,7 @@ Only highlight the changes within a line, not the whole line. Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitflow]]. #+begin_src emacs-lisp (use-package magit-gitflow - :ensure t + :straight t :hook (magit-mode . turn-on-magit-gitflow)) #+end_src *** git-identity @@ -1351,7 +1351,7 @@ Found it in this [[https://www.manueluberti.eu/emacs/2020/03/30/lockdown-beam-gi #+begin_src emacs-lisp (use-package git-identity - :ensure t + :straight t :custom (git-identity-verify t) (git-identity-list private/git-identity-list) @@ -1366,7 +1366,7 @@ navigate and revert hunks directly from the buffer. Use =g= to open #+begin_src emacs-lisp (use-package diff-hl - :ensure t + :straight t :defer t :bind (:map fpi-map ("g" . hydra-diff-hl/body)) :init (global-diff-hl-mode 1) @@ -1403,7 +1403,7 @@ some safe local variable values. #+begin_src emacs-lisp (use-package git-auto-commit-mode :delight - :ensure t + :straight t :custom (gac-automatically-push-p nil) :config @@ -1419,7 +1419,7 @@ some safe local variable values. #+BEGIN_SRC emacs-lisp (use-package projectile - :ensure t + :straight t :delight '(:eval (concat " " (projectile-project-name))) :init (setq projectile-project-search-path '("~/git/projects/")) @@ -1460,7 +1460,7 @@ brackets containing their path. Sort buffers in project groups using projectile. #+BEGIN_SRC emacs-lisp :tangle no (use-package ibuffer-projectile - :ensure t + :straight t :after (ibuffer projectile) :hook (ibuffer-mode . (lambda () @@ -1472,7 +1472,7 @@ Sort buffers in project groups using projectile. better performance. #+begin_src emacs-lisp (use-package ibuffer-vc - :ensure t + :straight t :custom (ibuffer-formats '((mark modified read-only vc-status-mini " " @@ -1532,7 +1532,7 @@ This is a nice package for easy window focus switching. I prefer it over =windmove=, as it does not interfere with org keybindings. #+begin_src emacs-lisp (use-package window-numbering - :ensure t + :straight t :config (window-numbering-mode 1)) #+end_src *** Winner-mode @@ -1555,7 +1555,7 @@ over =windmove=, as it does not interfere with org keybindings. (use-package epa :custom (epa-pinentry-mode 'loopback)) (use-package pinentry - :ensure t + :straight t :config (pinentry-start) :after epa) #+end_src @@ -1620,7 +1620,7 @@ make sure to compile the tex document with the option ~--synctex=1~. #+BEGIN_SRC emacs-lisp (use-package pdf-tools - :ensure t + :straight t :config (setq pdf-info-epdfinfo-program (concat user-emacs-directory "epdfinfo")) (pdf-tools-install)) @@ -1645,7 +1645,7 @@ would be better to unbind them only when in ~pdf-view-mode~. ** Latex #+begin_src emacs-lisp (use-package auctex - :ensure t) + :straight t) #+end_src =cdlatex= depends on =texmath.el=. The docstring of =cdlatex= says @@ -1653,7 +1653,7 @@ would be better to unbind them only when in ~pdf-view-mode~. does not have it. So =auctex= has to deliver this dependency instead. #+begin_src emacs-lisp (use-package cdlatex - :ensure t + :straight t :custom (cdlatex-env-alist (list '("equation*" "\\begin{equation*}\nAUTOLABEL\n?\n\\end{equation*}" nil) @@ -1666,7 +1666,7 @@ does not have it. So =auctex= has to deliver this dependency instead. needed. #+begin_src emacs-lisp (use-package sotlisp - :ensure t + :straight t :init (add-hook 'emacs-lisp-mode-hook 'speed-of-thought-mode)) #+end_src @@ -1838,7 +1838,7 @@ Switch projects and subprojects from NEXT back to TODO" #+end_src #+BEGIN_SRC emacs-lisp (use-package org-noter - :ensure t + :straight t :bind (:map org-mode-map ("C-c o" . org-noter)) :custom (org-noter-default-notes-file-names '("notes.org")) ) @@ -1850,7 +1850,7 @@ Switch projects and subprojects from NEXT back to TODO" (org-export-with-broken-links 'match) (org-export-backends '(ascii beamer html icalendar latex man md odt org groff koma-letter))) (use-package org-pdftools - :ensure t + :straight t :hook (org-load . org-pdftools-setup-link)) (use-package org-id :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)) @@ -1951,7 +1951,7 @@ Switch projects and subprojects from NEXT back to TODO" Here is a list of nice ones: ◉, ○, ►, •. The default ones are ~'("◉" "○" "✸" "✿")~. #+begin_src emacs-lisp (use-package org-bullets - :ensure t + :straight t :custom (org-bullets-bullet-list '("✧")) :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) #+end_src @@ -1978,7 +1978,7 @@ Use imagemagick and standalone class for latex preview. *** org-caldav #+begin_src emacs-lisp (use-package org-caldav - :ensure t + :straight t :custom (org-caldav-url private/calendar-url) (org-caldav-calendar-id private/calendar-id) @@ -2022,7 +2022,7 @@ Use imagemagick and standalone class for latex preview. **** org-clock-convenience #+begin_src emacs-lisp (use-package org-clock-convenience - :ensure t + :straight t :bind (:map org-agenda-mode-map ("" . org-clock-convenience-timestamp-up) ("" . org-clock-convenience-timestamp-down) @@ -2032,7 +2032,7 @@ Use imagemagick and standalone class for latex preview. *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal - :ensure t) + :straight t) (use-package reveal) (setq org-reveal-root (concat "file:///home/fpi/" "reveal.js")) ;;(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/") @@ -2061,7 +2061,7 @@ Set some prettify symbols for org mode. *** org-roam #+begin_src emacs-lisp (use-package org-roam - :ensure t + :straight t :delight :hook (after-init . org-roam-mode) @@ -2077,7 +2077,7 @@ Set some prettify symbols for org mode. **** org-roam-bibtex #+begin_src emacs-lisp :tangle no (use-package org-roam-bibtex - :ensure t + :straight t :hook (org-roam-mode . org-roam-bibtex-mode) :bind (:map org-mode-map (("C-c n a" . orb-note-actions)))) @@ -2092,7 +2092,7 @@ hydra to manage the various =org-edna= properties. I call it in my explanations checkout his config. #+begin_src emacs-lisp (use-package org-edna - :ensure t + :straight t :after org :defer t :config @@ -2376,7 +2376,7 @@ A small function to toggle the encryption state of the current entry. **** org-ref #+begin_src emacs-lisp (use-package org-ref - :ensure t + :straight t :custom (org-ref-bibliography-notes nil) (org-ref-notes-function 'org-ref-notes-function-many-files) @@ -2839,7 +2839,7 @@ files about various topics. =Deft= handles searching and file creation. #+begin_src emacs-lisp (use-package deft - :ensure t + :straight t :custom ((deft-directory "~/git/projects/zettel") (deft-extensions '("org")) (deft-default-extension "org") @@ -2855,7 +2855,7 @@ custom link format. #+begin_src emacs-lisp (use-package zetteldeft - :ensure t + :straight t :bind (:map fpi-map (("d d" . deft) ("d D" . zetteldeft-deft-new-search) ("d R" . deft-refresh) @@ -2883,7 +2883,7 @@ custom link format. To open and hide a shell quickly I use =shell-pop=. #+begin_src emacs-lisp (use-package shell-pop - :ensure t + :straight t :bind (("C-!" . shell-pop)) :custom (shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda nil (eshell)))))) @@ -2914,11 +2914,11 @@ bind a small function to copy a password or a field if called with a prefix to my custom keymap. #+BEGIN_SRC emacs-lisp (use-package pass - :ensure t) + :straight t) #+END_SRC #+begin_src emacs-lisp (use-package password-store - :ensure t + :straight t :commands (password-store-copy password-store-edit password-store-insert) @@ -2947,19 +2947,19 @@ user: root #+BEGIN_SRC emacs-lisp (use-package auth-source-pass - :ensure t + :straight t :config (auth-source-pass-enable)) #+END_SRC ** Ledger Here is a good [[https://www.reddit.com/r/emacs/comments/8x4xtt][reddit thread]] about using ledger #+BEGIN_SRC emacs-lisp (use-package ledger-mode - :ensure t + :straight t :init (setq ledger-clear-whole-transactions 1) :mode "\\.dat\\'" "\\.ledger\\'") ;; (use-package flycheck-ledger -;; :ensure t +;; :straight t ;; :after ledger-mode) #+END_SRC @@ -2970,7 +2970,7 @@ transactions. They are defined in [[file:emacs-private.el.gpg::4][emacs-private. #+BEGIN_SRC emacs-lisp (use-package elfeed - :ensure t + :straight t :init (setq elfeed-db-directory "~/.emacs.d/elfeed") :custom @@ -3028,7 +3028,7 @@ Load elfeed org after adding ~my/elfeed-mark-read~ to first before marking them unread based on their tag. #+BEGIN_SRC emacs-lisp (use-package elfeed-org - :ensure t + :straight t :config (elfeed-org) (setq rmh-elfeed-org-files (list "~/.emacs.d/elfeed.org"))) @@ -3116,9 +3116,9 @@ where it comes from. #+begin_src emacs-lisp (use-package gnuplot - :ensure t) + :straight t) (use-package gnuplot-mode - :ensure t) + :straight t) #+end_src ** HTML renderer =shr= is the /Simple HTML renderer/ library, which Emacs uses to @@ -3150,7 +3150,7 @@ tools. Support for HTML code blocks with proper syntax highlighting. See [[https://github.com/xuchunyang/shr-tag-pre-highlight.el][its GitHub project page]]. #+BEGIN_SRC emacs-lisp (use-package shr-tag-pre-highlight - :ensure t + :straight t :after shr :config (add-to-list 'shr-external-rendering-functions @@ -3191,7 +3191,7 @@ I use =msmtp= to send mail. (use-package mm-decode :config (use-package spice-mode - :ensure t) + :straight t) (defun mm-display-spice-inline (handle) "Show an spice mode text from HANDLE inline." (mm-display-inline-fontify handle 'spice-mode)) @@ -3213,7 +3213,7 @@ searching. - Setup format=flowed #+BEGIN_SRC emacs-lisp (use-package notmuch - :ensure t + :straight t :custom (notmuch-search-oldest-first nil) (notmuch-archive-tags '("-inbox" "-td" "+archived")) @@ -3236,7 +3236,7 @@ message initialization (signature, ...) also have this text property. For now I use this bad code. #+BEGIN_SRC emacs-lisp (use-package messages-are-flowing - :ensure t + :straight t :config (add-hook 'message-mode-hook 'messages-are-flowing-use-and-mark-hard-newlines)) (defun message-insert-signature (&optional force) (interactive) @@ -3304,7 +3304,7 @@ For now I use this bad code. ** BBDB #+begin_src emacs-lisp (use-package bbdb - :ensure t) + :straight t) (bbdb-initialize 'gnus 'message) (bbdb-mua-auto-update-init 'gnus 'message) @@ -3624,7 +3624,7 @@ temporary buffer is created. #+begin_src emacs-lisp :tangle no (use-package undo-propose - :ensure t + :straight t :bind (("C-/" . undo-propose))) #+end_src ** Electric stuff -- cgit v1.2.3 From 71e791e925cb44aac6649023d5c48e8e693e5481 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 14 Jun 2020 14:48:20 +0200 Subject: Remove :defer keywords --- emacs-init.org | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'emacs-init.org') diff --git a/emacs-init.org b/emacs-init.org index d8500ce..913e171 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1367,7 +1367,6 @@ navigate and revert hunks directly from the buffer. Use =g= to open #+begin_src emacs-lisp (use-package diff-hl :straight t - :defer t :bind (:map fpi-map ("g" . hydra-diff-hl/body)) :init (global-diff-hl-mode 1) :config (defhydra hydra-diff-hl (:body-pre (diff-hl-mode 1) @@ -1719,9 +1718,9 @@ Hansen's]] configs. #+begin_src emacs-lisp (use-package org - :ensure org-plus-contrib + ;; :ensure org-plus-contrib + :straight t :delight (org-cdlatex-mode) - :defer t :bind (("C-c c" . org-capture) ("C-c a" . org-agenda) @@ -2094,7 +2093,6 @@ explanations checkout his config. (use-package org-edna :straight t :after org - :defer t :config (org-edna-load) (defun org-edna-finder/link-ids (&rest ids) -- cgit v1.2.3 From 1ccd611b0639238dbd4aab21f28a745f9c6875cd Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 14 Jun 2020 14:48:30 +0200 Subject: Add relevant straight.el documentation excerpts --- emacs-init.org | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'emacs-init.org') diff --git a/emacs-init.org b/emacs-init.org index 913e171..203a182 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -153,6 +153,50 @@ with other package definition and customization. (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) #+end_src +**** straight.el documentation excerpts +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: +***** General usage +#+begin_quote +- To restore each package to its canonical state (a clean working + directory with the main branch checked out, and the remotes set + correctly), run ~M-x straight-normalize-package~ or ~M-x + straight-normalize-all~. +- To fetch from each package's configured remote, run ~M-x + straight-fetch-package-and-deps~ or ~M-x straight-fetch-all~; to + also fetch from the upstream for forked packages, supply a prefix + argument. +- To merge changes from each package's configured remote, run ~M-x + straight-merge-package-and-deps~ or ~M-x straight-merge-all~; to + also merge from the upstream for forked packages, supply a prefix + argument. +- To push all local changes to each package's configured remote, run + ~M-x straight-push-package~ or ~M-x straight-push-all~. +#+end_quote +***** Freezing package versions +#+begin_quote +To save the currently checked out revisions of all of your packages, +run ~M-x straight-freeze-versions~. The resulting file +(~~/.emacs.d/straight/versions/default.el~), together with your +init-file, perfectly define your package configuration. Keep your +version lockfile checked into version control; when you install your +Emacs configuration on another machine, the versions of packages +specified in your lockfile will automatically be checked out after the +packages are installed. You can manually revert all packages to the +revisions specified in the lockfile by running ~M-x +straight-thaw-versions~. +#+end_quote +***** =use-package= integration +#+begin_src emacs-lisp +(use-package el-patch + :straight (:host github :repo "raxod502/el-patch" + :branch "develop")) +(use-package tex-site + :straight (auctex :host github + :repo "emacsmirror/auctex" + :files (:defaults (:exclude "*.el.in")))) +#+end_src *** Use-package #+begin_src emacs-lisp (straight-use-package 'use-package) -- cgit v1.2.3 From 7436c81b662994312cf3d4078b96337538380e86 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 15 Jun 2020 08:11:14 +0200 Subject: Update odd package specifications & reorder loading - To make sure org is loaded with straight any org-crypt stuff is moved back. - load-theme is moved to the end to ensure pdf-tools is loaded beforehand. - Fix various other warnings --- emacs-init.org | 105 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 43 deletions(-) (limited to 'emacs-init.org') diff --git a/emacs-init.org b/emacs-init.org index 203a182..5ecd5b8 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -26,18 +26,18 @@ file, [[elisp:(find-library "org-crypt")][org-crypt]] is a possible solution. Ma private information with the tag =:crypt:= and adding the following to =init.el= works as a basic setup for =org-crypt=. Also make sure to disable ~buffer-auto-save-file-name~ for the files. -#+BEGIN_SRC emacs-lisp -(require 'org) -(require 'org-crypt) -(org-crypt-use-before-save-magic) -(setq org-tags-exclude-from-inheritance (quote ("crypt"))) -(setq org-crypt-key "F1EF502F9E81D81381B1679AF973BBEA6994521B") +#+BEGIN_SRC emacs-lisp :noweb-ref org-crypt :tangle no +(use-package org-crypt + :config (org-crypt-use-before-save-magic) + :custom + (org-tags-exclude-from-inheritance (quote ("crypt"))) + (org-crypt-key "F1EF502F9E81D81381B1679AF973BBEA6994521B")) #+END_SRC I use =.org= configuration files also for my other dotfiles. To ensure they are tangled upon save I use this function. #+NAME: tangle-hook -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (defun fpi/tangle-dotfiles () "If the current file is in '~/.dotfiles' tangle all code blocks." (when (equal (file-name-directory (directory-file-name buffer-file-name)) @@ -54,7 +54,7 @@ saved again. The latter part is not directly supported by =org=. and not inside the source =.org= file. Instead I add an advice to ~org-babel-tangle~. #+NAME: org-crypt-tangle-setup -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (defun save-without-hook () (let ((before-save-hook nil)) (save-buffer))) @@ -153,6 +153,10 @@ with other package definition and customization. (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) #+end_src + +#+BEGIN_SRC emacs-lisp +(setq straight-profiles `((nil . ,(expand-file-name "package-versions.el" "~/git/projects/dotfiles")))) +#+END_SRC **** straight.el documentation excerpts :PROPERTIES: :header-args:emacs-lisp: :tangle no @@ -301,7 +305,12 @@ appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][mod theme promising high color contrast. I ended up using the =spacemacs-light= and =spacemacs-dark= themes. #+begin_src emacs-lisp -(package-install 'spacemacs-theme) +(use-package spacemacs-light-theme + :no-require t + :straight (spacemacs-theme)) +(use-package spacemacs-dark-theme + :no-require t + :straight (spacemacs-theme)) #+end_src =Face-remap= is a library for basic face remapping. =Buffer-face-mode= @@ -891,13 +900,13 @@ The above macro can be used like this. #+end_src Advice =load-theme= to also update the colors for =pdf-view-midnight-mode=. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no :noweb-ref load-theme (defadvice load-theme (after update-pdf-view-midnight-color activate) (setq pdf-view-midnight-colors `(,(face-attribute 'default :foreground) . ,(face-attribute 'default :background)))) #+end_src -Finally load the theme. -#+begin_src emacs-lisp +Finally load the theme. The code is here, but only executed at the end of the initialization after ~pdf-view-midnight-colors~, etc. are defined. +#+begin_src emacs-lisp :tangle no :noweb-ref load-theme (load-theme 'spacemacs-light t) #+end_src *** Scaling the height of the =default= face. @@ -1538,37 +1547,37 @@ better performance. =fit-window-to-buffer= automatically shrinks the current buffer based on the amount of displayed text. #+begin_src emacs-lisp -(use-package window - :custom - (fit-window-to-buffer-horizontally t) - :bind (:map fpi-map ("s" . fit-window-to-buffer))) + (use-package window + :init + <> + :custom + (fit-window-to-buffer-horizontally t) + :bind (:map fpi-map ("s" . fit-window-to-buffer)) + ) #+end_src *** Window rules -#+begin_src emacs-lisp -(use-package window - :init - (setq display-buffer-alist - '( - ("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|Messages\\)\\*" - (display-buffer-in-side-window) - (window-height . 0.16) - (side . top) - (slot . 0) - (window-parameters . ((no-other-window t)))) - (".*\\*Completions.*" - (display-buffer-in-side-window) - (window-height . 0.16) - (side . bottom) - (slot . 0)) - ("\\*Help.*" - (display-buffer-in-side-window) - (window-width . 0.2) - (side . left) - (slot . 0) - (window-parameters . ((no-other-window . t) - (mode-line-format . (" " - mode-line-buffer-identification))))) - ))) +#+begin_src emacs-lisp :noweb-ref window +(setq display-buffer-alist + '(("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|Messages\\)\\*" + (display-buffer-in-side-window) + (window-height . 0.16) + (side . top) + (slot . 0) + (window-parameters . ((no-other-window t)))) + (".*\\*Completions.*" + (display-buffer-in-side-window) + (window-height . 0.16) + (side . bottom) + (slot . 0)) + ("\\*Help.*" + (display-buffer-in-side-window) + (window-width . 0.2) + (side . left) + (slot . 0) + (window-parameters . ((no-other-window . t) + (mode-line-format . (" " + mode-line-buffer-identification))))) + )) #+end_src *** window-numbering This is a nice package for easy window focus switching. I prefer it @@ -1688,6 +1697,7 @@ would be better to unbind them only when in ~pdf-view-mode~. ** Latex #+begin_src emacs-lisp (use-package auctex + :no-require t :straight t) #+end_src @@ -1762,8 +1772,7 @@ Hansen's]] configs. #+begin_src emacs-lisp (use-package org - ;; :ensure org-plus-contrib - :straight t + :straight (org-plus-contrib) :delight (org-cdlatex-mode) :bind (("C-c c" . org-capture) @@ -1846,6 +1855,10 @@ Switch projects and subprojects from NEXT back to TODO" ((and (member (org-get-todo-state) (list "NEXT")) (bh/is-project-p)) "INPROGRESS"))))) + +<> +<> +<> #+end_src #+begin_src emacs-lisp (use-package org-indent @@ -3687,3 +3700,9 @@ temporary buffer is created. (electric-pair-mode 1) (electric-quote-mode -1)) #+end_src +* Wrapping up + +Some stuff that is run after everything else. +#+begin_src emacs-lisp +<> +#+end_src -- cgit v1.2.3