From 77c344c9f18408fd4b84c126c82ccf1707289c71 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jan 2020 17:53:34 +0100 Subject: A fresh emacs config --- emacs-init.org | 2885 ++++++++++++++++++++++++++++++++++++++++++++++++++ emacs-private.el.gpg | Bin 0 -> 784 bytes init-exwm.org | 412 +++++++ 3 files changed, 3297 insertions(+) create mode 100644 emacs-init.org create mode 100644 emacs-private.el.gpg create mode 100644 init-exwm.org diff --git a/emacs-init.org b/emacs-init.org new file mode 100644 index 0000000..f72403f --- /dev/null +++ b/emacs-init.org @@ -0,0 +1,2885 @@ +#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-init.el :results silent +* Overview +** About this document +This files contains all the elisp code normally placed in the .emacs +file. It and the =init.el= file are then symlinked to my =~/.emacs.d/= +directory. Instead of symlinking the files could also be directly +tangled to =~/.emacs.d/=. +#+BEGIN_SRC shell :results silent +ln -sf $(pwd)/emacs-init.org ~/.emacs.d/ +ln -sf $(pwd)/tangle/emacs-init.el ~/.emacs.d/ +ln -sf $(pwd)/emacs-private.el.gpg ~/.emacs.d/ +ln -sf $(pwd)/tangle/init.el ~/.emacs.d/ +#+END_SRC + +An often seen setup is to use ~org-babel-load-file~ in =init.el= to +load this =.org= configuration file. Instead I chose to auto-tangle +the =.org= file on every save and load the tangled =.el= file +directly. This saves time on startup as tangling does not occur +everytime and also allows for more flexibility regarding tangling file +locations in this configuration file. Namely I can include the content +of =init.el= in this file without problems. + +I use =.org= configuration files also for my other dotfiles. To ensure +they are tangled upon save I use this function. +#+BEGIN_SRC emacs-lisp +(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)) + (expand-file-name "git/projects/dotfiles/" (getenv "HOME"))) + (org-babel-tangle) + (message "%s tangled" buffer-file-name))) + +(add-hook 'after-save-hook #'fpi/tangle-dotfiles) +#+END_SRC + +To share this configuration publicly, even though it contains private +information, several solutions are possible. To keep everything in one +file, [[elisp:(find-library "org-crypt")][org-crypt]] is a possible solution. Marking the headings with +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~ in this file. +#+begin_src emacs-lisp :tangle no :eval never +(require 'org-crypt) +(org-crypt-use-before-save-magic) +(setq org-tags-exclude-from-inheritance (quote ("crypt"))) +(setq org-crypt-key my-gpg-key-id) +#+end_src +To properly tangle this configuration all blocks need to be decrypted +before tangling. Given the structure of =org-babel-tangle= this leads +to saving the file twice each time. The first time unencrypted and +then after tangling is complete once again encrypted. The following +code can achieve this. +#+begin_src emacs-lisp :tangle no :eval never +;; Make sure buffers are decrypted before tangling +(defun save-buffer-without-tangle () + (interactive) + (let ((b (current-buffer))) + (with-temp-buffer + (let ((after-save-hook (remove 'fpi/tangle-dotfiles after-save-hook))) + (with-current-buffer b + (let ((after-save-hook (remove 'fpi/tangle-dotfiles after-save-hook))) + (save-buffer))))))) + +;; before tangling: decrypt all and save without encrypt +(advice-add 'org-babel-tangle :before '(lambda (&rest r) + (remove-hook 'before-save-hook 'org-encrypt-entries t) + (org-decrypt-entries) + (save-buffer-without-tangle))) +;; after tangling: encrypt all entries and re-add hook +(advice-add 'org-babel-tangle :after '(lambda (&rest r) + (org-encrypt-entries) + (add-hook 'before-save-hook 'org-encrypt-entries nil t) + (save-buffer-without-tangle))) +#+end_src +Unfortunately this leads to unusable diffs in =git= for the encrypted +parts. The approach of using a separate =.el.gpg= or =.org.gpg= file +has the same problem. But git can be told to decrypt =.gpg= files +before creating the diff using the following settings (see [[https://magit.vc/manual/magit/How-to-show-diffs-for-gpg_002dencrypted-files_003f.html][here]]). +#+begin_src shell +git config --global diff.gpg.textconv "gpg --no-tty --decrypt" +echo "*.gpg filter=gpg diff=gpg" > .gitattributes +#+end_src +A similar behaviour can be achieved using [[https://github.com/AGWA/git-crypt][git-crypt]]. I save private +details in =emacs-private.el.gpg= and load this file here. +#+begin_src emacs-lisp +(setq secret-file (expand-file-name "emacs-private.el.gpg" + user-emacs-directory)) +(load secret-file) +#+end_src + +This is the content of =init.el=. Notice the ~:tangle tange/init.el~ +header argument in the source code. +#+begin_src emacs-lisp :tangle tangle/init.el +(require 'package) +(package-initialize) +;; (setq safe-local-variable-values (list (cons 'buffer-auto-save-file-name nil) + ;; (cons 'header-line-format " "))) +(setq vc-follow-symlinks t) +(load (expand-file-name "emacs-init.el" user-emacs-directory)) +#+end_src + +I always wanted to reorganize my old init file with >5000 lines, but +never managed to do it completely. So I decided to start from scratch. +The structure and some of the base content is loosely based on the +[[https://gitlab.com/protesilaos/dotemacs/][config of Protesilaos Stavrou]]. Several functions and definitions are +from other configs as well. They are mentioned in the appropriate +places. + +Notable configs: +- [[https://gitlab.com/protesilaos/dotemacs/][Protesilaos Stavrou]] +- [[http://doc.rix.si/cce/cce.html][Ryan Rix]] +- [[http://doc.norang.ca/org-mode.html][Bernt Hansen]] + +* Base settings +** Setup some paths +#+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. +*** 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)) +#+end_src +*** Hydra +#+begin_src emacs-lisp +(use-package hydra + :ensure t) +#+end_src +This package allows hydra definitions in use-package. +#+begin_src emacs-lisp +(use-package use-package-hydra + :ensure t) +#+end_src +*** which-key +In Emacs you can press =?= or =C-h= after starting a key combination +to get a list of available commands. =which-key= shows these in a +small popup, which I think is more handy. +#+begin_src emacs-lisp +(use-package which-key + :ensure t + :custom (which-key-idle-delay 0.4) + :config (which-key-mode 1)) +#+end_src +*** Try +Sometimes I stumble over a package and want to try it out without +commiting to it and installing it fully – possibly forgetting to +remove it. =Try= installs packages temporarily for this emacs session +only. +#+begin_src emacs-lisp +(use-package try + :ensure t) +#+end_src +** GUI Interface +Disable most of the user interface. + +#+BEGIN_SRC emacs-lisp +(use-package emacs + :config + (tooltip-mode -1) + (tool-bar-mode -1) + (menu-bar-mode -1) + (scroll-bar-mode -1) + ) +#+END_SRC +In /awesomewm/ and other tiling window managers the emacs window +leaves a gap at the bottom. This removes it. +#+BEGIN_SRC emacs-lisp +(setq frame-resize-pixelwise t) +#+END_SRC +*** Remove mode line clutter +#+begin_src emacs-lisp +(use-package delight + :ensure t + :after use-package) +#+end_src +If removing mode symbols with =delight= is not enough, the mode line +can also be completely removed by setting ~mode-line-format~ to ~nil~. +=hide-mode-line= is a small minor mode that can toggle the mode-line +on and off. I added ~redraw-display~, because i had problems with the +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 + :hook + (hide-mode-line-mode . redraw-display) + (help-mode . hide-mode-line-mode)) +(global-set-key (kbd "C-c m") 'hide-mode-line-mode) +#+end_src +** Font +I am still not quite sure on my choice of font. + +=fpi/set-font= is a safe way to choose a font based on +availability. When starting with =emacs --daemon= it does not work as +=(font-family-list)= won't return anything. +#+begin_src emacs-lisp :tangle no + (use-package emacs + :config + (defun fpi/set-font () + (interactive) + (cond + ((member "Hack" (font-family-list)e) + (add-to-list 'default-frame-alist '(font . "Hack-12"))) + ((member "Source Code Pro" (font-family-list)) + (add-to-list 'default-frame-alist '(font . "Source Code Pro-12"))))) + (add-to-list 'default-frame-alist '(font . "Hack-12")) + ;; :hook (after-init . fpi/set-font) + ) +#+end_src + +Instead of the above code I set the font directly using =set-face-attribute=. +#+begin_src emacs-lisp +(set-face-attribute 'default nil :font "Hack-11") +#+end_src + +** Theme +=hc-zenburn= is the theme I chose for a long time. Lately I started to +appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light +theme promising high color contrast. I ended up using the +=spacemacs-light= and =spacemacs-dark= themes. +#+begin_src emacs-lisp +(package-install 'spacemacs-theme) +#+end_src + +To do some custom adjustments to it I use the following macro which +adds an advice to ~load-theme~. +#+begin_src emacs-lisp +(defmacro set-pair-faces (themes consts faces-alist) + "Macro for pair setting of custom faces. +THEMES name the pair (theme-one theme-two). CONSTS sets the variables like + ((sans-font \"Some Sans Font\") ...). FACES-ALIST has the actual faces +like: + ((face1 theme-one-attr theme-two-atrr) + (face2 theme-one-attr nil ) + (face3 nil theme-two-attr) + ...)" + (defmacro get-proper-faces () + `(let* (,@consts) + (backquote ,faces-alist))) + `(progn + ,@(mapcar + (lambda (theme) + `(defadvice load-theme + (after ,(gensym theme) last (loaded-theme &rest args) activate) + (when (equal loaded-theme (quote ,theme)) + (custom-theme-set-faces + (quote ,theme) ;; maybe instead use =user= theme? + ,@(cl-remove-if + (lambda (x) (equal x "NA")) + (mapcar + (lambda (face) + (let ((face-name (car face)) + (face-attrs (nth (cl-position theme themes) (cdr face)))) + (if face-attrs + `(quote (,face-name ((t ,face-attrs)))) + "NA"))) (get-proper-faces))) + )))) + themes))) +#+end_src + +The above macro can be used like this. +#+begin_src emacs-lisp +(set-pair-faces + ;; Themes to cycle in + (spacemacs-dark spacemacs-light) + ;; Variables + ((bg-white "#fbf8ef") + (bg-light "#222425") + (bg-dark "#1c1e1f") + (bg-darker "#1c1c1c") + (fg-white "#ffffff") + (shade-white "#efeae9") + (fg-light "#655370") + (dark-cyan "#008b8b") + (region-dark "#2d2e2e") + (region "#39393d") + (slate "#8FA1B3") + (keyword "#f92672") + (comment "#525254") + (builtin "#fd971f") + (purple "#9c91e4") + (doc "#727280") + (type "#66d9ef") + (string "#b6e63e") + (gray-dark "#999") + (gray "#bbb") + (sans-font "Source Sans Pro") + (serif-font "Merriweather") + (et-font "EtBookOt") + (sans-mono-font "Hack") + ;; (serif-mono-font "Verily Serif Mono") + (serif-mono-font "cmu typewriter text") + ) + + ;; (set-face-attribute 'default nil :font "Hack-11") +;; (set-face-attribute 'variable-pitch nil :font "EtBookOt-11") + ;; Settings + ((default + () + (:foreground ,bg-dark)) + (variable-pitch + (:family ,sans-font) + (:family ,et-font + :background nil + :foreground ,bg-dark + :height 1.2)) + (header-line + (:background nil :inherit nil) + (:background nil :inherit nil)) + ;; (company-tooltip + ;; (:background ,bg-darker + ;; :foreground ,gray) + ;; nil) + ;; (company-scrollbar-fg + ;; (:background ,comment) + ;; nil) + ;; (company-scrollbar-bg + ;; (:background ,bg-darker) + ;; nil) + ;; (company-tooltip-common + ;; (:foreground ,keyword) + ;; nil) + ;; (company-tootip-annotation + ;; (:foreground ,type) + ;; nil) + ;; (company-tooltip-selection + ;; (:background ,region) + ;; nil) + (show-paren-match + (:background ,keyword + :foreground ,bg-dark) + nil) + (magit-section-heading + (:foreground ,keyword) + nil) + (magit-header-line + (:background nil + :foreground ,bg-dark + :box nil) + (:background nil + :foreground ,bg-white + :box nil)) + (magit-diff-hunk-heading + (:background ,comment + :foreground ,gray) + nil) + (magit-diff-hunk-heading-highlight + (:background ,comment + :foreground ,fg-white) + nil) + (tooltip + (:foreground ,gray + :background ,bg-darker) + nil) + (mode-line + (:background ,bg-darker) + (:background ,bg-white + :box nil)) + (mode-line-inactive + nil + (:box nil)) + (powerline-active1 + nil + (:background ,bg-white)) + (powerline-active2 + nil + (:background ,bg-white)) + (powerline-inactive1 + nil + (:background ,bg-white)) + (powerline-inactive2 + nil + (:background ,bg-white)) + (highlight + (:background ,region + :foreground ,fg-white) + (:background ,shade-white)) + (hl-line + (:background ,region-dark) + nil) + (org-document-title + (:inherit variable-pitch + :height 1.3 + :weight normal + :foreground ,gray) + (:inherit nil + :family ,et-font + :height 1.8 + :foreground ,bg-dark + :underline nil)) + (org-document-info + (:foreground ,gray + :slant italic) + (:height 1.2 + :slant italic)) + (org-level-1 + (:inherit variable-pitch + :height 1.3 + :weight bold + :foreground ,keyword + :background ,bg-dark) + (:inherit nil + :family ,et-font + :height 1.6 + :weight normal + :slant normal + :foreground ,bg-dark)) + (org-level-2 + (:inherit variable-pitch + :weight bold + :height 1.2 + :foreground ,gray + :background ,bg-dark) + (:inherit nil + :family ,et-font + :weight normal + :height 1.3 + :slant italic + :foreground ,bg-dark)) + (org-level-3 + (:inherit variable-pitch + :weight bold + :height 1.1 + :foreground ,slate + :background ,bg-dark) + (:inherit nil + :family ,et-font + :weight normal + :slant italic + :height 1.2 + :foreground ,bg-dark)) + (org-level-4 + (:inherit variable-pitch + :weight bold + :height 1.1 + :foreground ,slate + :background ,bg-dark) + (:inherit nil + :family ,et-font + :weight normal + :slant italic + :height 1.1 + :foreground ,bg-dark)) + (org-level-5 + (:inherit variable-pitch + :weight bold + :height 1.1 + :foreground ,slate + :background ,bg-dark) + nil) + (org-level-6 + (:inherit variable-pitch + :weight bold + :height 1.1 + :foreground ,slate + :background ,bg-dark) + nil) + (org-level-7 + (:inherit variable-pitch + :weight bold + :height 1.1 + :foreground ,slate + :background ,bg-dark) + nil) + (org-level-8 + (:inherit variable-pitch + :weight bold + :height 1.1 + :foreground ,slate + :background ,bg-dark) + nil) + (org-headline-done + (:strike-through t) + (:family ,et-font + :strike-through t)) + (org-quote + (:background ,bg-dark + :family ,sans-mono-font) + nil) + (org-block + (:background ,bg-dark + :family ,sans-mono-font) + (:background nil + :height 0.9 + :foreground ,bg-dark + :family ,sans-mono-font)) + (org-block-begin-line + (:background ,bg-dark) + (:background nil + :height 0.8 + :family ,sans-mono-font + :foreground ,slate)) + (org-block-end-line + (:background ,bg-dark) + (:background nil + :height 0.8 + :family ,sans-mono-font + :foreground ,slate)) + (org-document-info-keyword + (:foreground ,comment) + (:height 0.8 + :foreground ,gray)) + (org-link + (:underline nil + :weight normal + :foreground ,slate) + (:foreground ,bg-dark)) + (org-special-keyword + (:height 0.9 + :foreground ,comment) + (:family ,sans-mono-font + :height 0.8)) + (org-todo + (:foreground ,builtin + :background ,bg-dark) + nil) + (org-done + (:inherit variable-pitch + :foreground ,dark-cyan + :background ,bg-dark) + nil) + (org-agenda-current-time + (:foreground ,slate) + nil) + (org-hide + nil + (:foreground ,bg-white)) + (org-indent + (:inherit org-hide) + (:inherit (org-hide fixed-pitch))) + (org-time-grid + (:foreground ,comment) + nil) + (org-warning + (:foreground ,builtin) + nil) + (org-date + nil + (:family ,sans-mono-font + :height 0.8)) + (org-agenda-structure + (:height 1.3 + :foreground ,doc + :weight normal + :inherit variable-pitch) + nil) + (org-agenda-date + (:foreground ,doc + :inherit variable-pitch) + (:inherit variable-pitch + :height 1.1)) + (org-agenda-date-today + (:height 1.5 + :foreground ,keyword + :inherit variable-pitch) + nil) + (org-agenda-date-weekend + (:inherit org-agenda-date) + nil) + (org-scheduled + (:foreground ,gray) + nil) + (org-upcoming-deadline + (:foreground ,keyword) + nil) + (org-scheduled-today + (:foreground ,fg-white) + nil) + (org-scheduled-previously + (:foreground ,slate) + nil) + (org-agenda-done + (:inherit nil + :strike-through t + :foreground ,doc) + (:strike-through t + :foreground ,doc)) + (org-ellipsis + (:underline nil + :foreground ,comment) + (:underline nil + :foreground ,comment)) + (org-tag + (:foreground ,doc) + (:foreground ,doc)) + (org-table + (:background nil + :family ,sans-mono-font) + (:family ,serif-mono-font + :height 0.9 + :background ,bg-white)) + (org-code + (:inherit font-lock-builtin-face) + (:inherit nil + :family ,serif-mono-font + :foreground ,comment + :height 0.9)) + (font-latex-sectioning-0-face + (:foreground ,type + :height 1.2) + nil) + (font-latex-sectioning-1-face + (:foreground ,type + :height 1.1) + nil) + (font-latex-sectioning-2-face + (:foreground ,type + :height 1.1) + nil) + (font-latex-sectioning-3-face + (:foreground ,type + :height 1.0) + nil) + (font-latex-sectioning-4-face + (:foreground ,type + :height 1.0) + nil) + (font-latex-sectioning-5-face + (:foreground ,type + :height 1.0) + nil) + (font-latex-verbatim-face + (:foreground ,builtin) + nil) + (spacemacs-normal-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (spacemacs-evilified-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (spacemacs-lisp-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (spacemacs-emacs-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (spacemacs-motion-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (spacemacs-visual-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (spacemacs-hybrid-face + (:background ,bg-dark + :foreground ,fg-white) + nil) + (bm-persistent-face + (:background ,dark-cyan + :foreground ,fg-white) + nil) + (helm-selection + (:background ,region) + nil) + (helm-match + (:foreground ,keyword) + nil) + (cfw:face-title + (:height 2.0 + :inherit variable-pitch + :weight bold + :foreground ,doc) + nil) + (cfw:face-holiday + (:foreground ,builtin) + nil) + (cfw:face-saturday + (:foreground ,doc + :weight bold) + nil) + (cfw:face-sunday + (:foreground ,doc) + nil) + (cfw:face-periods + (:foreground ,dark-cyan) + nil) + (cfw:face-annotation + (:foreground ,doc) + nil) + (cfw:face-select + (:background ,region) + nil) + (cfw:face-toolbar-button-off + (:foreground ,doc) + nil) + (cfw:face-toolbar-button-on + (:foreground ,type + :weight bold) + nil) + (cfw:face-day-title + (:foreground ,doc) + nil) + (cfw:face-default-content + (:foreground ,dark-cyan) + nil) + (cfw:face-disable + (:foreground ,doc) + nil) + (cfw:face-today + (:background ,region + :weight bold) + nil) + (cfw:face-toolbar + (:inherit default) + nil) + (cfw:face-today-title + (:background ,keyword + :foreground ,fg-white) + nil) + (cfw:face-grid + (:foreground ,comment) + nil) + (cfw:face-header + (:foreground ,keyword + :weight bold) + nil) + (cfw:face-default-day + (:foreground ,fg-white) + nil) + (dired-subtree-depth-1-face + (:background nil) + nil) + (dired-subtree-depth-2-face + (:background nil) + nil) + (dired-subtree-depth-3-face + (:background nil) + nil) + (dired-subtree-depth-4-face + (:background nil) + nil) + (dired-subtree-depth-5-face + (:background nil) + nil) + (dired-subtree-depth-6-face + (:background nil) + nil) + (nlinum-current-line + (:foreground ,builtin) + (:foreground ,bg-dark)) + (vertical-border + (:background ,region + :foreground ,region) + nil) + (which-key-command-description-face + (:foreground ,type) + nil) + (flycheck-error + (:background nil) + nil) + (flycheck-warning + (:background nil) + nil) + (font-lock-string-face + (:foreground ,string) + nil) + (font-lock-comment-face + (:foreground ,doc + :slant italic) + (:background nil + :foreground ,doc + :slant italic)) + (elfeed-search-unread-title-face + (:weight bold) + (:weight bold)) + (helm-ff-symlink + (:foreground ,slate) + nil) + (region + (:background ,region) + nil) + (header-line + (:background nil + :inherit nil) + (:background nil + :inherit nil)))) +#+end_src + +Finally load the theme. +#+begin_src emacs-lisp +(load-theme 'spacemacs-light t) +#+end_src +** User info +Set ~user-full-name~ and ~user-mail-address~. These are set in +[[file:emacs-private.el.gpg::1][emacs-private.el.gpg]]. + +#+begin_src emacs-lisp +(setq user-full-name private/user-full-name + user-mail-address private/user-mail-address) +#+end_src + +** Desktop module +This saves the state emacs was in. +#+begin_src emacs-lisp +(use-package desktop + :init + (setq desktop-dirname user-emacs-directory) + (setq desktop-base-file-name "desktop") + (setq desktop-globals-to-clear nil) + (setq desktop-missing-file-warning t) + (setq desktop-restore-eager 5) + (setq desktop-restore-frames nil) + (setq desktop-save 'ask-if-new) + :config + (desktop-save-mode 1)) +#+end_src +** Customize +#+BEGIN_SRC emacs-lisp +(use-package cus-edit + :custom + (custom-file (expand-file-name "custom.el" user-emacs-directory)) + :hook + (after-init . (lambda () + (unless (file-exists-p custom-file) + (write-region "" nil custom-file)) + (load custom-file)))) +#+END_SRC +** File and input history +*** Recentf +#+begin_src emacs-lisp +(use-package recentf + :init + (setq recentf-save-file (expand-file-name "recentf" user-emacs-directory)) + (setq recentf-max-menu-items 10) + (setq recentf-max-saved-items 200) + (setq recentf-show-file-shortcuts-flag nil) + :config + (recentf-mode 1)) +#+end_src +*** Minibuffer +#+begin_src emacs-lisp +(use-package savehist + :init + (setq savehist-file (expand-file-name "savehist" user-emacs-directory)) + (setq history-length 1000) + (setq savehist-save-minibuffer-history t) + :config + (savehist-mode 1)) +#+end_src +*** Point +Remember where point is in a file. +#+begin_src emacs-lisp +(use-package saveplace + :init + (setq save-place-file (expand-file-name "saveplace" user-emacs-directory)) + :config + (save-place-mode 1)) +#+end_src +*** Backups +#+begin_src emacs-lisp +(use-package emacs + :custom + (backup-directory-alist '(("." . "~/.emacs.d/backups"))) + (version-control t) + (delete-old-versions t) + (kept-new-versions 6) + (kept-old-versions 2) + (create-lockfiles nil)) +#+end_src +** Personal keymap + +Unfortunately =C-c [a-z]= is not always a safe place for user-defined +key bindings. I use a special keymap to aggregate common functions. I +rebind the =C-z= binding for this. +*** Toggle map to toggle common options +This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizardry.html][this post]] and I bind it to a key on my personal keymap. +#+BEGIN_SRC emacs-lisp :results silent +(define-prefix-command 'fpi/toggle-map) +(define-key fpi/toggle-map "c" #'column-number-mode) +;;(define-key fpi/toggle-map "d" #'toggle-debug-on-error) +(define-key fpi/toggle-map "f" #'auto-fill-mode) +(define-key fpi/toggle-map "l" #'scroll-lock-mode) +(define-key fpi/toggle-map "s" #'flyspell-mode) +(define-key fpi/toggle-map "t" #'toggle-truncate-lines) +(define-key fpi/toggle-map "q" #'toggle-debug-on-quit) +(define-key fpi/toggle-map "r" #'dired-toggle-read-only) +(autoload 'dired-toggle-read-only "dired" nil t) +(define-key fpi/toggle-map "w" #'whitespace-mode) +(define-key fpi/toggle-map "W" #'whitespace-toggle-options) +#+END_SRC +*** fpi-map +#+BEGIN_SRC emacs-lisp +(define-prefix-command 'fpi-map) +(unbind-key (kbd "C-z")) +(global-set-key (kbd "C-z") 'fpi-map) + +;;(define-key fpi-map (kbd "1") 'org-global-cycle) +(define-key fpi-map (kbd "a") 'org-agenda-show-agenda-and-todo) +(define-key fpi-map (kbd "b") 'bury-buffer) +(define-key fpi-map (kbd "c") 'compile) +;;(define-key fpi-map (kbd "u") 'multiple-cursors-hydra/body) +(define-key fpi-map (kbd "e") 'elfeed) +(define-key fpi-map (kbd "h") 'dfeich/context-hydra-launcher) +(define-key fpi-map (kbd "m") 'notmuch) +(define-key fpi-map (kbd "t") fpi/toggle-map) +(define-key fpi-map (kbd "n") 'sauron-toggle-hide-show) +(define-key fpi-map (kbd "j") (lambda () (interactive) (find-file org-journal-file))) +#+END_SRC + +* Selection and search methods +** Completion frameworks +Having used ido, ivy, icicles and helm in the past, I'm trying to +settle for something simple and go back to ido. The settings below +are for now mostly copied from [[https://gitlab.com/protesilaos/dotemacs/][Protesilaos Stavrou]]. +#+BEGIN_SRC emacs-lisp +(use-package ido + :init + (setq ido-everywhere t) + (setq ido-enable-flex-matching t) + (setq ido-enable-regexp nil) + (setq ido-enable-prefix nil) + (setq ido-all-frames nil) + (setq ido-buffer-disable-smart-matches t) + (setq ido-completion-buffer "*Ido Completions*") + (setq ido-completion-buffer-all-completions nil) + (setq ido-confirm-unique-completion nil) + (setq ido-create-new-buffer 'prompt) + (setq ido-default-buffer-method 'selected-window) + (setq ido-default-file-method 'selected-window) + (setq ido-enable-last-directory-history t) + (setq ido-use-filename-at-point nil) + (setq ido-use-url-at-point nil) + (setq ido-use-virtual-buffers t) + (setq ido-use-faces t) + (setq ido-max-window-height 1) + (setq ido-decorations + '(" " + " " + " | " + " | …" + "[" + "]" + " [No match]" + " [Matched]" + " [Not readable]" + " [Too big]" + " [Confirm]" + " " + " ")) + (setq ido-auto-merge-work-directories-length -1) + :config + (ido-mode 1) + :hook + (minibuffer-setup . (lambda () + (visual-line-mode 1) + (setq-local truncate-lines nil) + (setq-local resize-mini-windows nil) + (setq-local max-mini-window-height 1)))) +#+END_SRC + +#+BEGIN_SRC emacs-lisp +(use-package ido-completing-read+ + :ensure t + :after ido + :config + (ido-ubiquitous-mode 1)) +#+END_SRC +*** amx +Ido completion for =M-x=. +#+BEGIN_SRC emacs-lisp :tangle no +(use-package amx + :ensure t + :after (ido ido-completing-read+) + :init + (setq amx-backend 'ido) + (setq amx-save-file "~/.emacs.d/amx-items") + (setq amx-history-length 10) + (setq amx-show-key-bindings nil) + :config + (amx-mode 1)) +#+END_SRC +** isearch enhancements + +Once again this is mostly taken from [[https://gitlab.com/protesilaos/dotemacs/][Protesilaos Stavrou]]. + +#+BEGIN_SRC emacs-lisp +(use-package isearch + :init + (setq search-whitespace-regexp ".*") + ;; Or use the following for non-greedy matches + ;; (setq search-whitespace-regexp ".*?") + (setq isearch-lax-whitespace t) + (setq isearch-regexp-lax-whitespace nil) + :config + (defun prot/isearch-mark-and-exit () + "Marks the current search string. Can be used as a building +block for a more complex chain, such as to kill a region, or +place multiple cursors." + (interactive) + (push-mark isearch-other-end t 'activate) + (setq deactivate-mark nil) + (isearch-done)) + + (defun stribb/isearch-region (&optional not-regexp no-recursive-edit) + "If a region is active, make this the isearch default search +pattern." + (interactive "P\np") + (when (use-region-p) + (let ((search (buffer-substring-no-properties + (region-beginning) + (region-end)))) + (message "stribb/ir: %s %d %d" search (region-beginning) (region-end)) + (setq deactivate-mark t) + (isearch-yank-string search)))) + (advice-add 'isearch-forward-regexp :after 'stribb/isearch-region) + (advice-add 'isearch-forward :after 'stribb/isearch-region) + (advice-add 'isearch-backward-regexp :after 'stribb/isearch-region) + (advice-add 'isearch-backward :after 'stribb/isearch-region) + + (defun contrib/isearchp-remove-failed-part-or-last-char () + "Remove failed part of search string, or last char if successful. +Do nothing if search string is empty to start with." + (interactive) + (if (equal isearch-string "") + (isearch-update) + (if isearch-success + (isearch-delete-char) + (while (isearch-fail-pos) (isearch-pop-state))) + (isearch-update))) + + (defun contrib/isearch-done-opposite-end (&optional nopush edit) + "End current search in the opposite side of the match. +Particularly useful when the match does not fall within the +confines of word boundaries (e.g. multiple words)." + (interactive) + (funcall #'isearch-done nopush edit) + (when isearch-other-end (goto-char isearch-other-end))) + + :bind (:map isearch-mode-map + ("C-SPC" . prot/isearch-mark-and-exit) + ("DEL" . contrib/isearchp-remove-failed-part-or-last-char) + ("" . contrib/isearch-done-opposite-end))) +#+END_SRC +* Directory, project, buffer, window management +** Dired +*** Base settings +- Always do recursive copies and deletions. +- Be smart about searching file names or the whole buffer. +- Use the system trash for now. +- Customize dired output switches. +- Dont try to be smart about rename and copy target locations when + having two open dired buffers. Setting the target to the other + directory is just as easy using =M-n= twice. +- Hide details by default. =(= to toggle. +- Highlight current line. +- Let the relevant =find= commands use case-insensitive names. +- Enable asynchronous mode for copying/renaming. +#+BEGIN_SRC emacs-lisp +(use-package dired + :custom + (dired-recursive-copies 'always) + (dired-recursive-deletes 'always) + (dired-isearch-filenames 'dwim) + (delete-by-moving-to-trash t) + (dired-listing-switches "-AFlh --group-directories-first") + (dired-dwim-target nil) + :hook + (dired-mode . dired-hide-details-mode) + (dired-mode . hl-line-mode) + (dired-mode . auto-revert-mode)) + +(use-package find-dired + :after dired + :custom + (find-ls-option ;; applies to `find-name-dired' + '("-ls" . "-AFlv --group-directories-first")) + (find-name-arg "-iname")) + +(use-package async + :ensure t) + +(use-package dired-async + :after (dired async) + :config + (dired-async-mode 1)) +#+END_SRC +*** Narrowing +#+BEGIN_SRC emacs-lisp +(use-package dired-narrow + :ensure t + :after dired + :bind (:map dired-mode-map + ("SPC" . dired-narrow-regexp))) +#+END_SRC +*** wdired +Start with =C-x C-q=. +- Allow to change permissions. +- Interpret forward slash in renamed files as new subdirectory to + create. + +#+BEGIN_SRC emacs-lisp +(use-package wdired + :after dired + :init + (setq wdired-allow-to-change-permissions t) + (setq wdired-create-parent-directories t)) +#+END_SRC +*** peep-dired (file previews including images) +By default, dired does not show previews of files, while =image-dired= +is intended for a different purpose. We just want to toggle the +behaviour while inside a regular dired buffer. + +#+BEGIN_SRC emacs-lisp +(use-package peep-dired + :ensure t + :after dired + :bind (:map dired-mode-map + ("P" . peep-dired)) + :custom + (peep-dired-cleanup-on-disable t) + (peep-dired-ignored-extensions + '("mkv" "webm" "mp4" "mp3" "ogg" "iso"))) +#+END_SRC +*** dired-x +Some additional features that are shipped with Emacs. + +#+BEGIN_SRC emacs-lisp +(use-package dired-x + :after dired + :bind (("C-x C-j" . dired-jump) + ("C-x 4 C-j" . dired-jump-other-window)) + :hook + (dired-mode . (lambda () + (setq dired-clean-confirm-killing-deleted-buffers t)))) +#+END_SRC + + +*** dired-subtree ++ The tab key will expand or contract the subdirectory at point. ++ =C-TAB= will behave just like org-mode handles its headings: hit it + once to expand a subdir at point, twice to do it recursively, thrice + to contract the tree. ++ I also have Shift-TAB for contracting the subtree /when the point is + inside of it/. + +At any rate, this does not override the action of inserting a +subdirectory listing in the current dired buffer (with =i= over the +target dir). + +#+BEGIN_SRC emacs-lisp +(use-package dired-subtree + :ensure t + :after dired + :bind (:map dired-mode-map + ("" . dired-subtree-toggle) + ("" . dired-subtree-cycle) + ("" . dired-subtree-remove))) +#+END_SRC +*** dired-sidebar +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 + :commands (dired-sidebar-toggle-sidebar) + :hook + (dired-sidebar-mode . (lambda () + (unless (file-remote-p default-directory) + (auto-revert-mode)))) + :config + ;; (setq dired-sidebar-theme 'vscode) + (setq dired-sidebar-use-term-integration t)) +#+END_SRC + +*** dired-du +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 + :config (setq dired-du-size-format 't)) +#+END_SRC +** Magit + +#+BEGIN_SRC emacs-lisp +(use-package magit + :ensure t + :custom (magit-completing-read-function 'magit-ido-completing-read) + :init (global-magit-file-mode)) +#+END_SRC + +The following package is configured in accordance with the guidelines +provided by this article on [[https://chris.beams.io/posts/git-commit/][writing a Git commit message]]. + +#+BEGIN_SRC emacs-lisp +(use-package git-commit + :after magit + :custom + (git-commit-fill-column 72) + (git-commit-summary-max-length 50) + (git-commit-known-pseudo-headers + '("Signed-off-by" + "Acked-by" + "Modified-by" + "Cc" + "Suggested-by" + "Reported-by" + "Tested-by" + "Reviewed-by")) + (git-commit-style-convention-checks + '(non-empty-second-line + overlong-summary-line))) +#+END_SRC + +Only highlight the changes within a line, not the whole line. + +#+BEGIN_SRC emacs-lisp +(use-package magit-diff + :after magit + :custom + (magit-diff-refine-hunk 'all)) +#+END_SRC +*** diff-hl +Indicates changed lines in the left fringe. The Hydra can be used to +navigate and revert hunks directly from the buffer. Use =g= to open +=magit-status=. I also bind this hydra to =g= in my personal keymap. + +#+begin_src emacs-lisp +(use-package diff-hl + :ensure 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) + :hint nil) + " + Diff-hl: + _n_: next hunk _s_tage hunk _g_: Magit status + _p_: previous hunk _r_evert hunk _q_uit + ^ ^ _P_opup hunk _Q_uit and deactivate git-gutter + _a_: first hunk + _e_: last hunk _A_mend mode + " + ("n" diff-hl-next-hunk) + ("p" diff-hl-previous-hunk) + ("a" (progn (goto-char (point-min)) + (diff-hl-next-hunk))) + ("e" (progn (goto-char (point-max)) + (diff-hl-previous-hunk))) + ("s" git-gutter:stage-hunk) + ("r" diff-hl-revert-hunk) + ("P" diff-hl-diff-goto-hunk) + ("A" diff-hl-amend-mode) + ("g" magit-status :color blue) + ("q" nil :color blue) + ("Q" (diff-hl-mode -1) + :color blue)) +) +#+end_src +*** gitflow +Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitflow]]. +#+begin_src emacs-lisp +(use-package magit-gitflow + :ensure t + :hook (magit-mode . turn-on-magit-gitflow)) +#+end_src +** Projectile + +#+BEGIN_SRC emacs-lisp +(use-package projectile + :ensure t + :delight '(:eval (concat " " (projectile-project-name))) + :init + (setq projectile-project-search-path '("~/git/projects/")) + (setq projectile-indexing-method 'alien) + (setq projectile-enable-caching t) + (setq projectile-completion-system 'ido) + :config + (projectile-mode 1) + :bind (("C-c p" . projectile-command-map))) +#+END_SRC +** Working with buffers + +This renames buffers with the same name and uniqifies them using angled +brackets containing their path. +#+BEGIN_SRC emacs-lisp +(use-package uniquify + :custom + (uniquify-buffer-name-style 'forward) + (uniquify-strip-common-suffix t) + (uniquify-after-kill-buffer-p t)) +#+END_SRC +*** ibuffer + +#+BEGIN_SRC emacs-lisp +(use-package ibuffer + :custom + (ibuffer-display-summary nil) + (ibuffer-use-other-window nil) + (ibuffer-auto-mode -1) + :bind ("C-x C-b" . ibuffer) + :hook + (ibuffer-mode . ibuffer-auto-mode)) +#+END_SRC + +Sort buffers in project groups using projectile. +#+BEGIN_SRC emacs-lisp :tangle no +(use-package ibuffer-projectile + :ensure t + :after (ibuffer projectile) + :hook + (ibuffer-mode . (lambda () + (ibuffer-projectile-set-filter-groups) + (unless (eq ibuffer-sorting-mode 'recency) + (ibuffer-do-sort-by-recency))))) +#+END_SRC +=ibuffer-projectile= updates can be fairly slow. =ibuffer-vc= provides +better performance. +#+begin_src emacs-lisp +(use-package ibuffer-vc + :ensure t + :custom + (ibuffer-formats + '((mark modified read-only vc-status-mini " " + (name 18 18 :left :elide) + " " + (size 9 -1 :right) + " " + (mode 16 16 :left :elide) + " " + (vc-status 16 16 :left) + " " + vc-relative-file))) + :hook + (ibuffer . (lambda () + (ibuffer-vc-set-filter-groups-by-vc-root) + (unless (eq ibuffer-sorting-mode 'alphabetic) + (ibuffer-do-sort-by-alphabetic))))) +#+end_src +** Window configuration +=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))) +#+end_src +*** window-numbering +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 + :config (window-numbering-mode 1)) +#+end_src +*** Winner-mode +#+begin_src emacs-lisp +(use-package winner + :hook (after-init . winner-mode) + :hydra (winner-hydra + (global-map "C-c" :color red) + "Winner undo/redo" + ("" winner-undo "undo") + ("" winner-redo "redo")) + :bind (:map winner-mode-map + ("C-c " . winner-hydra/winner-undo) + ("C-c " . winner-hydra/winner-redo))) +#+end_src +* Applications and utilities +** Calendar +Some basic calendar options for date format und location to provide +correct sunrise/-set times. +#+begin_src emacs-lisp +(use-package calendar + :custom + (calendar-date-style 'european) + (calendar-latitude 52.3667) + (calendar-longitude 9.7167)) +#+end_src + +Set the holidays to consider. I only use german and christian +holidays. Note the =:init= keyword. The individual holiday lists have +to be set before =holidays= is loaded and ~calendar-holidays~ is +initialized. +#+begin_src emacs-lisp +(use-package holidays + :init + (setq holiday-bahai-holidays nil + holiday-christian-holidays + (quote + ((holiday-float 12 0 -4 "1. Advent" 24) + (holiday-float 12 0 -3 "2. Advent" 24) + (holiday-float 12 0 -2 "3. Advent" 24) + (holiday-float 12 0 -1 "4. Advent" 24) + (holiday-fixed 12 25 "1. Weihnachtstag") + (holiday-fixed 12 26 "2. Weihnachtstag") + (holiday-fixed 1 6 "Heilige Drei Könige") + (holiday-easter-etc -48 "Rosenmontag") + (holiday-easter-etc -2 "Karfreitag") + (holiday-easter-etc 0 "Ostersonntag") + (holiday-easter-etc 1 "Ostermontag") + (holiday-easter-etc 39 "Christi Himmelfahrt") + (holiday-easter-etc 49 "Pfingstsonntag") + (holiday-easter-etc 50 "Pfingstmontag") + (holiday-easter-etc 60 "Fronleichnam") + (holiday-fixed 8 15 "Mariae Himmelfahrt") + (holiday-fixed 11 1 "Allerheiligen") + (holiday-float 11 0 1 "Totensonntag" 20))) + holiday-general-holidays + (quote + ((holiday-fixed 1 1 "Neujahr") + (holiday-fixed 2 14 "Valentinstag") + (holiday-fixed 5 1 "1. Mai") + (holiday-float 5 0 2 "Muttertag") + (holiday-fixed 10 3 "Tag der Deutschen Einheit"))) + holiday-hebrew-holidays nil + holiday-islamic-holidays nil + holiday-oriental-holidays nil)) +(use-package solar + :custom + (solar-n-hemi-seasons '("Frühlingsanfang" "Sommeranfang" "Herbstanfang" "Winteranfang"))) +#+end_src +** PDFs +=PDF-Tools= provides better rendering than =DocView=, which is only +png based. It also provides pdf syncing with a tex source. To use this +make sure to compile the tex document with the option ~--synctex=1~. + +#+BEGIN_SRC emacs-lisp +(use-package pdf-tools + :ensure t + :config + (setq pdf-info-epdfinfo-program (concat user-emacs-directory "epdfinfo")) + (pdf-tools-install)) +#+END_SRC + +Add support for pdf annotations. +#+BEGIN_SRC emacs-lisp +(use-package pdf-annot + :bind (:map pdf-annot-minor-mode-map ("C-c C-a d" . pdf-annot-delete))) +#+END_SRC +** Latex +#+begin_src emacs-lisp +(use-package auctex + :ensure t) +#+end_src + +=cdlatex= depends on =texmath.el=. The docstring of =cdlatex= says +=texmath= is supposed to be part of Emacs. However my installation +does not have it. So =auctex= has to deliver this dependency instead. +#+begin_src emacs-lisp +(use-package cdlatex + :ensure t + :custom + (cdlatex-env-alist + (list '("equation*" "\\begin{equation*}\nAUTOLABEL\n?\n\\end{equation*}" nil) + '("tikzpicture" "\\begin{tikzpicture}\nAUTOLABEL\n?\n\\end{tikzpicture}" nil) + '("circuitikz" "\\begin{circuitikz}\nAUTOLABEL\n?\n\\end{circuitikz}" nil)))) +#+end_src +** Programming languages +*** Emacs lisp +=Speed of thought= makes writing lisp so easy. No more snippets +needed. +#+begin_src emacs-lisp +(use-package sotlisp + :ensure t + :init + (add-hook 'emacs-lisp-mode-hook 'speed-of-thought-mode)) +#+end_src +** Org mode +Org is the mode you never need to leave, if you do not want to. My org +TODO and clocking setup is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt +Hansen's]] configs. +- Scale latex previews :: The default is just a little bit too + small +- org-plus-contrib :: Install the =org-plus-contrib= package which + contains many extra org-modules. +- Startup indented :: Enable =org-indent-mode= in every org file. This + shows the content of headings indented to the headings level, but + does not actually insert whitespace at the start of the line. +- Enable Speed commands :: With the custom function speed commands are + enabled on any star of an headline. +- Set fast tag selection :: By defining default tags they can be set + just with one key press, similar to TODO states. +- Code blocks :: Open code blocks in the current window and use native + settings for the code blocks. +- Custom link abbrevs :: Define any expansion and use them as normal + org links like [[ddg:emacs]]. +- Babel languages :: Enable more languages to use in org-babel blocks. +- Youtube links :: See [[http://endlessparentheses.com/embedding-youtube-videos-with-org-mode-links.html][this blog post]] for more info. +- Ellipsis :: I currently use =" "= and previously used ="⚡⚡⚡"=. +#+begin_src emacs-lisp +(use-package org + :ensure org-plus-contrib + :defer t + :bind + (("C-c c" . org-capture) + ("C-c a" . org-agenda) + ("C-c l" . org-store-link)) + :custom + (org-format-latex-options '(:foreground default :background default :scale 1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers + ("begin" "$1" "$" "$$" "\\(" "\\["))) + (org-catch-invisible-edits 'smart) + (org-agenda-diary-file "~/sync/diary.org") + (org-startup-indented t) + (org-use-speed-commands (lambda () (and (looking-at org-outline-regexp) (looking-back "^\**")))) + (org-pretty-entities t) + (org-fast-tag-selection-single-key t) + (org-tag-alist (quote ((:startgroup) + ("@errand" . ?e) + ("@office" . ?o) + ("@home" . ?H) + (:endgroup) + ("IDLE" . ?i) + ("shelf" . ?s) + ("soon" . ?t) + ("project" . ?p) + ;; ("HOLD" . ?h) + ;; ("PERSONAL" . ?P) + ("WORK" . ?W) + ;; ("ORG" . ?O) + ("crypt" . ?E) + ("NOTE" . ?n) + ;; ("CANCELLED" . ?c) + ("FLAGGED" . ??) + ))) + (org-link-abbrev-alist + '(("google" . "http://www.google.com/search?q=") + ("ddg" . "https://duckduckgo.com/?q=") + ("gmap" . "http://maps.google.com/maps?q=%s") + ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) + (org-ellipsis " ") + :config + (add-hook 'org-mode-hook 'turn-on-org-cdlatex) + (add-to-list 'org-structure-template-alist (cons "f" "figure")) + (add-to-list 'org-tags-exclude-from-inheritance "MARKED")) +#+end_src +#+begin_src emacs-lisp +(use-package ob + :config (org-babel-do-load-languages + 'org-babel-load-languages + '((ruby . t) + (python . t) + ;;(ipython . t) + (emacs-lisp . t) + (octave . t) + (gnuplot . t) + (dot . t) + (spice . t) + (C . t) + (calc . t) + (latex . t) + (matlab . t) + (shell . t) + (lua . t) + (org . t) + (js . t) + (ditaa . t) + (plantuml . t) + ;; (hvm . t) + (ledger . t) + ))) +#+end_src +#+BEGIN_SRC emacs-lisp +(use-package org-noter + :ensure t + :bind (:map org-mode-map ("C-c o" . org-noter)) + :custom (org-noter-default-notes-file-names '("notes.org")) + ) +#+END_SRC + +#+begin_src emacs-lisp +(use-package ox + :custom + (org-export-with-broken-links 'match) + (org-export-backends '(ascii beamer html icalendar latex man md odt org groff koma-letter))) +(use-package org-pdfview +:ensure t) +(use-package org-id + :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)) +(use-package org-clock + :custom + (org-clock-out-remove-zero-time-clocks t) + (org-clock-persist 'history) + (org-clock-history-length 30) + :init + (org-clock-persistence-insinuate) + ) +(use-package org-src + :custom + (org-src-window-setup 'current-window) + (org-src-fontify-natively t) + (org-src-tab-acts-natively t) + (org-edit-src-content-indentation 0) +) +(use-package org-agenda + :custom + (org-agenda-files (quote ("~/s/s.org" "~/sync" "~/.emacs.d/gcal.org" "~/.emacs.d/tr.org" "~/n.org"))) + (org-deadline-warning-days 14) + (org-agenda-start-on-weekday nil) + (org-agenda-span 14) + (org-agenda-start-day "+0d") + (org-agenda-include-diary nil) + (org-agenda-sticky t) + (org-agenda-todo-ignore-deadlines 'near) ;; or future? + (org-agenda-todo-ignore-scheduled 'future) + (org-agenda-tags-todo-honor-ignore-options t) + (org-agenda-todo-list-sublevels t) ;; nil to exclude sublevels of todos + (org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) + (todo priority-down category-keep) + (tags priority-down category-keep) + (search category-keep))) + (org-agenda-skip-scheduled-if-done t) + (org-agenda-dim-blocked-tasks t) + (org-agenda-custom-commands + '(("n" "Agenda and all TODOs" + ((agenda) (tags-todo "+soon") + (tags-todo "+shelve") + (tags-todo "+habit") + (todo "IDLE") + (tags-todo "-habit-shelve-soon-idle"))) + ("r" "Refile entries" ((tags "+REFILE"))) + ("i" "Idle Actions" + ((tags-todo "IDLE-READLIST-WATCH" + ((org-agenda-overriding-header "Idle Tasks") + (org-agenda-skip-function 'bh/skip-project-tasks) + (org-agenda-sorting-strategy + '(todo-state-down effort-up)))) + (tags-todo "READLIST" + ((org-agenda-overriding-header "Idle Reading List") + (org-agenda-sorting-strategy + '(todo-state-down effort-up)))) + (tags-todo "WATCH" + ((org-agenda-overriding-header "Things to Watch") + (org-agenda-skip-function 'bh/skip-project-tasks) + (org-agenda-sorting-strategy + '(todo-state-down effort-up)))))))) + ) +(use-package ob-core + :custom + (org-confirm-babel-evaluate nil)) +(use-package org-screenshot) +(use-package org-collector) +(use-package ox) +(use-package org-notmuch) +(use-package org-expiry + :custom + (org-expiry-handler-function 'org-expiry-archive-subtree)) +(use-package org-habit) +#+end_src +#+begin_src emacs-lisp +(use-package org-inlinetask) +#+end_src +=org-bullets= provides better headline bullets. +Here is a list of nice ones: ◉, ○, ►, •. The default ones are ~'("◉" "○" "✸" "✿")~. +#+begin_src emacs-lisp +(use-package org-bullets + :ensure t + :custom (org-bullets-bullet-list '(" ")) + :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) +#+end_src +Use imagemagick and standalone class for latex preview. +#+begin_src emacs-lisp +(setq org-preview-latex-default-process 'imagemagick) +(setq + org-format-latex-header +"\\documentclass{standalone} +\\usepackage[usenames]{color} +[PACKAGES] +[DEFAULT-PACKAGES] +\\pagestyle{empty} % do not remove") +#+end_src +*** ox-reveal +#+BEGIN_SRC emacs-lisp +(use-package ox-reveal + :ensure 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/") +#+END_SRC + +*** Org-Capture +#+BEGIN_SRC emacs-lisp +(use-package org-capture + :custom ( + (org-journal-file (format "~/sync/journal/%s.org" (nth 2 (calendar-current-date)))) + (org-capture-templates + `(("j" "Journal") + ("jj" "Journal Entry (Link)" + entry + (file+olp+datetree + ,org-journal-file) + ;; "** %<%H:%M> %a\n %i%? \n%:description\n%:elfeed-entry-content\n%:elfeed-entry-date\n%:elfeed-entry-meta\n%:elfeed-entry-title\n%:elfeed-entry-enclosures\n%:elfeed-entry-tags" ) + "** %<%H:%M> %a +%i%?" ) + ("je" "Journal Entry" + entry + (file+olp+datetree + ,org-journal-file) + "** %<%H:%M> %? +%i" ) + + + + ;; ("a" "Appointment" entry (file "~/sync/a.org") + ;; "* %i%?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%^t") + ;; ("t" "Soonish task" entry (file "~/sync/refile.org") + ;; "* NEXT %?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%i") + ;; ("s" "Shelve something" entry (file+headline "~/sync/t.org" "Shelf") + ;; "* NEXT %?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%i") + ;; ;; ("r" "respond" entry (file "~/sync/refile.org") + ;; ;; "* NEXT Respond to %:from on %:subject\n:PROPERTIES:\n:CREATED: %U\n:END:\n%a\n" :clock-in t :clock-resume t :immediate-finish t) + ;; ("r" "respond" entry (file "~/sync/refile.org") + ;; "* NEXT Respond to %:from on %:subject\n:PROPERTIES:\n:CREATED: %U\n:END:\n%a\n" :immediate-finish t) + ;; ("n" "note" entry (file "~/sync/refile.org") + ;; "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t) + ;; ("j" "Journal/Interruptions" entry (file+olp+datetree "~/sync/diary.org") + ;; "* %?\n%U\n" :clock-in t :clock-resume t) + ;; ("h" "Habit" entry (file "~/sync/refile.org") + ;; "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n") + ;; ("m" "Meeting" entry (file "~/sync/refile.org") + ;; "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) + ;; ("p" "Phone call" entry (file "~/sync/refile.org") + ;; "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t) + + ;; ("c" "Item to Current Clocked Task" item (clock) + ;; "%i%?" :empty-lines 1) + ;; ("K" "Kill-ring to Current Clocked Task" plain (clock) + ;; "%c" :immediate-finish t :empty-lines 1) + + ;; ("p" "Gcal Appointment" entry (file "~/.emacs.d/gcal.org") + ;; "* %?\n%^T\n") + + ;; ("z" "Zettel" entry (file "~/zettel.org") + ;; "* %i%? %(and (org-id-get-create) nil) + ;; :PROPERTIES:\n :CREATED: %u\n :END:\n ") + + ;; ("l" "Ledger") + ;; ("lb" "Bank" plain (file ,(format "~/.personal/f/%s.ledger" (format-time-string "%Y"))) + ;; ,my/org-ledger-card-template + ;; :empty-lines 1 + ;; :immediate-finish t) + ;; ("lc" "Cash" plain (file ,(format "~/.personal/f/%s.ledger" (format-time-string "%Y"))) + ;; ,my/org-ledger-cash-template + ;; :empty-lines 1 + ;; :immediate-finish t) + ) + ))) +#+END_SRC +*** Ricing +#+begin_src emacs-lisp +(setq line-spacing 0.1) +(setq header-line-format " ") +;; (set-face-attribute 'header-line nil :height 50) ;; make buffer-local first + +;; side padding +(lambda () + (progn + (setq left-margin-width 2 + right-margin-width 2) + (set-window-buffer nil (current-buffer)))) + +;; try writeroom-mode +#+end_src +*** Org crypt +A small function to toggle the encryption state of the current entry. +#+begin_src emacs-lisp +(use-package org-crypt + :config + (defun fpi/org-toggle-crypt-entry () + "Encrypt/Decrypt current headline." + (interactive) + (require 'epg) + (when (eq major-mode 'org-mode) + (unless (org-before-first-heading-p) + (org-with-wide-buffer + (org-back-to-heading t) + (org-end-of-meta-data) + (if (looking-at-p "-----BEGIN PGP MESSAGE-----") + (org-decrypt-entry) + (org-encrypt-entry)))))) + (define-key fpi/toggle-map "e" #'fpi/org-toggle-crypt-entry)) +#+end_src +*** org-ref +#+begin_src emacs-lisp +(use-package org-ref + :ensure t + :custom + (org-ref-bibliography-notes "~/s/ma/notes.org") + (org-ref-default-bibliography '("~/s/ma/ma.bib")) + (org-ref-pdf-directory "~/s/ma/lit/")) +#+end_src +*** Todo settings +- WAITING tasks are waiting on the completion of other tasks +- NEXT tasks can be picked up +- INPROGRESS are current tasks with time clocked +- DONE are complete tasks +- ICEBOX tasks are on ice for whatever reason + +TODO->DONE cycle is for habits.\\ +Idle states cover things to do for time in between, checking the +inbox, reading news, … + +Phonecalls? + +#+BEGIN_SRC dot :file /tmp/todo.png +digraph hierarch{ + node [shape=box] + // Tasks, Projects + PLANNING -> NEXT, INPROGRESS, ICEBOX + WAITING -> NEXT -> INPROGRESS -> DONE, WAITING, ICEBOX + NEXT -> WAITING -> INPROGRESS, ICEBOX + NEXT -> ICEBOX, DONE + + // stuff for idle time + IDLE -> IDLE + //NEXT -> DONE + + // Phonecalls, Meetings + PHONE -> DONE, CANCELED + MEETING -> DONE, CANCELED +} +#+END_SRC + +#+RESULTS: +[[file:/tmp/todo.png]] + +#+BEGIN_SRC emacs-lisp +(setq org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") + (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") + (sequence "TODO(t)" "|" "DONE(d)") + (sequence "IDLE(a)"))) +(setq org-use-fast-todo-selection t) + + +(setq org-todo-keyword-faces + '(("NEXT" :foreground "light blue" :weight bold) + ("INPROGRESS" :foreground "burlywood" :weight bold) + ("DONE" :foreground "forest green" :weight bold) + ("WAITING" :foreground "orange" :weight bold) + ("ICEBOX" :foreground "orange" :weight normal) + ("CANCELLED" :foreground "forest green" :weight bold) + ("MEETING" :foreground "yellow" :weight bold) + ("PHONE" :foreground "yellow" :weight bold) + ("IDLE" :foreground "magenta" :weight bold))) +#+END_SRC + +Switch a todo entry from NEXT to INPROGRESS when clocking in. +#+begin_src emacs-lisp +(setq org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) + +(defun bh/clock-in-to-inprogress (kw) + "Switch a task from NEXT to INPROGRESS when clocking in. +Skips capture tasks, projects, and subprojects. +Switch projects and subprojects from NEXT back to TODO" + (when (not (and (boundp 'org-capture-mode) org-capture-mode)) + (cond + ((and (member (org-get-todo-state) (list "NEXT")) + (bh/is-task-p)) + "INPROGRESS") + ((and (member (org-get-todo-state) (list "NEXT")) + (bh/is-project-p)) + "INPROGRESS")))) +#+end_src + +**** State changes +Track state changes to done +#+begin_src emacs-lisp +(setq org-log-done 'time) +#+end_src +*** Toggle drawer visibility +#+begin_src emacs-lisp +(setq fpi/org-meta-heading-info-store nil) +(make-variable-buffer-local 'fpi/org-meta-heading-info-store) +(defun mw-org-hide-meta-heading-info () + "Hide meta data following headings." + (interactive) + (org-save-outline-visibility t + (save-excursion + ;; (widen) + ;; (org-cycle '(64)) + ;; (org-show-all '(drawers)) ; expand all props before make invisible to avoid ellipses. + (goto-char (point-min)) + (unless (org-at-heading-p) (outline-next-heading)) + (while (not (eobp)) + (let ((beg (1+ (progn (end-of-line) (point)))) + (end (1- (progn (org-end-of-meta-data t) (point))))) + (when (< beg end) + (push (make-overlay beg end) fpi/org-meta-heading-info-store) + (overlay-put (car fpi/org-meta-heading-info-store) 'invisible t))) + (when (not (org-at-heading-p)) + (outline-next-heading)))))) + +(defun mw-org-show-meta-info-lines () + "Show meta info." + (interactive) + (mapc #'delete-overlay fpi/org-meta-heading-info-store) + (setq fpi/org-meta-heading-info-store nil)) + + +(defun fpi/org-toggle-meta-info-lines () + (interactive) + (if fpi/org-meta-heading-info-store + (mw-org-show-meta-info-lines) + (mw-org-hide-meta-heading-info))) +(define-key fpi/toggle-map "m" #'fpi/org-toggle-meta-info-lines) +#+end_src +*** Workflow +My current workflow is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt +Hansen's]] configs. + +First set the ids of some default and often referenced tasks. +#+begin_src emacs-lisp +(setq fpi/organization-task-id "52ac704f-9cc4-4291-9721-aa3cd3b34fae") +(setq fpi/lunch-task "e3d95e3b-416d-4265-835b-1ba57aa84704" + fpi/break-task "fede843d-02fc-4cdd-8a63-91905e727dab" + ;; fpi/prep-task "9d6279b8-c921-46e7-8ee4-b4d367dca1e0" + fpi/morning-flow "2bec1c12-2ee5-4f50-9eac-a018ca081d7d" + ) +#+end_src + +This hydra contains most parts of my current workflow. It has +everything from going to certain headlines, clocking time and +capturing notes. +#+begin_src emacs-lisp +(defhydra hydra-workflow (:hint nil) + " +Searching ----------> Do stuff --------> Do Stuff 2 -------> Workflow ---------------> Nar/Wid ------------------> +_i_: In-file headings _d_: Clock in _c_: Capture _m_: Prep meeting notes _n_: Narrow to Subtree +_h_: All headings _e_: Email _<_: Last Task _M_: Mail meeting notes _w_: Widen +_a_: Select an Agenda _l_: Lunch _j_: Jump Clock _B_: BBDB search _r_: Narrow to region +_g_: Go to active clock _b_: Break _P_: Insert BBDB _c_: Capture _t_: Show TODO Entries + _k_: Morning prep _z_: Capture Note _s_: *scratch* + _o_: Clock out _S_: Org Scratch +" + ("<" bh/clock-in-last-task) + ("a" org-agenda :exit t) + ("B" bbdb) + ("b" rrix/clock-in-break-task) ;; TODO + ("c" org-capture) + ("d" bh/punch-in) + ("e" rrix/clock-in-email-task) ;; TODO + ("g" org-clock-goto) + ("h" cce/org-goto-agenda-heading) + ("i" org-goto) + ("j" (progn + (interactive) + (setq current-prefix-arg '(4)) + (call-interactively 'org-clock-in))) + ("k" rrix/clock-morning-prep) + ("l" rrix/clock-in-lunch-task) + ("M" bh/mail-subtree) ;; TODO ;; checkout org-mime + ("m" bh/prepare-meeting-notes) ;; TODO + ("n" bh/narrow-to-subtree) ;; TODO + ("o" bh/punch-out) + ("P" bh/phone-call) ;; TODO + ("r" narrow-to-region) ;; neccessary? + ("S" bh/make-org-scratch) ;; neccessary? + ("s" bh/switch-to-scratch) ;; neccessary? + ("t" bh/org-todo) ;; neccessary? + ("w" bh/widen) ;; neccessary? + ("z" cce/note-to-clock)) + +(define-key fpi-map (kbd "f") 'hydra-workflow/body) +#+end_src +Basic flow: +1. Start your work by clocking in with ~bh/punch-in~. This sets a + predefined "Organizational" entry as default clocking entry and + clocks you in on it. +2. To start planning your day go to "Morning prep" or directly start + working on something and clock in on it using either "Jump clock" + or ~org-clock-in~ normally. +3. Do stuff. Change clocks, capture stuff, take notes, take breaks, … +4. At the end of the day clock out with ~bh/punch-out~. + +While punched in org continues to clock your time. Each time you clock +out of an entry it clocks you in on the parent entry or the default +organizational task. +#+begin_src emacs-lisp +(defun bh/clock-out-maybe () + (when (and bh/keep-clock-running + (not org-clock-clocking-in) + (marker-buffer org-clock-default-task) + (not org-clock-resolving-clocks-due-to-idleness)) + (rrix/clock-in-sibling-or-parent-task))) + +(add-hook 'org-clock-out-hook 'bh/clock-out-maybe 'append) + +(defun rrix/clock-in-sibling-or-parent-task () + "Move point to the parent (project) task if any and clock in" + (let ((parent-task) + (parent-task-is-flow) + (sibling-task) + (curpoint (point))) + (save-excursion + (save-restriction + (widen) + (outline-back-to-heading) + (org-cycle) + (while (and (not parent-task) (org-up-heading-safe)) + (when (member (nth 2 (org-heading-components)) org-todo-keywords-1) + (setq parent-task (point)))) + (goto-char curpoint) + (while (and (not sibling-task) (org-get-next-sibling)) + (when (member (nth 2 (org-heading-components)) org-todo-keywords-1) + (setq sibling-task (point)))) + (setq parent-task-is-flow (cdr (assoc "FLOW" + (org-entry-properties parent-task)))) + (cond ((and sibling-task + parent-task-is-flow) + (org-with-point-at sibling-task + (org-clock-in)) + (org-clock-goto)) + (parent-task + (org-with-point-at parent-task + (org-clock-in)) + (org-clock-goto)) + (t (when bh/keep-clock-running + (bh/clock-in-default-task)))))))) +(defun bh/clock-in-default-task () + (save-excursion + (org-with-point-at org-clock-default-task + (org-clock-in) + (org-clock-goto)))) +#+end_src +Define the punch-in and punch-out functions. +#+begin_src emacs-lisp +(defun bh/punch-in (arg) + (interactive "p") + (setq bh/keep-clock-running t) + (if (equal major-mode 'org-agenda-mode) + (let* ((marker (org-get-at-bol 'org-hd-marker)) + (tags (org-with-point-at marker (org-get-tags-at)))) + (if (and (eq arg 4) tags) + (org-agenda-clock-in '(16)) + (bh/clock-in-organization-task-as-default))) + (save-restriction + (widen) + (if (and (equal major-mode 'org-mode) (not (org-before-first-heading-p)) (eq arg 4)) + (org-clock-in '(16)) + (bh/clock-in-organization-task-as-default))))) + +(defun bh/clock-in-organization-task-as-default () + (interactive) + (org-with-point-at (org-id-find fpi/organization-task-id 'marker) + (org-clock-in '(16)))) + +(defun bh/punch-out () + (interactive) + (setq bh/keep-clock-running nil) + (when (org-clock-is-active) + (org-clock-out)) + (org-agenda-remove-restriction-lock)) +#+end_src +Clocking into a task by id and some default clock-in functions. +The separate functions are needed so they can be used in the hydra. +#+begin_src emacs-lisp +(defun bh/clock-in-task-by-id (id) + "Clock in a task by id" + (org-with-point-at (org-id-find id 'marker) + (org-clock-in nil))) +(setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) + +(defun rrix/clock-in-lunch-task () + (interactive) + (bh/clock-in-task-by-id fpi/lunch-task) + (org-clock-goto) + (org-add-note)) +(defun rrix/clock-in-break-task () + (interactive) + (bh/clock-in-task-by-id fpi/break-task) + (org-agenda nil "i")) + +(defun rrix/clock-morning-prep () + (interactive) + (bh/clock-in-task-by-id fpi/morning-flow) + (org-clock-goto) + ;; (bh/narrow-to-subtree) + ) +#+end_src +Function to clock into the last task. +#+begin_src emacs-lisp +(defun bh/clock-in-last-task (arg) + "Clock in the interrupted task if there is one +Skip the default task and get the next one. +A prefix arg forces clock in of the default task." + (interactive "p") + (let ((clock-in-to-task + (cond + ((eq arg 4) org-clock-default-task) + ((and (org-clock-is-active) + (equal org-clock-default-task (cadr org-clock-history))) + (caddr org-clock-history)) + ((org-clock-is-active) (cadr org-clock-history)) + ((equal org-clock-default-task (car org-clock-history)) (cadr org-clock-history)) + (t (car org-clock-history))))) + (widen) + (org-with-point-at clock-in-to-task + (org-clock-in nil)))) +#+end_src +Add a note to the current clock +#+begin_src emacs-lisp +(defun cce/note-to-clock () + "Add a note to the currently clocked task." + (interactive) + (save-window-excursion + (org-clock-goto) + (org-add-note))) +#+END_SRC +Go to any heading in an agenda file (or more specifically in any file +included in 'org-refile-targets) +#+begin_src emacs-lisp +(defun cce/org-goto-agenda-heading (&optional prompt) + (interactive) + (let* ((location (org-refile-get-location (or prompt "Goto"))) + (file (cadr location)) + (marker (car (last location)))) + (find-file file) + (goto-char marker) + (org-show-context) + (current-buffer))) +#+END_SRC + +**** Filter functions +Various functions to determine if the current entry is a task, a +project or neither. +#+begin_src emacs-lisp +(defun bh/is-task-p () + "Any task with a todo keyword and no subtask" + (save-restriction + (widen) + (let ((has-subtask) + (subtree-end (save-excursion (org-end-of-subtree t))) + (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1))) + (save-excursion + (forward-line 1) + (while (and (not has-subtask) + (< (point) subtree-end) + (re-search-forward "^\*+ " subtree-end t)) + (when (member (org-get-todo-state) org-todo-keywords-1) + (setq has-subtask t)))) + (and is-a-task (not has-subtask))))) +(defun bh/is-project-p () + "Any task with a todo keyword subtask" + (save-restriction + (widen) + (let ((has-subtask) + (subtree-end (save-excursion (org-end-of-subtree t))) + (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1))) + (save-excursion + (forward-line 1) + (while (and (not has-subtask) + (< (point) subtree-end) + (re-search-forward "^\*+ " subtree-end t)) + (when (member (org-get-todo-state) org-todo-keywords-1) + (setq has-subtask t)))) + (and is-a-task has-subtask)))) +(defun bh/find-project-task () + "Move point to the parent (project) task if any" + (save-restriction + (widen) + (let ((parent-task (save-excursion (org-back-to-heading 'invisible-ok) (point)))) + (while (org-up-heading-safe) + (when (member (nth 2 (org-heading-components)) org-todo-keywords-1) + (setq parent-task (point)))) + (goto-char parent-task) + parent-task))) +(defun bh/is-project-subtree-p () + "Any task with a todo keyword that is in a project subtree. +Callers of this function already widen the buffer view." + (let ((task (save-excursion (org-back-to-heading 'invisible-ok) + (point)))) + (save-excursion + (bh/find-project-task) + (if (equal (point) task) + nil + t)))) +(defun bh/skip-project-tasks () + "Show non-project tasks. +Skip project and sub-project tasks, habits, and project related tasks." + (save-restriction + (widen) + (let* ((subtree-end (save-excursion (org-end-of-subtree t)))) + (cond + ((bh/is-project-p) + subtree-end) + ((org-is-habit-p) + subtree-end) + ((bh/is-project-subtree-p) + subtree-end) + (t + nil))))) +#+end_src +** Shell +#+begin_src emacs-lisp +(use-package shell + :commands (shell shell-command)) +#+end_src +To open and hide a shell quickly I use =shell-pop=. +#+begin_src emacs-lisp +(use-package shell-pop + :ensure t + :bind (("C-!" . shell-pop)) + :custom + (shell-pop-shell-type (quote ("shell" "*shell*" (lambda nil (shell))))) + (shell-pop-term-shell "/bin/bash")) +#+end_src +** Proced +Built-in process monitor. +#+BEGIN_SRC emacs-lisp +(use-package proced + :commands proced + :custom + (proced-toggle-auto-update t) + (proced-auto-update-interval 1) + (proced-descend t) + (proced-filter 'user)) +#+END_SRC +** Pass +Emacs interface & mode for the password manager [[https://www.passwordstore.org/][pass/password-store]]. +The emacs =pass= package provides a nice buffer listing all stored +passwords files and also a good mode to edit them. The +=password-store= package provides functions to copy and edit +individual password files. I'm not sure which one I'll end up using. I +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) +#+END_SRC +#+begin_src emacs-lisp +(use-package password-store + :ensure t + :commands (password-store-copy + password-store-edit + password-store-insert) + :custom (password-store-time-before-clipboard-restore 30) + :config (defun fpi/password-store-copy-pass-or-field (&optional arg) + (interactive "P") + (if arg + (call-interactively 'password-store-copy-field) + (call-interactively 'password-store-copy))) + :bind (:map fpi-map ("p" . fpi/password-store-copy-pass-or-field))) +#+end_src +*** auth-password-store/auth-source-pass +A password-store backend for the Emacs [[info:auth#Top][auth-source]] library which +normally uses the =~/.authinfo= file. For correct setup of +password-store files see [[https://rkm.id.au/2015/07/07/integrating-password-store-with-emacs/#fnr.1][here]] and in its [[https://github.com/DamienCassou/auth-password-store][github repo]]. For remote hosts +they need to contain the host and user info. The port is most of the +time inferred. The filename must also include the hostname. For +multiple users on the same host either use =user1@host.gpg= and +=user2@host.gpg= or =host/user1.gpg=, =host/user2.gpg=. +#+CAPTION: Example =pass= entry for use with =auth-source-pass= +#+begin_src pass-view + +host: localhost +user: root +#+end_src + +#+BEGIN_SRC emacs-lisp +(use-package auth-source-pass + :ensure 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 + :init (setq ledger-clear-whole-transactions 1) + :mode "\\.dat\\'" + "\\.ledger\\'") +;; (use-package flycheck-ledger +;; :ensure t +;; :after ledger-mode) +#+END_SRC + +I also use some =org-capture= templates to quickly capture +transactions. They are defined in [[file:emacs-private.el.gpg::4][emacs-private.el.gpg]]. + +** Elfeed + +#+BEGIN_SRC emacs-lisp +(use-package elfeed + :ensure t + :init + (setq elfeed-db-directory "~/.emacs.d/elfeed") + :custom + (elfeed-enclosure-default-dir "~/Downloads") + (elfeed-search-clipboard-type 'CLIPBOARD) + (elfeed-search-title-max-width (current-fill-column)) + (elfeed-search-title-min-width 30) + (elfeed-search-trailing-width 16) + (elfeed-show-truncate-long-urls t) + (elfeed-show-unique-buffers t) + :config + (defalias 'elfeed-toggle-star + (elfeed-expose #'elfeed-search-toggle-all 'star)) + (defun fpi/elfeed-search-show-entry-in-bg (entry) + (interactive (list (elfeed-search-selected :ignore-region))) + (elfeed-search-show-entry entry) + (bury-buffer)) + :bind + (:map elfeed-search-mode-map + ("m" . elfeed-toggle-star) + ("o" . fpi/elfeed-search-show-entry-in-bg) + ("j" . mz/make-and-run-elfeed-hydra) + )) +#+END_SRC +Some feeds I want to automatically mark as read. This way I can look +at them whenever I want to, but they don't show up in the unread search. +#+BEGIN_SRC emacs-lisp +(defun elfeed-mark-all-as-read () + (interactive) + (save-excursion + (mark-whole-buffer) + (elfeed-search-untag-all-unread))) +(defun elfeed-mark-search-read (search-string) + "Mark all results of SEARCH-STRING as read." + (interactive) + (elfeed) + (let ((filter elfeed-search-filter)) + (elfeed-search-set-filter search-string) + (elfeed-mark-all-as-read) + (elfeed-search-set-filter filter) + (bury-buffer))) +#+END_SRC +Now execute this whenever feeds are fetched +#+BEGIN_SRC emacs-lisp +(defun my/elfeed-mark-read (entry) + "Tag ENTRY as read if it contains certain tags" + (when (member 'tRaffic (elfeed-entry-tags entry)) + (elfeed-untag entry 'unread) + )) +(add-hook 'elfeed-new-entry-hook 'my/elfeed-mark-read) +#+END_SRC +*** Elfeed Org +Load elfeed org after adding ~my/elfeed-mark-read~ to +~elfeed-new-entry-hook~. New entries need to get tagged by elfeed org +first before marking them unread based on their tag. +#+BEGIN_SRC emacs-lisp +(use-package elfeed-org + :ensure t + :config + (elfeed-org) + (setq rmh-elfeed-org-files (list "~/.emacs.d/elfeed.org"))) +#+END_SRC +*** Hydra +This creates a smart hydra based on all available tags (see +https://cestlaz.github.io/posts/using-emacs-31-elfeed-3/). +#+BEGIN_SRC emacs-lisp +(defun z/hasCap (s) "" + (let ((case-fold-search nil)) + (string-match-p "[[:upper:]]" s) + )) +(defun z/get-hydra-option-key (s) + "returns single upper case letter (converted to lower) or first" + (interactive) + (let ( (loc (z/hasCap s))) + (if loc + (downcase (substring s loc (+ loc 1))) + (substring s 0 1) + ))) + +;; (active blogs cs eDucation emacs local misc sports star tech unread webcomics) +(defun mz/make-elfeed-cats (tags) + "Returns a list of lists. Each one is line for the hydra configuratio in the form + (c function hint)" + (interactive) + (mapcar (lambda (tag) + (let* ( + (tagstring (symbol-name tag)) + (c (z/get-hydra-option-key tagstring)) + ) + (list c (append '(elfeed-search-set-filter) (list (format "@6-months-ago +%s" tagstring) ))tagstring ))) + tags)) +(defmacro mz/make-elfeed-hydra () + `(defhydra mz/hydra-elfeed () + "filter" + ,@(mz/make-elfeed-cats (elfeed-db-get-all-tags)) + ("*" (elfeed-search-set-filter "@6-months-ago +star") "Starred") + ("M" elfeed-toggle-star "Mark") + ("A" (elfeed-search-set-filter "@6-months-ago") "All") + ("T" (elfeed-search-set-filter "@1-day-ago") "Today") + ("Q" bjm/elfeed-save-db-and-bury "Quit Elfeed" :color blue) + ("q" nil "quit" :color blue) + )) +(defun mz/make-and-run-elfeed-hydra () + "" + (interactive) + (mz/make-elfeed-hydra) + (mz/hydra-elfeed/body)) +#+END_SRC + +*** Youtube to Vlc +Open a entry with vlc +#+BEGIN_SRC emacs-lisp +(defface elfeed-youtube + '((t :foreground "#a9f")) + "Marks YouTube videos in Elfeed." + :group 'elfeed) + +(push '(youtube elfeed-youtube) + elfeed-search-face-alist) + +(defun elfeed-show-vlc () + "Play the current entry with vlc." + (interactive) + (pop-to-buffer (shell-command (format "vlc %s &" (elfeed-entry-link elfeed-show-entry))))) + +(defun elfeed-search-vlc () + "Play the current entry with vlc." + (interactive) + (let ((entries (elfeed-search-selected))) + (dolist (entry entries) + (shell-command (format "vlc %s &" (elfeed-entry-link entry))) + (elfeed-untag entry 'unread) + (elfeed-search-update-entry entry) + (unless (use-region-p) (forward-line))))) + +(define-key elfeed-show-mode-map "v" 'elfeed-show-vlc) +(define-key elfeed-search-mode-map "v" 'elfeed-search-vlc) +#+END_SRC +** Plotting data + +=gnuplot= is a great option for plotting any kind of data, no matter +where it comes from. + +#+begin_src emacs-lisp +(use-package gnuplot + :ensure t) +(use-package gnuplot-mode + :ensure t) +#+end_src +** HTML renderer +=shr= is the /Simple HTML renderer/ library, which Emacs uses to +display HTML. It is used by elfeed, notmuch and a variety of other +tools. + +- Open links in =eww= instead of the system browser +- Limit the entry width to the same as =fill-column= +- Limit the size of images + +#+BEGIN_SRC emacs-lisp + ;; (lambda (url &rest args) + ;; (if args + ;; (browse-url-default-browser url) + ;; (eww-browse-url url))) + +(use-package shr + :commands (eww eww-browse-url) + :custom + (browse-url-browser-function 'eww-browse-url) + (browse-url-generic-program "firefox") + (shr-external-browser 'browse-url-generic) + (shr-width (current-fill-column)) + (shr-max-image-proportion 0.4) + (shr-use-colors nil) + (shr-use-fonts nil) ) +#+END_SRC + +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 + :after shr + :config + (add-to-list 'shr-external-rendering-functions + '(pre . shr-tag-pre-highlight)) + (when (version< emacs-version "26") + (with-eval-after-load 'eww + (advice-add 'eww-display-html :around + 'eww-display-html--override-shr-external-rendering-functions)))) +#+END_SRC +** Email +For the setup of external mail specific programs see [[file:mail.org]]. +*** Sending mail +I use =msmtp= to send mail. + +- Infer the =envelope-from= header and therefore the adress to send + the mail from based on the /From/ header argument. +- Add a =-f username= flag to the sendmail command line call, as msmtp + needs it. +- Enable footnote-mode when entering message-mode. + +#+begin_src emacs-lisp +(use-package message + :custom + (message-send-mail-function 'message-send-mail-with-sendmail) + (message-sendmail-envelope-from 'header) + (message-sendmail-f-is-evil nil) + (message-kill-buffer-on-exit t) + :hook (message-mode . footnote-mode)) +(use-package sendmail + :custom + (send-mail-function 'smtpmail-send-it) + (sendmail-program "/usr/bin/msmtp") + (mail-specify-envelope-from t) + (mail-envelope-from 'header)) +#+end_src + +*** MUA/Notmuch + +After using =mu4e= as my mail user agent for a while I switched to +=notmuch=. I like the tagging based approach and the easy & great +searching. + +- Show newest messages first. +- Set archive tags to remove/set upon archiving a mail with =a=. +- Setup some saved searched. +- Set my signature (defined in [[file:emacs-private.el.gpg::13][emacs-private.el.gpg]]). +- Set the FCC directories where sent mails should be saved to (also + defined in [[file:emacs-private.el.gpg::20][emacs-private.el.gpg]].). +- Setup format=flowed +#+BEGIN_SRC emacs-lisp +(use-package notmuch + :ensure t + :custom + (notmuch-search-oldest-first nil) + (notmuch-archive-tags '("-inbox" "-td" "+archived")) + (notmuch-saved-searches + '((:name "inbox" :query "tag:inbox" :key "i") + (:name "unread (inb)" :query "(tag:unread and tag:inbox) or tag:td" :key "u") + (:name "unread (tot)" :query "tag:unread and date:6month..0month" :key "U") + (:name "flagged" :query "tag:flagged" :key "f") + (:name "sent" :query "tag:sent" :key "s") + (:name "drafts" :query "tag:draft" :key "d") + (:name "all mail" :query "*" :key "a") + (:name "tr" :query "tag:tr and date:6month..0month" :key "t"))) + (message-signature private/message-signature) + (notmuch-fcc-dirs private/notmuch-fcc-dirs)) +#+END_SRC +**** f=f +Hard new lines are identified using a ~hard~ text property and +displayed as =⏎=. We need to make sure all newlines inserted by +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 + :config (add-hook 'message-mode-hook 'messages-are-flowing-use-and-mark-hard-newlines)) +(defun message-insert-signature (&optional force) + (interactive) + (goto-char (point-max)) + (let ((point (point))) + (message-insert-signature-original force) + (goto-char point) + (while (search-forward "\n" nil t) + (set-hard-newline-properties (- (point) 1) (point))))) + +(defun message-insert-signature-original (&optional force) + "Insert a signature. See documentation for variable `message-signature'. " + (interactive (list 0)) + (let* ((signature + (cond + ((and (null message-signature) + (eq force 0)) + (save-excursion + (goto-char (point-max)) + (not (re-search-backward message-signature-separator nil t)))) + ((and (null message-signature) + force) + t) + ((functionp message-signature) + (funcall message-signature)) + ((listp message-signature) + (eval message-signature)) + (t message-signature))) + signature-file) + (setq signature + (cond ((stringp signature) + signature) + ((and (eq t signature) message-signature-file) + (setq signature-file + (if (and message-signature-directory + ;; don't actually use the signature directory + ;; if message-signature-file contains a path. + (not (file-name-directory + message-signature-file))) + (expand-file-name message-signature-file + message-signature-directory) + message-signature-file)) + (file-exists-p signature-file)))) + (when signature + (goto-char (point-max)) + ;; Insert the signature. + (unless (bolp) + (newline)) + (when message-signature-insert-empty-line + (newline)) + (insert "-- ") + (newline) + (if (eq signature t) + (insert-file-contents signature-file) + (insert signature)) + (goto-char (point-max)) + (or (bolp) (newline))))) +#+END_SRC +** Context aware hydra +[[https://dfeich.github.io/www/org-mode/emacs/2018/05/10/context-hydra.html][dfeich]] has a nice post on this. Basically it launches a specific hydra +based on the current mode and context around point. +#+BEGIN_SRC emacs-lisp +(defun dfeich/context-hydra-launcher () + "A launcher for hydras based on the current context." + (interactive) + (cl-case major-mode + ((org-mode org-journal-mode) + (let* ((elem (org-element-context)) + (etype (car elem)) + (type (org-element-property :type elem))) + (cl-case etype + (headline (jmm/org-edna-hydra/body)) + (src-block (hydra-babel-helper/body)) + (link (hydra-org-link-helper/body)) + ((table-row table-cell) (hydra-org-table-helper/body) ) + (t (message "No specific hydra for %s/%s" etype type) + (hydra-org-default/body))))) + ('bibtex-mode (org-ref-bibtex-hydra/body)) + ('ibuffer-mode (hydra-ibuffer-main/body)) + (t (message "No hydra for this major mode: %s" major-mode)))) + +;;; *** org mode hydras +(defhydra hydra-org-default (:color pink :hint nil) + " +Org default hydra + +_l_ insert template from last src block +_s_ insert src block ref with helm + +_q_ quit +" + ("l" fpi/copy-last-src-block-head :color blue) + ("s" helm-lib-babel-insert :color blue) + ("q" nil :color blue)) + + +(defhydra hydra-org-link-helper (:color pink :hint nil) + " +org link helper +_b_ backward slurp _f_ forward slurp _n_ next link +_m_ backward barf _g_ forward barf _p_ previous link +_t_ terminal at path + +_q_ quit +" + ("b" org-link-edit-backward-slurp) + ("f" org-link-edit-forward-slurp) + ("m" org-link-edit-backward-barf) + ("g" org-link-edit-forward-barf) + ("n" org-next-link) + ("p" org-previous-link) + ("t" fpi/gnome-terminal-at-link :color blue) + ("q" nil :color blue)) + +(defhydra hydra-org-table-helper (:color pink :hint nil) + " +org table helper +_r_ recalculate _w_ wrap region _c_ toggle coordinates +_i_ iterate table _t_ transpose _D_ toggle debugger +_B_ iterate buffer _E_ export table _d_ edit field +_e_ eval formula _s_ sort lines + +_q_ quit +" + ("E" org-table-export :color blue) + ("s" org-table-sort-lines) + ("d" org-table-edit-field) + ("e" org-table-eval-formula) + ("r" org-table-recalculate) + ("i" org-table-iterate) + ("B" org-table-iterate-buffer-tables) + ("w" org-table-wrap-region) + ("D" org-table-toggle-formula-debugger) + ("t" org-table-transpose-table-at-point) + ("c" org-table-toggle-coordinate-overlays :color blue) + ("q" nil :color blue)) + +(defhydra hydra-babel-helper (:color pink :hint nil) + " +org babel src block helper functions +_n_ next _i_ info _I_ insert header +_p_ prev _c_ check +_h_ goto head _E_ expand +^ ^ _s_ split +_q_ quit _r_ remove result _e_ examplify region + +" + ("i" org-babel-view-src-block-info) + ("I" org-babel-insert-header-arg) + ("c" org-babel-check-src-block :color blue) + ("s" org-babel-demarcate-block :color blue) + ("n" org-babel-next-src-block) + ("p" org-babel-previous-src-block) + ("E" org-babel-expand-src-block :color blue) + ("e" org-babel-examplify-region :color blue) + ("r" org-babel-remove-result :color blue) + ("h" org-babel-goto-src-block-head) + ("q" nil :color blue)) + + +;;; *** ibuffer hydra +;; from https://github.com/abo-abo/hydra/wiki/Ibuffer +(defhydra hydra-ibuffer-main (:color pink :hint nil) + " + ^Navigation^ | ^Mark^ | ^Actions^ | ^View^ +-^----------^-+-^----^--------+-^-------^--------+-^----^------- + _p_: ʌ | _m_: mark | _D_: delete | _g_: refresh + _RET_: visit | _u_: unmark | _S_: save | _s_: sort + _n_: v | _*_: specific | _a_: all actions | _/_: filter +-^----------^-+-^----^--------+-^-------^--------+-^----^------- +" + ("n" ibuffer-forward-line) + ("RET" ibuffer-visit-buffer :color blue) + ("p" ibuffer-backward-line) + + ("m" ibuffer-mark-forward) + ("u" ibuffer-unmark-forward) + ("*" hydra-ibuffer-mark/body :color blue) + + ("D" ibuffer-do-delete) + ("S" ibuffer-do-save) + ("a" hydra-ibuffer-action/body :color blue) + + ("g" ibuffer-update) + ("s" hydra-ibuffer-sort/body :color blue) + ("/" hydra-ibuffer-filter/body :color blue) + + ("o" ibuffer-visit-buffer-other-window "other window" :color blue) + ("q" nil "quit" :color blue)) + +(defhydra hydra-ibuffer-mark (:color teal :columns 5 + :after-exit (hydra-ibuffer-main/body)) + "Mark" + ("*" ibuffer-unmark-all "unmark all") + ("M" ibuffer-mark-by-mode "mode") + ("m" ibuffer-mark-modified-buffers "modified") + ("u" ibuffer-mark-unsaved-buffers "unsaved") + ("s" ibuffer-mark-special-buffers "special") + ("r" ibuffer-mark-read-only-buffers "read-only") + ("/" ibuffer-mark-dired-buffers "dired") + ("e" ibuffer-mark-dissociated-buffers "dissociated") + ("h" ibuffer-mark-help-buffers "help") + ("z" ibuffer-mark-compressed-file-buffers "compressed") + ("b" hydra-ibuffer-main/body "back" :color blue)) + +(defhydra hydra-ibuffer-action (:color teal :columns 4 + :after-exit + (if (eq major-mode 'ibuffer-mode) + (hydra-ibuffer-main/body))) + "Action" + ("A" ibuffer-do-view "view") + ("E" ibuffer-do-eval "eval") + ("F" ibuffer-do-shell-command-file "shell-command-file") + ("I" ibuffer-do-query-replace-regexp "query-replace-regexp") + ("H" ibuffer-do-view-other-frame "view-other-frame") + ("N" ibuffer-do-shell-command-pipe-replace "shell-cmd-pipe-replace") + ("M" ibuffer-do-toggle-modified "toggle-modified") + ("O" ibuffer-do-occur "occur") + ("P" ibuffer-do-print "print") + ("Q" ibuffer-do-query-replace "query-replace") + ("R" ibuffer-do-rename-uniquely "rename-uniquely") + ("T" ibuffer-do-toggle-read-only "toggle-read-only") + ("U" ibuffer-do-replace-regexp "replace-regexp") + ("V" ibuffer-do-revert "revert") + ("W" ibuffer-do-view-and-eval "view-and-eval") + ("X" ibuffer-do-shell-command-pipe "shell-command-pipe") + ("b" nil "back")) + +(defhydra hydra-ibuffer-sort (:color amaranth :columns 3) + "Sort" + ("i" ibuffer-invert-sorting "invert") + ("a" ibuffer-do-sort-by-alphabetic "alphabetic") + ("v" ibuffer-do-sort-by-recency "recently used") + ("s" ibuffer-do-sort-by-size "size") + ("f" ibuffer-do-sort-by-filename/process "filename") + ("m" ibuffer-do-sort-by-major-mode "mode") + ("b" hydra-ibuffer-main/body "back" :color blue)) + +(defhydra hydra-ibuffer-filter (:color amaranth :columns 4) + "Filter" + ("m" ibuffer-filter-by-used-mode "mode") + ("M" ibuffer-filter-by-derived-mode "derived mode") + ("n" ibuffer-filter-by-name "name") + ("c" ibuffer-filter-by-content "content") + ("e" ibuffer-filter-by-predicate "predicate") + ("f" ibuffer-filter-by-filename "filename") + (">" ibuffer-filter-by-size-gt "size") + ("<" ibuffer-filter-by-size-lt "size") + ("/" ibuffer-filter-disable "disable") + ("b" hydra-ibuffer-main/body "back" :color blue)) +#+END_SRC +* Language settings +End sentences with single spaces. +#+begin_src emacs-lisp +(setq sentence-end-double-space nil) +#+end_src +* Interface +** General +#+begin_src emacs-lisp +(use-package emacs + :custom + (vc-follow-symlinks t) + (echo-keystrokes 0.25) + (auto-revert-verbose nil) + :config + (defalias 'yes-or-no-p 'y-or-n-p) + (put 'dired-find-alternate-file 'disabled nil) + (put 'narrow-to-region 'disabled nil)) +#+end_src +** Parentheses +#+begin_src emacs-lisp +(use-package paren + :custom + (show-paren-style 'mixed) + (show-paren-when-point-in-periphery t) + (show-paren-when-point-inside-paren t) + :config + (show-paren-mode 1)) +#+end_src +** Whitespace +I do not really care about spaces versus tabs most of the time. I only +want it to be consistent within a file. +#+begin_src emacs-lisp +(use-package emacs + :custom + (indent-tabs-mode nil)) +#+end_src +Instead of =$= use =⏎= to indicate newlines +#+begin_src emacs-lisp +(use-package whitespace +:custom (whitespace-display-mappings '((space-mark 32 + [183] + [46]) + (space-mark 160 + [164] + [95]) + (newline-mark 10 + [9166 10]) ;;[36 10] + (tab-mark 9 + [187 9] + [92 9])))) +#+end_src +** Undo + +Emacs undo mechanic can be confusing. =undo-tree= is a great package +but is prone to corruption and also does not allow undo based on the +active region. + +*** Undo-propose :ARCHIVE: +=undo-propose= shows undo changes in a temporary buffer. For the +keybindings see [[elisp:(which-key-show-full-keymap +'undo-propose-mode-map)]]. =undo-propose-commit= commits the cumulated +undo changes and the traveled undo history to the original buffer. +=undo-propose-squash-commit= omits the history. + +The temporary buffer messes up point and folding in org buffers. +Therefore I don't use it anymore and should someday look into how this +temporary buffer is created. + +#+begin_src emacs-lisp :tangle no +(use-package undo-propose + :ensure t + :bind (("C-/" . undo-propose))) +#+end_src +** Electric stuff +#+begin_src emacs-lisp +(use-package electric + :init + (setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit) + (setq electric-pair-pairs '((34 . 34) + (8216 . 8217) + (8220 . 8221) + (171 . 187))) + (setq electric-pair-skip-self 'electric-pair-default-skip-self) + (setq electric-quote-context-sensitive t) + (setq electric-quote-paragraph t) + (setq electric-quote-string nil) + :config + (electric-indent-mode 1) + (electric-pair-mode 1) + (electric-quote-mode -1)) +#+end_src diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg new file mode 100644 index 0000000..a34ae19 Binary files /dev/null and b/emacs-private.el.gpg differ diff --git a/init-exwm.org b/init-exwm.org new file mode 100644 index 0000000..792dcbe --- /dev/null +++ b/init-exwm.org @@ -0,0 +1,412 @@ +#+PROPERTY: header-args:emacs-lisp :results silent +,#+PROPERTY: header-args:emacs-lisp :tangle tangle/init-exwm.el + +When stating the client from .xinitrc, `save-buffer-kill-terminal' will +force-kill Emacs before it can run through `kill-emacs-hook'. +#+BEGIN_SRC emacs-lisp +(global-set-key (kbd "C-x C-c") 'save-buffers-kill-emacs) +#+END_SRC + + + +set keyboard +#+BEGIN_SRC emacs-lisp +(shell-command "setxkbmap -layout \"de(neo),us,ru,de\"") +#+END_SRC +* functions +#+BEGIN_SRC emacs-lisp +(defun ambrevar/switch-to-last-buffer () + "Switch to last open buffer in current window." + (interactive) + (switch-to-buffer (other-buffer (current-buffer) 1))) + +(defun ambrevar/toggle-window-dedicated () + "Toggle whether the current active window is dedicated or not. +Run it in each window you want to 'freeze', i.e. prevent Emacs +from acting on it." + (interactive) + (message + (if (let ((window (get-buffer-window (current-buffer)))) + (set-window-dedicated-p window + (not (window-dedicated-p window)))) + "Window '%s' is dedicated" + "Window '%s' is normal") + (current-buffer))) + +(defun ambrevar/toggle-window-split () + "Switch between vertical and horizontal split. +It only works for frames with exactly two windows." + (interactive) + (if (= (count-windows) 2) + (let* ((this-win-buffer (window-buffer)) + (next-win-buffer (window-buffer (next-window))) + (this-win-edges (window-edges (selected-window))) + (next-win-edges (window-edges (next-window))) + (this-win-2nd (not (and (<= (car this-win-edges) + (car next-win-edges)) + (<= (cadr this-win-edges) + (cadr next-win-edges))))) + (splitter + (if (= (car this-win-edges) + (car (window-edges (next-window)))) + 'split-window-horizontally + 'split-window-vertically))) + (delete-other-windows) + (let ((first-win (selected-window))) + (funcall splitter) + (if this-win-2nd (other-window 1)) + (set-window-buffer (selected-window) this-win-buffer) + (set-window-buffer (next-window) next-win-buffer) + (select-window first-win) + (if this-win-2nd (other-window 1)))))) + +(defun ambrevar/toggle-single-window () + "Un-maximize current window. +If multiple windows are active, save window configuration and +delete other windows. If only one window is active and a window +configuration was previously save, restore that configuration." + (interactive) + (if (= (count-windows) 1) + (when single-window--last-configuration + (set-window-configuration single-window--last-configuration)) + (setq single-window--last-configuration (current-window-configuration)) + (delete-other-windows))) +#+END_SRC +** Window swapping +#+BEGIN_SRC emacs-lisp +(defun ambrevar/swap-windows (&optional w1 w2) + "If 2 windows are up, swap them. +Else if W1 is a window, swap it with current window. +If W2 is a window too, swap both." + (interactive) + (unless (or (= 2 (count-windows)) + (windowp w1) + (windowp w2)) + (error "Ambiguous window selection")) + (let* ((w1 (or w1 (car (window-list)))) + (w2 (or w2 + (if (eq w1 (car (window-list))) + (nth 1 (window-list)) + (car (window-list))))) + (b1 (window-buffer w1)) + (b2 (window-buffer w2)) + (s1 (window-start w1)) + (s2 (window-start w2))) + (with-temp-buffer + ;; Some buffers like EXWM buffers can only be in one live buffer at once. + ;; Switch to a dummy buffer in w2 so that we don't display any buffer twice. + (set-window-buffer w2 (current-buffer)) + (set-window-buffer w1 b2) + (set-window-buffer w2 b1)) + (set-window-start w1 s2) + (set-window-start w2 s1)) + (select-window w1)) + +(defun ambrevar/swap-windows-left () + "Swap current window with the window to the left." + (interactive) + (ambrevar/swap-windows (window-in-direction 'left))) +(defun ambrevar/swap-windows-below () + "Swap current window with the window below." + (interactive) + (ambrevar/swap-windows (window-in-direction 'below))) +(defun ambrevar/swap-windows-above () + "Swap current window with the window above." + (interactive) + (ambrevar/swap-windows (window-in-direction 'above))) +(defun ambrevar/swap-windows-right () + "Swap current window with the window to the right." + (interactive) + (ambrevar/swap-windows (window-in-direction 'right))) +#+END_SRC +** Volume & Brightness +#+BEGIN_SRC emacs-lisp +(defun exwm-brightness (incdec) + (shell-command (concat "xbacklight " incdec "10")) + (notifications-notify :title (substring (shell-command-to-string "xbacklight") 0 -1) + :replaces-id 6969 + :urgency 'low + :timeout 550)) + +(defun exwm-volume (incdec) + (notifications-notify + :title (format + "Volume %s" + (substring + (shell-command-to-string + (format "amixer -D pulse set Master 5%%%s|tail -n 1|cut -d '[' -f 2|cut -d ']' -f 1" + incdec)) 0 -1)) + :replaces-id 6968 + :urgency 'low + :timeout 550)) +(defun exwm-togglemute () + (interactive) + (notifications-notify + :title (format + "Volume %s" + (substring + (shell-command-to-string + "amixer -D pulse set Master toggle|tail -n 1|cut -d '[' -f 3|cut -d ']' -f 1") 0 -1)) + :replaces-id 6968 + :urgency 'low + :timeout 550)) +#+END_SRC +** XF86 Multimedia keys +#+BEGIN_SRC emacs-lisp +(defun exwm-xf86audio (cmd) + ;; Control Spotify + (shell-command (concat "dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player." cmd))) +#+END_SRC +** Browser switching +#+BEGIN_SRC emacs-lisp +(defun fpi/helm-exwm-switch (class &optional program other-window) + "Switch to some EXWM windows belonging to CLASS. +If current window is not showing CLASS, switch to the last open CLASS window. +If there is none, start PROGRAM. + +If PROGRAM is nil, it defaults to CLASS. +With prefix argument or if OTHER-WINDOW is non-nil, open in other window." + ;; If current window is not in `exwm-mode' we switch to it. Therefore we must + ;; also make sure that current window is not a Helm buffer, otherwise calling + ;; this function will lose focus in Helm. + (unless helm-alive-p + (setq program (or program class) + other-window (or other-window current-prefix-arg)) + (let ((filter (lambda () + (member (downcase (or exwm-class-name "")) class)))) + (if (and (eq major-mode 'exwm-mode) + (funcall filter)) + (let ((helm-buffer-details-flag nil)) + (helm-exwm filter)) + (let ((last (buffer-list))) + (while (and last + (not (with-current-buffer (car last) + (and (eq major-mode 'exwm-mode) + (funcall filter))))) + (setq last (cdr last))) + (if last + (funcall (if other-window 'switch-to-buffer-other-window 'switch-to-buffer) (car last)) + (when other-window (select-window (split-window-sensibly))) + (start-process-shell-command program nil program))))))) + +(defun fpi/helm-exwm-switch-browser () + "Switch to some `browse-url-generic-program' windows. + +See `helm-exwm-switch'." + (interactive) + (fpi/helm-exwm-switch (quote ("qutebrowser" + "firefox")) + browse-url-generic-program)) +#+END_SRC +* config +Time & Battery display +#+BEGIN_SRC emacs-lisp +(display-time) +(display-battery-mode) +#+END_SRC +Rename buffer to window title.\\ +Spotify's title does not include "spotify" while playing music so just +append it. +#+BEGIN_SRC emacs-lisp +(defun fpie/exwm-rename-buffer-to-title () + (let ((newname (if (string-match "Spotify" (buffer-name)) + (concat exwm-title " - Spotify") + exwm-title))) + (exwm-workspace-rename-buffer newname))) + +(add-hook 'exwm-update-title-hook 'fpie/exwm-rename-buffer-to-title) +#+END_SRC +#+BEGIN_SRC emacs-lisp +(add-hook 'exwm-floating-setup-hook 'exwm-layout-hide-mode-line) +(add-hook 'exwm-floating-exit-hook 'exwm-layout-show-mode-line) +#+END_SRC + +Non-floating resizing with mouse +#+BEGIN_SRC emacs-lisp +(setq window-divider-default-bottom-width 2 + window-divider-default-right-width 2) +(window-divider-mode) +#+END_SRC +System tray +#+BEGIN_SRC emacs-lisp +(require 'exwm-systemtray) +(exwm-systemtray-enable) +(setq exwm-systemtray-height 16) +#+END_SRC ++auto focus+ +#+BEGIN_SRC emacs-lisp :tangle no +(setq mouse-autoselect-window t + focus-follows-mouse t) +#+END_SRC +List all buffers +#+BEGIN_SRC emacs-lisp +(setq exwm-workspace-show-all-buffers t) +(setq exwm-layout-show-all-buffers t) +#+END_SRC +** Helm +#+BEGIN_SRC emacs-lisp :results silent +(with-eval-after-load 'helm + ;; Need `with-eval-after-load' here since 'helm-map is not defined in 'helm-config. + (define-key helm-map (kbd "s-\\") 'helm-toggle-resplit-and-swap-windows) + (exwm-input--set-key (kbd "s-p") 'helm-run-external-command) + (exwm-input-set-key (kbd "s-c") 'helm-resume) + (exwm-input-set-key (kbd "s-b") 'helm-mini) + (exwm-input-set-key (kbd "s-f") 'helm-find-files) + (exwm-input-set-key (kbd "s-F") 'helm-locate) + ;;(when (fboundp 'ambrevar/helm-locate-meta) + ;; (exwm-input-set-key (kbd "s-F") #'ambrevar/helm-locate-meta)) + ;;(exwm-input-set-key (kbd "s-g") 'ambrevar/helm-grep-git-or-ag) + ;;(exwm-input-set-key (kbd "s-G") 'ambrevar/helm-grep-git-all-or-ag) + ) + +(use-package helm-exwm) +(exwm-input-set-key (kbd "s-w") #'fpi/helm-exwm-switch-browser) +(exwm-input-set-key (kbd "s-W") #'helm-exwm-switch-browser-other-window) +#+END_SRC +** Keys +Global bindings +#+BEGIN_SRC emacs-lisp +(exwm-input-set-key (kbd "s-K") #'exwm-reset) +(exwm-input-set-key (kbd "s-x") #'exwm-input-toggle-keyboard) + +(exwm-input-set-key (kbd "s-s") #'windmove-left) +(exwm-input-set-key (kbd "s-n") #'windmove-down) +(exwm-input-set-key (kbd "s-r") #'windmove-up) +(exwm-input-set-key (kbd "s-t") #'windmove-right) + +(exwm-input-set-key (kbd "M-s") #'ace-jump-word-mode) +(exwm-input-set-key (kbd "s-B") #'ibuffer-list-buffers) +(exwm-input-set-key (kbd "s-X") #'kill-this-buffer) + +(exwm-input-set-key (kbd "s-M") #'exwm-workspace-switch) + +(exwm-input-set-key (kbd "s-\\") 'ambrevar/toggle-window-split) +(exwm-input-set-key (kbd "s-S") 'ambrevar/swap-windows-left) +(exwm-input-set-key (kbd "s-N") 'ambrevar/swap-windows-below) +(exwm-input-set-key (kbd "s-R") 'ambrevar/swap-windows-above) +(exwm-input-set-key (kbd "s-T") 'ambrevar/swap-windows-right) + +(exwm-input-set-key (kbd "s-") #'ambrevar/switch-to-last-buffer) +(exwm-input-set-key (kbd "s-") (lambda () + (interactive) + (start-process "term" nil "tilix"))) +(exwm-input-set-key (kbd "s-h") 'bury-buffer) + +(exwm-input-set-key (kbd "s-g") 'previous-buffer) +(exwm-input-set-key (kbd "s-G") 'next-buffer) +#+END_SRC +#+BEGIN_SRC emacs-lisp +(exwm-input-set-key (kbd "s-!") 'helm-pass) +#+END_SRC +Volume & Brightness +#+BEGIN_SRC emacs-lisp +(exwm-input-set-key [XF86AudioLowerVolume] (lambda () (interactive) (exwm-volume "-"))) +(exwm-input-set-key [XF86AudioRaiseVolume] (lambda () (interactive) (exwm-volume "+"))) +(exwm-input-set-key [XF86AudioMute] 'exwm-togglemute) +(exwm-input-set-key [XF86MonBrightnessUp] (lambda () (interactive) (exwm-brightness "+"))) +(exwm-input-set-key [XF86MonBrightnessDown] (lambda () (interactive) (exwm-brightness "-"))) +#+END_SRC +XF86 Multimedia Keys +#+BEGIN_SRC emacs-lisp +(exwm-input--set-key [XF86AudioPlay] (lambda () (interactive) (exwm-xf86audio "PlayPause"))) +(exwm-input--set-key [XF86AudioPause] (lambda () (interactive) (exwm-xf86audio "PlayPause"))) +(exwm-input--set-key [XF86AudioNext] (lambda () (interactive) (exwm-xf86audio "Next"))) +(exwm-input--set-key [XF86AudioPrev] (lambda () (interactive) (exwm-xf86audio "Previous"))) +#+END_SRC +*** Local bindings +#+BEGIN_SRC emacs-lisp +(push ?\s- exwm-input-prefix-keys) +(define-key exwm-mode-map (kbd "s-SPC") #'exwm-floating-toggle-floating) +(define-key exwm-mode-map (kbd "s-i") #'follow-delete-other-windows-and-split) ;; any useful? +(define-key exwm-mode-map (kbd "s-o") #'ambrevar/toggle-single-window) +(define-key exwm-mode-map (kbd "s-O") #'exwm-layout-toggle-fullscreen) + +(define-key exwm-mode-map (kbd "C-q") #'exwm-input-send-next-key) +#+END_SRC +Allow access to my personal keymap. +#+BEGIN_SRC emacs-lisp +(push ?\C-z exwm-input-prefix-keys) +#+END_SRC + +*** Simulation keys +#+BEGIN_SRC emacs-lisp +(setq exwm-input-simulation-keys + '(([?\C-b] . [left]) + ([?\C-f] . [right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\M-v] . [prior]) + ([?\C-v] . [next]) + ([?\C-d] . [delete]))) + ;;([?\C-k] . [S-end delete]))) ; doesn't work in tilix +#+END_SRC +** Multiple monitors +#+BEGIN_SRC emacs-lisp +(require 'exwm-randr) +(setq exwm-randr-workspace-output-plist + '(0 "DP1" 1 "HDMI1" 2 "HDMI2" 3 "eDP1")) +(exwm-randr-enable) +#+END_SRC +** Configure helm-raise-command +~(shell-command "emacsclient -e ...")~ does not work. Advice +~helm-run-or-raise~ instead and overshadow ~shell-command~. + +For now ~helm-run-or-raise~ is redefined after helm is loaded in +~emacs-init.org~ instead of advised. +#+begin_src emacs-lisp +(defun fpi/get-proc-buffers (proc) + (let ((cand (helm-exwm-candidates))) + (remove + nil (mapcar + (lambda (c) + (if (equal + (downcase proc) + (downcase (with-current-buffer c (or exwm-class-name "")))) + c + nil)) cand)))) +(defun fpi/switch-to-proc-buffer (proc) + (switch-to-buffer (car (fpi/get-proc-buffers proc)))) + +;; (setq helm-raise-command "emacsclient -e '(fpi/switch-to-proc-buffer \"%s\")'") +(setq helm-raise-command t) +#+end_src +** Screenshots +UncleDave has a nice exwm configuration in his [[https://github.com/daedreth/UncleDavesEmacs/blob/master/config.org][config]]. These snippets +are taken from there. + +A nice alternative for screenshots in org-mode is ~org-screenshot.el~. +It uses ~scrot~ to take screenshots of windows and insert a link the +image into the current org buffer. + +*** Screenshotting the entire screen +#+BEGIN_SRC emacs-lisp + (defun daedreth/take-screenshot () + "Takes a fullscreen screenshot of the current workspace" + (interactive) + (when window-system + (loop for i downfrom 3 to 1 do + (progn + (message (concat (number-to-string i) "...")) + (sit-for 1))) + (message "Cheese!") + (sit-for 1) + (start-process "screenshot" nil "import" "-window" "root" + (concat (getenv "HOME") "/" (subseq (number-to-string (float-time)) 0 10) ".png")) + (message "Screenshot taken!"))) + (global-set-key (kbd "") 'daedreth/take-screenshot) +#+END_SRC + +*** Screenshotting a region +#+BEGIN_SRC emacs-lisp +(defun daedreth/take-screenshot-region () + "Takes a screenshot of a region selected by the user." + (interactive) + (when window-system + (call-process "import" nil nil nil ".newScreen.png") + (call-process "convert" nil nil nil ".newScreen.png" "-shave" "1x1" + (concat (getenv "HOME") "/" (subseq (number-to-string (float-time)) 0 10) ".png")) + (call-process "rm" nil nil nil ".newScreen.png"))) +;; (global-set-key (kbd "") 'daedreth/take-screenshot-region) +#+END_SRC -- cgit v1.2.3 From 587b036ea198534d3e9b208b2144f7cc9d6de247 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:13:35 +0100 Subject: Setup org-crypt usage & whitespace cleanup --- emacs-init.org | 141 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 68 insertions(+), 73 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index f72403f..068b36d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -18,7 +18,21 @@ the =.org= file on every save and load the tangled =.el= file directly. This saves time on startup as tangling does not occur everytime and also allows for more flexibility regarding tangling file locations in this configuration file. Namely I can include the content -of =init.el= in this file without problems. +of =init.el= in this file without problems. + +To share this configuration publicly, even though it contains private +information, several solutions are possible. To keep everything in one +file, [[elisp:(find-library "org-crypt")][org-crypt]] is a possible solution. Marking the headings with +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 "C12356B984BA799943824FD5DB31E653435C87C6") +#+END_SRC I use =.org= configuration files also for my other dotfiles. To ensure they are tangled upon save I use this function. @@ -30,65 +44,46 @@ they are tangled upon save I use this function. (org-babel-tangle) (message "%s tangled" buffer-file-name))) -(add-hook 'after-save-hook #'fpi/tangle-dotfiles) +(add-hook 'org-mode-hook (lambda () (add-hook 'before-save-hook #'fpi/tangle-dotfiles nil t)) t) #+END_SRC +As I use =org-crypt= all =.org= files need to be decrypted before +tangling, saved without encrypting and encrypted after tangling and +saved again. The latter part is not directly supported by =org=. +~org-babel-post-tangle-hook~ is executed in the created tangled files +and not inside the source =.org= file. Instead I add an advice to +~org-babel-tangle~. +#+BEGIN_SRC emacs-lisp +(defun save-without-hook () + (let ((before-save-hook nil)) + (save-buffer))) -To share this configuration publicly, even though it contains private -information, several solutions are possible. To keep everything in one -file, [[elisp:(find-library "org-crypt")][org-crypt]] is a possible solution. Marking the headings with -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~ in this file. -#+begin_src emacs-lisp :tangle no :eval never -(require 'org-crypt) -(org-crypt-use-before-save-magic) -(setq org-tags-exclude-from-inheritance (quote ("crypt"))) -(setq org-crypt-key my-gpg-key-id) -#+end_src -To properly tangle this configuration all blocks need to be decrypted -before tangling. Given the structure of =org-babel-tangle= this leads -to saving the file twice each time. The first time unencrypted and -then after tangling is complete once again encrypted. The following -code can achieve this. -#+begin_src emacs-lisp :tangle no :eval never -;; Make sure buffers are decrypted before tangling -(defun save-buffer-without-tangle () - (interactive) - (let ((b (current-buffer))) - (with-temp-buffer - (let ((after-save-hook (remove 'fpi/tangle-dotfiles after-save-hook))) - (with-current-buffer b - (let ((after-save-hook (remove 'fpi/tangle-dotfiles after-save-hook))) - (save-buffer))))))) - -;; before tangling: decrypt all and save without encrypt -(advice-add 'org-babel-tangle :before '(lambda (&rest r) - (remove-hook 'before-save-hook 'org-encrypt-entries t) - (org-decrypt-entries) - (save-buffer-without-tangle))) -;; after tangling: encrypt all entries and re-add hook +(setq org-babel-pre-tangle-hook '(org-decrypt-entries save-without-hook)) +;; (setq org-babel-post-tangle-hook '(org-encrypt-entries save-without-hook)) (advice-add 'org-babel-tangle :after '(lambda (&rest r) - (org-encrypt-entries) - (add-hook 'before-save-hook 'org-encrypt-entries nil t) - (save-buffer-without-tangle))) -#+end_src -Unfortunately this leads to unusable diffs in =git= for the encrypted -parts. The approach of using a separate =.el.gpg= or =.org.gpg= file -has the same problem. But git can be told to decrypt =.gpg= files -before creating the diff using the following settings (see [[https://magit.vc/manual/magit/How-to-show-diffs-for-gpg_002dencrypted-files_003f.html][here]]). + (org-encrypt-entries) + (save-without-hook))) +#+END_SRC + +Using =org-crypt= unfortunately leads to unusable diffs in =git= for +the encrypted parts. So I tend to only use it for configuration files +which I do not want to split into multiple files. The approach of +using a separate =.el.gpg= or =.org.gpg= file has the same problem. +But =git= can be told to decrypt =.gpg= files before creating the diff +using the following settings (see [[https://magit.vc/manual/magit/How-to-show-diffs-for-gpg_002dencrypted-files_003f.html][here]]). #+begin_src shell git config --global diff.gpg.textconv "gpg --no-tty --decrypt" echo "*.gpg filter=gpg diff=gpg" > .gitattributes #+end_src A similar behaviour can be achieved using [[https://github.com/AGWA/git-crypt][git-crypt]]. I save private -details in =emacs-private.el.gpg= and load this file here. +details regarding my emacs configuration in =emacs-private.el.gpg= and +load this file here. #+begin_src emacs-lisp (setq secret-file (expand-file-name "emacs-private.el.gpg" - user-emacs-directory)) + user-emacs-directory)) (load secret-file) #+end_src -This is the content of =init.el=. Notice the ~:tangle tange/init.el~ +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) @@ -202,18 +197,18 @@ I am still not quite sure on my choice of font. availability. When starting with =emacs --daemon= it does not work as =(font-family-list)= won't return anything. #+begin_src emacs-lisp :tangle no - (use-package emacs - :config - (defun fpi/set-font () - (interactive) - (cond - ((member "Hack" (font-family-list)e) - (add-to-list 'default-frame-alist '(font . "Hack-12"))) - ((member "Source Code Pro" (font-family-list)) - (add-to-list 'default-frame-alist '(font . "Source Code Pro-12"))))) - (add-to-list 'default-frame-alist '(font . "Hack-12")) - ;; :hook (after-init . fpi/set-font) - ) +(use-package emacs + :config + (defun fpi/set-font () + (interactive) + (cond + ((member "Hack" (font-family-list)e) + (add-to-list 'default-frame-alist '(font . "Hack-12"))) + ((member "Source Code Pro" (font-family-list)) + (add-to-list 'default-frame-alist '(font . "Source Code Pro-12"))))) + (add-to-list 'default-frame-alist '(font . "Hack-12")) + ;; :hook (after-init . fpi/set-font) + ) #+end_src Instead of the above code I set the font directly using =set-face-attribute=. @@ -1351,7 +1346,7 @@ on the amount of displayed text. #+end_src *** window-numbering This is a nice package for easy window focus switching. I prefer it -over =windmove=, as it does not interfere with org keybindings. +over =windmove=, as it does not interfere with org keybindings. #+begin_src emacs-lisp (use-package window-numbering :ensure t @@ -1432,7 +1427,7 @@ make sure to compile the tex document with the option ~--synctex=1~. #+BEGIN_SRC emacs-lisp (use-package pdf-tools :ensure t - :config + :config (setq pdf-info-epdfinfo-program (concat user-emacs-directory "epdfinfo")) (pdf-tools-install)) #+END_SRC @@ -2266,7 +2261,7 @@ user: root :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 +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 @@ -2831,17 +2826,17 @@ want it to be consistent within a file. Instead of =$= use =⏎= to indicate newlines #+begin_src emacs-lisp (use-package whitespace -:custom (whitespace-display-mappings '((space-mark 32 - [183] - [46]) - (space-mark 160 - [164] - [95]) - (newline-mark 10 - [9166 10]) ;;[36 10] - (tab-mark 9 - [187 9] - [92 9])))) + :custom (whitespace-display-mappings '((space-mark 32 + [183] + [46]) + (space-mark 160 + [164] + [95]) + (newline-mark 10 + [9166 10]) ;;[36 10] + (tab-mark 9 + [187 9] + [92 9])))) #+end_src ** Undo -- cgit v1.2.3 From 4d6e94faf1b25a9c96864e179c6082b0bc4b34e7 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:22:06 +0100 Subject: Fix the default font for my themes --- emacs-init.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 068b36d..4eb520d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -211,7 +211,8 @@ availability. When starting with =emacs --daemon= it does not work as ) #+end_src -Instead of the above code I set the font directly using =set-face-attribute=. +Instead of the above code I set the font directly using +=set-face-attribute=. This is overwritten by my theme settings. #+begin_src emacs-lisp (set-face-attribute 'default nil :font "Hack-11") #+end_src @@ -299,8 +300,9 @@ The above macro can be used like this. ;; (set-face-attribute 'variable-pitch nil :font "EtBookOt-11") ;; Settings ((default - () - (:foreground ,bg-dark)) + (:family ,sans-mono-font) + (:family ,sans-mono-font + :foreground ,bg-dark)) (variable-pitch (:family ,sans-font) (:family ,et-font -- cgit v1.2.3 From 8d3d08ab2a9a6e5405f51e6028b3ed4b85ac1ddc Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:27:20 +0100 Subject: Add redshift configuration --- redshift.org | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 redshift.org diff --git a/redshift.org b/redshift.org new file mode 100644 index 0000000..bd463bf --- /dev/null +++ b/redshift.org @@ -0,0 +1,66 @@ +Website: http://jonls.dk/redshift/ +#+PROPERTY: header-args:conf :tangle tangle/redshift.conf +** Config +#+BEGIN_SRC conf +[redshift] +; Set the day and night screen temperatures +temp-day=5700 +temp-night=3500 + +; Enable/Disable a smooth transition between day and night +; 0 will cause a direct change from day to night screen temperature. +; 1 will gradually increase or decrease the screen temperature. +transition=1 + +; Set the screen brightness. Default is 1.0. +;brightness=0.9 +; It is also possible to use different settings for day and night +; since version 1.8. +;brightness-day=0.7 +;brightness-night=0.4 +; Set the screen gamma (for all colors, or each color channel +; individually) +gamma=0.8 +;gamma=0.8:0.7:0.8 +; This can also be set individually for day and night since +; version 1.10. +;gamma-day=0.8:0.7:0.8 +;gamma-night=0.6 + +; Set the location-provider: 'geoclue', 'geoclue2', 'manual' +; type 'redshift -l list' to see possible values. +; The location provider settings are in a different section. +location-provider=manual + +; Set the adjustment-method: 'randr', 'vidmode' +; type 'redshift -m list' to see all possible values. +; 'randr' is the preferred method, 'vidmode' is an older API. +; but works in some cases when 'randr' does not. +; The adjustment method settings are in a different section. +adjustment-method=randr + +; Configuration of the location-provider: +; type 'redshift -l PROVIDER:help' to see the settings. +; ex: 'redshift -l manual:help' +; Keep in mind that longitudes west of Greenwich (e.g. the Americas) +; are negative numbers. +[manual] +lat=52.375892 +lon=9.732010 + +; Configuration of the adjustment-method +; type 'redshift -m METHOD:help' to see the settings. +; ex: 'redshift -m randr:help' +; In this example, randr is configured to adjust screen 1. +; Note that the numbering starts from 0, so this is actually the +; second screen. If this option is not specified, Redshift will try +; to adjust _all_ screens. +[randr] +;screen=0 +#+END_SRC + +** Symlink + + #+BEGIN_SRC sh :tangle no + ln -sf $(pwd)/tangle/redshift.conf ~/.config/ + #+END_SRC -- cgit v1.2.3 From 8928f932ea5937acc7beaf2106e7b0adfba38310 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:27:04 +0100 Subject: Add rofi configuration --- rofi.org | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 rofi.org diff --git a/rofi.org b/rofi.org new file mode 100644 index 0000000..ff05d95 --- /dev/null +++ b/rofi.org @@ -0,0 +1,142 @@ +#+begin_src shell :tangle no :results silent +path=$(pwd)/tangle +ln -sf $path/config.rasi ~/.config/rofi/ +#+end_src + +#+begin_src conf :tangle tangle/config.rasi :eval never +,* { + background: #303f30df; + background-color: #00000000; + foreground: #778877ff; + + selected-normal-foreground: #ffffffff; + normal-foreground: #778877ff; + alternate-normal-foreground: @normal-foreground; + active-foreground: #bbccbb; + selected-active-foreground: #ffffff; + alternate-active-foreground: @active-foreground; + + normal-background: #00000000; + alternate-normal-background: #00000000; + selected-normal-background: #00000000; + selected-active-background: #00000000; + active-background: #00000000; + alternate-active-background: #00000000; + + border-color: #000000aa; + spacing: 2; + separatorcolor: #00000000; + red: rgba ( 220, 50, 47, 100 % ); + blue: rgba ( 38, 139, 210, 100 % ); + lightbg: rgba ( 238, 232, 213, 100 % ); + lightfg: rgba ( 88, 104, 117, 100 % ); + + selected-urgent-foreground: @background; + urgent-foreground: @red; + alternate-urgent-foreground: @red; + selected-urgent-background: @red; + urgent-background: @background; + alternate-urgent-background: @lightbg; +} +#window { + background-color: @background; + border: 0; + padding: 50; + transparency: "background"; +} +#mainbox { + border: 0; + padding: 0; +} +#message { + border: 1px dash 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; +} +#textbox { + text-color: @foreground; +} +#listview { + fixed-height: 0; + border: 2px dash 0px 0px ; + border-color: @separatorcolor; + spacing: 2px ; + scrollbar: false; + padding: 2px 0px 0px ; +} +#element { + border: 0; + padding: 1px ; +} +#element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +#element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +#element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +#element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +#element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +#element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +#element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +#element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +#element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +#scrollbar { + width: 4px ; + border: 0; + handle-color: @normal-foreground; + padding: 0; +} +#sidebar { + border: 2px dash 0px 0px ; + border-color: @separatorcolor; +} +#button { + spacing: 0; + text-color: @normal-foreground; +} +#button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +#inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px ; +} +#case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +#entry { + spacing: 0; + text-color: @normal-foreground; +} +#prompt { + spacing: 0; + text-color: @normal-foreground; +} +#+end_src -- cgit v1.2.3 From d918f8511e764c6ef100e94061ba2c52b291fcda Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:25:04 +0100 Subject: Add ledger configuration --- ledgerrc.org | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ledgerrc.org diff --git a/ledgerrc.org b/ledgerrc.org new file mode 100644 index 0000000..52231e3 --- /dev/null +++ b/ledgerrc.org @@ -0,0 +1,8 @@ +#+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent + +#+begin_src conf +--file ~/.personal/f/ledger/main.ledger +#+end_src +#+begin_src shell +ln -sf $(pwd)/tangle/.ledgerrc ~/ +#+end_src -- cgit v1.2.3 From d0696001902ed3fef790b3e2a50c9ede71d7a887 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:24:55 +0100 Subject: Add gpg-agent configuration --- gpg-agent.org | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 gpg-agent.org diff --git a/gpg-agent.org b/gpg-agent.org new file mode 100644 index 0000000..70bbeca --- /dev/null +++ b/gpg-agent.org @@ -0,0 +1,19 @@ +#+PROPERTY: header-args:conf :tangle tangle/gpg-agent.conf :comments org + +#+BEGIN_SRC sh :tangle no :results silent +ln -sf $(pwd)/tangle/gpg-agent.conf ~/.gnupg/gpg-agent.conf +#+END_SRC + + +#+BEGIN_SRC conf +max-cache-ttl 34560000 +#+END_SRC +* ssh password caching +#+BEGIN_SRC conf +max-cache-ttl-ssh 34560000 +#+END_SRC +* Emacs pinentry +#+BEGIN_SRC conf +allow-emacs-pinentry +allow-loopback-pinentry +#+END_SRC -- cgit v1.2.3 From 56cd7b311f925d2d38f4a932a28d17a1ce06a60c Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:24:47 +0100 Subject: Add mail configuration --- mail.org | 456 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 456 insertions(+) create mode 100644 mail.org diff --git a/mail.org b/mail.org new file mode 100644 index 0000000..b1166e0 --- /dev/null +++ b/mail.org @@ -0,0 +1,456 @@ +# -*- buffer-auto-save-file-name: nil; -*- +* Intro + +This file describes my mail setup using +- =mbsync= (isync) to get mail from the mail server and save it + locally +- =notmuch= for tagging-based mail searching and organization + integrated into emacs +- =afew= to provide initial tagging for new mail to notmuch +- =msmtp= to actually send the mail written in emacs + +* mbsync +:PROPERTIES: +:header-args: :tangle tangle/.mbsyncrc :eval never :exports code :results silent +:END: + +The config for mbsync is described in =~/.mbsyncrc=. +#+BEGIN_SRC conf +# IMAP keeps an "internaldate" attribute for messages, which is separate +# from the date given in the message header, set based upon when the +# message was first received. Fastmail's webmail interface at least +# uses this attribute to properly order messages chronologically. +# The CopyArrivalDate option isn't well documented but it seems that when +# synchronising a new message it uses the Maildir file's Modify date as the +# IMAP internaldate attribute and vice versa. Otherwise it seemed the +# synchronisation time was being used instead. By setting the option here it's +# enabled by default for all Channels. +#+END_SRC + +#+BEGIN_SRC conf +# 1st Account GMX +IMAPAccount gmx +# Address to connect to +Host imap.gmx.net +#+end_src +** My mail address :crypt: +-----BEGIN PGP MESSAGE----- + +hQEMA6SnnQUY6GkFAQf/RUqzIsIlyVwYQ4+JG5vXIeVjX5qhuoHrhSJ46FAzCAVZ +ZwLsPaJ8yMDiCgo1R62gCoOt+jKBxbfBslBc6S7yYbhK6TnvRCuFvmYib7X8nirE +Jo9CVZ1Rd6L53PDu1tBpPKUbB/V4dLa2785W3Gq97jKS0G1I/lN3wE1FKKc3q3fo +ZrcTOtCId2qCcl/IpRMaBFiEdXSM1LC306nFFEHtoGoVlQv6P7ro7ButcmdSiHd2 +lyoDvffDr2hpnU+kjDDIqZIdcgyBalC1Vp1aEWT/N41AABtWbpOa72YGG/X2zFMG +FR9Q8biqU5+g3VJJ3ezZvZqPnXW9lpQ2Vt9kwFT/D9KcAbJrZpelPlpQ717VpG38 +FZ8hKrefvKVeiQQgbkFYr1V6rTZqcYOHKSSpnVX6x47R3wv5a3m1SXhnFOgF5vuK +t2VIbGm7PLbErjGXt+fAkAOndF3/Pk2e8lGeRjXAnseiFERWPMCGEV/abUk96+QQ +zDfhkmp8sHPkyRe5pVDOABrcnLn6tirDkcuCtbe5aC+cBLSMpzKdwW+xfwBK +=szMA +-----END PGP MESSAGE----- +** Rest of the configuration +#+begin_src conf :padline no +# Use SSL +SSLType IMAPS +# The following line should work. If get certificate errors, uncomment the two following lines and read the "Troubleshooting" section. +CertificateFile /etc/ssl/certs/ca-certificates.crt +#CertificateFile ~/.cert/imap.gmail.com.pem +#CertificateFile ~/.cert/Equifax_Secure_CA.pem + +IMAPStore gmx-remote +Account gmx + +MaildirStore gmx-local +# The trailing "/" is important +Path ~/Maildir/gmx/ +Inbox ~/Maildir/gmx/INBOX +Flatten . +SubFolders Verbatim + +Channel gmx +Master :gmx-remote: +Slave :gmx-local: +# Exclude everything under the internal [Gmail] folder, except the interesting folders +#Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" +# Or include everything +Patterns * +# Automatically create missing mailboxes, both locally and on the server +Create Both +# Save the synchronization state files in the relevant directory +SyncState * +# Remove messages on master marked for deletion +Expunge Master + +Channel gmx-quick +Master :gmx-remote: +Slave :gmx-local: +Patterns INBOX +SyncState * +Sync Pull New + +########################################################## +#+END_SRC + +** More mail accounts :crypt: +-----BEGIN PGP MESSAGE----- + +hQEMA6SnnQUY6GkFAQf/e+ruPfPql0ZtLUpTAEXjD036TyTCcjhx4dfmq+CD+Af8 +miqFilLCB6LvYrMkhH++gtvgcIL12NgUdVcBH5sUKVlztcPo7QS+MvTtWVYEPBUD +VZgGeKeKZRtXYAD6xRySPHOX/2TuaKUrcsoEgMOvqZT+rT57t/jYVIEeDAgG6zdL +qlRvFMEmTzcMeO6o/AYs0t145FmPoq4tg+M/df0r+UqVPMZ3jUXjrun9NAi0/H3Q +Unwm1fEM/BM9uMEZotjBRfdVXS6C7rR5KFqaBRIqXo2E/vu8ZITRJKjhquEODYCw +soD+QGIBjxX3KFyD0IuYCMUaPoDsxvCymhrC2L1AHNLpAejabDxufuoo2kYl7xHi +WU5uU0E8vBA7M3T+HRP54w/fvZeRQ56WDK8SnJPAcZEUXtvIDvU03/vJocFRfScA +85ieW0UyEv61zBLj/a9l8GxeOgPqD2KxpvjKtDYhFG5qXtvavJVEZFF/B8IHR5uX +5EKiN/oj53l6353MSnBKUWsW2lwImPfrZ0NbYeCX3YfIZnlVfKCi7Y6gKmOf1JUu +vZovG7k0t2Lgr8rcEVhulObTV2KXHX0+ealHKoztqh/oOBQ/W6vr70j6Y7jZqOxJ +vEviGwkAEyjwadC4iuRWlUJexCN4xRiIIN7XHXBe8ZUMyrfqGXnTS7NmdvBwZTwu +xIrqMIGKdDCx+ZWQ3yLBCG8wUR0AXyj2HJMMxFiTKUUmmWqrkxOK0hc1AC0kG5GZ +BpBQw6ao0WgB3FH/s/tzElBtobceNGjzTiHleuqpcQhjzs/uAJ1TA6KN46BWNIXt +0OkU4rDhvX3FuAesV0W53TgiIoiQRTHoGg8qKCO/FZ/voy4nFCd39f6E1stFwQFB +GRByocIgAXF7ztImWi8+CzDO3V6P2cLLcDkB8qOMS19pFmQdQRDg/AROAiY5sf37 +19VT22KXuGAzSbFkMDJCvRxJwGI02f5o/fKc27c7jOWCc4cEX2mbNH+3HQyn3bcH +5L6YgsjdgosevmFHv9t4Y8zAnQDDgJ7ScsFn8QPQpC1w7WIfa2hzVQsFfzQpqWOA +mJ9HZlnFAi2Et22edJVcXBRfuWCn8ONkS3LxP5C1fPM+MAhRlnOgsPFBWwXpoxby +Qshin5lYnw2LfxH9cwPIxGjzbKxXMH40fEvl35YhPk5+afvd1XxnY8S12Wd9BhIg +Iy1O6yzIVbmu+CFJjnnqZLYaiKd5JiVNpuL0sLWjaJpBTrF66mzIS+kYLK+GiTEk +uuYhaD2Gicey5Q29fnPFifMJCYFE3su9AuxReHqQJ09q2//j0OCGxVzcuXGz9gxU +H/UI6+oB7okdZRC8CkFsD148KE5Ey4rKwGJde09ARsm9ufL3DhHu5Evt8OnsTTge +LxV0DFD/f3OrZArq4NE0tcCjeLX2u/BWfIwi1BvRdmqrlc0nM9huLN94HXqN+M7t +Oix8y0GS4wbqoWVKY/zekcHJ1nbihu1fhfo0FHwYn68= +=vA+w +-----END PGP MESSAGE----- +* afew +:PROPERTIES: +:header-args: :tangle tangle/afew.config :eval never :exports code :results silent +:END: + +Config expected to be in =~/.config/afew/config=. + +~ArchiveSentMailsFilter~ entfernt den /new/ tag und danach werden keine +CustomFilter mehr angewendet. Um auch gesendete Mails richtig zu +taggen, wird ~ArchiveSentMailsFilter~ erst am Ende aufgerufen. +#+BEGIN_SRC conf +#default filter chain +[SpamFilter] +[KillThreadsFilter] +[ListMailsFilter] +[SentMailsFilter] +sent_tag = sent +#+end_src +** custom filters :crypt: +-----BEGIN PGP MESSAGE----- + +hQEMA6SnnQUY6GkFAQf9HdGdNQhH0pwo4VTRIyuKLoUDnG+YUfibOCQR+IT54pl8 +d6ZbGmzOhHcV5ucEvy+orswyD5joaJI7TWwAqD9ymevq9k5rT+Ly2cC3gr9Dpxlo +WCZKL6nMgObJZQUWFgk+qp8nHc6Ellq+8zkfAIltN9oip9ugZ4xUskx/avs9lF2I +G1+nXgPB2B/WFPQftIFS2rVAhuPjNOMplXpgIWQKb0gRYWvWSM1QNICpFVd+d2g1 +pWgfy/IW0fhOj3BRVqajAnNU/5A3W+lnpHOu3yBmj9g087b3dxwArnNAYa0jBU3R +N4dgUEXWxDhjNRHqw8DXPfCTqGHcuZPxNzB7TwsrOtLpASE2b/ztjMDuTjUnPepj +pAWcyNyt3+xqj8pT+9CXPq7G736NInTQX4uADW88ATZfTflj1FSf1ebgQAVxfuzu +1uIGFsFdnFbSXQT2vRrenKaW+f8A+cpeR6uVerndDJPTxl2qNjqfqrRRgvbfVLWx +UgUj9DVRqn7iMNzH1KmjfeFQJwE8XC3oHlausHXBop/r09i0e+y4TIs+XMPaR5Mb +C6w1AUwiqTpClE7lDXl+GTDlDU5WZOogZEn9T3aldC6/FR/m24/1HD+HvYJKwv4Q +NNRULzE7KTiRS+NyZ7jBAUavbdiSHmWLsdWJliiWVCcwVRlBMS+xD67OmD723KGZ +ZNe/j0hWz8lxDg2glwFaodShaH1gfcsPIKJtKaPI4MBDtE1yJjDeAaTESPzqAwqQ +/aNvot4CTaY8116E91DBjNeiIl8pKhvvcmSgMgZ4sFdm4pxf4FIo3s14QceeK8zI +DW5vIHgJtSkZRU0xfKVD2Y+pPEzwmA/QrBOqLW1xRgQgUPKZCm9XH2kbg6ZdTHym +y6mUkRmiSEcnS+9PRNIlpqUGXXlq1jpGuhncRb6cZnwhIZVe58O3oZRdmzK/NEYo +ihg009W7xfRwEtyDIjWfizOwWwapFkzUcMDhI/cwh1BEWYo9n4my51dcbPL1rgGc +yyoBMXV8Jr9GqSszYZzGmW94pjJ6CIE89dN/uZA7LluRGRbRwLP8cTukjgPp6YU9 +ZTeSgvvAQZ+epAwppAds8voHPCbI6rxiT4425q9D2oJ/8/61XXpVB/clm1a/MYZs +TvBSklmyMA1DXv/05PL1KSw0kyYhwVf6LeysXbBott5P/P8auOD852bn +=+wv0 +-----END PGP MESSAGE----- +** more stuff +#+begin_src conf +[Filter.1] +message = "Get mailing lists out" +query = tag:lists and tag:new +tags = -new; + +[ArchiveSentMailsFilter] + +[InboxFilter] +#+END_SRC +Move archived messages from inbox to remote Archive. Archived Messages older +than 1 year are moved to local Archive. + +#+begin_src conf :tangle no +[MailMover] +folders = Inbox Sent Spam +rename = true + +# rules +Inbox = 'date:-1800d..-60d':archive 'tag:spam':Spam +#+end_src +** MailMover section :crypt: +-----BEGIN PGP MESSAGE----- + +hQEMA6SnnQUY6GkFAQf+ICLLhgKd+qv4ZDQXt+HoQIAXc4FnDUm3wMwr3oXg9i4h +kbZ46zxD4fSPkGAS4HmEHXFW1vHzy2oOxW/fiXKzo6Gtzg8sk+Q2w0rd7twRclJs +ovxxUWxNmaFbveGwgBHb35LMvPWxS0PobM0NA7g4nrpB/VA61n8uAij4C7Mr/eLk +PADL5NgC1mhHGSsLtewAYK0psws4zDGCYKMI6cG7cWgFpwLwNbbJM+bzDmO7wdvg +I+zQE/Ledu0UzZZ+6FDWhZ9TJa6Hw4iU04MrL8Nm8+ptq3YAYRlHX0jmjrSIrnGo +f+1CrLhffdP/1QlHWSMVDcHwSs0TOpNkv1gLvsEYqdLAmwG5E3a26faFPRko212Y +RULOnX10FQ+3d3b3cITRGLKkYwoRpAnMj6zUGk7aTdkZmPmQvdFozfuWbI0pnEbN +H3BpJrgDFB4B2xlT012kUmH3AzWQW4LHur/Fk7CXFBBnhOVSTcN/VuSuezoGKJQp +QEt5kusVKk4tkDYbdneA4NveCjum6QeFop1VliJ77tLKFlxCiTLE+c4ssQNc7tO8 +JR6Bv5piQexYeNjuADilcmGoYH8kjP1rkp5PkjIvm5cgUWFd+WAJOyCR6BkAkUv8 +a6+XqsAV1z+jvEFmxgYu00IahdLRie+kZU/ud9zMkj1d0XsK9KFWKtb7SzOEyHYS +Mqy85ND/nlwZy5CXAw6TMkltRvdet00e9X6z7AtH+N0oAMWc3kkquskNrgWj90OK +FVtUffixHcpqE0LouIzmMjWNKbxLm+zyU9fDJtvbDijMzGjsKM8nO6XlR0Ju +=ze7O +-----END PGP MESSAGE----- +* notmuch +:PROPERTIES: +:header-args: :tangle tangle/.notmuch-config :eval never :exports code :results silent +:END: + +Config in =~/.notmuch-config=. +#+BEGIN_SRC conf +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# +[database] +path=/home/fpi/Maildir +#+end_src +** User configuration :crypt: +-----BEGIN PGP MESSAGE----- + +hQEMA6SnnQUY6GkFAQgA2rFXXm7umflR9w3LqX6w5nR/lq09KnkL0aD79CDPMmnv +O0pPFDMmOWXSIUZRd2F0QU4rdy1Wh23he+0aoe8+hrhB4IXFgUYoW/uif/FDQP8/ +vIgE722F+C2ANZOi5hxZKAlboHnqDHhk0G/zBsHfYShK2es33jN0RNVCETJFHVYr +fsGAqvDGxXEuvms9lfzmDg8uIiM19hGC9E6BXxkVdMYDbJl/xok59gXkvYvmkh9K +3joufftAO8dKMOeuQGyYVsUtBfzurXTV2VTQQjKIqbHfWfVESQlRQeCOmbhNzUYz +AQmUbflAXadadpd3W6g4eqqPpMAJWTYlj4jcti6JI9LBMQFYcW4zeUK1y7HfAhgk +g1JVZ5BWcKChoxTHRzPy6NlRwyLIe7lXk39aK+GgUCq0UqZKDAaiydyO+psQM+dM +/s0C3phYh1cWCg8/9bq/Iu+nINXx0BuS0dmbrGh8UPMPjPlXYskaMIezKHobStNB +oYOC3Y4VA1qYkaDpcU6/JqpvzvCSm01JTE4DbOMLQGghu9opXsbT7ArM5vkGoDMS +Nvvl2VrJApGP1bde7pvbjL08/43yBlJKlOBFn6awE9sqpF08T6/9bJFvjAdQDs68 +ab3VnHJ8F4LZX5IOkePAQVvK3ZPxNfWutAeRRvICqouGH+v+MBtsafVYr1VmfeI6 +NNpRbra6/ycveBAcQoaJcZYsx4ZcliqPU+GOKRhNcjEjrtDeqWmfBBIvkBYy4QOu +z9y7f7JM7QHyn9RFvKAy3obVU+F/RujLOuOCKCQrA5uoM+INcznqSXlo6u21M6AF +LJk6+Lt8GDH2XjAhjcDOWmRweKPnFsi1wHUwlIxv3SIAFl0kb2mkVx5+dzWIR2yO +vj0NYcHwMO/h3CM+7IjpAjLffDXWjR7QvXpdV9cpEELzAy6T2C7W0s0tGjpI7065 +5Z+AG1KoJr3YPu+E1v3rWtIuwUw8Sv2Z/H3gLZXbMrZNy3k4m5lfsVZWcHWiaXy3 +x5DE +=EvAL +-----END PGP MESSAGE----- +** More configuration +#+begin_src conf +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# +[new] +tags=new +ignore=.mbsyncstate;.uidvalidity + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# +[maildir] +synchronize_flags=true + +# Cryptography related configuration +# +# The following *deprecated* option is currently supported: +# +# gpg_path +# binary name or full path to invoke gpg. +# NOTE: In a future build, this option will be ignored. +# Setting $PATH is a better approach. +# +[crypto] +gpg_path=gpg +#+END_SRC +* msmtp +:PROPERTIES: +:header-args: :tangle tangle/.msmtprc :eval never :exports code :results silent +:END: + +Config in =~/.msmtprc=. +#+BEGIN_SRC conf +# Set default values for all following accounts. +defaults +# Use the mail submission port 587 instead of the SMTP port 25. +port 587 +# Always use TLS. +tls on +# don't use auto_from +auto_from off + +# Log to syslog/systemd +syslog on + +tls_trust_file /etc/ssl/certs/ca-certificates.crt + +# Additionally, you should use the tls_crl_file command to check for revoked +# certificates, but unfortunately getting revocation lists and keeping them +# up to date is not straightforward. +#tls_crl_file ~/.tls-crls + +#+end_src +** Account configuration :crypt: +-----BEGIN PGP MESSAGE----- + +hQEMA6SnnQUY6GkFAQf/csoGa1RI1hzBuv+DGkZ8Rp6YKy1bMJxppOdrRjIZNHCR +Zf0+l/tNk+dg4p3O++N1+hORzcYcFnXepMCvjtlhOCW5Un/JvUZMFfXhWH+Vb503 +TFo+2bzir+zoCeSg5CwY8mXpQja4GXCcVbGNCUDyV5u86vnktQZpn9NUjEJ0vOf0 +To87ZEuAeDpoAzPuVB0BerxHjtQ9dsTSudEyc2oW63/FruEpHZl3j9gsuNB/rbIw +QYbf5hC0RyvRjjqx3E0RXgGLq+Z+HEAJl8ztnJ4/koI695f/MXVKmquO6GoOm1PA +3/2lSInBd3fPIfNwR3JT5NZO0+LL+D526Eos/xgMl9LpAQR3/V/oFvsXFW34bB55 +t7TCDJPg8UoJhzfaXcCCA8XUUsUehJT+y4eoEkc07ehbsQ1G0mb2MCW3Zczrmrqy +qX1GABfQ2+ncL3cnybAyXkxqnCqLm37DGQUSkkQvi64TiQNUhR/elrg58rNnr3f7 +Nc6dKoHBvdFERSjU0L+32bAgCVt9XmFAnk/chVSVapCPIDGR8sk9xJEuy7e2TSDy +YvI3XUkVir3OD+cwJgBVDJ2/CExZ4wZ3YXZuIHh1USEWi8JZS2qAEIlovzALcmoT +SBfkYOmi/xYDKmEDuARMR1g5LFh+0utgJFkgNIQq9pENbzstqRIWKtCDESNlPj0k +5bk3abFS83Xt/y2DN0ToUvRqXqTNavwDmrtpjhX6Ca0HblLPyZiK+Yhe/EctyjrI +UUaPHXGQP9mVxZqJqQg1Yr2CQdGC6v/mw/4XAJs2y1A8dAUHcfkOVTLfI+PZGkRL +jFuVCyeXnR66qXeNhw33xPoxytIf7q7aHw/0SaQkX8+ult0mO8n8xAM7LXerM21b +VFUxesN6YTqTyEH2v1ZC6GmknSthljYZTn2bbmA2pBGnDhmVSUCLa/6p+pxj9BqA +xG/SGhSQWseHDWa+EveXJlzMUo/+AfIKFuNVIJrJAbl+uUzSfW01iyBWGpQQIrzZ +Fbi3XFOQYjPZrlMh9DWnaFvAXYE8VSbJGunorRiGG00K7zvErCSnVjwNEjPd4ygm +bmR1aZJTbeUh2NmvEUqtYQe8QfblCtMlPy/48sJlGs4VzHWZ4bSFcH3dfYDxceL8 +6QbN4sjqvPYHFhXk3tFH4zBEnvR6DzkR6+WErUURDsS4die7d5+nKiqX/+audH3e +rSJXruKotOwvz95u49AzapFXpuwEAasRaWNUbBY/xDfbmL4NoY1Poxh7rcJiyb+W +fR/DlUtGEeB3lYNSWLaJplov9Xv2jpMMN/9hqSN5QFZZPheHEroxNb7q8Cn2B+Zk +u0kSSCPys5z0+HZmxUVzSY25YmwYbTk+8YhiLus/fdjBTjPqkza1J/lUoKp4SivN +nB9Df3NOp06JrxzI94o4Gw== +=K6DS +-----END PGP MESSAGE----- +* Checkmail.sh +:PROPERTIES: +:header-args: :tangle tangle/checkmail.sh :exports code +:END: + +This script calls everything necessary to receive mail. An optional 'quick' +argument can be supplied to only sync the inbox. + +#+BEGIN_SRC shell :shebang "#!/bin/sh" :results silent +STATE=`nmcli networking connectivity` +run=$1 + +# no of old unread mails +OLD_UNREAD=`notmuch count "tag:unread and tag:inbox"` + +# Delete deleted mails +COUNT=`notmuch count "tag:deleted and (tag:spam or not tag:spam)"` +if [ $COUNT != 0 ] +then + echo "- deleting $COUNT messages ..." + notmuch search --format=text0 --output=files "tag:deleted and (tag:spam or not tag:spam)" | xargs -0 --no-run-if-empty rm +fi + +if [ $STATE = 'full' ] +then + #~/.local/bin/msmtp-runqueue.sh + if [ $run = 'quick' ] + then + # echo 'Quick Sync' + mbsync gmx-quick + else + # echo 'Normal Sync' + mbsync all + fi + notmuch new + # tag mail + afew -tn + # move mail + # all mail to move archived messages + afew -ma + #notmuch tag -inbox tag:inbox AND tag:lists + + NEW_UNREAD=`notmuch count "tag:unread and tag:inbox"` + if (( $NEW_UNREAD > $OLD_UNREAD )) + then + msgs=( $(notmuch search --output=threads 'tag:unread and tag:inbox')) + for i in $(seq 0 $(($NEW_UNREAD - $OLD_UNREAD -1))) + do + subject=$(notmuch search ${msgs[i]}|grep -oP "(?<=\] ).*(?=( \())") + emacsclient -e "(sauron-add-event 'mail 3 \"$subject\" '(lambda () (other-window 1) (notmuch-show \"${msgs[i]}\" nil nil \"tag:unread and tag:inbox\")))" + notify-send -u low "New mail:" "$subject" + done + fi + + exit 0 +fi +# echo "No Internets!" +exit 0 +#+END_SRC + +A simple cronjob then regulary calls this script. Setup like this it +performs a quick sync every minute and a full sync every ten minutes +and also logs stdout to systemd. +#+BEGIN_SRC conf :eval never :tangle no +,* * * * * systemd-cat /home/fpi/.checkmail.sh quick +,*/10 * * * * systemd-cat /home/fpi/.checkmail.sh full +#+END_SRC +* Emacs setup +:PROPERTIES: +:header-args: :tangle tangle/emacs-mail.el :eval never :exports code :results silent +:END: + +See [[id:1e1d7ae0-3e88-4e14-b67f-72c6be66e565][emacs init file]]. +* Create symlinks + +Finally symbolic links to the desired locations are created for all +the tangled files. + +#+BEGIN_SRC shell :tangle no +path=$(pwd)/tangle +ln -sf $path/.mbsyncrc ~/ +ln -sf $path/afew.config ~/.config/afew/config +ln -sf $path/.notmuch-config ~/ +ln -sf $path/.msmtprc ~/ +ln -sf $path/checkmail.sh ~/ +#+END_SRC -- cgit v1.2.3 From f5e07059df2e98f1f507e0b4ddb7a649a156a0c1 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jan 2020 15:27:54 +0100 Subject: Add README --- README.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 README.org diff --git a/README.org b/README.org new file mode 100644 index 0000000..bfd2a0d --- /dev/null +++ b/README.org @@ -0,0 +1,17 @@ +* My dotfiles +The config files are organized in emacs org files. They are tangled +and symlinked to the appropriate directories. + +[[file:emacs-init.org::*tangle%20dotfiles][A hook]] tangles all files automatically on each save. +~emacs-init.org~ is special and not automatically tangled. The >100 src +blocks make tangling take several seconds and ~org-babel-load-file~ in +~init.el~ tangles the init org file on each emacs start anyway. + +For now the symlinks need to be created by manually running the +appropriate src block in each configuration file. + +* Window manager +I use [[https://github.com/ch11ng/exwm][exwm]] and [[https://awesomewm.org/][awesome]] as my window managers. When doing a lot of +coding and similar stuff I tend to use exwm as I will spend most of my +time in emacs anyway. + -- cgit v1.2.3 From 30fb051d8fa808337be3e42f96ba919dac87b16f Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jan 2020 10:59:10 +0100 Subject: Reduce size of archived headlines --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 4eb520d..652c07f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -398,6 +398,10 @@ The above macro can be used like this. :slant italic) (:height 1.2 :slant italic)) + (org-archived + nil + (:inherit shadow + :height 0.6)) (org-level-1 (:inherit variable-pitch :height 1.3 -- cgit v1.2.3 From b0f42879a3761e7cfc57aba055f523c524080d3b Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jan 2020 11:10:48 +0100 Subject: Fix background of dired subtrees --- emacs-init.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 652c07f..7803b64 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -733,22 +733,22 @@ The above macro can be used like this. nil) (dired-subtree-depth-1-face (:background nil) - nil) + (:background nil)) (dired-subtree-depth-2-face (:background nil) - nil) + (:background nil)) (dired-subtree-depth-3-face (:background nil) - nil) + (:background nil)) (dired-subtree-depth-4-face (:background nil) - nil) + (:background nil)) (dired-subtree-depth-5-face (:background nil) - nil) + (:background nil)) (dired-subtree-depth-6-face (:background nil) - nil) + (:background nil)) (nlinum-current-line (:foreground ,builtin) (:foreground ,bg-dark)) -- cgit v1.2.3 From 878e9acbf68ab0224b7858352a1ae7cc5a5c4c9e Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 17 Jan 2020 14:28:55 +0100 Subject: Remove strike-through from org-*-done faces --- emacs-init.org | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 7803b64..245bb2d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -479,9 +479,8 @@ The above macro can be used like this. :background ,bg-dark) nil) (org-headline-done - (:strike-through t) - (:family ,et-font - :strike-through t)) + (nil) + (:family ,et-font)) (org-quote (:background ,bg-dark :family ,sans-mono-font) @@ -580,10 +579,8 @@ The above macro can be used like this. nil) (org-agenda-done (:inherit nil - :strike-through t :foreground ,doc) - (:strike-through t - :foreground ,doc)) + (:foreground ,doc)) (org-ellipsis (:underline nil :foreground ,comment) -- cgit v1.2.3 From 621711fc3dd886b9c405735e04a272a6477a726a Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jan 2020 18:32:29 +0100 Subject: Change address of a mail server --- mail.org | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/mail.org b/mail.org index b1166e0..9d56f18 100644 --- a/mail.org +++ b/mail.org @@ -93,31 +93,31 @@ Sync Pull New ** More mail accounts :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQf/e+ruPfPql0ZtLUpTAEXjD036TyTCcjhx4dfmq+CD+Af8 -miqFilLCB6LvYrMkhH++gtvgcIL12NgUdVcBH5sUKVlztcPo7QS+MvTtWVYEPBUD -VZgGeKeKZRtXYAD6xRySPHOX/2TuaKUrcsoEgMOvqZT+rT57t/jYVIEeDAgG6zdL -qlRvFMEmTzcMeO6o/AYs0t145FmPoq4tg+M/df0r+UqVPMZ3jUXjrun9NAi0/H3Q -Unwm1fEM/BM9uMEZotjBRfdVXS6C7rR5KFqaBRIqXo2E/vu8ZITRJKjhquEODYCw -soD+QGIBjxX3KFyD0IuYCMUaPoDsxvCymhrC2L1AHNLpAejabDxufuoo2kYl7xHi -WU5uU0E8vBA7M3T+HRP54w/fvZeRQ56WDK8SnJPAcZEUXtvIDvU03/vJocFRfScA -85ieW0UyEv61zBLj/a9l8GxeOgPqD2KxpvjKtDYhFG5qXtvavJVEZFF/B8IHR5uX -5EKiN/oj53l6353MSnBKUWsW2lwImPfrZ0NbYeCX3YfIZnlVfKCi7Y6gKmOf1JUu -vZovG7k0t2Lgr8rcEVhulObTV2KXHX0+ealHKoztqh/oOBQ/W6vr70j6Y7jZqOxJ -vEviGwkAEyjwadC4iuRWlUJexCN4xRiIIN7XHXBe8ZUMyrfqGXnTS7NmdvBwZTwu -xIrqMIGKdDCx+ZWQ3yLBCG8wUR0AXyj2HJMMxFiTKUUmmWqrkxOK0hc1AC0kG5GZ -BpBQw6ao0WgB3FH/s/tzElBtobceNGjzTiHleuqpcQhjzs/uAJ1TA6KN46BWNIXt -0OkU4rDhvX3FuAesV0W53TgiIoiQRTHoGg8qKCO/FZ/voy4nFCd39f6E1stFwQFB -GRByocIgAXF7ztImWi8+CzDO3V6P2cLLcDkB8qOMS19pFmQdQRDg/AROAiY5sf37 -19VT22KXuGAzSbFkMDJCvRxJwGI02f5o/fKc27c7jOWCc4cEX2mbNH+3HQyn3bcH -5L6YgsjdgosevmFHv9t4Y8zAnQDDgJ7ScsFn8QPQpC1w7WIfa2hzVQsFfzQpqWOA -mJ9HZlnFAi2Et22edJVcXBRfuWCn8ONkS3LxP5C1fPM+MAhRlnOgsPFBWwXpoxby -Qshin5lYnw2LfxH9cwPIxGjzbKxXMH40fEvl35YhPk5+afvd1XxnY8S12Wd9BhIg -Iy1O6yzIVbmu+CFJjnnqZLYaiKd5JiVNpuL0sLWjaJpBTrF66mzIS+kYLK+GiTEk -uuYhaD2Gicey5Q29fnPFifMJCYFE3su9AuxReHqQJ09q2//j0OCGxVzcuXGz9gxU -H/UI6+oB7okdZRC8CkFsD148KE5Ey4rKwGJde09ARsm9ufL3DhHu5Evt8OnsTTge -LxV0DFD/f3OrZArq4NE0tcCjeLX2u/BWfIwi1BvRdmqrlc0nM9huLN94HXqN+M7t -Oix8y0GS4wbqoWVKY/zekcHJ1nbihu1fhfo0FHwYn68= -=vA+w +hQEMA6SnnQUY6GkFAQf8D0Z1y2IjAlvuDhLG4+cUQ2UxWkIPtnKrOHJSciULJh8s +Ow/lwwH+ww6HtJvgDKQsEE43ARATfXymQgXpULSMvVX63SM5a/kUbtV/jlyoCKc4 +LCkcRHn3aTW0p3vHhGu0qQLTPvwnfSpF2BIae+THPANJMcW3G0L4qL1HJmgb6RYa +R0wYjYInOvWH/oFK2EkBhQJMVo/9K797xN3fLow9m5KHZbOOS1Joe7rtOdvrLvqB +XuOkWgAhFYSnu3WCSCrFYeKYXbJr4euZ8j9cOXyhTsS+kgwMC4ZiT4UZHTDWIfBy +6dirRjlVsUj2DfaP0Miq9pTNO8m48r5cj/ihNcapPNLpAbcAIFF2FuXPuYmeXr5j +4VOTXi/4VqhoM1jusDF1yJ8UBsE150d5aqry46wkGpNTEoxGzOGZNCzuiP4tYrLg +Ijloke2cPS+R0iC8iGdrIcV3NecEnhosUW0ivHH18ODQQAk3WZrUUaBDTAoSV+1/ +lVy2VZujhe92vZUfpVs0ObGdXL6VEanjssmnyKUsW2I4Wafl/oZtoVOgM7UGF75F +NKuuc7V9CX8+5NoUpJ+6U0Ky3NRdHzr0jQUyD1CgIhCW2iQGYLuuRk50t8ga6F+C +zB7/RlmJDYdbRtFNKcxCBVt3ZVgxt9XpkSArDLDJoAQ4Gxknu25GC3a0s8X8KFMs +KulvdW9VDwoE30oinHPyteu0g2oLhvax2DsxEeCF/9lPgT/ZpyFXBhYEc8klqj4z +MU7DjYXqO85TtaM4KTk5y6C0sCRxqlpAwxn29VhojOSPlVYmxi50Qz/UFaSD9EeL +V0j7Jki7TqnucSz1L//vPP52DFoY2bLMLBY+2TrgYADNQ54tjZIt6cHQSWPbNp74 +ncxtF/ZCjFVLuBmAv0a/u2iypSfH/LPM8M90p3cVQy3Hoka9NdWYsSif+kp5pLMv +jKTAT1FHIfSXRAfDFqdeeNYnkNPC8uW2aJAu1wISaRkH7GHoMr4J+bqjS5i9hiHi +2l5BdLbfp877jQj3SUbC4vTAm1tHnfWoviMwAgjfXgY6pTP78NRmiqHIItbqXAQK +3a4eSXv6IvxdBLf+CdhTjJX+Iemyt4WbJcfNatILvSOPGdpkzYnYn3VRdblwFX38 +FP13aIWaWToPSVINY+PuHBfDNVx2FzsJa4+LbOWdAe2KfQHFRov9mOoa36PiQ26J +NQ5hUgsiBGADPBbg+RtSb4KqHBATJP2p5f7gILDEoK9zVRwIwmgW+XFRd6QtxKJZ +kjJpzUBYHpfe/me8BflBRsXU3QnFwWATpMW5xd7I5ZRqZtmVZLaejTiVIYJjoZlM +wKTSFxFfVZqrhgapNpyB8e+KP1AU7/ufsYA9TwuZpjZBT12j0RVOAwqN55G5jU+h +yDlNCQmhyp5kZ1GIDxI8ln+X0dqcfdNo1GbupfsAdcTOCactkMd57+9sOQPY3lhy +aJLPQXacmDINhKe8AYmybz7S8WPTY8iAwt+CAFmO +=sYDv -----END PGP MESSAGE----- * afew :PROPERTIES: -- cgit v1.2.3 From 5dd403c1ec92b5999cbc2599e2b499864cafb86c Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 18 Jan 2020 20:07:28 +0100 Subject: Add Deft for knowledge management --- emacs-init.org | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 245bb2d..04cab0a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2192,6 +2192,31 @@ Skip project and sub-project tasks, habits, and project related tasks." (t nil))))) #+end_src +** Deft + +#+begin_quote +Deft is an Emacs mode for quickly browsing, filtering, and editing +directories of plain text notes, inspired by Notational Velocity. It +was designed for increased productivity when writing and taking notes +by making it fast and simple to find the right file at the right time +and by automating many of the usual tasks such as creating new files +and saving files. +#+end_quote + +I use =Deft= to organize my =Zettelkasten=. It contains many single +files about various topics. =Deft= handles searching and file +creation. +#+begin_src emacs-lisp +(use-package deft + :ensure t + :custom ((deft-directory "~/zettel") + (deft-extensions '("org")) + (deft-default-extension "org") + (deft-use-filename-as-title t) + (deft-recursive t) + (deft-use-filter-string-for-filename t))) +#+end_src + ** Shell #+begin_src emacs-lisp (use-package shell -- cgit v1.2.3 From 82eefb09c0912c92ff8d86811f8bed8ad2d35466 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 21 Jan 2020 12:45:10 +0100 Subject: Change org-bullet to ✧ (White Four Pointed Star) --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 04cab0a..4bad5c1 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1657,7 +1657,7 @@ Here is a list of nice ones: ◉, ○, ►, •. The default ones are ~'("◉" " #+begin_src emacs-lisp (use-package org-bullets :ensure t - :custom (org-bullets-bullet-list '(" ")) + :custom (org-bullets-bullet-list '("✧")) :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) #+end_src Use imagemagick and standalone class for latex preview. -- cgit v1.2.3 From 06ea09e70890d0ac803c3c51f975211b257ee73a Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 21 Jan 2020 12:56:59 +0100 Subject: Fix background of default face for light customization --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 4bad5c1..5688e78 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -302,6 +302,7 @@ The above macro can be used like this. ((default (:family ,sans-mono-font) (:family ,sans-mono-font + :background ,bg-white :foreground ,bg-dark)) (variable-pitch (:family ,sans-font) -- cgit v1.2.3 From 7f41026fa80c93a832c9381e4f3db781d9487ef5 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 26 Jan 2020 18:06:59 +0100 Subject: Highlight org links --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 5688e78..1f663fe 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -513,7 +513,7 @@ The above macro can be used like this. (:underline nil :weight normal :foreground ,slate) - (:foreground ,bg-dark)) + (:foreground ,builtin)) (org-special-keyword (:height 0.9 :foreground ,comment) -- cgit v1.2.3 From 458287e34ea32c8677bbe90016a80e79e98bebdd Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 26 Jan 2020 18:07:18 +0100 Subject: Introduce Zetteldeft --- emacs-init.org | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 1f663fe..f7147e0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2204,7 +2204,7 @@ and by automating many of the usual tasks such as creating new files and saving files. #+end_quote -I use =Deft= to organize my =Zettelkasten=. It contains many single +I use =Deft= to organize my /Zettelkasten/. It contains many single files about various topics. =Deft= handles searching and file creation. #+begin_src emacs-lisp @@ -2218,6 +2218,33 @@ creation. (deft-use-filter-string-for-filename t))) #+end_src +[[https://github.com/EFLS/zetteldeft][Zetteldeft]] provides further functions to search and link between +different /Zettel/. As /Zettel/ are scattered in separate files, +normal org file links using IDs lack in comparison to the introduced +custom link format. + +#+begin_src emacs-lisp +(use-package zetteldeft + :ensure t + :bind (:map fpi-map (("d d" . deft) + ("d D" . zetteldeft-deft-new-search) + ("d R" . deft-refresh) + ("d s" . zetteldeft-search-at-point) + ("d c" . zetteldeft-search-current-id) + ("d f" . zetteldeft-follow-link) + ("d F" . zetteldeft-avy-file-search-ace-window) + ("d l" . zetteldeft-avy-link-search) + ("d t" . zetteldeft-avy-tag-search) + ("d T" . zetteldeft-tag-buffer) + ("d i" . zetteldeft-find-file-id-insert) + ("d I" . zetteldeft-find-file-full-title-insert) + ("d o" . zetteldeft-find-file) + ("d n" . zetteldeft-new-file) + ("d N" . zetteldeft-new-file-and-link) + ("d r" . zetteldeft-file-rename) + ("d x" . zetteldeft-count-words)))) +#+end_src + ** Shell #+begin_src emacs-lisp (use-package shell -- cgit v1.2.3 From 67b1c2713efe192a21367c6cfaf0cc4cfbbb4746 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jan 2020 17:36:11 +0100 Subject: Easier prefix for pdf-annot keybindings --- emacs-init.org | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index f7147e0..6b2ad17 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1436,10 +1436,21 @@ make sure to compile the tex document with the option ~--synctex=1~. (pdf-tools-install)) #+END_SRC -Add support for pdf annotations. +Add support for pdf annotations. Rebind ~pdf-annot-minor-mode-map~ to +an easier prefix and undefine the bindings of ~image-mode~ for this +prefix. For now they are unbound globally as I never use them. It +would be better to unbind them only when in ~pdf-view-mode~. #+BEGIN_SRC emacs-lisp +(use-package image-mode + :config + (define-key image-mode-map "a+" nil) + (define-key image-mode-map "a-" nil) + (define-key image-mode-map "a0" nil) + (define-key image-mode-map "ar" nil)) + (use-package pdf-annot - :bind (:map pdf-annot-minor-mode-map ("C-c C-a d" . pdf-annot-delete))) + :init (setq pdf-annot-minor-mode-map-prefix "a") + :bind (:map pdf-annot-minor-mode-map ("a d" . pdf-annot-delete))) #+END_SRC ** Latex #+begin_src emacs-lisp -- cgit v1.2.3 From 7b8d9c9da4cfaba9e1fcb7a2796bdf084340e95a Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jan 2020 17:37:23 +0100 Subject: Functions to create floating frames --- emacs-init.org | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 6b2ad17..afb6f90 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1693,6 +1693,7 @@ Use imagemagick and standalone class for latex preview. #+END_SRC *** Org-Capture +Templates #+BEGIN_SRC emacs-lisp (use-package org-capture :custom ( @@ -1760,6 +1761,36 @@ Use imagemagick and standalone class for latex preview. ) ))) #+END_SRC +Setup for floating capture window. For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]]. +#+begin_src emacs-lisp +(defun fpi/make-floating-frame (&optional width height minibuffer name) + (interactive) + (let ((width (or width 80)) + (height (or height 36)) + (name (or name "*Floating Emacs*"))) + (make-frame `((name . ,name) + (window-system . x) + (width . ,width) + (height . ,height) + (minibuffer . ,minibuffer))))) + +(defadvice org-capture-finalize + (after delete-capture-frame activate) + "Advise capture-finalize to close the frame" + (if (equal "*Capture*" (frame-parameter nil 'name)) + (delete-frame))) +(defadvice org-capture-destroy + (after delete-capture-frame activate) + "Advise capture-destroy to close the frame" + (if (equal "*Capture*" (frame-parameter nil 'name)) + (delete-frame))) +(defun fpi/make-floating-capture-frame () + (interactive) + (select-frame (fpi/make-floating-frame 70 20 t "*Capture*")) + (add-hook 'org-capture-mode-hook 'delete-other-windows) + (org-capture) + (remove-hook 'org-capture-mode-hook 'delete-other-windows)) +#+end_src *** Ricing #+begin_src emacs-lisp (setq line-spacing 0.1) -- cgit v1.2.3 From fa3cb3a7d3927d38680584f8e2345b2423588ca6 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jan 2020 23:19:28 +0100 Subject: Set face for #+RESULTS: lines --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index afb6f90..f27a10f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -505,6 +505,10 @@ The above macro can be used like this. :height 0.8 :family ,sans-mono-font :foreground ,slate)) + (org-meta-line + (:foreground ,comment) + (:height 0.8 + :foreground ,gray)) (org-document-info-keyword (:foreground ,comment) (:height 0.8 -- cgit v1.2.3 From fc2267fb8857a0af0dd63d683756a7f839834665 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 2 Feb 2020 15:40:19 +0100 Subject: Add git merge script --- README.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.org b/README.org index bfd2a0d..03ac014 100644 --- a/README.org +++ b/README.org @@ -10,6 +10,18 @@ blocks make tangling take several seconds and ~org-babel-load-file~ in For now the symlinks need to be created by manually running the appropriate src block in each configuration file. +** Git Setup +Every program's configuration lives in its own branch. All branches +are then merged into =master=. To keep the git history clean, I use +this script: + +#+begin_src shell :shebang "#!/bin/bash" :tangle tangle/merge.sh +git checkout master +git reset --hard init +git branch | grep -v private | sed "s/[ *] //" | xargs git merge +git push --force origin master +#+end_src + * Window manager I use [[https://github.com/ch11ng/exwm][exwm]] and [[https://awesomewm.org/][awesome]] as my window managers. When doing a lot of coding and similar stuff I tend to use exwm as I will spend most of my -- cgit v1.2.3 From b35a4701940be44a8ce289e6276e7aff49ca4173 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 2 Feb 2020 14:52:55 +0100 Subject: Add testing support for org-caldav --- emacs-init.org | 14 ++++++++++++++ emacs-private.el.gpg | Bin 784 -> 860 bytes 2 files changed, 14 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index f27a10f..8e74035 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1687,6 +1687,20 @@ Use imagemagick and standalone class for latex preview. [DEFAULT-PACKAGES] \\pagestyle{empty} % do not remove") #+end_src +*** org-caldav +#+begin_src emacs-lisp +(use-package org-caldav + :ensure t + :custom + (org-caldav-url private/calendar-url) + (org-caldav-calendar-id private/calendar-id) + (org-caldav-inbox "~/sync/w.org") + (org-caldav-files nil) + (org-caldav-sync-direction 'cal->org) + (org-caldav-delete-calendar-entries 'never) + (org-caldav-exclude-tags '(nocal)) +) +#+end_src *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index a34ae19..867cd1f 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 18126e59b3782a0bf79d48597bd7895b30092fe9 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 4 Feb 2020 16:46:07 +0100 Subject: Update some org faces & default face bg,fg - Dark theme default bg,fg - org-property-value and org-drawer to match - org-agenda dates to not inherit variable pitch Second to be consistent with the org-special-keyword face used inside drawers. --- emacs-init.org | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8e74035..3671aec 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -300,7 +300,9 @@ The above macro can be used like this. ;; (set-face-attribute 'variable-pitch nil :font "EtBookOt-11") ;; Settings ((default - (:family ,sans-mono-font) + (:family ,sans-mono-font + :background ,bg-dark + :foreground ,bg-white) (:family ,sans-mono-font :background ,bg-white :foreground ,bg-dark)) @@ -523,6 +525,16 @@ The above macro can be used like this. :foreground ,comment) (:family ,sans-mono-font :height 0.8)) + (org-property-value + (:height 0.9 + :foreground ,comment) + (:family ,sans-mono-font + :height 0.8)) + (org-drawer + (:height 0.9 + :foreground ,comment) + (:family ,sans-mono-font + :height 0.8)) (org-todo (:foreground ,builtin :background ,bg-dark) @@ -558,15 +570,12 @@ The above macro can be used like this. :inherit variable-pitch) nil) (org-agenda-date - (:foreground ,doc - :inherit variable-pitch) - (:inherit variable-pitch - :height 1.1)) + (:foreground ,doc) + (:foreground ,doc)) (org-agenda-date-today (:height 1.5 - :foreground ,keyword - :inherit variable-pitch) - nil) + :foreground ,keyword) + (:height 1.2)) (org-agenda-date-weekend (:inherit org-agenda-date) nil) -- cgit v1.2.3 From 2fb6c0beaf807e50ac99c5c2267fc9fbaa3614fa Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 6 Feb 2020 15:07:20 +0100 Subject: Add a shortcut for `visible-mode` --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 3671aec..b169a2f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -900,6 +900,7 @@ This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizard (define-key fpi/toggle-map "q" #'toggle-debug-on-quit) (define-key fpi/toggle-map "r" #'dired-toggle-read-only) (autoload 'dired-toggle-read-only "dired" nil t) +(define-key fpi/toggle-map "v" #'visible-mode) (define-key fpi/toggle-map "w" #'whitespace-mode) (define-key fpi/toggle-map "W" #'whitespace-toggle-options) #+END_SRC -- cgit v1.2.3 From a02e2bf5d11d1fae6cc36afedeae59c31359f473 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 6 Feb 2020 15:07:44 +0100 Subject: Auto display images after org-babel-execute --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index b169a2f..a7d780a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1585,8 +1585,8 @@ Hansen's]] configs. (ditaa . t) (plantuml . t) ;; (hvm . t) - (ledger . t) - ))) + (ledger . t))) + :hook (org-babel-after-execute . org-display-inline-images)) #+end_src #+BEGIN_SRC emacs-lisp (use-package org-noter -- cgit v1.2.3 From 9837301e93abed6c9213bb3894e26937e8e37b2f Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 6 Feb 2020 15:08:12 +0100 Subject: No longer ask for a note when clocking lunch --- emacs-init.org | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index a7d780a..0281ea8 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2135,9 +2135,7 @@ The separate functions are needed so they can be used in the hydra. (defun rrix/clock-in-lunch-task () (interactive) - (bh/clock-in-task-by-id fpi/lunch-task) - (org-clock-goto) - (org-add-note)) + (bh/clock-in-task-by-id fpi/lunch-task)) (defun rrix/clock-in-break-task () (interactive) (bh/clock-in-task-by-id fpi/break-task) -- cgit v1.2.3 From 17f04352b44c56d46507b19a72140565dbfa0209 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 6 Feb 2020 15:13:29 +0100 Subject: Add an Interrupt capture template --- emacs-init.org | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0281ea8..d07e465 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1741,9 +1741,19 @@ Templates ,org-journal-file) "** %<%H:%M> %? %i" ) - - - + ("i" "Interrupt" + entry + (id "802014b3-fddf-4090-b140-7fb62cb982f2") + "** Interrupt: %? +:PROPERTIES: +:CREATED: %T +:SOURCE: %a +:END: +:LOGBOOK: +:END: +" +:clock-in t +:clock-resume t) ;; ("a" "Appointment" entry (file "~/sync/a.org") ;; "* %i%?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%^t") ;; ("t" "Soonish task" entry (file "~/sync/refile.org") -- cgit v1.2.3 From b56fd01ef4486357716deed5c0e3e02ef8338b23 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 12 Feb 2020 08:50:26 +0100 Subject: Add an appointment/event capture template --- emacs-init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index d07e465..c2c1b5e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1754,6 +1754,17 @@ Templates " :clock-in t :clock-resume t) + ("a" "Appointment" + entry + (id "802014b3-fddf-4090-b140-7fb62cb982f2") + "** %? +:PROPERTIES: +:CREATED: %U +:DATE: %^T +:SOURCE: %a +:END: +" + ) ;; ("a" "Appointment" entry (file "~/sync/a.org") ;; "* %i%?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%^t") ;; ("t" "Soonish task" entry (file "~/sync/refile.org") -- cgit v1.2.3 From 78a0d19c044ef44f118c7a92079eecb8eef96bbb Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 12 Feb 2020 08:50:43 +0100 Subject: Update my agenda view 1. Current INPROGRESS Tasks first. Keep this list small. 2. Main agenda view 3. Second level TODOs are Main Tasks. TODOs at lower levels are subtasks. 4. List of all TODOs 5. List of Ideas 6. Habits 7. Idle stuff --- emacs-init.org | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index c2c1b5e..f0737aa 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1641,7 +1641,13 @@ Hansen's]] configs. (org-agenda-dim-blocked-tasks t) (org-agenda-custom-commands '(("n" "Agenda and all TODOs" - ((agenda) (tags-todo "+soon") + ((todo "INPROGRESS" + ((org-agenda-overriding-header "Inprogress Tasks"))) + (agenda) + (tags-todo "+soon+LEVEL=2" + ((org-agenda-overriding-header "2nd Level /Soon/ Tasks"))) + (tags-todo "+soon" + ((org-agenda-overriding-header "All /Soon/ Tasks"))) (tags-todo "+shelve") (tags-todo "+habit") (todo "IDLE") -- cgit v1.2.3 From 5904fb5b09e86aeae65bd265781eef711ad63204 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 12 Feb 2020 08:59:24 +0100 Subject: Better distinguish refile targets with the same name --- emacs-init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index f0737aa..67746e2 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1516,6 +1516,11 @@ Hansen's]] configs. - Babel languages :: Enable more languages to use in org-babel blocks. - Youtube links :: See [[http://endlessparentheses.com/embedding-youtube-videos-with-org-mode-links.html][this blog post]] for more info. - Ellipsis :: I currently use =" "= and previously used ="⚡⚡⚡"=. +- Refile Targets :: Use the full outline path so I can distinguish + headlines with the same name & disable step-wise completion as I + think from the refile target backwards, not from top-level + downwards. + #+begin_src emacs-lisp (use-package org :ensure org-plus-contrib @@ -1557,6 +1562,8 @@ Hansen's]] configs. ("gmap" . "http://maps.google.com/maps?q=%s") ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) (org-ellipsis " ") + (org-refile-use-outline-path 'file) + (org-outline-path-complete-in-steps nil) :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) -- cgit v1.2.3 From 91a2c6106a49cb207490493807e989256b5d50cf Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 10:17:21 +0100 Subject: Patch for SSH X-Forwarding on Windows --- emacs-init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 67746e2..6143409 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -91,6 +91,13 @@ header argument in the source code. ;; (setq safe-local-variable-values (list (cons 'buffer-auto-save-file-name nil) ;; (cons 'header-line-format " "))) (setq vc-follow-symlinks t) + +;; For use on Windows via SSH X-Forwarding +;; See https://emacs.stackexchange.com/a/42440/25850 +(setq default-frame-alist + (append default-frame-alist '((inhibit-double-buffering . t)))) +(setq posframe-inhibit-double-buffering t) + (load (expand-file-name "emacs-init.el" user-emacs-directory)) #+end_src -- cgit v1.2.3 From 4552b64bb9508d66c5ad6b36c49f8fd132e3beed Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 10:17:49 +0100 Subject: Show agenda items without time on top of current day --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 6143409..14c13aa 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1653,6 +1653,7 @@ Hansen's]] configs. (search category-keep))) (org-agenda-skip-scheduled-if-done t) (org-agenda-dim-blocked-tasks t) + (org-sort-agenda-notime-is-late t) (org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((todo "INPROGRESS" -- cgit v1.2.3 From 91f45b204f064cb7df88968c84e35748163f6c4b Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 10:35:31 +0100 Subject: Add org-edna for todo dependency management --- emacs-init.org | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 14c13aa..009a116 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1741,6 +1741,72 @@ Use imagemagick and standalone class for latex preview. ;;(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/") #+END_SRC +*** Org-edna +=Org-edna= is a great tool to manage =TODO= dependencies. I mainly use +it to mark tasks as =NEXT= after switching another task to =DONE=. The +functions below are taken from Josh's Emacs Config over at [[https://github.com/mm--/dot-emacs/blob/master/jmm-org-config.org][Github]]. He +wrote wrote a =edna-finder= which allows link descriptions and a nice +hydra to manage the various =org-edna= properties. I call it in my +[[id:22750e48-aaee-4f60-bdce-1d511ebe3375][context aware hydra]] when on an org headline. For more functions and +explanations checkout his config. +#+begin_src emacs-lisp +(use-package org-edna + :ensure t + :after org + :defer t + :config + (org-edna-load) + (defun org-edna-finder/link-ids (&rest ids) + "Find a list of headlines with given IDs. + +Unlike `org-edna-finder/ids', IDS here can be links of the form \"[[id:UUID][Headline]]\" (in quotes). +This allows for easier readability of targets." + (mapcar (lambda (id) (save-window-excursion + (org-open-link-from-string id) + (point-marker))) + ids)) + (defun jmm/org-edna-set-trigger-and-point (triggervalue) + "Set the TRIGGER property to TRIGGERVALUE. Move the point to +the newly set value. Open the PROPERTIES drawer." + (let ((property "TRIGGER")) + (org-entry-put (point) property triggervalue) + (org-back-to-heading t) + (let* ((beg (point)) + (range (org-get-property-block beg 'force)) + (end (cdr range)) + (case-fold-search t)) + (goto-char (1- (car range))) ;Need to go one character back to get property-drawer element + (let ((element (org-element-at-point))) + (when (eq (org-element-type element) 'property-drawer) + (org-flag-drawer nil element))) + (goto-char (car range)) + (re-search-forward (org-re-property property nil t) end t)))) + (defun jmm/org-edna-chain-next () + "Set TRIGGER to chain next" + (interactive) + (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\")")) + (defun jmm/org-pop-stored-link () + "Get the string for the previously stored link, then remove it from `org-stored-links'" + (let* ((firstlink (car org-stored-links)) + (link (car firstlink)) + (desc (cadr firstlink))) + (setq org-stored-links (delq (assoc link org-stored-links) + org-stored-links)) + (org-make-link-string link desc))) + (defun jmm/org-edna-link (&optional rest) + "Set TRIGGER to chain next. With option" + (interactive) + (jmm/org-edna-set-trigger-and-point + (format "link-ids(\"%s\")%s" (jmm/org-pop-stored-link) (if rest (concat " " rest) "")))) + (defhydra jmm/org-edna-hydra (:color blue) + "Org Edna" + ("l" jmm/org-edna-link "Link") + ("L" (jmm/org-edna-link "todo!(NEXT)") "Link NEXT") + ("n" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT)") "Next sibling NEXT") + ("N" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\")") "Chain next-sibling NEXT") + ("p" (jmm/org-edna-set-trigger-and-point "parent todo!(DONE)") "Parent DONE") + ("q" nil "cancel"))) +#+end_src *** Org-Capture Templates #+BEGIN_SRC emacs-lisp @@ -2761,6 +2827,9 @@ For now I use this bad code. (or (bolp) (newline))))) #+END_SRC ** Context aware hydra +:PROPERTIES: +:ID: 22750e48-aaee-4f60-bdce-1d511ebe3375 +:END: [[https://dfeich.github.io/www/org-mode/emacs/2018/05/10/context-hydra.html][dfeich]] has a nice post on this. Basically it launches a specific hydra based on the current mode and context around point. #+BEGIN_SRC emacs-lisp -- cgit v1.2.3 From d8098c7e1df1e46189c9dbbcf323140da4044b48 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 10:40:48 +0100 Subject: Put Notes into a drawer & separate of clock times --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 009a116..13edbfa 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1527,6 +1527,8 @@ Hansen's]] configs. headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. + - Drawer for Notes :: Notes go into the =NOTES= drawer. Clocking + times should stay separate in the =LOGBOOK= drawer. #+begin_src emacs-lisp (use-package org @@ -1571,6 +1573,8 @@ Hansen's]] configs. (org-ellipsis " ") (org-refile-use-outline-path 'file) (org-outline-path-complete-in-steps nil) + (org-log-state-notes-into-drawer "NOTES") + (org-clock-into-drawer "LOGBOOK") :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) -- cgit v1.2.3 From 579b564ead5dec2cb2680e0b433a58dde9e42422 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 10:41:24 +0100 Subject: Align tags left --- emacs-init.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 13edbfa..fe9c679 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1529,6 +1529,8 @@ Hansen's]] configs. downwards. - Drawer for Notes :: Notes go into the =NOTES= drawer. Clocking times should stay separate in the =LOGBOOK= drawer. + - Align tags left :: Fixes problems with line breaking on small + window width. #+begin_src emacs-lisp (use-package org @@ -1575,6 +1577,7 @@ Hansen's]] configs. (org-outline-path-complete-in-steps nil) (org-log-state-notes-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") + (org-tags-column 0) :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) -- cgit v1.2.3 From b5d1ae5eeb7cb4243a0d39767689c20ace8a9e6d Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 10:41:32 +0100 Subject: Nicer separator (─) for block agendas --- emacs-init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index fe9c679..8558334 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1661,6 +1661,8 @@ Hansen's]] configs. (org-agenda-skip-scheduled-if-done t) (org-agenda-dim-blocked-tasks t) (org-sort-agenda-notime-is-late t) + ;; See emacs.christianbaeuerlein.com/my-org-config.html + (org-agenda-block-separator 9472) (org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((todo "INPROGRESS" -- cgit v1.2.3 From 4939f9705b0d9f8d701363f4748e2fe8b212b95e Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 13 Feb 2020 16:11:37 +0100 Subject: Add a capture template for bibtex entries --- emacs-init.org | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 8558334..fd0900b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1861,6 +1861,10 @@ Templates :END: " ) + ("b" "Bibtex entry" + entry + (id "efc97963-b714-4020-94b6-c23ad2a286ee") + (function fpi/add-org-from-doi)) ;; ("a" "Appointment" entry (file "~/sync/a.org") ;; "* %i%?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%^t") ;; ("t" "Soonish task" entry (file "~/sync/refile.org") @@ -1979,6 +1983,35 @@ A small function to toggle the encryption state of the current entry. (org-ref-default-bibliography '("~/s/ma/ma.bib")) (org-ref-pdf-directory "~/s/ma/lit/")) #+end_src +I store my bibtex references in an org file together with my notes. In +addition to saving the meta information in properties using the same +functions as =doi-utils-doi-to-org-bibtex=, I also store them a second +time in a bibtex src block in the heading. The src blocks are tangled +to compile into a separate =.bib= file. The function below creates new +entries from a given doi and is called in my respective capture +template. +#+begin_src emacs-lisp +(defun fpi/add-org-from-doi (&optional doi) + "Get bibtex entry from doi and format as Org header with +properties and additional bibtex src block. Also downloads the +pdf if available." + (let* ((doi (or doi (read-string "Enter doi: "))) + (content (replace-regexp-in-string "\n$" "" (doi-utils-doi-to-bibtex-string doi))) + (cleaned (with-temp-buffer + (insert content) + (org-ref-clean-bibtex-entry) + (org-bibtex-read) + (buffer-substring (point-min) (point-max))))) + (with-temp-buffer + (org-mode) + (org-bibtex-write) + (goto-char (point-max)) + (insert "#+BEGIN_SRC bibtex\n") + (insert cleaned) + (insert "\n#+END_SRC\n") + (org-demote) + (buffer-substring (point-min) (point-max))))) +#+end_src *** Todo settings - WAITING tasks are waiting on the completion of other tasks - NEXT tasks can be picked up -- cgit v1.2.3 From f735eff318a50cc9810701c602be249496763507 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 14 Feb 2020 11:33:40 +0100 Subject: Prefer PATH settings in ~/.profile in Tramp --- emacs-init.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index fd0900b..5afb11f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1203,6 +1203,15 @@ while for directories with lots of nested files. :ensure t :config (setq dired-du-size-format 't)) #+END_SRC +** Tramp +Set Tramp to prefer the path settings in =~/.profile= over the value +of src_shell{getconf "PATH"}. See [[elisp:(describe-variable +'tramp-remote-path)]] for more info. +#+begin_src emacs-lisp +(use-package tramp + :config + (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) +#+end_src ** Magit #+BEGIN_SRC emacs-lisp -- cgit v1.2.3 From ed3bdb12c390fb1ef97a532f4bab88c7ff31a06d Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 14 Feb 2020 17:09:09 +0100 Subject: Update pdf-view-midnight-colors after theme change --- emacs-init.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 5afb11f..df14609 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -807,6 +807,12 @@ The above macro can be used like this. (:background nil :inherit nil)))) #+end_src +Advice =load-theme= to also update the colors for +=pdf-view-midnight-mode=. +#+begin_src emacs-lisp +(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 -- cgit v1.2.3 From c801d516ee4c2a56ba936231ec424c741c696938 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 15 Feb 2020 17:12:18 +0100 Subject: Disable useless questions to restore deleted buffers --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index df14609..fcee4f8 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -835,7 +835,7 @@ This saves the state emacs was in. (setq desktop-dirname user-emacs-directory) (setq desktop-base-file-name "desktop") (setq desktop-globals-to-clear nil) - (setq desktop-missing-file-warning t) + (setq desktop-missing-file-warning nil) (setq desktop-restore-eager 5) (setq desktop-restore-frames nil) (setq desktop-save 'ask-if-new) -- cgit v1.2.3 From 588cf9a24d7cb0a94c28d8f27fb747db19e1ecc6 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 15 Feb 2020 17:16:30 +0100 Subject: Use eshell instead of shell as my popup shell --- emacs-init.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index fcee4f8..4c9b3be 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2489,8 +2489,7 @@ To open and hide a shell quickly I use =shell-pop=. :ensure t :bind (("C-!" . shell-pop)) :custom - (shell-pop-shell-type (quote ("shell" "*shell*" (lambda nil (shell))))) - (shell-pop-term-shell "/bin/bash")) + (shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda nil (eshell)))))) #+end_src ** Proced Built-in process monitor. -- cgit v1.2.3 From 914e49c2a4630e09c6b0dee67ec4169456468ae9 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 15 Feb 2020 17:25:41 +0100 Subject: Setup bibtex environment to use BibTeX on startup --- emacs-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4c9b3be..8442edd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1996,7 +1996,9 @@ A small function to toggle the encryption state of the current entry. :custom (org-ref-bibliography-notes "~/s/ma/notes.org") (org-ref-default-bibliography '("~/s/ma/ma.bib")) - (org-ref-pdf-directory "~/s/ma/lit/")) + (org-ref-pdf-directory "~/s/ma/lit/") + :config + (bibtex-set-dialect 'BibTeX)) #+end_src I store my bibtex references in an org file together with my notes. In addition to saving the meta information in properties using the same -- cgit v1.2.3 From 68ab5bca0fad7a51af7a000b25a88e68d8e97ec3 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 16 Feb 2020 21:18:06 +0100 Subject: Update bibliography locations to be more general --- emacs-init.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8442edd..af28d6b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1994,9 +1994,9 @@ A small function to toggle the encryption state of the current entry. (use-package org-ref :ensure t :custom - (org-ref-bibliography-notes "~/s/ma/notes.org") - (org-ref-default-bibliography '("~/s/ma/ma.bib")) - (org-ref-pdf-directory "~/s/ma/lit/") + (org-ref-bibliography-notes "~/git/projects/personal/bib.org") + (org-ref-default-bibliography '("~/git/projects/personal/bib.bib")) + (org-ref-pdf-directory "~/git/projects/personal/Lit/") :config (bibtex-set-dialect 'BibTeX)) #+end_src -- cgit v1.2.3 From b20761c39588a66f3eeaba3b133ecc7a3082dd8d Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 20 Feb 2020 13:24:47 +0100 Subject: Setup org-attach & use with git-annex --- emacs-init.org | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index af28d6b..94aec99 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1831,6 +1831,32 @@ the newly set value. Open the PROPERTIES drawer." ("p" (jmm/org-edna-set-trigger-and-point "parent todo!(DONE)") "Parent DONE") ("q" nil "cancel"))) #+end_src +*** org-attach +=org-attach= is useful to attach reference material to org files. This can be reference images, data or other files. A special link type is available for attached files: ~[[attachment:file]]~. + +- Inheritance :: While inheritance for attachments sounds useful, so subheadings can access their parents attachments, I find that the current implementation (Org 9.3.1) instead of inheriting just sets the attachment dir of all children to that of the parent. So for now I decided not to use it. +- Attachment Folder :: While I do not like the default double nested + folder structure it creates, I also do not want to set an individual + =DIR= property for all headings I want to attach something to. + Instead I define a new function to use the uuid directly as the + folder name. +#+begin_src emacs-lisp +(use-package org-attach + :custom + (org-attach-use-inheritance nil) + :config + (defun fpi/org-attach-id-folder-format (id) + id) + (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-folder-format)) +#+end_src +=org-attach-git= auto-commits changes to attachments if the directory +is a git repository. I want every attachments to be saved using +=git-annex=. +#+begin_src emacs-lisp +(use-package org-attach-git + :custom + (org-attach-git-annex-cutoff 0)) +#+end_src *** Org-Capture Templates #+BEGIN_SRC emacs-lisp -- cgit v1.2.3 From af77370b06340cd5d2792973f4df9b8e09cdd181 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Feb 2020 18:17:27 +0100 Subject: Add gnuplot configuration --- gnuplot.org | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 gnuplot.org diff --git a/gnuplot.org b/gnuplot.org new file mode 100644 index 0000000..2988e22 --- /dev/null +++ b/gnuplot.org @@ -0,0 +1,69 @@ +# -*- coding: utf-8-unix -*- +#+PROPERTY: header-args:gnuplot :tangle tangle/.gnuplot :eval query +* Symlink +First create a symlink to the desired config location. +#+begin_src shell :results silent +ln -s $(pwd)/tangle/.gnuplot ~/ +#+end_src +* Main configuration +#+begin_src gnuplot +reset + +set style line 1 lc rgb '#cb1a0e' pt 1 ps 1 lt 1 lw 2 # --- red +set style line 2 lc rgb '#5e9c36' pt 6 ps 1 lt 1 lw 2 # --- green +set style line 3 lc 3 pt 1 ps 1 lt 1 lw 2 # --- blue +set style line 4 lc 7 pt 6 ps 1 lt 1 lw 2 # --- black +set style line 5 lc 9 pt 1 ps 1 lt 1 lw 2 # --- grey +set style line 6 lc 4 pt 1 ps 1 lt 1 lw 2 # --- pink +set style line 11 lc rgb '#808080' lt 1 +set border 3 back ls 11 +set tics nomirror +set style line 12 lc rgb '#808080' lt 0 lw 1 +set grid back ls 12 + +set style increment user +set style data lp + +set macros +#+end_src +* Interactive Label Placement +[[http://www.gnuplotting.org/interactive-label-placing/][Source]]. I adapted the =label_loop= function to newer gnuplot syntax & +added functionality for multiple arguments. The function call to +=label_loop= is stored inside a string and can then be executeds as a +macro like this: src_gnuplot{@iLabel "label1" "label2"}. + +#+begin_src gnuplot +iLabel = "call '~/git/projects/dotfiles/tangle/label_loop.gp " +#+end_src + +#+begin_src gnuplot :tangle tangle/label_loop.gp +# label_loop +# This loop adds a label to a plot by pressing the left mouse key. +# If you are not convinced with your chosen position, just klick the mouse key +# again and it will be positioned at another place. If you are finished, just +# press another key. +# +# Original AUTHOR: Hagen Wierstorf + +# Initialize a label number +if (!exists("label_number")) { label_number = 1 } + +do for [ELEMENT in ARG1." ".ARG2." ".ARG3." ".ARG4." ".ARG5] { + while (1) { + # Waiting for the key press + pause mouse any ELEMENT + + # Check if the left mouse key is pressed and add the given label to the plot. + # Otherwise stop the loop and count the added label + if( MOUSE_BUTTON==1 ) { + set label label_number ELEMENT at MOUSE_X,MOUSE_Y textcolor ls 1 + print " at ",MOUSE_X,MOUSE_Y + replot + } else { + label_number = label_number+1 + print "\n" + break + } + } +} +#+end_src -- cgit v1.2.3 From 5bf8101f2a6f7ca60e09558b08430afc085d2044 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Feb 2020 18:40:09 +0100 Subject: Exclude branches which match +$ in merge script --- README.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 03ac014..929e139 100644 --- a/README.org +++ b/README.org @@ -12,13 +12,13 @@ appropriate src block in each configuration file. ** Git Setup Every program's configuration lives in its own branch. All branches -are then merged into =master=. To keep the git history clean, I use -this script: +except the ones which end with a plus sign are then merged into +=master=. To keep the git history clean, I use this script: #+begin_src shell :shebang "#!/bin/bash" :tangle tangle/merge.sh git checkout master git reset --hard init -git branch | grep -v private | sed "s/[ *] //" | xargs git merge +git branch | grep -v -e +$ -e master | sed "s/[ *] //" | xargs git merge git push --force origin master #+end_src -- cgit v1.2.3 From 699c269abaf109e4f997e50e68a76e0454f5cdf1 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Feb 2020 18:43:50 +0100 Subject: Include remote branches in the merge script --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 929e139..0877cc1 100644 --- a/README.org +++ b/README.org @@ -18,7 +18,7 @@ except the ones which end with a plus sign are then merged into #+begin_src shell :shebang "#!/bin/bash" :tangle tangle/merge.sh git checkout master git reset --hard init -git branch | grep -v -e +$ -e master | sed "s/[ *] //" | xargs git merge +git branch -a | grep -v -e +$ -e master | sed "s/[ *] //" | xargs git merge git push --force origin master #+end_src -- cgit v1.2.3 From 25c42f364ea6fc94fece289ccaa2afb7e0c35891 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 24 Feb 2020 15:23:00 +0100 Subject: Add git-auto-commit-mode --- emacs-init.org | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 94aec99..91f0849 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1218,7 +1218,8 @@ of src_shell{getconf "PATH"}. See [[elisp:(describe-variable :config (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) #+end_src -** Magit +** Git +*** Magit #+BEGIN_SRC emacs-lisp (use-package magit @@ -1258,6 +1259,13 @@ Only highlight the changes within a line, not the whole line. :custom (magit-diff-refine-hunk 'all)) #+END_SRC +**** gitflow +Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitflow]]. +#+begin_src emacs-lisp +(use-package magit-gitflow + :ensure t + :hook (magit-mode . turn-on-magit-gitflow)) +#+end_src *** diff-hl Indicates changed lines in the left fringe. The Hydra can be used to navigate and revert hunks directly from the buffer. Use =g= to open @@ -1295,13 +1303,25 @@ navigate and revert hunks directly from the buffer. Use =g= to open :color blue)) ) #+end_src -*** gitflow -Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitflow]]. +*** git-auto-commit +Mode to automatically commit on file save. Ensure that automatic +pushing is always turned off. To enable this with [[info:emacs#File Variables][File Variables]] set +some safe local variable values. #+begin_src emacs-lisp -(use-package magit-gitflow - :ensure t - :hook (magit-mode . turn-on-magit-gitflow)) +(use-package git-auto-commit-mode + :ensure t + :custom + (gac-automatically-push-p nil) + :config + (add-to-list 'safe-local-variable-values + '(eval add-hook + (quote after-save-hook) + (quote gac-after-save-func) + t t)) + (add-to-list 'safe-local-variable-values + '(git-auto-commit-mode . t))) #+end_src + ** Projectile #+BEGIN_SRC emacs-lisp -- cgit v1.2.3 From 4426392a53d127bd9452000e3d7b5c0a6e5f3325 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 26 Feb 2020 19:18:14 +0100 Subject: Enable gpg keys for ssh authentication --- gpg-agent.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gpg-agent.org b/gpg-agent.org index 70bbeca..3ba28c4 100644 --- a/gpg-agent.org +++ b/gpg-agent.org @@ -2,6 +2,7 @@ #+BEGIN_SRC sh :tangle no :results silent ln -sf $(pwd)/tangle/gpg-agent.conf ~/.gnupg/gpg-agent.conf +ln -sf $(pwd)/tangle/sshcontrol ~/.gnupg/sshcontrol #+END_SRC @@ -17,3 +18,11 @@ max-cache-ttl-ssh 34560000 allow-emacs-pinentry allow-loopback-pinentry #+END_SRC +* Enable use as ssh keys +#+begin_src conf +enable-ssh-support +#+end_src + +#+begin_src conf :tangle tangle/sshcontrol +4AFDEF6B35160F892F61666CE891B2456D755807 +#+end_src -- cgit v1.2.3 From f5fc9b3b28961d8e365ad5e334eeb86bfa828491 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 26 Feb 2020 19:40:03 +0100 Subject: Add ~/.ssh/config --- ssh_config.org.gpg | Bin 0 -> 699 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ssh_config.org.gpg diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg new file mode 100644 index 0000000..62701d5 Binary files /dev/null and b/ssh_config.org.gpg differ -- cgit v1.2.3 From 3f58a1fd58cb1432be0061fb9790a7013b68cf3d Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 26 Feb 2020 19:46:28 +0100 Subject: Change to new gpg encryption key --- emacs-init.org | 2 +- emacs-private.el.gpg | Bin 860 -> 988 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 91f0849..7cdb1b9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -31,7 +31,7 @@ disable ~buffer-auto-save-file-name~ for the files. (require 'org-crypt) (org-crypt-use-before-save-magic) (setq org-tags-exclude-from-inheritance (quote ("crypt"))) -(setq org-crypt-key "C12356B984BA799943824FD5DB31E653435C87C6") +(setq org-crypt-key "F1EF502F9E81D81381B1679AF973BBEA6994521B") #+END_SRC I use =.org= configuration files also for my other dotfiles. To ensure diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 867cd1f..18194cf 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 005d87cbdea1e75c77e48f5bf30116200fcf70ef Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 26 Feb 2020 19:58:01 +0100 Subject: Re-encrypt with new gpg key --- mail.org | 238 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 127 insertions(+), 111 deletions(-) diff --git a/mail.org b/mail.org index 9d56f18..aca41e1 100644 --- a/mail.org +++ b/mail.org @@ -36,16 +36,19 @@ Host imap.gmx.net ** My mail address :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQf/RUqzIsIlyVwYQ4+JG5vXIeVjX5qhuoHrhSJ46FAzCAVZ -ZwLsPaJ8yMDiCgo1R62gCoOt+jKBxbfBslBc6S7yYbhK6TnvRCuFvmYib7X8nirE -Jo9CVZ1Rd6L53PDu1tBpPKUbB/V4dLa2785W3Gq97jKS0G1I/lN3wE1FKKc3q3fo -ZrcTOtCId2qCcl/IpRMaBFiEdXSM1LC306nFFEHtoGoVlQv6P7ro7ButcmdSiHd2 -lyoDvffDr2hpnU+kjDDIqZIdcgyBalC1Vp1aEWT/N41AABtWbpOa72YGG/X2zFMG -FR9Q8biqU5+g3VJJ3ezZvZqPnXW9lpQ2Vt9kwFT/D9KcAbJrZpelPlpQ717VpG38 -FZ8hKrefvKVeiQQgbkFYr1V6rTZqcYOHKSSpnVX6x47R3wv5a3m1SXhnFOgF5vuK -t2VIbGm7PLbErjGXt+fAkAOndF3/Pk2e8lGeRjXAnseiFERWPMCGEV/abUk96+QQ -zDfhkmp8sHPkyRe5pVDOABrcnLn6tirDkcuCtbe5aC+cBLSMpzKdwW+xfwBK -=szMA +hQGMA/lzu+pplFIbAQv6Ap/2jmc78BmLzE/M/u/8kMyiBmXuGY6p2S92aRXi2A5a +RzZgox9A3hs1OtUlrFS3n+/qGJu6ufzHFU+NC/xblDCPHJakn8LHiGufqG09B5v5 +F1iDYO7x8+ehcNvfjqBjsrOdqJfkpq57yyzKgO0EwZ65tP+OxOcunINfyOmzDXId +K6Y+ZTVLYKVHpGhdC52t8jXmFCEZyatBlMKMUizVBrGUoHjKXpwbU3D5OyJoSqA7 +QidGC6XNxlGQNjtJLMapSBrNy3srWkprZDhXFersxDNIpfY1+HWAGmnhUbp/1XI8 +rH86gtzZ1xeaVAC7Q0ZUssQ23naIdRlxDM7zMpeH0LXkvC2ElT7JpK1H8XuVe0eH +PBPGleotvWXG6/DT/WLkHvNE/vHXOa4QhJCa2xaEWQP+n1REIXiSuM8YhoM90tY9 +++Xiux4APeeHKGds3Z8FxDS1TxKQ2ijZOXHLXJAcYKdIFBlA+voN79H2IzVz6k1l +TW2HS1eDpVImUrAkKs2Z0pwBcRFcsiTG6FQxJ0Y4qJGjsZK2llwDqptlDApshg7x +13f9wpJnm3qBHQT13sNhzz1Dy4AQsZXj3QEz+u00NqRWy6oVmwKTLQ5W0cXimLn5 +rOfIyOw2zAU9ZLP9yS8/KdONFgrv17bDcToYfjZFeJipHF4b/K0Uk2NSqoX6Hxtd +D9OhyiSwxcYYpY1+0OGQoYcKyAqS3fSu+0vgS48= +=ktHf -----END PGP MESSAGE----- ** Rest of the configuration #+begin_src conf :padline no @@ -93,31 +96,34 @@ Sync Pull New ** More mail accounts :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQf8D0Z1y2IjAlvuDhLG4+cUQ2UxWkIPtnKrOHJSciULJh8s -Ow/lwwH+ww6HtJvgDKQsEE43ARATfXymQgXpULSMvVX63SM5a/kUbtV/jlyoCKc4 -LCkcRHn3aTW0p3vHhGu0qQLTPvwnfSpF2BIae+THPANJMcW3G0L4qL1HJmgb6RYa -R0wYjYInOvWH/oFK2EkBhQJMVo/9K797xN3fLow9m5KHZbOOS1Joe7rtOdvrLvqB -XuOkWgAhFYSnu3WCSCrFYeKYXbJr4euZ8j9cOXyhTsS+kgwMC4ZiT4UZHTDWIfBy -6dirRjlVsUj2DfaP0Miq9pTNO8m48r5cj/ihNcapPNLpAbcAIFF2FuXPuYmeXr5j -4VOTXi/4VqhoM1jusDF1yJ8UBsE150d5aqry46wkGpNTEoxGzOGZNCzuiP4tYrLg -Ijloke2cPS+R0iC8iGdrIcV3NecEnhosUW0ivHH18ODQQAk3WZrUUaBDTAoSV+1/ -lVy2VZujhe92vZUfpVs0ObGdXL6VEanjssmnyKUsW2I4Wafl/oZtoVOgM7UGF75F -NKuuc7V9CX8+5NoUpJ+6U0Ky3NRdHzr0jQUyD1CgIhCW2iQGYLuuRk50t8ga6F+C -zB7/RlmJDYdbRtFNKcxCBVt3ZVgxt9XpkSArDLDJoAQ4Gxknu25GC3a0s8X8KFMs -KulvdW9VDwoE30oinHPyteu0g2oLhvax2DsxEeCF/9lPgT/ZpyFXBhYEc8klqj4z -MU7DjYXqO85TtaM4KTk5y6C0sCRxqlpAwxn29VhojOSPlVYmxi50Qz/UFaSD9EeL -V0j7Jki7TqnucSz1L//vPP52DFoY2bLMLBY+2TrgYADNQ54tjZIt6cHQSWPbNp74 -ncxtF/ZCjFVLuBmAv0a/u2iypSfH/LPM8M90p3cVQy3Hoka9NdWYsSif+kp5pLMv -jKTAT1FHIfSXRAfDFqdeeNYnkNPC8uW2aJAu1wISaRkH7GHoMr4J+bqjS5i9hiHi -2l5BdLbfp877jQj3SUbC4vTAm1tHnfWoviMwAgjfXgY6pTP78NRmiqHIItbqXAQK -3a4eSXv6IvxdBLf+CdhTjJX+Iemyt4WbJcfNatILvSOPGdpkzYnYn3VRdblwFX38 -FP13aIWaWToPSVINY+PuHBfDNVx2FzsJa4+LbOWdAe2KfQHFRov9mOoa36PiQ26J -NQ5hUgsiBGADPBbg+RtSb4KqHBATJP2p5f7gILDEoK9zVRwIwmgW+XFRd6QtxKJZ -kjJpzUBYHpfe/me8BflBRsXU3QnFwWATpMW5xd7I5ZRqZtmVZLaejTiVIYJjoZlM -wKTSFxFfVZqrhgapNpyB8e+KP1AU7/ufsYA9TwuZpjZBT12j0RVOAwqN55G5jU+h -yDlNCQmhyp5kZ1GIDxI8ln+X0dqcfdNo1GbupfsAdcTOCactkMd57+9sOQPY3lhy -aJLPQXacmDINhKe8AYmybz7S8WPTY8iAwt+CAFmO -=sYDv +hQGMA/lzu+pplFIbAQv/VIvFz9ywYSXo4DJPC0AoRgjUGTs/ECam7bosV+QAo8JA +4S+AlonfxROa+tuqC7Sd3GrK4BngJhf+lf7BqmJPr7/yjEAW/SA2IWxOypem3/6o +C62fhqtxAw2b6WT+zCpeCzG95zDIXJNxgqe2fATVpMtno3odV5NkinFxj3AQ20yw +80PIAxOGzPf4xtWmvAcNGD0jwKT8DYHo7Yexr78JYgp3cZNYs3jmO8NYfKoNFzV1 +fSBb07XYz/4v07alP4kwQETOg+ssGflGRknxk6W65XgQO2nm9QTtMhoGcVJtstpG +PYF8UUmg71mJv2GZb2+SxC7IFYbwLOJaYBVCOsZqwxKzy1EBmyhuIzgaJKZbB8EM +yMGKP6pJPoy6BKskALbsptF1cNrDVLWxdrOny3OcK+8JfhfH5MPGiV/u2xMa9sig +ERz6Hy1VY0S/MYt2P+m73G1AMTbN+Qiqp+/023cc3J5ZxaY0R+eZcd785mRQMh+O +fjLU+tlhx0xUUxoRLAT80ukB1sAqaJnn345dR1KMklHC5TFr81wp3zMu+2JoKnqu +/K8SCTo+1t/QkOaf51uGEa9uQ57mqTf9vQdXnQ/gdPGM59K/r75lR/ehVmus9rUW +qeOtBKSRdqTGVHVqLAK9aJ6blNpINSXWWQts0vsZistMpXrhQ5QSK1qIyHBa04Vj +tjzGHtNvRRSkj+eCKQynJDzxVFpw1ElyoHxs0lPItDOSLV3r9HQ9fCCD5e9hoRBm +zzkp4BCBc8WyB1kIUnz/TQvsTCNacbFxume6arysNzMWzQNNHusx/L/83AbTyJ28 +UK26CHvbSkKGYrxKHt5IEenrZFNr7gYNKMhYc/PH3+1hANA7kUXdasFQuIT7Ij1u +fHl7egsKI/k7wyKfKmgKa/FVT5MJ4V7fO3YX2oGAhuH704fhmG4mCMrot4Nz7Gq0 +uzAI7I2eayXQ2ZS83aE0FUhdk2BFCfR4R282PN/1uadAp/8MFDjIW7dhoktMDtST +JeODbnIrqD0kfnq+cCLTSqlHi06v1TeJvB0CS7AugsE4rgiitkN6ELUzKMZsruBx +hQom2CHPKQ7ZSa8tQnLNePIySWy9QO5KNT15ZuScRvXsxUU0awsQExk7asTpawHD +gdZE/n3ekRq9QAnsv0EmCITzGVBy573JCwNDNUwbGseLVeoW5sYJNDXtilRrXhdY +icCbQge6rn7fHqAnBWnxgvDKVcBFZJpVYa//6tIzSHLGDmYi3Kt0HXkf6PwYIvjz +jRHf1Xpy7VRNOA9JTCV5cw6khvpU2u8p+j90f68fsIDqMiLdlgsZSoSwLf2hvjqU +ZgB9W87oQr7yCEuVI41esNF0IhykxlAiJnSfEb8YYnp3DxDvwRF5SLyQCwuFOUpO +sf3KVSye/78roQRIkGLJXp5tdelOPAw+fJi7hv90o29xcieoEoPuwNDhCps4vylH +qPVtv0fcMBZEC1HQwSrrrmBUf0U4kTJntrs/YHAJcEdtGFry5Y7O9eWYX1IKnu2H +q/oq9Qp6mtv66nn61KEYfxx6Jc2dYwo6D+CVEHlLtICqqfPMLZi/toGaz7KPlPTq +/gYSbqIGwzKF6SvLy4vD84we3u65u+fcTnb9uqiLq/oUE83CP6sFapphARl6No9A +zLgC9FzBj5hqh3g2Kg4= +=q0eG -----END PGP MESSAGE----- * afew :PROPERTIES: @@ -140,26 +146,29 @@ sent_tag = sent ** custom filters :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQf9HdGdNQhH0pwo4VTRIyuKLoUDnG+YUfibOCQR+IT54pl8 -d6ZbGmzOhHcV5ucEvy+orswyD5joaJI7TWwAqD9ymevq9k5rT+Ly2cC3gr9Dpxlo -WCZKL6nMgObJZQUWFgk+qp8nHc6Ellq+8zkfAIltN9oip9ugZ4xUskx/avs9lF2I -G1+nXgPB2B/WFPQftIFS2rVAhuPjNOMplXpgIWQKb0gRYWvWSM1QNICpFVd+d2g1 -pWgfy/IW0fhOj3BRVqajAnNU/5A3W+lnpHOu3yBmj9g087b3dxwArnNAYa0jBU3R -N4dgUEXWxDhjNRHqw8DXPfCTqGHcuZPxNzB7TwsrOtLpASE2b/ztjMDuTjUnPepj -pAWcyNyt3+xqj8pT+9CXPq7G736NInTQX4uADW88ATZfTflj1FSf1ebgQAVxfuzu -1uIGFsFdnFbSXQT2vRrenKaW+f8A+cpeR6uVerndDJPTxl2qNjqfqrRRgvbfVLWx -UgUj9DVRqn7iMNzH1KmjfeFQJwE8XC3oHlausHXBop/r09i0e+y4TIs+XMPaR5Mb -C6w1AUwiqTpClE7lDXl+GTDlDU5WZOogZEn9T3aldC6/FR/m24/1HD+HvYJKwv4Q -NNRULzE7KTiRS+NyZ7jBAUavbdiSHmWLsdWJliiWVCcwVRlBMS+xD67OmD723KGZ -ZNe/j0hWz8lxDg2glwFaodShaH1gfcsPIKJtKaPI4MBDtE1yJjDeAaTESPzqAwqQ -/aNvot4CTaY8116E91DBjNeiIl8pKhvvcmSgMgZ4sFdm4pxf4FIo3s14QceeK8zI -DW5vIHgJtSkZRU0xfKVD2Y+pPEzwmA/QrBOqLW1xRgQgUPKZCm9XH2kbg6ZdTHym -y6mUkRmiSEcnS+9PRNIlpqUGXXlq1jpGuhncRb6cZnwhIZVe58O3oZRdmzK/NEYo -ihg009W7xfRwEtyDIjWfizOwWwapFkzUcMDhI/cwh1BEWYo9n4my51dcbPL1rgGc -yyoBMXV8Jr9GqSszYZzGmW94pjJ6CIE89dN/uZA7LluRGRbRwLP8cTukjgPp6YU9 -ZTeSgvvAQZ+epAwppAds8voHPCbI6rxiT4425q9D2oJ/8/61XXpVB/clm1a/MYZs -TvBSklmyMA1DXv/05PL1KSw0kyYhwVf6LeysXbBott5P/P8auOD852bn -=+wv0 +hQGMA/lzu+pplFIbAQv+LYa99pjG6frcwF8PbG43jAbZobloStIR4LrIwxMaZtYw +1mvUyZKG2L6VHRQaN2h8SiTzhnojw0iaT8Q0AyJTBiCaL6uJx+A5JNPrhC6vWLnK +MSBA4Bj8WTQrLstsl0FBu6az25QM0AE9RObqWeO3E+cym4x9ZpIKA8RXMqd6tIx6 +tsGE2XGCCm7N7pPoRmSnZS1/UmFD69zgSqG/DX0UdFA2I44kERSzQjTdFVxEmc+U +0RVtK3ykeQfmqv1gxBCp96jXzjhHkt0UeiHmsjUQfQA5SSAKY0kMODGh789P6uVa +tfUs7TnrnQJAsEm+Wa+y4ffr+7zoyCyVsupE/EXRf84sXHs34gReh2AJy7mx138I +x1hdEG+eO0xnByxvkcOdGs4CeyuXp46nHEHSzOuwX0tJ2BrGvV5lDYCVjuYQPQsi +gGhickbpzARIrQp767oKNMkIca67VsOoRKf2h4bogI01997e3bR/rIsL+Fco9JOd +o6SXcZm9Twrip3s+MP2G0ukBkXs0lxDQw/2zQWXjjRBUqAeb+kYCGCNVpRRoBWZK +OK09HRuAtgwGQh+B1+JeXhCGoK+JB0EIChIbSJj9NypfTxCe8Iqm9iV8aXfbboK8 +dTGONnltE7PXT/4piF13zZiDkPEHWU7wgIXKcIjtblqYPakkXD26IveZZtaPEJdR +uKuCU6WtgPc28gt5vokzny59kQPJVAWQKY9zTiQGkUz1tWhJCh+KR3sjp/zgYPXb +Mze40oi+LRpEAgDhu+J8zztnXQgfQuFqjO+erW4qTkoxaw11d/IbGFUIdf4EcZF7 +S8eJKUAksNUqUxvMSKkG5dJqr/ApcBEfNtZjuBorphm9VSimWcQblpc4jy8rS0lq +ZeGHkzW2b5Oni6dp0VX+86gp7eHrxLoIQAec6IbD58r+uZfucC4mcdFI4D9+WeSV +ZmT9KwnY5xvQBW3RYVF+LhqQfEvYedlq+Y8Infpm2YgzhkskTO4vEHoLB3DNIAcf +nsR+tyuF0XxamWHaz8QorIIgQlxJ+RKrcJsAS8eiaGhMm0GnVFvazt8zIDruSf3e +GsgCHlUjvz+u8bIBNEIzif5nxv3DTjaSq3bYrQFIkWieGwzBOnyEUil0NV5NKxrb +Xpzkgp64TIGQJSqBrM1Fx7rlMXRJp+XxhWgv1sfprk9uDnzS1N8F8wI+bvQXBC0I +InbYkw69UuTAFhLf2M/JCf87dyo6Ve7jRI3ujJoMW/i65MjVijhVz/ddfBGmg5MP +yXdYe/VIdiugbjSWGapmYiWwN6zjf00MzY41K9XLvQtX8BMmX1QgYiOEDEsZqhTB +h9GxlPTuH9OkgVDpKs+/vNKUrUhdWnpK +=guIu -----END PGP MESSAGE----- ** more stuff #+begin_src conf @@ -186,20 +195,23 @@ Inbox = 'date:-1800d..-60d':archive 'tag:spam':Spam ** MailMover section :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQf+ICLLhgKd+qv4ZDQXt+HoQIAXc4FnDUm3wMwr3oXg9i4h -kbZ46zxD4fSPkGAS4HmEHXFW1vHzy2oOxW/fiXKzo6Gtzg8sk+Q2w0rd7twRclJs -ovxxUWxNmaFbveGwgBHb35LMvPWxS0PobM0NA7g4nrpB/VA61n8uAij4C7Mr/eLk -PADL5NgC1mhHGSsLtewAYK0psws4zDGCYKMI6cG7cWgFpwLwNbbJM+bzDmO7wdvg -I+zQE/Ledu0UzZZ+6FDWhZ9TJa6Hw4iU04MrL8Nm8+ptq3YAYRlHX0jmjrSIrnGo -f+1CrLhffdP/1QlHWSMVDcHwSs0TOpNkv1gLvsEYqdLAmwG5E3a26faFPRko212Y -RULOnX10FQ+3d3b3cITRGLKkYwoRpAnMj6zUGk7aTdkZmPmQvdFozfuWbI0pnEbN -H3BpJrgDFB4B2xlT012kUmH3AzWQW4LHur/Fk7CXFBBnhOVSTcN/VuSuezoGKJQp -QEt5kusVKk4tkDYbdneA4NveCjum6QeFop1VliJ77tLKFlxCiTLE+c4ssQNc7tO8 -JR6Bv5piQexYeNjuADilcmGoYH8kjP1rkp5PkjIvm5cgUWFd+WAJOyCR6BkAkUv8 -a6+XqsAV1z+jvEFmxgYu00IahdLRie+kZU/ud9zMkj1d0XsK9KFWKtb7SzOEyHYS -Mqy85ND/nlwZy5CXAw6TMkltRvdet00e9X6z7AtH+N0oAMWc3kkquskNrgWj90OK -FVtUffixHcpqE0LouIzmMjWNKbxLm+zyU9fDJtvbDijMzGjsKM8nO6XlR0Ju -=ze7O +hQGMA/lzu+pplFIbAQv/Y9HmsMJS6hVR+LJtOJgL/uDTQv8mMKp1yKg9o5iX1oro +Gs/aaJcy8HpjsYnZd7Yx3PpuFh/yfM4XmNRhE68K2MtljTxrLmhm9oScQNv8QlFK +PwQbN9gKydrYbkxRrpNgbGBSFkrXd7uQ7NAyyvPdHY1Z0w/rDM4LZZKCTx9/1S1Q +3OZniVklBO94fIaPRDXcZK0dhuvXuOYFY6pSnByRJHzK/y0JzU6j50ZoEPre9frb +L/OiQLbsCwOZGXu96uHD6IN1YoTg+y3wSHUt+/rQyBIt9wH65oR2UJzQGiBevWoy +ZB/roXHFUA3qWBtye2zwUUgn9zwfHhxpVXh/CUF+H/nJpu4onr2NFZpVQBjTv3PM +LfS3QFRzArCSwFxAWpwzk8LHAeFTMoL5Ojz5bHGsrJbq3+WO2LPepN0Mb6HJbL+T +p1dYEfdIWLTVOJ+h+OGKg2FhHuN9+sEamrW1MhBqpgiTLN+RcxYLdqzUUYkX5y2l +R3rwiARy20KmQdvPDkgi0sCbAXh3Qkm2FP+naUkpMG8hygfDAIvlKzPPNrfQIF+c +K0sgSSHg6zDY8WD5O+jgsJMb+MDFVVavmy7evA+w5lPXToVrVNItz5iVvXjAY74k +4mUSKkY7RTRDpHihNYNKZ/7iz5QqpCCdAPiZt9neZ/2TR8zD8ESkxFRHt296Tw+Z +U9A5+cmTq05c7KoVsp4S1DADL0V4w5ELbXEAkeZ+fJoYMjTLJ9QxH9FGHduxN161 +uEED+B2SztY/8YWHGk+C6JtRgFqlCIdcshJVRWTlJg36R9jzXKuxhM+GJ4FQ+BSV +GhhV58pAPg/OzvR2o8TmlYm2QUhufZY08PH1HqJWu/GQigpHQlM5sXZgDRlu5ovv +f+hcnYxlWVjh6tquhT4uHo6uVwh//SaOPpYmEVAe9O9PdwL47pFJu6k0MMkH4qrK +7zUsvb+IgDtvGL3JLgMP7+qEF5NhrjoQVowImx8= +=oUMI -----END PGP MESSAGE----- * notmuch :PROPERTIES: @@ -226,24 +238,26 @@ path=/home/fpi/Maildir ** User configuration :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQgA2rFXXm7umflR9w3LqX6w5nR/lq09KnkL0aD79CDPMmnv -O0pPFDMmOWXSIUZRd2F0QU4rdy1Wh23he+0aoe8+hrhB4IXFgUYoW/uif/FDQP8/ -vIgE722F+C2ANZOi5hxZKAlboHnqDHhk0G/zBsHfYShK2es33jN0RNVCETJFHVYr -fsGAqvDGxXEuvms9lfzmDg8uIiM19hGC9E6BXxkVdMYDbJl/xok59gXkvYvmkh9K -3joufftAO8dKMOeuQGyYVsUtBfzurXTV2VTQQjKIqbHfWfVESQlRQeCOmbhNzUYz -AQmUbflAXadadpd3W6g4eqqPpMAJWTYlj4jcti6JI9LBMQFYcW4zeUK1y7HfAhgk -g1JVZ5BWcKChoxTHRzPy6NlRwyLIe7lXk39aK+GgUCq0UqZKDAaiydyO+psQM+dM -/s0C3phYh1cWCg8/9bq/Iu+nINXx0BuS0dmbrGh8UPMPjPlXYskaMIezKHobStNB -oYOC3Y4VA1qYkaDpcU6/JqpvzvCSm01JTE4DbOMLQGghu9opXsbT7ArM5vkGoDMS -Nvvl2VrJApGP1bde7pvbjL08/43yBlJKlOBFn6awE9sqpF08T6/9bJFvjAdQDs68 -ab3VnHJ8F4LZX5IOkePAQVvK3ZPxNfWutAeRRvICqouGH+v+MBtsafVYr1VmfeI6 -NNpRbra6/ycveBAcQoaJcZYsx4ZcliqPU+GOKRhNcjEjrtDeqWmfBBIvkBYy4QOu -z9y7f7JM7QHyn9RFvKAy3obVU+F/RujLOuOCKCQrA5uoM+INcznqSXlo6u21M6AF -LJk6+Lt8GDH2XjAhjcDOWmRweKPnFsi1wHUwlIxv3SIAFl0kb2mkVx5+dzWIR2yO -vj0NYcHwMO/h3CM+7IjpAjLffDXWjR7QvXpdV9cpEELzAy6T2C7W0s0tGjpI7065 -5Z+AG1KoJr3YPu+E1v3rWtIuwUw8Sv2Z/H3gLZXbMrZNy3k4m5lfsVZWcHWiaXy3 -x5DE -=EvAL +hQGMA/lzu+pplFIbAQwAyADHr9/dxo+qBiAnayNbHLRsCOZlRI/LdY8zL9AUN2Dm +V3RvD9vgJAg/FQR3Q3/St+EWrYd8ktPshr/54zE9EpqbQf/iZf1nHx8hQdyZLmFQ +teYuX+d4+r65LV6dwMKc3IYRNVefy0qMYYJcGxisgvg2FmJbZw5pInEfRjlu3e7c +yuiYPfbE1JfbF5Q+UK+jnq1MA/12XRYB+vSaEz+oYAY1B8L/oIifTFTBM2LlSYrs +e1oR1oYcEqZ6/NNcM8oFJV8mKo3ppvLQT3T9mIZinq9wdBssqSm7JjCghh+rBjrA +ZCk9+7n4WgsBIzclKXLPUpQrNt7i/j2o/lJZMe1X6uhwEvY4k2Ef/URRd5T3L0lz +XXHIkcNZQGfko+AnwSIeG2fsDA9h5HOx5t/9gQX5JqVXHNxUomyaumxafEkAw51N +hWN78JIZNTTIeNdlbKs+7tPqc/0Pg5KQsBrOIjsI8Q0/xy0U6ggNflce3jRXQ8b1 +ugcZK5XwVXVChho2w5340sEtAY7o7yrPPB0guACFB6T+pddMGlR2KRFqkL7n3UTt +R0BuuPcAaYwu4NA0dGG3HWEsHHnrCjADQNRimM5vxa2yl74YDBa/sA+eZ48ee3oV +bHXerSuERu0TZd/PxcFGyHLjbe6CR26a+q6O87pYbmlzCANddGSFmhInFv9dzpi9 +1EnTRr8KS2t+KPOAOYGnyuJD/gBsPuA43DAfZG+CFDIve4593QadyovvntJMgb2v +p1P899T9n76zuLd+kpi0vE/1U2XZkJQfp6eZh/1KiP5tnSAQfFaPBICg412vAg/D +7EbWn4xav4MQA7BPz2WWVuIktsJ/22ZhX+EmIB2pKSqad6q0mGt8/nu4ZzUY3HLb +fZA1qaBdSkIZIef4mNkiT2Sl+sbwzv/M8Lg0BZAPAS6hCrt4kNOeRhpcJNTlSaOD +mVq6dwrfvvPiY3tFMkbCLVT+4OztYsgHg+D+e4eGnA6geVCCvVtb79pK1tQKcAED +Y20tp9QZ7jVAP1zOVTZn8x9fe2VTa6+oyAayWtvgxQbSLhfmKc7et0LCngtTaasT +mHQXwQ7r0EIVyrkrhC0/Dlo7pgyoQ9spaBpCPg8hszDoNTJ0gunf2NxYBjjyO5hI +Zxz8+V8+wgKl/CfIoX0EoF3VcOs0EL+GvqFqcM9tsg== +=H1dY -----END PGP MESSAGE----- ** More configuration #+begin_src conf @@ -343,30 +357,32 @@ tls_trust_file /etc/ssl/certs/ca-certificates.crt ** Account configuration :crypt: -----BEGIN PGP MESSAGE----- -hQEMA6SnnQUY6GkFAQf/csoGa1RI1hzBuv+DGkZ8Rp6YKy1bMJxppOdrRjIZNHCR -Zf0+l/tNk+dg4p3O++N1+hORzcYcFnXepMCvjtlhOCW5Un/JvUZMFfXhWH+Vb503 -TFo+2bzir+zoCeSg5CwY8mXpQja4GXCcVbGNCUDyV5u86vnktQZpn9NUjEJ0vOf0 -To87ZEuAeDpoAzPuVB0BerxHjtQ9dsTSudEyc2oW63/FruEpHZl3j9gsuNB/rbIw -QYbf5hC0RyvRjjqx3E0RXgGLq+Z+HEAJl8ztnJ4/koI695f/MXVKmquO6GoOm1PA -3/2lSInBd3fPIfNwR3JT5NZO0+LL+D526Eos/xgMl9LpAQR3/V/oFvsXFW34bB55 -t7TCDJPg8UoJhzfaXcCCA8XUUsUehJT+y4eoEkc07ehbsQ1G0mb2MCW3Zczrmrqy -qX1GABfQ2+ncL3cnybAyXkxqnCqLm37DGQUSkkQvi64TiQNUhR/elrg58rNnr3f7 -Nc6dKoHBvdFERSjU0L+32bAgCVt9XmFAnk/chVSVapCPIDGR8sk9xJEuy7e2TSDy -YvI3XUkVir3OD+cwJgBVDJ2/CExZ4wZ3YXZuIHh1USEWi8JZS2qAEIlovzALcmoT -SBfkYOmi/xYDKmEDuARMR1g5LFh+0utgJFkgNIQq9pENbzstqRIWKtCDESNlPj0k -5bk3abFS83Xt/y2DN0ToUvRqXqTNavwDmrtpjhX6Ca0HblLPyZiK+Yhe/EctyjrI -UUaPHXGQP9mVxZqJqQg1Yr2CQdGC6v/mw/4XAJs2y1A8dAUHcfkOVTLfI+PZGkRL -jFuVCyeXnR66qXeNhw33xPoxytIf7q7aHw/0SaQkX8+ult0mO8n8xAM7LXerM21b -VFUxesN6YTqTyEH2v1ZC6GmknSthljYZTn2bbmA2pBGnDhmVSUCLa/6p+pxj9BqA -xG/SGhSQWseHDWa+EveXJlzMUo/+AfIKFuNVIJrJAbl+uUzSfW01iyBWGpQQIrzZ -Fbi3XFOQYjPZrlMh9DWnaFvAXYE8VSbJGunorRiGG00K7zvErCSnVjwNEjPd4ygm -bmR1aZJTbeUh2NmvEUqtYQe8QfblCtMlPy/48sJlGs4VzHWZ4bSFcH3dfYDxceL8 -6QbN4sjqvPYHFhXk3tFH4zBEnvR6DzkR6+WErUURDsS4die7d5+nKiqX/+audH3e -rSJXruKotOwvz95u49AzapFXpuwEAasRaWNUbBY/xDfbmL4NoY1Poxh7rcJiyb+W -fR/DlUtGEeB3lYNSWLaJplov9Xv2jpMMN/9hqSN5QFZZPheHEroxNb7q8Cn2B+Zk -u0kSSCPys5z0+HZmxUVzSY25YmwYbTk+8YhiLus/fdjBTjPqkza1J/lUoKp4SivN -nB9Df3NOp06JrxzI94o4Gw== -=K6DS +hQGMA/lzu+pplFIbAQv/Z+gf1HDfl3ujUmWlhnNSgtDYvJ0p1F5ocDQFbycYcMnK +y0pgNbBHTt4EnpyBzcO4fJeWnytd8VWivcNyie36fwInOfZGDWwGGbg6mbDSTZ7R +TE6oGnUIJZGZGi3Tc48Pfi2/dnLFaqIFjpCBHoF3SJt35HlHCaH5fo1VCym0WRW/ +zCXZUbbLgncDYnzb1TLvMZcDTqPiIKsMkqXiO2tf/P9WJTqk0gZBPvMWTQKqrjtm +tj5+PAUCG2YATra5MBGeQED7DflV9UMyxcP8pHGV8HStoih0xTQ72X0N0mL5JquK +A0LW4p0jGNig0v5EdgP8yZtygv2Rx+3IRJzuedubM37dnRF+jzAfkmC1ALY5zEfW +8l//9iwcARtEde8AS2vAoPVXlS0xIEF12d6VzkWWzncZmcXIHyXDrFY1+z3tEe0V +e8fBSx4LsBfCTJineSCcDkh+AuGr2JyvM71b8eX3BE1FqrfNppV2pqXlkVIL19R8 +/kr4nDHmtG+59+lmbzyD0ukB0OUbXqHJMnnMbJRjHsEbuQUAazGfOZDUyjd4zJx2 +2fNFuPEPkKiiJUWOFeYqnbG12e+sl0LP2CMTGNdd4aT51IDrWXlSxbkwxBiK3spt +n2LhqzZs0xK0ZGkSiH+7BnxtVgkzBIbF4sGmhq696gWyGuY3EfmIBSNRidlpCGtC +iJwK29G9DUKX7s6cR3+n7A2wWK47fQazRN/lcUQ7XD0JOhsasR0SMUQvQRwnfR9e +ft8romZ4uGBeRhm7n2cA7d5CJJPVJfsq5QdZFLewPmQPDbH4Fkeg8i4Oeh7Lu2fs +EOLOhao5ejocKlY9ZdGpNzhDxHLkZJ4ShX9+OoV9Uz3Sf2rmtz8r94pkNDmaaQ8c +990I3/caiy4PpsWTp1QJ4EUvhT3EWUsE2EYvM3SQSGpF+HOT0j6vrIaoecMCqoLX +WkUvZap6obg3KiSqodGn007iiqQ8pwJZl76FZMbse0jei0XcyiHt+hY2EO1FhMyv +pKRiHcwx8rICoiw2oGn13Zb9UbVmXU5SMeurE59C/0PFUC6SzafMnPTJXUQ7NlUq +ne9se0qmT7JoqHXshuotRSsYRVpxns2JZuE7tqHA7/Ud5hVPLy3ZOl+Zk6ddagc9 +lPhqal3qX0U9nSWQsCXBa8+MhduFG4hYuNj9X5uviTNK2q3wLgRUCo2gRXK2cp+k +FMBa71Nk8D4/EBU9giq5FAPG91uer+UcmSZVknLncY0pd1uAdtBsIUT/+zZvIJMJ +8FNjguacnEefSewhLAcMVrKOQ2WYOvOP5nLr9TaKnJ5nS5GSRXVJy9nBKFtEAZf+ +2wmHTkmFSwP3lqi1ZaIxovF3rs2lHc5Y+l2TYUMpZ7IoENt3mHV5NpMf8n9YMXvH +iml2sfR/j4AwOMKGoq4kd/+X5T3+YDXceV9Na5dVS8Gi988FYJ7mUQgpQEBh97PF +Rfk0cIaKPIfioUlzYQqH1j2iJJ3oR1cY7zOaPZiWsvbIthhMLOFfkHh70Ohcu/b+ +/gV5ByyC9yQDRuyjleeUMuWjQP8rr9eA2ieri6QajNz1xDuf2VwB13NhMAWx +=wmLO -----END PGP MESSAGE----- * Checkmail.sh :PROPERTIES: -- cgit v1.2.3 From 00d93264a5247d645299cf6f1ea809fbd729f1f2 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 27 Feb 2020 10:41:21 +0100 Subject: Add another host to .ssh/config --- ssh_config.org.gpg | Bin 699 -> 731 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index 62701d5..583ecc9 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From bcaee90f36224e54271cc51a349007de267ead70 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 27 Feb 2020 10:20:34 +0100 Subject: Add a function to copy the doi from crossref-lookup --- emacs-init.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 7cdb1b9..3320179 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2075,6 +2075,15 @@ pdf if available." (org-demote) (buffer-substring (point-min) (point-max))))) #+end_src +Here's a function to easily copy a doi from the results of =crossref-lookup=. +#+begin_src emacs-lisp +(defun fpi/biblio-get-doi () + (interactive) + (let ((doi (alist-get 'doi (cdr (biblio--selection-metadata-at-point))))) + (kill-new doi) + (message "Copied doi %s" doi))) +(define-key biblio-selection-mode-map "d" #'fpi/biblio-get-doi) +#+end_src *** Todo settings - WAITING tasks are waiting on the completion of other tasks - NEXT tasks can be picked up -- cgit v1.2.3 From 73f5e3655378f07f677fcbafd19c087ae1aaecd9 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 27 Feb 2020 10:21:29 +0100 Subject: Disable org-attach-git. git-annex assistant is better --- emacs-init.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 3320179..ef671fa 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1871,8 +1871,10 @@ the newly set value. Open the PROPERTIES drawer." #+end_src =org-attach-git= auto-commits changes to attachments if the directory is a git repository. I want every attachments to be saved using -=git-annex=. -#+begin_src emacs-lisp +=git-annex=. I stopped using this because the buildin =git annex +assistant= seems like a better choice, as it also handles automatic +content syncing upon commit. +#+begin_src emacs-lisp :tangle no (use-package org-attach-git :custom (org-attach-git-annex-cutoff 0)) -- cgit v1.2.3 From 13c9e0b0e31eae4555ef2b4ee909dae8590df033 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 27 Feb 2020 11:42:56 +0100 Subject: Automatically resize inline org images to 400px --- emacs-init.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index ef671fa..c14a915 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1566,6 +1566,8 @@ Hansen's]] configs. times should stay separate in the =LOGBOOK= drawer. - Align tags left :: Fixes problems with line breaking on small window width. + - Inline image width :: Resize images to 400px but respect width + specifications in attribute lines. #+begin_src emacs-lisp (use-package org @@ -1613,6 +1615,7 @@ Hansen's]] configs. (org-log-state-notes-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") (org-tags-column 0) + (org-image-actual-width '(400)) :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) -- cgit v1.2.3 From 495037c5556e015c21aaaaf9ea391ad4a4cb016b Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 Mar 2020 16:56:46 +0100 Subject: Remove mode line indicator for a bunch of modes --- emacs-init.org | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index c14a915..75f5127 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -147,6 +147,7 @@ to get a list of available commands. =which-key= shows these in a small popup, which I think is more handy. #+begin_src emacs-lisp (use-package which-key + :delight :ensure t :custom (which-key-idle-delay 0.4) :config (which-key-mode 1)) @@ -224,7 +225,7 @@ Instead of the above code I set the font directly using (set-face-attribute 'default nil :font "Hack-11") #+end_src -** Theme +** Theme & Faces =hc-zenburn= is the theme I chose for a long time. Lately I started to appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light theme promising high color contrast. I ended up using the @@ -233,6 +234,13 @@ theme promising high color contrast. I ended up using the (package-install 'spacemacs-theme) #+end_src +=Face-remap= is a library for basic face remapping. =Buffer-face-mode= +is enabled when using =variable-pitch-mode= to show the face defined +in =variable-pitch= instead of =default=. +#+begin_src emacs-lisp +(use-package face-remap + :delight (buffer-face-mode)) +#+end_src To do some custom adjustments to it I use the following macro which adds an advice to ~load-theme~. #+begin_src emacs-lisp @@ -935,7 +943,11 @@ This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizard (define-key fpi-map (kbd "n") 'sauron-toggle-hide-show) (define-key fpi-map (kbd "j") (lambda () (interactive) (find-file org-journal-file))) #+END_SRC - +** Base commands (simple.el) +#+begin_src emacs-lisp +(use-package simple + :delight (visual-line-mode)) +#+end_src * Selection and search methods ** Completion frameworks Having used ido, ivy, icicles and helm in the past, I'm trying to @@ -1309,6 +1321,7 @@ pushing is always turned off. To enable this with [[info:emacs#File Variables][F some safe local variable values. #+begin_src emacs-lisp (use-package git-auto-commit-mode + :delight :ensure t :custom (gac-automatically-push-p nil) @@ -1348,6 +1361,10 @@ brackets containing their path. (uniquify-strip-common-suffix t) (uniquify-after-kill-buffer-p t)) #+END_SRC +#+begin_src emacs-lisp +(use-package autorevert + :delight (auto-revert-mode)) +#+end_src *** ibuffer #+BEGIN_SRC emacs-lisp @@ -1536,6 +1553,12 @@ needed. :init (add-hook 'emacs-lisp-mode-hook 'speed-of-thought-mode)) #+end_src +=Eldoc= displays information on variables and functions in the echo +area. +#+begin_src emacs-lisp +(use-package eldoc + :delight) +#+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org TODO and clocking setup is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt @@ -1572,6 +1595,7 @@ Hansen's]] configs. #+begin_src emacs-lisp (use-package org :ensure org-plus-contrib + :delight (org-cdlatex-mode) :defer t :bind (("C-c c" . org-capture) @@ -1582,7 +1606,6 @@ Hansen's]] configs. ("begin" "$1" "$" "$$" "\\(" "\\["))) (org-catch-invisible-edits 'smart) (org-agenda-diary-file "~/sync/diary.org") - (org-startup-indented t) (org-use-speed-commands (lambda () (and (looking-at org-outline-regexp) (looking-back "^\**")))) (org-pretty-entities t) (org-fast-tag-selection-single-key t) @@ -1622,6 +1645,12 @@ Hansen's]] configs. (add-to-list 'org-tags-exclude-from-inheritance "MARKED")) #+end_src #+begin_src emacs-lisp +(use-package org-indent + :delight + :custom + (org-startup-indented t)) +#+end_src +#+begin_src emacs-lisp (use-package ob :config (org-babel-do-load-languages 'org-babel-load-languages @@ -1765,6 +1794,10 @@ Use imagemagick and standalone class for latex preview. [DEFAULT-PACKAGES] \\pagestyle{empty} % do not remove") #+end_src +#+begin_src emacs-lisp +(use-package org-num + :delight) +#+end_src *** org-caldav #+begin_src emacs-lisp (use-package org-caldav -- cgit v1.2.3 From 5d8a4d73db4cb9c514f77ae345625c40f6fabcad Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 Mar 2020 16:57:41 +0100 Subject: Add basic window rules with display-buffer-alist --- emacs-init.org | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 75f5127..750ebb1 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1421,6 +1421,33 @@ on the amount of displayed text. (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))))) + ))) +#+end_src *** window-numbering This is a nice package for easy window focus switching. I prefer it over =windmove=, as it does not interfere with org keybindings. -- cgit v1.2.3 From b1e7ce9f802ec28a72fc5b629479da8e0895a524 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 Mar 2020 16:57:58 +0100 Subject: Do not show deadline warnings in agenda if scheduled --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 750ebb1..46e3d62 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1746,6 +1746,7 @@ Hansen's]] configs. (org-agenda-sticky t) (org-agenda-todo-ignore-deadlines 'near) ;; or future? (org-agenda-todo-ignore-scheduled 'future) + (org-agenda-skip-deadline-prewarning-if-scheduled t) (org-agenda-tags-todo-honor-ignore-options t) (org-agenda-todo-list-sublevels t) ;; nil to exclude sublevels of todos (org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) -- cgit v1.2.3 From e8ec67e20003fe290c385dbcf44c045f75f071de Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 Mar 2020 16:58:20 +0100 Subject: Add functions to manipulate clocking times --- emacs-init.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 46e3d62..40756e7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1840,6 +1840,16 @@ Use imagemagick and standalone class for latex preview. (org-caldav-exclude-tags '(nocal)) ) #+end_src +*** org-clock-convenience +#+begin_src emacs-lisp +(use-package org-clock-convenience + :ensure t + :bind (:map org-agenda-mode-map + ("" . org-clock-convenience-timestamp-up) + ("" . org-clock-convenience-timestamp-down) + ("" . org-clock-convenience-fill-gap) + ("" . org-clock-convenience-fill-gap-both))) +#+end_src *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal -- cgit v1.2.3 From 191a73dff7dcb3e360b744617ccf75b27c6e125d Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 Mar 2020 16:59:18 +0100 Subject: Add bbdb and ol-bbdb --- emacs-init.org | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 40756e7..7783ca0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1859,6 +1859,10 @@ Use imagemagick and standalone class for latex preview. ;;(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/") #+END_SRC +*** ol-bbdb +#+begin_src emacs-lisp +(use-package ol-bbdb) +#+end_src *** Org-edna =Org-edna= is a great tool to manage =TODO= dependencies. I mainly use it to mark tasks as =NEXT= after switching another task to =DONE=. The @@ -3015,6 +3019,30 @@ For now I use this bad code. (goto-char (point-max)) (or (bolp) (newline))))) #+END_SRC +** BBDB +#+begin_src emacs-lisp +(use-package bbdb + :ensure t) +(bbdb-initialize 'gnus 'message) +(bbdb-mua-auto-update-init 'gnus 'message) + +;; size of the bbdb popup +(setq bbdb-pop-up-window-size 0.15) +(setq bbdb-mua-pop-up-window-size 0.15) + +;; What do we do when invoking bbdb interactively +(setq bbdb-mua-update-interactive-p '(query . create)) + +;; Make sure we look at every address in a message and not only the +;; first one +(setq bbdb-message-all-addresses t) + +;; use ; on a message to invoke bbdb interactively +(add-hook + 'gnus-summary-mode-hook + (lambda () + (define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field))) +#+end_src ** Context aware hydra :PROPERTIES: :ID: 22750e48-aaee-4f60-bdce-1d511ebe3375 -- cgit v1.2.3 From b29b79a86fc3791126304274e8a4afb9cef54b49 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 Mar 2020 16:59:33 +0100 Subject: Add org-roam and fix deft settings --- emacs-init.org | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 7783ca0..2603cc3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1863,6 +1863,22 @@ Use imagemagick and standalone class for latex preview. #+begin_src emacs-lisp (use-package ol-bbdb) #+end_src +*** org-roam +#+begin_src emacs-lisp +(use-package org-roam + :delight + :hook + (after-init . org-roam-mode) + :load-path "~/git/clone/org-roam" + :custom + (org-roam-directory "~/git/projects/zettel/") + :bind (:map org-roam-mode-map + (("C-c n l" . org-roam) + ("C-c n f" . org-roam-find-file) + ("C-c n g" . org-roam-show-graph)) + :map org-mode-map + (("C-c n i" . org-roam-insert)))) +#+end_src *** Org-edna =Org-edna= is a great tool to manage =TODO= dependencies. I mainly use it to mark tasks as =NEXT= after switching another task to =DONE=. The @@ -2580,10 +2596,10 @@ creation. #+begin_src emacs-lisp (use-package deft :ensure t - :custom ((deft-directory "~/zettel") + :custom ((deft-directory "~/git/projects/zettel") (deft-extensions '("org")) (deft-default-extension "org") - (deft-use-filename-as-title t) + (deft-use-filename-as-title nil) (deft-recursive t) (deft-use-filter-string-for-filename t))) #+end_src -- cgit v1.2.3 From 06825e7ba2be3645a7320855e5510f093a699baa Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 19 Mar 2020 13:21:41 +0100 Subject: Add another host to .ssh/config --- ssh_config.org.gpg | Bin 731 -> 743 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index 583ecc9..67a329f 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From bdf6f5b554fd45f493ff6be768ca422e2b7fbe25 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 19 Mar 2020 13:23:34 +0100 Subject: Move org todo configuration to main org block --- emacs-init.org | 111 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 36 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 2603cc3..57fc4f3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1612,12 +1612,18 @@ Hansen's]] configs. headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. - - Drawer for Notes :: Notes go into the =NOTES= drawer. Clocking - times should stay separate in the =LOGBOOK= drawer. - - Align tags left :: Fixes problems with line breaking on small - window width. - - Inline image width :: Resize images to 400px but respect width - specifications in attribute lines. +- Drawer for Notes :: Notes go into the =NOTES= drawer. Clocking + times should stay separate in the =LOGBOOK= drawer. +- Track state changes :: Notes when an entry is switched to done when + the deadline or scheduled time change +- TODO Keywords :: Set my todo keywords, enable fast selection & some + custom faces for the todo keywords +- Change todo state on clock-in :: Switch entries automatically from + NEXT to INPROGRESS +- Align tags left :: Fixes problems with line breaking on small + window width. +- Inline image width :: Resize images to 400px but respect width + specifications in attribute lines. #+begin_src emacs-lisp (use-package org @@ -1630,46 +1636,78 @@ Hansen's]] configs. ("C-c l" . org-store-link)) :custom (org-format-latex-options '(:foreground default :background default :scale 1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers - ("begin" "$1" "$" "$$" "\\(" "\\["))) + ("begin" "$1" "$" "$$" "\\(" "\\["))) (org-catch-invisible-edits 'smart) (org-agenda-diary-file "~/sync/diary.org") (org-use-speed-commands (lambda () (and (looking-at org-outline-regexp) (looking-back "^\**")))) (org-pretty-entities t) (org-fast-tag-selection-single-key t) (org-tag-alist (quote ((:startgroup) - ("@errand" . ?e) - ("@office" . ?o) - ("@home" . ?H) - (:endgroup) - ("IDLE" . ?i) - ("shelf" . ?s) - ("soon" . ?t) - ("project" . ?p) - ;; ("HOLD" . ?h) - ;; ("PERSONAL" . ?P) - ("WORK" . ?W) - ;; ("ORG" . ?O) - ("crypt" . ?E) - ("NOTE" . ?n) - ;; ("CANCELLED" . ?c) - ("FLAGGED" . ??) - ))) + ("@errand" . ?e) + ("@office" . ?o) + ("@home" . ?H) + (:endgroup) + ("IDLE" . ?i) + ("shelf" . ?s) + ("soon" . ?t) + ("project" . ?p) + ;; ("HOLD" . ?h) + ;; ("PERSONAL" . ?P) + ("WORK" . ?W) + ;; ("ORG" . ?O) + ("crypt" . ?E) + ("NOTE" . ?n) + ;; ("CANCELLED" . ?c) + ("FLAGGED" . ??) + ))) (org-link-abbrev-alist - '(("google" . "http://www.google.com/search?q=") - ("ddg" . "https://duckduckgo.com/?q=") - ("gmap" . "http://maps.google.com/maps?q=%s") - ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) + '(("google" . "http://www.google.com/search?q=") + ("ddg" . "https://duckduckgo.com/?q=") + ("gmap" . "http://maps.google.com/maps?q=%s") + ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) (org-ellipsis " ") (org-refile-use-outline-path 'file) (org-outline-path-complete-in-steps nil) (org-log-state-notes-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") + (org-log-done 'time) + (org-log-redeadline 'time) + (org-log-reschedule 'time) + (org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") + (sequence "S(s)" "DONE(d)") + (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") + (sequence "TODO(t)" "|" "DONE(d)") + (sequence "IDLE(a)"))) + (org-use-fast-todo-selection t) + (org-todo-keyword-faces + '(("NEXT" :foreground "light blue" :weight bold) + ("INPROGRESS" :foreground "burlywood" :weight bold) + ("DONE" :foreground "forest green" :weight bold) + ("WAITING" :foreground "orange" :weight bold) + ("ICEBOX" :foreground "orange" :weight normal) + ("CANCELLED" :foreground "forest green" :weight bold) + ("MEETING" :foreground "yellow" :weight bold) + ("PHONE" :foreground "yellow" :weight bold) + ("IDLE" :foreground "magenta" :weight bold))) + (org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) (org-tags-column 0) (org-image-actual-width '(400)) :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) - (add-to-list 'org-tags-exclude-from-inheritance "MARKED")) + (add-to-list 'org-tags-exclude-from-inheritance "MARKED") + (defun bh/clock-in-to-inprogress (kw) + "Switch a task from NEXT to INPROGRESS when clocking in. +Skips capture tasks, projects, and subprojects. +Switch projects and subprojects from NEXT back to TODO" + (when (not (and (boundp 'org-capture-mode) org-capture-mode)) + (cond + ((and (member (org-get-todo-state) (list "NEXT")) + (bh/is-task-p)) + "INPROGRESS") + ((and (member (org-get-todo-state) (list "NEXT")) + (bh/is-project-p)) + "INPROGRESS"))))) #+end_src #+begin_src emacs-lisp (use-package org-indent @@ -2215,10 +2253,11 @@ digraph hierarch{ #+RESULTS: [[file:/tmp/todo.png]] -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (setq org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") + (sequence "S(s)" "DONE(d)") (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") - (sequence "TODO(t)" "|" "DONE(d)") + (sequence "TODO(t)" "|" "DONE(d)") (sequence "IDLE(a)"))) (setq org-use-fast-todo-selection t) @@ -2236,9 +2275,8 @@ digraph hierarch{ #+END_SRC Switch a todo entry from NEXT to INPROGRESS when clocking in. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (setq org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) - (defun bh/clock-in-to-inprogress (kw) "Switch a task from NEXT to INPROGRESS when clocking in. Skips capture tasks, projects, and subprojects. @@ -2252,11 +2290,12 @@ Switch projects and subprojects from NEXT back to TODO" (bh/is-project-p)) "INPROGRESS")))) #+end_src - **** State changes -Track state changes to done -#+begin_src emacs-lisp +Track state changes to done & changes to schedules and deadlines. +#+begin_src emacs-lisp :tangle no (setq org-log-done 'time) +(setq org-log-redeadline 'time) +(setq org-log-reschedule 'time) #+end_src *** Toggle drawer visibility #+begin_src emacs-lisp -- cgit v1.2.3 From fc8fb02b3219d7e18f0cc777539de663445fa77a Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 19 Mar 2020 13:24:06 +0100 Subject: Allow to pass options to grep command Default grep-command ends with "-e" and expects a pattern and no options --- emacs-init.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 57fc4f3..93e0ebe 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2683,6 +2683,11 @@ To open and hide a shell quickly I use =shell-pop=. :custom (shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda nil (eshell)))))) #+end_src +** Grep +#+begin_src emacs-lisp +(use-package grep + :custom (grep-command "grep --color -nH --null ")) +#+end_src ** Proced Built-in process monitor. #+BEGIN_SRC emacs-lisp -- cgit v1.2.3 From d85f1541c039156beceee507a053ec88514bbc09 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 19 Mar 2020 13:27:07 +0100 Subject: Change capture timestamps to inactive or w/o time --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 93e0ebe..60a4c4d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2037,7 +2037,7 @@ Templates (id "802014b3-fddf-4090-b140-7fb62cb982f2") "** Interrupt: %? :PROPERTIES: -:CREATED: %T +:CREATED: %U :SOURCE: %a :END: :LOGBOOK: @@ -2051,7 +2051,7 @@ Templates "** %? :PROPERTIES: :CREATED: %U -:DATE: %^T +:DATE: %^t :SOURCE: %a :END: " -- cgit v1.2.3 From 78f350af02f2a7d5253f65b7fb41cc3775cfbcfe Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:20:26 +0200 Subject: Add function to zap-to-char excluding char --- emacs-init.org | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 60a4c4d..a3120e9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -946,7 +946,26 @@ This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizard ** Base commands (simple.el) #+begin_src emacs-lisp (use-package simple - :delight (visual-line-mode)) + :delight (visual-line-mode) + :config + (defun zap-up-to-char (arg char) + "Kill up to and excluding ARGth occurrence of CHAR. +Case is ignored if `case-fold-search' is non-nil in the current buffer. +Goes backward if ARG is negative; error if CHAR not found." + (interactive (list (prefix-numeric-value current-prefix-arg) + (read-char "Zap to char: " t))) + ;; Avoid "obsolete" warnings for translation-table-for-input. + (with-no-warnings + (if (char-table-p translation-table-for-input) + (setq char (or (aref translation-table-for-input char) char)))) + (kill-region (point) (progn + (search-forward (char-to-string char) nil nil arg) + (if (>= arg 0) + (backward-char) + (forward-char)) + (point)))) + :bind (:map global-map + ("M-z" . zap-up-to-char))) #+end_src * Selection and search methods ** Completion frameworks -- cgit v1.2.3 From 898e66c666bac372d37cf497fbca3c482211a6db Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:21:01 +0200 Subject: Unbind ibuffer C-x C-b to not call it accidentally --- emacs-init.org | 1 - 1 file changed, 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index a3120e9..0281833 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1392,7 +1392,6 @@ brackets containing their path. (ibuffer-display-summary nil) (ibuffer-use-other-window nil) (ibuffer-auto-mode -1) - :bind ("C-x C-b" . ibuffer) :hook (ibuffer-mode . ibuffer-auto-mode)) #+END_SRC -- cgit v1.2.3 From bf2d81905f16f7b449836ff7a8566ea74cabc2ed Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:22:42 +0200 Subject: Not mark beginning of footnotes section --- emacs-init.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 0281833..4ed8801 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3097,6 +3097,12 @@ For now I use this bad code. (goto-char (point-max)) (or (bolp) (newline))))) #+END_SRC +** Footnote Mode +#+begin_src emacs-lisp +(use-package footnote + :custom + (footnote-section-tag "")) +#+end_src ** BBDB #+begin_src emacs-lisp (use-package bbdb -- cgit v1.2.3 From d9bafb8ab143142122b149e170f5c508b3c4e642 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:23:39 +0200 Subject: Add call for org-src-block lang specific hydras --- emacs-init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4ed8801..dfb1aec 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3209,11 +3209,19 @@ _q_ quit ("c" org-table-toggle-coordinate-overlays :color blue) ("q" nil :color blue)) +(defun fpi/org-babel-src-mode-hydra () + "Launch a hydra specific to the src language of the current + babel code block if defined." + (interactive) + (let* ((elem (org-element-context)) + (lang (plist-get (cadr elem) :language))) + (pcase lang + ("bibtex" (org-ref-bibtex-hydra/body))))) (defhydra hydra-babel-helper (:color pink :hint nil) " org babel src block helper functions _n_ next _i_ info _I_ insert header -_p_ prev _c_ check +_p_ prev _c_ check _m_ ode hydra _h_ goto head _E_ expand ^ ^ _s_ split _q_ quit _r_ remove result _e_ examplify region @@ -3229,6 +3237,7 @@ _q_ quit _r_ remove result _e_ examplify region ("e" org-babel-examplify-region :color blue) ("r" org-babel-remove-result :color blue) ("h" org-babel-goto-src-block-head) + ("m" fpi/org-babel-src-mode-hydra :color blue) ("q" nil :color blue)) -- cgit v1.2.3 From ea87d72f319ba932106eadbbfab76ad0be127dbd Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:25:02 +0200 Subject: Rewrite ssh_config hosts to be more generic See https://serverfault.com/a/536073 --- ssh_config.org.gpg | Bin 743 -> 970 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index 67a329f..d7f0890 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From c86e9958098d4616fced44319b5da63fde0595d5 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 13:50:08 +0200 Subject: Add gnus configuration --- emacs-private.el.gpg | Bin 988 -> 1030 bytes gnus.org | 289 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 gnus.org diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 18194cf..6b46930 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ diff --git a/gnus.org b/gnus.org new file mode 100644 index 0000000..0240d8a --- /dev/null +++ b/gnus.org @@ -0,0 +1,289 @@ +#+PROPERTY: header-args:emacs-lisp :tangle tangle/gnus.el + +#+begin_src shell :results silent +ln -s $(pwd)/tangle/gnus.el ~/.gnus.el +#+end_src + +Load private settings +#+begin_src emacs-lisp +(setq secret-file (expand-file-name "emacs-private.el.gpg" + user-emacs-directory)) +(load secret-file) +#+end_src +* Config +#+begin_src emacs-lisp +;; (add-to-list 'gnus-secondary-select-methods +(setq gnus-select-method + `(nnimap ,private/imap-name + (nnimap-address ,private/imap-address) + (nnimap-server-port 993) + (nnimap-stream ssl) + (nnir-search-engine imap))) +#+end_src +Sort by newest first +#+begin_src emacs-lisp +(setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) + gnus-thread-sort-functions '((not gnus-thread-sort-by-date))) +#+end_src + +Sending mail +#+begin_src emacs-lisp :tangle no +(setq message-send-mail-function 'smtpmail-send-it + smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) + smtpmail-auth-credentials '(("smtp.gmail.com" 587 "your-name@gmail.com" nil)) + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 587 + starttls-use-gnutls t) +#+end_src + +Load only groups with level < 2 for faster startup. +#+begin_src emacs-lisp +(setq gnus-activate-level 2) +#+end_src +Sent mails are read. +#+begin_src emacs-lisp +(setq gnus-gcc-mark-as-read t) +#+end_src +Save sent mails in my imap folder +#+begin_src emacs-lisp +(setq gnus-message-archive-method "dummy string") +(setq gnus-message-archive-group private/imap-sent-folder) +#+end_src + +** Adaptive scoring +See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. +#+begin_src emacs-lisp +(setq gnus-use-adaptive-scoring '(word line)) +(setq gnus-adaptive-word-length-limit 5) +(setq gnus-adaptive-word-no-group-words t) +(setq gnus-summary-mark-below -300) +(setq gnus-default-adaptive-score-alist + '((gnus-unread-mark) + (gnus-ticked-mark) + (gnus-dormant-mark) + (gnus-del-mark (subject -1)) + (gnus-read-mark (subject 2)) + (gnus-expirable-mark (subject -1)) + (gnus-killed-mark (subject -3)) + (gnus-kill-file-mark) + (gnus-ancient-mark) + (gnus-low-score-mark) + (gnus-catchup-mark (subject -1)))) +#+end_src +Scoring List for Groups with various From Senders: +#+begin_example +'((gnus-unread-mark) + (gnus-ticked-mark (from 4)) + (gnus-dormant-mark (from 5)) + (gnus-del-mark (from -4) (subject -1)) + (gnus-read-mark (from 4) (subject 2)) + (gnus-expirable-mark (from -1) (subject -1)) + (gnus-killed-mark (from -1) (subject -3) (followup -1)) + (gnus-kill-file-mark) + (gnus-ancient-mark) + (gnus-low-score-mark) + (gnus-catchup-mark (from -1) (subject -1))) +#+end_example +** Window Layout +See [[info:gnus#Window Layout][info:gnus#Window Layout]]. +#+begin_src emacs-lisp +(setq gnus-use-full-window nil) +#+end_src +** Format Summary buffer lines +#+begin_src emacs-lisp +(setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s +") +#+end_src +** Demon +Background fetching for gnus. See the manual and [[https://www.emacswiki.org/emacs/GnusDemon][emacswiki]]. +#+begin_src emacs-lisp +(defun gnus-demon-scan-news-level (level only) + (let ((win (current-window-configuration)) + (gnus-read-active-file 'some) + (gnus-check-new-newsgroups nil) + (gnus-verbose 2) + (gnus-verbose-backends 5)) + (while-no-input + (unwind-protect + (save-window-excursion + (when (gnus-alive-p) + (with-current-buffer gnus-group-buffer + (gnus-group-get-new-news level only)))) + (set-window-configuration win))))) +(defun gnus-demon-scan-news-2 () + (gnus-demon-scan-news-level 2 nil)) +(defun gnus-demon-scan-news-3 () + (gnus-demon-scan-news-level 3 t)) + +(setq gnus-demon-timestep 10) +(gnus-demon-add-handler 'gnus-demon-scan-news-2 3 nil) +(gnus-demon-add-handler 'gnus-demon-scan-news-3 360 nil) +(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 1) +#+end_src +** Modeline indicator +From the [[https://www.emacswiki.org/emacs/GnusNotify][emacswiki Gnus Notify]]. +#+begin_quote +[…] use ~G p~ in the group buffer, then add ~(modeline-notify t)~ […] +#+end_quote +Activate with [[elisp:gnus-mst-show-groups-with-new-messages]]. +Code: +#+begin_src emacs-lisp +;;; gnus-notify.el --- use the modeline to indicate groups with new messages + +;; Author: Mark Triggs +;; +;; Contributions from: Frederic Couchet + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This code provides modeline notification of when certain groups contain +;; unread messages. Groups for whom unread messages should be indicated are +;; chosen by setting a group parameter. + +;; Clicking on a group in the modeline will enter that group and view the new +;; message. + +;; Code: + +(require 'cl-lib) + +(defvar gnus-notify-show-unread-counts t + "If true, show the number of unread messages in the modeline in addition to shortened group names.") + + +(when (fboundp 'gnus-define-group-parameter) + (gnus-define-group-parameter + modeline-notify + :type bool + :parameter-type '(const :tag "Notify of new messages for this group." t) + :parameter-document "\ + +If this is set, the name of this group will be placed on the modeline when it +contains new messages")) + +(defvar gnus-mst-display-new-messages "") +(defvar gnus-mst-notify-groups '()) +(defvar gnus-notify-jump-to-group-hook '() + "This hook is invoked before jumping to a gnus group with unread messages. + Each hook should take a single argument - the GROUP to be selected") + + +(add-hook 'gnus-exit-gnus-hook + (lambda () + (setq gnus-mst-display-new-messages ""))) + + +(defun gnus-mst-notify-modeline-form () + gnus-mst-display-new-messages) + + +(if (featurep 'xemacs) + (unless (member 'gnus-mst-display-new-messages global-mode-string) + (if (null global-mode-string) + (setq global-mode-string '("" gnus-mst-display-new-messages)) + (setq global-mode-string + (append global-mode-string + '(gnus-mst-display-new-messages))))) + (unless (member '(:eval (gnus-mst-notify-modeline-form)) global-mode-string) + (setq global-mode-string + (append global-mode-string + (list '(:eval (gnus-mst-notify-modeline-form))))))) + + +(defun gnus-mst-notify-shorten-group-name (group) + "shorten the group name to make it better fit on the modeline" + (let ((name (if (string-match ":" group) + (cadr (split-string group "[:]")) + group))) + (mapconcat 'identity + (mapcar + (lambda (segment) + (string (elt segment 0))) + (split-string name "[\\./]")) + "."))) + + +(defun gnus-mst-notify-update-modeline () + "Update the modeline to show groups containing new messages" + (if gnus-mst-notify-groups + (setq gnus-mst-display-new-messages + (append (list " [m: ") + (cl-maplist + (lambda (sublist) + (let ((group (car sublist)) + (map (make-sparse-keymap))) + (define-key map [mode-line mouse-1] + `(lambda () + (interactive) + (run-hook-with-args + 'gnus-notify-jump-to-group-hook ,group) + (gnus-group-read-group nil nil ,group))) + (cl-list* + (list ':propertize + (if gnus-notify-show-unread-counts + (format "[%s %s]" + (gnus-mst-notify-shorten-group-name + (car sublist)) + (gnus-group-unread (car sublist))) + (format "%s" + (gnus-mst-notify-shorten-group-name + (car sublist)))) + 'face 'bold + 'keymap map + 'help-echo "Visit this group") + (if (cdr sublist) + (list ", ") + nil)))) + gnus-mst-notify-groups) + (list "] "))) + (setq gnus-mst-display-new-messages ""))) + + +(defun gnus-mst-notify-group (group) + "Add notification for this group" + (unless (member group gnus-mst-notify-groups) + (add-to-list 'gnus-mst-notify-groups group t) + (gnus-mst-notify-update-modeline))) + + +(defun gnus-mst-show-groups-with-new-messages (&rest ignored) + (interactive) + (setq gnus-mst-notify-groups '()) + (gnus-mst-notify-update-modeline) + (mapc #'(lambda (g) + (let* ((group (car g)) + (unread (gnus-group-unread group))) + (when (and (cdr (assoc 'modeline-notify + (gnus-group-find-parameter group))) + (and (numberp unread) (> unread 0))) + (gnus-mst-notify-group group)))) + gnus-newsrc-alist)) + + +(add-hook 'gnus-after-getting-new-news-hook + 'gnus-mst-show-groups-with-new-messages) + + +(add-hook 'gnus-summary-exit-hook + 'gnus-mst-show-groups-with-new-messages) + + +(provide 'gnus-notify) +;;; gnus-notify.el ends here +#+end_src -- cgit v1.2.3 From 754123b17738e8b0d734a15644a2443da3ef51da Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 18:58:56 +0200 Subject: Fix permission of tangled file Use `:tangle mode (identity #o700)` --- ssh_config.org.gpg | Bin 970 -> 974 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index d7f0890..f3c420d 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From 725471b962d220ccdae0f2492b52335356add686 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 18:59:49 +0200 Subject: Update package definitions: renamed & new in melpa --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index dfb1aec..fbc0b1c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1850,7 +1850,7 @@ Switch projects and subprojects from NEXT back to TODO" (use-package org-screenshot) (use-package org-collector) (use-package ox) -(use-package org-notmuch) +(use-package ol-notmuch) (use-package org-expiry :custom (org-expiry-handler-function 'org-expiry-archive-subtree)) @@ -1922,10 +1922,10 @@ Use imagemagick and standalone class for latex preview. *** org-roam #+begin_src emacs-lisp (use-package org-roam + :ensure t :delight :hook (after-init . org-roam-mode) - :load-path "~/git/clone/org-roam" :custom (org-roam-directory "~/git/projects/zettel/") :bind (:map org-roam-mode-map -- cgit v1.2.3 From 1ceccf375f07333d49a4de50255bd0cc037e0a77 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 19:59:42 +0200 Subject: Update symlinks --- emacs-init.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index fbc0b1c..11dc6da 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5,11 +5,11 @@ This files contains all the elisp code normally placed in the .emacs file. It and the =init.el= file are then symlinked to my =~/.emacs.d/= directory. Instead of symlinking the files could also be directly tangled to =~/.emacs.d/=. -#+BEGIN_SRC shell :results silent -ln -sf $(pwd)/emacs-init.org ~/.emacs.d/ -ln -sf $(pwd)/tangle/emacs-init.el ~/.emacs.d/ -ln -sf $(pwd)/emacs-private.el.gpg ~/.emacs.d/ -ln -sf $(pwd)/tangle/init.el ~/.emacs.d/ +#+BEGIN_SRC shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv $(pwd)/emacs-init.org ~/.emacs.d/ +ln -siv $(pwd)/tangle/emacs-init.el ~/.emacs.d/ +ln -siv $(pwd)/emacs-private.el.gpg ~/.emacs.d/ +ln -siv $(pwd)/tangle/init.el ~/.emacs.d/ #+END_SRC An often seen setup is to use ~org-babel-load-file~ in =init.el= to -- cgit v1.2.3 From c97f6e8dbfab7938a939bb3ca23e99d7357690dd Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:23 +0200 Subject: Update symlinks --- gnuplot.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnuplot.org b/gnuplot.org index 2988e22..04973f5 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -2,8 +2,8 @@ #+PROPERTY: header-args:gnuplot :tangle tangle/.gnuplot :eval query * Symlink First create a symlink to the desired config location. -#+begin_src shell :results silent -ln -s $(pwd)/tangle/.gnuplot ~/ +#+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/.gnuplot ~/ #+end_src * Main configuration #+begin_src gnuplot -- cgit v1.2.3 From c9d71cab67bd90becfa1472d3af9220f367f2ee3 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:32 +0200 Subject: Update symlinks --- gpg-agent.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpg-agent.org b/gpg-agent.org index 3ba28c4..02e2d55 100644 --- a/gpg-agent.org +++ b/gpg-agent.org @@ -1,8 +1,8 @@ #+PROPERTY: header-args:conf :tangle tangle/gpg-agent.conf :comments org -#+BEGIN_SRC sh :tangle no :results silent -ln -sf $(pwd)/tangle/gpg-agent.conf ~/.gnupg/gpg-agent.conf -ln -sf $(pwd)/tangle/sshcontrol ~/.gnupg/sshcontrol +#+BEGIN_SRC sh :tangle tangle/symlink.sh :results silent :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/gpg-agent.conf ~/.gnupg/gpg-agent.conf +ln -siv $(pwd)/tangle/sshcontrol ~/.gnupg/sshcontrol #+END_SRC -- cgit v1.2.3 From 4882047499b0e3350da8c2791ea37b98ab6cf492 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:01:12 +0200 Subject: Update symlinks --- ssh_config.org.gpg | Bin 974 -> 998 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index f3c420d..5761bec 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From 0541443d1f8765bb3b1d745ba9ec0702fb61f76d Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:52 +0200 Subject: Update symlinks --- rofi.org | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rofi.org b/rofi.org index ff05d95..f706789 100644 --- a/rofi.org +++ b/rofi.org @@ -1,6 +1,5 @@ -#+begin_src shell :tangle no :results silent -path=$(pwd)/tangle -ln -sf $path/config.rasi ~/.config/rofi/ +#+begin_src shell :tangle tangle/symlink.sh :results silent :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/config.rasi ~/.config/rofi/ #+end_src #+begin_src conf :tangle tangle/config.rasi :eval never -- cgit v1.2.3 From b5ecda1b673eebb3cb63a7d78bdeadbf14d7d8d9 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:47 +0200 Subject: Update symlinks --- redshift.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redshift.org b/redshift.org index bd463bf..5003528 100644 --- a/redshift.org +++ b/redshift.org @@ -61,6 +61,6 @@ lon=9.732010 ** Symlink - #+BEGIN_SRC sh :tangle no - ln -sf $(pwd)/tangle/redshift.conf ~/.config/ + #+BEGIN_SRC sh :tangle tangle/symlink.sh :shebang "#!/bin/bash" + ln -siv $(pwd)/tangle/redshift.conf ~/.config/ #+END_SRC -- cgit v1.2.3 From eabad48b6b68309d2dc63b316d165c121010a794 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:40 +0200 Subject: Update symlinks --- mail.org | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mail.org b/mail.org index aca41e1..dc5853b 100644 --- a/mail.org +++ b/mail.org @@ -462,11 +462,10 @@ See [[id:1e1d7ae0-3e88-4e14-b67f-72c6be66e565][emacs init file]]. Finally symbolic links to the desired locations are created for all the tangled files. -#+BEGIN_SRC shell :tangle no -path=$(pwd)/tangle -ln -sf $path/.mbsyncrc ~/ -ln -sf $path/afew.config ~/.config/afew/config -ln -sf $path/.notmuch-config ~/ -ln -sf $path/.msmtprc ~/ -ln -sf $path/checkmail.sh ~/ +#+BEGIN_SRC shell :tangle tangle/symlink.sh :shebang "#!/bin/bash" :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/.mbsyncrc ~/ +ln -siv $(pwd)/tangle/afew.config ~/.config/afew/config +ln -siv $(pwd)/tangle/.notmuch-config ~/ +ln -siv $(pwd)/tangle/.msmtprc ~/ +ln -siv $(pwd)/tangle/checkmail.sh ~/ #+END_SRC -- cgit v1.2.3 From cb28f01926933583c82d23485a62a8ad54242a00 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:36 +0200 Subject: Update symlinks --- ledgerrc.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledgerrc.org b/ledgerrc.org index 52231e3..ec44d5e 100644 --- a/ledgerrc.org +++ b/ledgerrc.org @@ -3,6 +3,6 @@ #+begin_src conf --file ~/.personal/f/ledger/main.ledger #+end_src -#+begin_src shell -ln -sf $(pwd)/tangle/.ledgerrc ~/ +#+begin_src shell :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/.ledgerrc ~/ #+end_src -- cgit v1.2.3 From 7982deed85a67ff7b186b25ae90a14c52844ee80 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:00:27 +0200 Subject: Update symlinks --- gnus.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index 0240d8a..a373bde 100644 --- a/gnus.org +++ b/gnus.org @@ -1,7 +1,7 @@ #+PROPERTY: header-args:emacs-lisp :tangle tangle/gnus.el -#+begin_src shell :results silent -ln -s $(pwd)/tangle/gnus.el ~/.gnus.el +#+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/gnus.el ~/.gnus.el #+end_src Load private settings -- cgit v1.2.3 From 60015f844b659b456b44eedc540a8106a1d1018f Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 19:00:52 +0200 Subject: Add script to (re-)tangle all files --- README.org | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 0877cc1..3355f7d 100644 --- a/README.org +++ b/README.org @@ -22,8 +22,42 @@ git branch -a | grep -v -e +$ -e master | sed "s/[ *] //" | xargs git merge git push --force origin master #+end_src +** Updating all tangled files +This script (re-)tangles all =.org= and =.org.gpg= files. Run this in +case the org files were updated outside of your local emacs (e.g. +after pulling from a remote). Make sure to run it from the dotfiles +directory. + +#+begin_src shell :shebang "#!/bin/bash" :tangle no +emacs --batch --eval="\ + (progn (require 'org) + (let ((org-confirm-babel-evaluate nil)) + (mapc 'org-babel-tangle-file (split-string \"$(ls *.org *.org.gpg)\"))))" +#+end_src + +The above won't quite work for me as I use ~org-crypt~ in some +configuration files and it also needs to be loaded & setup. For +details see [[file:emacs-init.org][emacs-init.org]]. + +#+begin_src shell :shebang "#!/bin/bash" :tangle tangle/tangle.sh +emacs --batch --eval="\ + (progn (require 'org) + (require 'org-crypt) + (org-crypt-use-before-save-magic) + (setq org-tags-exclude-from-inheritance '(\"crypt\")) + (setq org-crypt-key \"F1EF502F9E81D81381B1679AF973BBEA6994521B\") + (defun save-without-hook () + (let ((before-save-hook nil)) + (save-buffer))) + (setq org-babel-pre-tangle-hook '(org-decrypt-entries save-without-hook)) + (advice-add 'org-babel-tangle :after '(lambda (&rest r) + (org-encrypt-entries) + (save-without-hook))) + (let ((org-confirm-babel-evaluate nil)) + (mapc 'org-babel-tangle-file (split-string \"$(ls *.org *.org.gpg)\"))))" +#+end_src + * Window manager I use [[https://github.com/ch11ng/exwm][exwm]] and [[https://awesomewm.org/][awesome]] as my window managers. When doing a lot of coding and similar stuff I tend to use exwm as I will spend most of my time in emacs anyway. - -- cgit v1.2.3 From 20402088679d2fd52052dad73b15739f178d5819 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 19:59:31 +0200 Subject: Add script to create all symlinks --- README.org | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 3355f7d..477de5f 100644 --- a/README.org +++ b/README.org @@ -7,8 +7,8 @@ and symlinked to the appropriate directories. blocks make tangling take several seconds and ~org-babel-load-file~ in ~init.el~ tangles the init org file on each emacs start anyway. -For now the symlinks need to be created by manually running the -appropriate src block in each configuration file. +The symlinks can be created by manually running the appropriate src +block in each configuration file. For an automated solution see below. ** Git Setup Every program's configuration lives in its own branch. All branches @@ -57,6 +57,39 @@ emacs --batch --eval="\ (mapc 'org-babel-tangle-file (split-string \"$(ls *.org *.org.gpg)\"))))" #+end_src +** Creating symlinks +Each config files contains a source block which creates symlinks of +the tangled configurations to their respective target locations. These +blocks all have the ~:tangle tangle/symlink.sh~ and ~:shebang +#!/bin/bash~ header arguments. The symlinks are created with ~ln -siv~ +to list created symlinks (~-v~) and to ask when overwriting existing +files (~-i~). To always replace all symlinks you can pipe ~yes~ into +the ~ln -siv~ calls: ~yes | tangle/link.sh~. Make sure to run it from +the dotfiles directory. + +As the symlink shell source blocks are scattered in all configuration +files, all files are collected together using cat and then all blocks +with the correct ~:tangle~ target are tangled. Unfortunately there is +no function to directly only tangle blocks with a certain target, so +this is not straightforward. +#+begin_src shell :shebang "#!/bin/bash" :tangle tangle/link.sh +catFile="concat.org" +symlinkFile="tangle/symlink.sh" + +cat <(cat *.org) <(ls *.org.gpg | xargs gpg --decrypt) > $catFile + +emacs --batch --eval="\ + (progn (require 'org) + (let ((org-confirm-babel-evaluate nil)) + (find-file \"$catFile\") + (search-forward \":tangle $symlinkFile\") + (org-babel-tangle '(16))))" + +rm $catFile + +$symlinkFile +#+end_src + * Window manager I use [[https://github.com/ch11ng/exwm][exwm]] and [[https://awesomewm.org/][awesome]] as my window managers. When doing a lot of coding and similar stuff I tend to use exwm as I will spend most of my -- cgit v1.2.3 From a6ac92abcbc0bdf3e55470071defcc6f7529ee94 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 5 Apr 2020 20:55:51 +0200 Subject: Remove note of not tangling emacs-init.org This already changed a while back. See commits in the ~emacs~ branch. Tangling on emacs startup was unnecessarily slow. --- README.org | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.org b/README.org index 477de5f..0020720 100644 --- a/README.org +++ b/README.org @@ -3,9 +3,6 @@ The config files are organized in emacs org files. They are tangled and symlinked to the appropriate directories. [[file:emacs-init.org::*tangle%20dotfiles][A hook]] tangles all files automatically on each save. -~emacs-init.org~ is special and not automatically tangled. The >100 src -blocks make tangling take several seconds and ~org-babel-load-file~ in -~init.el~ tangles the init org file on each emacs start anyway. The symlinks can be created by manually running the appropriate src block in each configuration file. For an automated solution see below. -- cgit v1.2.3 From 1537ca57df4901d0972bab2a18a56e65175121d3 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 9 Apr 2020 16:39:31 +0200 Subject: Add nnreddit backend --- gnus.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnus.org b/gnus.org index a373bde..6454d78 100644 --- a/gnus.org +++ b/gnus.org @@ -95,6 +95,12 @@ See [[info:gnus#Window Layout][info:gnus#Window Layout]]. (setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s ") #+end_src +** nnreddit +#+begin_src emacs-lisp +(use-package nnreddit + :ensure t) +(add-to-list 'gnus-secondary-select-methods '(nnreddit "")) +#+end_src ** Demon Background fetching for gnus. See the manual and [[https://www.emacswiki.org/emacs/GnusDemon][emacswiki]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 8fff970f2a71002ba809280c737daa7ca3dff680 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 9 Apr 2020 16:39:38 +0200 Subject: Disable accidental topic indentation with TAB --- gnus.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnus.org b/gnus.org index 6454d78..d799395 100644 --- a/gnus.org +++ b/gnus.org @@ -50,7 +50,10 @@ Save sent mails in my imap folder (setq gnus-message-archive-method "dummy string") (setq gnus-message-archive-group private/imap-sent-folder) #+end_src - +Disable indenting a topic. I always do it by accident. +#+begin_src emacs-lisp +(define-key gnus-topic-mode-map (kbd "") nil) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 131f7087e8542ed8e6a128a4f7b89e0fd199efa8 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 9 Apr 2020 16:37:39 +0200 Subject: Add git-identity --- emacs-init.org | 14 ++++++++++++-- emacs-private.el.gpg | Bin 1030 -> 1073 bytes 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 11dc6da..5421d81 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1251,7 +1251,6 @@ of src_shell{getconf "PATH"}. See [[elisp:(describe-variable #+end_src ** Git *** Magit - #+BEGIN_SRC emacs-lisp (use-package magit :ensure t @@ -1297,6 +1296,18 @@ Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitf :ensure t :hook (magit-mode . turn-on-magit-gitflow)) #+end_src +*** git-identity +Found it in this [[https://www.manueluberti.eu/emacs/2020/03/30/lockdown-beam-git-identity/][blog post]] from Manuel Uberti. An easy way to handle multiple git identities. + +#+begin_src emacs-lisp +(use-package git-identity + :ensure t + :custom + (git-identity-verify t) + (git-identity-list private/git-identity-list) + :config (git-identity-magit-mode 1) + :bind (:map magit-status-mode-map ("I" . git-identity-info))) +#+end_src *** diff-hl Indicates changed lines in the left fringe. The Hydra can be used to navigate and revert hunks directly from the buffer. Use =g= to open @@ -1353,7 +1364,6 @@ some safe local variable values. (add-to-list 'safe-local-variable-values '(git-auto-commit-mode . t))) #+end_src - ** Projectile #+BEGIN_SRC emacs-lisp diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 6b46930..b997400 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 3afae2ba4fea7ba9998f9107196b4d1613485f4c Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 9 Apr 2020 16:38:34 +0200 Subject: Add some bibtex settings --- emacs-init.org | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 5421d81..4ed3f35 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2197,17 +2197,34 @@ A small function to toggle the encryption state of the current entry. (org-encrypt-entry)))))) (define-key fpi/toggle-map "e" #'fpi/org-toggle-crypt-entry)) #+end_src -*** org-ref +*** Reference management +**** Bibtex +#+begin_src emacs-lisp +(use-package bibtex + :custom + (bibtex-autokey-titlewords 3) + (bibtex-autokey-titlewords-stretch 1) + (bibtex-autokey-titleword-length 5) + :config + (bibtex-set-dialect 'BibTeX)) + +(setq bibtex-completion-bibliography "~/git/projects/zettel/Lit/bib.bib") +(setq bibtex-completion-notes-path "~/git/projects/zettel/Lit") +(setq bibtex-completion-notes-extension ".org") + +#+end_src +**** org-ref #+begin_src emacs-lisp (use-package org-ref :ensure t :custom - (org-ref-bibliography-notes "~/git/projects/personal/bib.org") + (org-ref-bibliography-notes nil) + (org-ref-notes-function 'org-ref-notes-function-many-files) + (org-ref-notes-directory "~/git/projects/zettel/Lit") (org-ref-default-bibliography '("~/git/projects/personal/bib.bib")) - (org-ref-pdf-directory "~/git/projects/personal/Lit/") - :config - (bibtex-set-dialect 'BibTeX)) + (org-ref-pdf-directory "~/git/projects/personal/Lit/")) #+end_src +***** Capturing entries I store my bibtex references in an org file together with my notes. In addition to saving the meta information in properties using the same functions as =doi-utils-doi-to-org-bibtex=, I also store them a second -- cgit v1.2.3 From bd99576d739fc2965abc3d7c6125d5e0a64d5236 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:15:19 +0200 Subject: Change default font size --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4ed3f35..b7d2f47 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -320,7 +320,8 @@ The above macro can be used like this. :foreground ,bg-white) (:family ,sans-mono-font :background ,bg-white - :foreground ,bg-dark)) + :foreground ,bg-dark + :height 75)) (variable-pitch (:family ,sans-font) (:family ,et-font -- cgit v1.2.3 From 175361abefd56025bf8e6b4eec10424838b5c5d4 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:16:09 +0200 Subject: Add basic org mode prettify symbols --- emacs-init.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index b7d2f47..11dfd82 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1930,6 +1930,22 @@ Use imagemagick and standalone class for latex preview. #+begin_src emacs-lisp (use-package ol-bbdb) #+end_src +*** prettify symbols +Set some prettify symbols for org mode. +#+begin_src emacs-lisp +(defun fpi/add-org-prettify-symbols () + "Beautify Org Checkbox Symbol" + (setq prettify-symbols-alist + (append prettify-symbols-alist + '(("#+BEGIN_SRC" . ?») + ("#+END_SRC" . ?«) + ("#+begin_src" . ?») + ("#+end_src" . ?«) + ("[ ]" . ?☐) + ("[X]" . ?☑ ) + ("[-]" . ?❍ ))))) +(add-hook 'org-mode-hook 'fpi/add-org-prettify-symbols) +#+end_src *** org-roam #+begin_src emacs-lisp (use-package org-roam -- cgit v1.2.3 From 6f0bcb50ae1e022651f909b758a1c26c0ad4feda Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:36:19 +0200 Subject: Setup fancy imap mail splitting --- emacs-private.el.gpg | Bin 1030 -> 1043 bytes gnus.org | 25 ++++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 6b46930..4b638e1 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ diff --git a/gnus.org b/gnus.org index d799395..e50097a 100644 --- a/gnus.org +++ b/gnus.org @@ -14,11 +14,19 @@ Load private settings #+begin_src emacs-lisp ;; (add-to-list 'gnus-secondary-select-methods (setq gnus-select-method - `(nnimap ,private/imap-name - (nnimap-address ,private/imap-address) - (nnimap-server-port 993) - (nnimap-stream ssl) - (nnir-search-engine imap))) + `(nnimap ,private/imap-name + (nnimap-address ,private/imap-address) + (nnimap-server-port 993) + (nnimap-stream ssl) + (nnir-search-engine imap) + (nnimap-inbox "INBOX") + (nnimap-split-methods 'nnimap-split-fancy) + (nnimap-split-fancy + (| (: nnmail-split-fancy-with-parent) + ,@private/imap-split-fancy + "INBOX" + )) + )) #+end_src Sort by newest first #+begin_src emacs-lisp @@ -36,6 +44,13 @@ Sending mail smtpmail-smtp-service 587 starttls-use-gnutls t) #+end_src +Setup for fancy mail splitting. Also see the parameters in ~gnus-select-method~. +#+begin_src emacs-lisp +(setq nnmail-split-methods 'nnimap-split-fancy) + +(setq nnmail-cache-accepted-message-ids t) +(setq nnmail-message-id-cache-length 10000) +#+end_src Load only groups with level < 2 for faster startup. #+begin_src emacs-lisp -- cgit v1.2.3 From d36b31f33949e6d02e5f2514d74168cbfe0ff636 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:36:48 +0200 Subject: Add local nntp server I use pnntprss to convert rss and atom feeds to nntp --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index e50097a..91ff202 100644 --- a/gnus.org +++ b/gnus.org @@ -28,6 +28,10 @@ Load private settings )) )) #+end_src +Add local nntp server +#+begin_src emacs-lisp +(add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) +#+end_src Sort by newest first #+begin_src emacs-lisp (setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) -- cgit v1.2.3 From 500385ad9ad3bdee632b93f64b4f5b549bc25875 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:37:52 +0200 Subject: Enable message delaying --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index 91ff202..8db3b08 100644 --- a/gnus.org +++ b/gnus.org @@ -73,6 +73,10 @@ Disable indenting a topic. I always do it by accident. #+begin_src emacs-lisp (define-key gnus-topic-mode-map (kbd "") nil) #+end_src +Enable message delaying (scheduling) +#+begin_src emacs-lisp +(gnus-delay-initialize) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 19fdb00168cc495b25a685d4ea8c6005a18dd2e5 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:38:09 +0200 Subject: Verify signed mail signatures and display results --- gnus.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnus.org b/gnus.org index 8db3b08..ce6c357 100644 --- a/gnus.org +++ b/gnus.org @@ -77,6 +77,14 @@ Enable message delaying (scheduling) #+begin_src emacs-lisp (gnus-delay-initialize) #+end_src +Verify mail signatures with known protocols. +#+begin_src emacs-lisp +(setq mm-verify-option 'known) +#+end_src +Show buttons for result of signature verification & for multipart mails. To show the message fully buttonized use =K b= in the summary buffer. +#+begin_src emacs-lisp +(setq gnus-buttonized-mime-types '("multipart/signed" "multipart/alternative")) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 97050ca686a4b0a623e0a1a33f40602e659c61c7 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:41:06 +0200 Subject: Enable use of bbdb mail-alias in message-mode --- gnus.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.org b/gnus.org index ce6c357..4ae2e23 100644 --- a/gnus.org +++ b/gnus.org @@ -85,6 +85,11 @@ Show buttons for result of signature verification & for multipart mails. To show #+begin_src emacs-lisp (setq gnus-buttonized-mime-types '("multipart/signed" "multipart/alternative")) #+end_src +Enable =mail-aliases= and create aliases for all mail adresses if an entry has multiple. +#+begin_src emacs-lisp +(add-hook 'message-setup-hook 'bbdb-mail-aliases) +(setq bbdb-mail-alias 'all) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 60efcd27d8ab30778bc05ea84daf6f3564fc120a Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:41:29 +0200 Subject: Dont fetch large attachments before text --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index 4ae2e23..4d8d75c 100644 --- a/gnus.org +++ b/gnus.org @@ -90,6 +90,10 @@ Enable =mail-aliases= and create aliases for all mail adresses if an entry has m (add-hook 'message-setup-hook 'bbdb-mail-aliases) (setq bbdb-mail-alias 'all) #+end_src +Don't fetch attachments before showing the message text to avoid long load times with big attachments. +#+begin_src emacs-lisp +(setq nnimap-fetch-partial-articles "text/") +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From dfe5a0cc71cb8c14aee7003423a53a1f49615f19 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:41:46 +0200 Subject: New handlers to fetch level 4 and 5 news --- gnus.org | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index 4d8d75c..39623e2 100644 --- a/gnus.org +++ b/gnus.org @@ -164,11 +164,16 @@ Background fetching for gnus. See the manual and [[https://www.emacswiki.org/ema (gnus-demon-scan-news-level 2 nil)) (defun gnus-demon-scan-news-3 () (gnus-demon-scan-news-level 3 t)) +(defun gnus-demon-scan-news-4 () + (gnus-demon-scan-news-level 4 t)) +(defun gnus-demon-scan-news-5 () + (gnus-demon-scan-news-level 5 t)) (setq gnus-demon-timestep 10) (gnus-demon-add-handler 'gnus-demon-scan-news-2 3 nil) -(gnus-demon-add-handler 'gnus-demon-scan-news-3 360 nil) -(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 1) +(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 t) +(gnus-demon-add-handler 'gnus-demon-scan-news-4 130 1) +(gnus-demon-add-handler 'gnus-demon-scan-news-5 140 1) #+end_src ** Modeline indicator From the [[https://www.emacswiki.org/emacs/GnusNotify][emacswiki Gnus Notify]]. -- cgit v1.2.3 From a650dbf28fb1f624466641e92107edec3ea0c52d Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:34:53 +0200 Subject: Use windows compatible file names --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index 39623e2..907136e 100644 --- a/gnus.org +++ b/gnus.org @@ -128,6 +128,10 @@ Scoring List for Groups with various From Senders: (gnus-low-score-mark) (gnus-catchup-mark (from -1) (subject -1))) #+end_example +To ensure filenames compatible with Windows and stuff: +#+begin_src emacs-lisp +(setq nnheader-file-name-translation-alist '((?: . ?_) (?[ . ?_) (?] . ?_))) +#+end_src ** Window Layout See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 2148c0f243f9ebbeef41e171e8aea7e7e2d341e6 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:35:42 +0200 Subject: Update adaptive scoring & introduce score decaying --- gnus.org | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/gnus.org b/gnus.org index 907136e..b3f7327 100644 --- a/gnus.org +++ b/gnus.org @@ -95,7 +95,7 @@ Don't fetch attachments before showing the message text to avoid long load times (setq nnimap-fetch-partial-articles "text/") #+end_src ** Adaptive scoring -See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. +See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) (setq gnus-adaptive-word-length-limit 5) @@ -103,16 +103,22 @@ See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. (setq gnus-summary-mark-below -300) (setq gnus-default-adaptive-score-alist '((gnus-unread-mark) - (gnus-ticked-mark) - (gnus-dormant-mark) - (gnus-del-mark (subject -1)) - (gnus-read-mark (subject 2)) - (gnus-expirable-mark (subject -1)) - (gnus-killed-mark (subject -3)) - (gnus-kill-file-mark) - (gnus-ancient-mark) - (gnus-low-score-mark) - (gnus-catchup-mark (subject -1)))) + (gnus-ticked-mark) + (gnus-dormant-mark) + (gnus-del-mark (subject -50)) + (gnus-read-mark (from 5) (subject 100)) + (gnus-expirable-mark) + (gnus-killed-mark (subject -300)) + (gnus-kill-file-mark) + (gnus-ancient-mark) + (gnus-low-score-mark) + (gnus-catchup-mark (subject -40)))) +(setq gnus-default-adaptive-word-score-alist + `((,gnus-read-mark . 5) + (,gnus-catchup-mark . -5) + (,gnus-killed-mark . -15) + (,gnus-del-mark . -10))) +(setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) #+end_src Scoring List for Groups with various From Senders: #+begin_example @@ -132,6 +138,13 @@ To ensure filenames compatible with Windows and stuff: #+begin_src emacs-lisp (setq nnheader-file-name-translation-alist '((?: . ?_) (?[ . ?_) (?] . ?_))) #+end_src + +Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= score files and decay each scoring rule by 1 point or 1%, whichever is larger. +#+begin_src emacs-lisp +(setq gnus-decay-scores "\\.ADAPT\\'" + gnus-score-decay-constant 1 + gnus-score-decay-scale 0.01) +#+end_src ** Window Layout See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 62d7f1af2da4d0e961221756a2d768e336390546 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:36:09 +0200 Subject: Split imap server definition --- gnus.org | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/gnus.org b/gnus.org index b3f7327..e0c0a8a 100644 --- a/gnus.org +++ b/gnus.org @@ -11,22 +11,42 @@ Load private settings (load secret-file) #+end_src * Config -#+begin_src emacs-lisp -;; (add-to-list 'gnus-secondary-select-methods +I use =imap= as my primary server. Setup some generic options: +#+begin_src emacs-lisp :noweb-ref imap :tangle no +nnimap ,private/imap-name +(nnimap-address ,private/imap-address) +(nnimap-server-port 993) +(nnimap-stream ssl) +(nnir-search-engine imap) +#+end_src +Only fetch partial articles. This saves time on opening messages with +large attachments. Load any text based parts and also load any +signature if the message is signed. Unfortunately to correctly verify +the signature the full message needs to be loaded, which is why I +disabled partial fetching for now. +#+begin_src emacs-lisp :noweb-ref imap :tangle no +;; (nnimap-fetch-partial-articles "\\(text/\\|signature\\)") +#+end_src +Set my default inbox folder. This is the folder mail is split out of. +#+begin_src emacs-lisp :noweb-ref imap :tangle no +(nnimap-inbox "INBOX") +#+end_src +Use fancy splitting and setup splitting rules. See [[info:gnus#Fancy Mail Splitting][info:gnus#Fancy Mail Splitting]] for details. +#+begin_src emacs-lisp :noweb-ref imap :tangle no +(nnimap-split-methods nnimap-split-fancy) +(nnimap-split-fancy + (| (: nnmail-split-fancy-with-parent) + ,@private/imap-split-fancy + "INBOX" + )) +#+end_src + +Noweb the primary server settings together. +#+begin_src emacs-lisp :noweb yes (setq gnus-select-method - `(nnimap ,private/imap-name - (nnimap-address ,private/imap-address) - (nnimap-server-port 993) - (nnimap-stream ssl) - (nnir-search-engine imap) - (nnimap-inbox "INBOX") - (nnimap-split-methods 'nnimap-split-fancy) - (nnimap-split-fancy - (| (: nnmail-split-fancy-with-parent) - ,@private/imap-split-fancy - "INBOX" - )) - )) + `( + <> + )) #+end_src Add local nntp server #+begin_src emacs-lisp -- cgit v1.2.3 From 2befd2e7229e9a960bcb904a53c592166cfe0f89 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:36:41 +0200 Subject: Better thread display & topic fixes --- gnus.org | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index e0c0a8a..315e16c 100644 --- a/gnus.org +++ b/gnus.org @@ -57,7 +57,35 @@ Sort by newest first (setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) gnus-thread-sort-functions '((not gnus-thread-sort-by-date))) #+end_src - +Gathering loose threads, whose parent is currently not displayed. I find the default ~'adopt~ to be too confusing. +#+begin_src emacs-lisp +(setq gnus-summary-make-false-root 'dummy) +(setq gnus-summary-dummy-line-format " %(: :%) %S +") +(setq gnus-summary-make-false-root-always t) +#+end_src +Also try to connect threads by guessing which articles are missing +#+begin_src emacs-lisp +(setq gnus-fetch-old-headers nil) +(setq gnus-build-sparse-threads 'more) +#+end_src +Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][emacswiki/GnusFormatting)]]. +#+begin_src emacs-lisp +(setq + gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B%s%)\n" + gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M")) + gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references + gnus-sum-thread-tree-false-root "" + gnus-sum-thread-tree-indent " " + gnus-sum-thread-tree-leaf-with-other "├► " + gnus-sum-thread-tree-root "" + gnus-sum-thread-tree-single-leaf "╰► " + gnus-sum-thread-tree-vertical "│") +#+end_src +Unicode reply symbol +#+begin_src emacs-lisp +(setq gnus-summary-to-prefix "→ ") +#+end_src Sending mail #+begin_src emacs-lisp :tangle no (setq message-send-mail-function 'smtpmail-send-it @@ -91,7 +119,33 @@ Save sent mails in my imap folder #+end_src Disable indenting a topic. I always do it by accident. #+begin_src emacs-lisp -(define-key gnus-topic-mode-map (kbd "") nil) +(use-package gnus-topic + :config + (defun fpi/gnus-topic-toggle-topic () + "Toggle display of the topic." + (interactive) + (when (gnus-group-topic-p) + (if (equal 'visible + (nth 1 (cadr (gnus-topic-find-topology (gnus-current-topic))))) + (gnus-topic-hide-topic) + (gnus-topic-show-topic)))) + (define-key gnus-topic-mode-map (kbd "") 'fpi/gnus-topic-toggle-topic) + (define-key gnus-topic-mode-map (kbd "TAB") 'fpi/gnus-topic-toggle-topic)) +#+end_src +Function to toggle display of group levels in the group buffer. +#+begin_src emacs-lisp +(defvar gnus-group-line-format-wo-levels nil) +(defun fpi/gnus-group-toggle-levels () + (interactive) + (if gnus-group-line-format-wo-levels + (setq gnus-group-line-format gnus-group-line-format-wo-levels + gnus-group-line-format-wo-levels nil) + (setq gnus-group-line-format-wo-levels gnus-group-line-format + gnus-group-line-format (concat "[%L] " gnus-group-line-format))) + ;; Hack to update display + (gnus-group-get-new-news 0)) +(define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) +#+end_src #+end_src Enable message delaying (scheduling) #+begin_src emacs-lisp -- cgit v1.2.3 From 58b750c90380595ca848c34d3d0e1c9ce63eb329 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:36:58 +0200 Subject: Add icalendar support --- gnus.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnus.org b/gnus.org index 315e16c..94227da 100644 --- a/gnus.org +++ b/gnus.org @@ -146,6 +146,15 @@ Function to toggle display of group levels in the group buffer. (gnus-group-get-new-news 0)) (define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) #+end_src +Enable responding to meeting invites. +#+begin_src emacs-lisp +(use-package gnus-icalendar + :config + (gnus-icalendar-setup) + (setq gnus-icalendar-org-capture-file "~/win/Documents/sync/appointments.org") + (setq gnus-icalendar-org-capture-headline '("Calendar")) ;;make sure to create Calendar heading first + (gnus-icalendar-org-setup) + ) #+end_src Enable message delaying (scheduling) #+begin_src emacs-lisp -- cgit v1.2.3 From 2857ea9e67b66e5479100266c754c6e557fce314 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:37:17 +0200 Subject: Fixes --- gnus.org | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gnus.org b/gnus.org index 94227da..7f26fbd 100644 --- a/gnus.org +++ b/gnus.org @@ -175,7 +175,11 @@ Enable =mail-aliases= and create aliases for all mail adresses if an entry has m #+end_src Don't fetch attachments before showing the message text to avoid long load times with big attachments. #+begin_src emacs-lisp -(setq nnimap-fetch-partial-articles "text/") +(setq nnimap-fetch-partial-articles "\\(text/\\|signature\\)") +#+end_src +Workaround for bug with ~gnus-cloud-method~ and ~custom-variable-recalc-variable~ upon reloading the =spacemacs-*= theme. +#+begin_src emacs-lisp +(setq server "nnimap:imsmail") #+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. @@ -235,8 +239,8 @@ See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+end_src ** Format Summary buffer lines #+begin_src emacs-lisp -(setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s -") +;; (setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s +;; ") #+end_src ** nnreddit #+begin_src emacs-lisp -- cgit v1.2.3 From 2397c8941dee65403bd826f4d443f8dcdff33b51 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 8 Jun 2020 19:57:11 +0200 Subject: Set a default ttl and decrease max ttl --- gpg-agent.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gpg-agent.org b/gpg-agent.org index 02e2d55..75493fa 100644 --- a/gpg-agent.org +++ b/gpg-agent.org @@ -7,11 +7,13 @@ ln -siv $(pwd)/tangle/sshcontrol ~/.gnupg/sshcontrol #+BEGIN_SRC conf -max-cache-ttl 34560000 +default-cache-ttl 10800 +max-cache-ttl 172800 #+END_SRC * ssh password caching #+BEGIN_SRC conf -max-cache-ttl-ssh 34560000 +default-cache-ttl-ssh 10800 +max-cache-ttl-ssh 172800 #+END_SRC * Emacs pinentry #+BEGIN_SRC conf -- cgit v1.2.3 From 2c63cd040851ede402a26fb55837fd89789f346b Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:17:37 +0200 Subject: Show .cir mail attachments inline with spice-mode --- emacs-init.org | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 11dfd82..5296c67 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3043,7 +3043,18 @@ I use =msmtp= to send mail. (mail-specify-envelope-from t) (mail-envelope-from 'header)) #+end_src - +*** MIME +#+begin_src emacs-lisp +(use-package mm-decode + :config + (use-package spice-mode + :ensure t) + (defun mm-display-spice-inline (handle) + "Show an spice mode text from HANDLE inline." + (mm-display-inline-fontify handle 'spice-mode)) + (add-to-list 'mm-inline-media-tests '("application/x-wine-extension-cir" mm-display-spice-inline identity)) + (add-to-list 'mm-inlined-types "application/x-wine-extension-cir")) +#+end_src *** MUA/Notmuch After using =mu4e= as my mail user agent for a while I switched to -- cgit v1.2.3 From c4211fe5ce8c398c9f6df2a9c1af99d9c4260061 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:28:11 +0200 Subject: Display bbdb window horizontally --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 5296c67..d480f21 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3165,6 +3165,7 @@ For now I use this bad code. (bbdb-initialize 'gnus 'message) (bbdb-mua-auto-update-init 'gnus 'message) +(setq bbdb-mua-pop-up 'horiz) ;; size of the bbdb popup (setq bbdb-pop-up-window-size 0.15) (setq bbdb-mua-pop-up-window-size 0.15) -- cgit v1.2.3 From 3af5ab4866bbd8baed8f8b8d4bb00593b79d1639 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:28:38 +0200 Subject: Smarter refile target selection --- emacs-init.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index d480f21..091570e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1640,7 +1640,9 @@ Hansen's]] configs. - Refile Targets :: Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level - downwards. + downwards. Also include the current file's headings as a refile + targets up to a deep level, all agenda files up to a small level and + all open org files up to an even smaller level. - Drawer for Notes :: Notes go into the =NOTES= drawer. Clocking times should stay separate in the =LOGBOOK= drawer. - Track state changes :: Notes when an entry is switched to done when @@ -1696,6 +1698,9 @@ Hansen's]] configs. ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) (org-ellipsis " ") (org-refile-use-outline-path 'file) + (org-refile-targets '((nil :maxlevel . 8) + (org-agenda-files :maxlevel . 3) + (org-buffer-list :maxlevel . 2))) (org-outline-path-complete-in-steps nil) (org-log-state-notes-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") -- cgit v1.2.3 From ce2e25063b3bae217178c38ba65a9095bfcdaa34 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 3 Jun 2020 19:20:55 +0200 Subject: Set better colors for scheduled entries in the agenda --- emacs-init.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 091570e..64cc3d7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -291,6 +291,9 @@ The above macro can be used like this. (shade-white "#efeae9") (fg-light "#655370") (dark-cyan "#008b8b") + (light-green "#4f774f") ;;#3f773f + (dark-green "#1c661c") + (dark-green2 "#002000") (region-dark "#2d2e2e") (region "#39393d") (slate "#8FA1B3") @@ -597,16 +600,16 @@ The above macro can be used like this. nil) (org-scheduled (:foreground ,gray) - nil) + (:foreground ,light-green)) (org-upcoming-deadline (:foreground ,keyword) nil) (org-scheduled-today (:foreground ,fg-white) - nil) + (:foreground ,dark-green)) (org-scheduled-previously (:foreground ,slate) - nil) + (:foreground ,dark-green2)) (org-agenda-done (:inherit nil :foreground ,doc) -- cgit v1.2.3 From 006863bebd5b0b951ec804a308450bcd17db47ab Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 3 Jun 2020 19:21:42 +0200 Subject: Disable ido-completing-read --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 64cc3d7..37ae657 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1022,7 +1022,7 @@ are for now mostly copied from [[https://gitlab.com/protesilaos/dotemacs/][Prote (setq-local max-mini-window-height 1)))) #+END_SRC -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (use-package ido-completing-read+ :ensure t :after ido -- cgit v1.2.3 From c68cee618df34c4ca31c682a9d5d7ecd37e49688 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 3 Jun 2020 19:22:00 +0200 Subject: Set emacs to ask for gpg passphrases in the minibuffer --- emacs-init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 37ae657..b636c0f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1501,6 +1501,17 @@ over =windmove=, as it does not interfere with org keybindings. ("C-c " . winner-hydra/winner-undo) ("C-c " . winner-hydra/winner-redo))) #+end_src +** File encryption +=epa= handles en-/decryption with =gnupg=. Setting ~'loopback~ pinentry mode will ask for the key passphrase in the emacs minibuffer. For this the =pinentry= package is needed, as well as setting =allow-emacs-pinentry= in the =gnupg= configuration. + +#+begin_src emacs-lisp +(use-package epa + :custom (epa-pinentry-mode 'loopback)) +(use-package pinentry + :ensure t + :config (pinentry-start) + :after epa) +#+end_src * Applications and utilities ** Calendar Some basic calendar options for date format und location to provide -- cgit v1.2.3 From a02db53860b418fe56cc403bf2d116bb634d007a Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 3 Jun 2020 19:22:25 +0200 Subject: Customize org column view layout --- emacs-init.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index b636c0f..5741649 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1912,6 +1912,11 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** Column view +#+begin_src emacs-lisp +(setq org-columns-default-format + "%50ITEM(Task) %5Effort(Effort){:} %5CLOCKSUM %3PRIORITY %20DEADLINE %20SCHEDULED %20TIMESTAMP %TODO %CATEGORY %TAGS") +#+end_src *** org-caldav #+begin_src emacs-lisp (use-package org-caldav -- cgit v1.2.3 From b6762922776f998cd9ddd662284c819c2cdb865c Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 3 Jun 2020 19:22:46 +0200 Subject: Add org-roam-bibtex package --- emacs-init.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 5741649..bbe46d2 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1986,6 +1986,14 @@ Set some prettify symbols for org mode. :map org-mode-map (("C-c n i" . org-roam-insert)))) #+end_src +**** org-roam-bibtex +#+begin_src emacs-lisp :tangle no +(use-package org-roam-bibtex + :ensure t + :hook (org-roam-mode . org-roam-bibtex-mode) + :bind (:map org-mode-map + (("C-c n a" . orb-note-actions)))) +#+end_src *** Org-edna =Org-edna= is a great tool to manage =TODO= dependencies. I mainly use it to mark tasks as =NEXT= after switching another task to =DONE=. The -- cgit v1.2.3 From c611cd53bdf6a03adc3fb79bf1ef516c344a89bf Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 16:08:51 +0200 Subject: Fix git-identity settings --- emacs-init.org | 3 ++- emacs-private.el.gpg | Bin 1085 -> 1086 bytes 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index bbe46d2..8ca8c20 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1309,8 +1309,9 @@ Found it in this [[https://www.manueluberti.eu/emacs/2020/03/30/lockdown-beam-gi :custom (git-identity-verify t) (git-identity-list private/git-identity-list) - :config (git-identity-magit-mode 1) :bind (:map magit-status-mode-map ("I" . git-identity-info))) +(use-package git-identity-magit + :config (git-identity-magit-mode 1)) #+end_src *** diff-hl Indicates changed lines in the left fringe. The Hydra can be used to diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index a94dda3..6100326 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 23228408a615cfa2f65f6bfd6d28d33231707b94 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 16:09:25 +0200 Subject: Switch from obsolete org-pdfview to org-pdftools --- emacs-init.org | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8ca8c20..416a5ef 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1803,8 +1803,9 @@ Switch projects and subprojects from NEXT back to TODO" :custom (org-export-with-broken-links 'match) (org-export-backends '(ascii beamer html icalendar latex man md odt org groff koma-letter))) -(use-package org-pdfview -:ensure t) +(use-package org-pdftools + :ensure 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)) (use-package org-clock -- cgit v1.2.3 From 9e835276715b46099f08c4e7e8981bef0deff004 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 6 Jun 2020 15:38:19 +0200 Subject: Add support for ansi-colors in compilation buffer output --- emacs-init.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 416a5ef..6f114fd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3217,6 +3217,19 @@ For now I use this bad code. (lambda () (define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field))) #+end_src +** Compile +Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]]. +#+begin_src emacs-lisp +(use-package compile + :config + (require 'ansi-color) + (defun endless/colorize-compilation () + "Colorize from `compilation-filter-start' to `point'." + (let ((inhibit-read-only t)) + (ansi-color-apply-on-region + compilation-filter-start (point)))) + :hook (compilation-filter . endless/colorize-compilation)) +#+END_src ** Context aware hydra :PROPERTIES: :ID: 22750e48-aaee-4f60-bdce-1d511ebe3375 -- cgit v1.2.3 From 4b7751438351671a99cf698f685ac55acd8d86a1 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 7 Jun 2020 14:17:08 +0200 Subject: Add agenda view for roam-directory & current directory Ideally the view for current-directory should be non-sticky.. --- emacs-init.org | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 6f114fd..9b8802d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1821,11 +1821,13 @@ Switch projects and subprojects from NEXT back to TODO" (org-src-window-setup 'current-window) (org-src-fontify-natively t) (org-src-tab-acts-natively t) - (org-edit-src-content-indentation 0) -) + (org-edit-src-content-indentation 0)) +(defun fpi/collect-org-directories-recursively (dir) + "Return list of all directories which contain .org files of DIR and its subdirectories" + (delete-dups (mapcar 'file-name-directory (directory-files-recursively dir "\.org$")))) (use-package org-agenda :custom - (org-agenda-files (quote ("~/s/s.org" "~/sync" "~/.emacs.d/gcal.org" "~/.emacs.d/tr.org" "~/n.org"))) + (org-agenda-files (fpi/collect-org-directories-recursively "~/sync")) (org-deadline-warning-days 14) (org-agenda-start-on-weekday nil) (org-agenda-span 14) @@ -1847,7 +1849,7 @@ Switch projects and subprojects from NEXT back to TODO" ;; See emacs.christianbaeuerlein.com/my-org-config.html (org-agenda-block-separator 9472) (org-agenda-custom-commands - '(("n" "Agenda and all TODOs" + `(("n" "Agenda and all TODOs" ((todo "INPROGRESS" ((org-agenda-overriding-header "Inprogress Tasks"))) (agenda) @@ -1874,7 +1876,15 @@ Switch projects and subprojects from NEXT back to TODO" ((org-agenda-overriding-header "Things to Watch") (org-agenda-skip-function 'bh/skip-project-tasks) (org-agenda-sorting-strategy - '(todo-state-down effort-up)))))))) + '(todo-state-down effort-up)))))) + ("z" "Todos in org-roam-dir" + ((alltodo "" + ((org-agenda-files (fpi/collect-org-directories-recursively org-roam-directory)))))) + ("c" "Agenda and all todos in current directory" + ((agenda "" + ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))) + (alltodo "" + ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))))))) ) (use-package ob-core :custom -- cgit v1.2.3 From 58b13b80f03ceedd0d809155b4935466940375eb Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:01:10 +0200 Subject: Add function to scale height of default face --- emacs-init.org | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 9b8802d..4fa0ecd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -830,6 +830,24 @@ Finally load the theme. #+begin_src emacs-lisp (load-theme 'spacemacs-light t) #+end_src +*** Scaling the height of the =default= face. +When switching between monitors with different resolution, scaling the +=default= face can be used to in-/decreases the size of text and UI elements +(modeline, …) to a more readable size. +#+begin_src emacs-lisp +(defun fpi/scale-default-face (&optional arg) + "Increase height of face default." + (interactive "P") + (let* ((height (face-attribute 'default :height)) + (scale (if arg -10 10)) + (new (+ height scale))) + (set-face-attribute 'default nil :height new) + (message "Default height: %s" new))) +#+end_src +#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings +(define-key 'fpi-map (kbd "+") 'fpi/scale-default-face) +(define-key 'fpi-map (kbd "-") (lambda () (interactive) (fpi/scale-default-face t))) +#+end_src ** User info Set ~user-full-name~ and ~user-mail-address~. These are set in [[file:emacs-private.el.gpg::1][emacs-private.el.gpg]]. @@ -930,7 +948,7 @@ This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizard (define-key fpi/toggle-map "W" #'whitespace-toggle-options) #+END_SRC *** fpi-map -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :noweb yes (define-prefix-command 'fpi-map) (unbind-key (kbd "C-z")) (global-set-key (kbd "C-z") 'fpi-map) @@ -946,6 +964,8 @@ This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizard (define-key fpi-map (kbd "t") fpi/toggle-map) (define-key fpi-map (kbd "n") 'sauron-toggle-hide-show) (define-key fpi-map (kbd "j") (lambda () (interactive) (find-file org-journal-file))) + +<> #+END_SRC ** Base commands (simple.el) #+begin_src emacs-lisp -- cgit v1.2.3 From 69fb885bf37131f18f1601e8cc9715d1663d531c Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:01:58 +0200 Subject: Add function to join adjacent clock lines if possible --- emacs-init.org | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4fa0ecd..37abc99 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1963,7 +1963,37 @@ Use imagemagick and standalone class for latex preview. (org-caldav-exclude-tags '(nocal)) ) #+end_src -*** org-clock-convenience +*** Clocking +**** Combine adjacent clock lines +#+begin_src emacs-lisp +(defun fpi/org-clock-join-last-clock () + "Join current clock with last one if start/end point match." + (save-mark-and-excursion + (beginning-of-line) + (let* ((eol (save-excursion (end-of-line) (point))) + (boi (progn (re-search-forward "\\[" eol t) (backward-char) (point))) + (eoi (progn (re-search-forward "\\]" eol t) (point))) + (i (buffer-substring-no-properties boi eoi)) ;; last clock-in-time + (boc (progn (re-search-forward "\\[" eol t) (backward-char) (point))) + (eoc (progn (re-search-forward "\\]" eol t) (point))) + (c (buffer-substring-no-properties boc eoc))) ;; last clock-out-time (equals org-clock-out-time if last clock) + (next-line) + (end-of-line) + (let* ((bol (save-excursion (beginning-of-line) (point))) + (eoo (progn (re-search-backward "\\]" bol t) (forward-char) (point))) + (boo (progn (re-search-backward "\\[" bol t) (point))) + (o (buffer-substring-no-properties boo eoo))) ;; last-last clock-out-time + (when (equal i o) + (delete-region boo eoo) + ;; (insert (format-time-string (org-time-stamp-format t t) org-clock-out-time)) + (insert c) + (org-evaluate-time-range) + (previous-line) + (delete-region (save-excursion (beginning-of-line) (backward-char) (point)) eol) + (message (format "Joined nearby clocks at %s" i))))))) +(add-hook 'org-clock-out-hook 'fpi/org-clock-join-last-clock) +#+end_src +**** org-clock-convenience #+begin_src emacs-lisp (use-package org-clock-convenience :ensure t -- cgit v1.2.3 From 825b390765a5203892003dda8f0b1a9462e2fda0 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:02:22 +0200 Subject: Add reply to mail and checkout capture templates --- emacs-init.org | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 37abc99..70e9d89 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2199,6 +2199,26 @@ Templates entry (id "efc97963-b714-4020-94b6-c23ad2a286ee") (function fpi/add-org-from-doi)) + ("r" "Reply" + entry + (file "~/sync/refile.org") + "* REPLY: %:from: %:subject +:PROPERTIES: +:CREATED: %U +:SOURCE: %a +:END: +%? +" + ) + ("c" "Checkout") + ("cr" ".. & read" + entry + (file "~/sync/refile.org") + "* TODO %a :READLIST: +:PROPERTIES: +:CREATED: %U +:END: +%?") ;; ("a" "Appointment" entry (file "~/sync/a.org") ;; "* %i%?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%^t") ;; ("t" "Soonish task" entry (file "~/sync/refile.org") @@ -2242,7 +2262,10 @@ Templates ;; :empty-lines 1 ;; :immediate-finish t) ) - ))) + ) + (org-capture-templates-contexts + '(("r" ((in-mode . "gnus-summary-mode") + (in-mode . "gnus-article-mode"))))))) #+END_SRC Setup for floating capture window. For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]]. #+begin_src emacs-lisp -- cgit v1.2.3 From e638683b4338d3b15346ee45a99fdeeb494dc2bf Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:02:57 +0200 Subject: Reduce noise in my agenda by viewing day only --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 70e9d89..15a65fa 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1850,7 +1850,7 @@ Switch projects and subprojects from NEXT back to TODO" (org-agenda-files (fpi/collect-org-directories-recursively "~/sync")) (org-deadline-warning-days 14) (org-agenda-start-on-weekday nil) - (org-agenda-span 14) + (org-agenda-span 'day) (org-agenda-start-day "+0d") (org-agenda-include-diary nil) (org-agenda-sticky t) -- cgit v1.2.3 From a1e3179d941aa00182f3decfe3fdf7f3172c40d5 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:03:31 +0200 Subject: Add hunspell spellchecker with EN+DE setup Still have to check for hunspell dictionaries with more entries --- emacs-init.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 15a65fa..645d315 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3300,6 +3300,16 @@ For now I use this bad code. (lambda () (define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field))) #+end_src +** Spellcheck +#+begin_src emacs-lisp +(use-package ispell + :config + (setq ispell-program-name "/usr/bin/hunspell") + (setq ispell-dictionary "en_US,de_DE") + (ispell-set-spellchecker-params) + (ispell-hunspell-add-multi-dic "en_US,de_DE") + ) +#+end_src ** Compile Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]]. #+begin_src emacs-lisp -- cgit v1.2.3 From a5a1d90a3763fa43a06c88c80e1b659f317a5b21 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:04:17 +0200 Subject: Make relevant src blocks linkable from readme --- emacs-init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 645d315..2f5e448 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -36,6 +36,7 @@ disable ~buffer-auto-save-file-name~ for the files. 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 (defun fpi/tangle-dotfiles () "If the current file is in '~/.dotfiles' tangle all code blocks." @@ -52,6 +53,7 @@ saved again. The latter part is not directly supported by =org=. ~org-babel-post-tangle-hook~ is executed in the created tangled files 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 (defun save-without-hook () (let ((before-save-hook nil)) -- cgit v1.2.3 From ffb23cc69641171ede39d798032b631e513fd4de Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 12 Jun 2020 15:05:55 +0200 Subject: Update readme to more accurately reflect status quo --- README.org | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/README.org b/README.org index 0020720..34ca2b7 100644 --- a/README.org +++ b/README.org @@ -1,16 +1,22 @@ * My dotfiles -The config files are organized in emacs org files. They are tangled +The config files are organized in [[https://www.gnu.org/software/emacs/][emacs]] [[https://orgmode.org/][org mode]] files. They are tangled and symlinked to the appropriate directories. -[[file:emacs-init.org::*tangle%20dotfiles][A hook]] tangles all files automatically on each save. +[[file:emacs-init.org::tangle-hook][A hook]] tangles all files automatically on each save. In addition there +are shell scripts that tangle all =.org= files at once. -The symlinks can be created by manually running the appropriate src -block in each configuration file. For an automated solution see below. +The symlinks can be created by manually running the appropriate [[https://orgmode.org/worg/org-contrib/babel/][babel]] +source block in each configuration file or by running the scripts +below. ** Git Setup -Every program's configuration lives in its own branch. All branches -except the ones which end with a plus sign are then merged into -=master=. To keep the git history clean, I use this script: +This repository somewhat abuses git branches. Every program's +configuration lives in its own separate branch. All branches are then +merged into =master= using an [[https://git-scm.com/docs/merge-strategies#Documentation/merge-strategies.txt-octopus][octopus merge]]. To keep the git history +clean I reset =master= for every merge. Here is a small script to do +that and push the changes. I mark branches, which I want to keep local +only, with a trailing =+= and then exclude them with the ~+$~ pattern +in grep. #+begin_src shell :shebang "#!/bin/bash" :tangle tangle/merge.sh git checkout master @@ -20,10 +26,10 @@ git push --force origin master #+end_src ** Updating all tangled files -This script (re-)tangles all =.org= and =.org.gpg= files. Run this in -case the org files were updated outside of your local emacs (e.g. -after pulling from a remote). Make sure to run it from the dotfiles -directory. +This script (re-)tangles all =.org= and =.org.gpg= files in the +current directory. Run this in case the org files were updated outside +of your local emacs (e.g. after pulling from a remote). Make sure to +run it from the dotfiles directory. #+begin_src shell :shebang "#!/bin/bash" :tangle no emacs --batch --eval="\ @@ -32,9 +38,9 @@ emacs --batch --eval="\ (mapc 'org-babel-tangle-file (split-string \"$(ls *.org *.org.gpg)\"))))" #+end_src -The above won't quite work for me as I use ~org-crypt~ in some +The above won't quite work for me as I use [[https://orgmode.org/worg/org-tutorials/encrypting-files.html#org697961a][org-crypt]] in some configuration files and it also needs to be loaded & setup. For -details see [[file:emacs-init.org][emacs-init.org]]. +details see [[file:emacs-init.org::org-crypt-tangle-setup][emacs-init.org]]. #+begin_src shell :shebang "#!/bin/bash" :tangle tangle/tangle.sh emacs --batch --eval="\ @@ -65,7 +71,7 @@ the ~ln -siv~ calls: ~yes | tangle/link.sh~. Make sure to run it from the dotfiles directory. As the symlink shell source blocks are scattered in all configuration -files, all files are collected together using cat and then all blocks +files, all files are collected together using ~cat~ and then all blocks with the correct ~:tangle~ target are tangled. Unfortunately there is no function to directly only tangle blocks with a certain target, so this is not straightforward. @@ -86,8 +92,3 @@ rm $catFile $symlinkFile #+end_src - -* Window manager -I use [[https://github.com/ch11ng/exwm][exwm]] and [[https://awesomewm.org/][awesome]] as my window managers. When doing a lot of -coding and similar stuff I tend to use exwm as I will spend most of my -time in emacs anyway. -- cgit v1.2.3 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(-) 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(-) 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(-) 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(+) 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 ++++++++++++++++++++++++++++++++++----------------------- gnus.org | 2 +- 2 files changed, 63 insertions(+), 44 deletions(-) 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 diff --git a/gnus.org b/gnus.org index 7f26fbd..7d6fe19 100644 --- a/gnus.org +++ b/gnus.org @@ -245,7 +245,7 @@ See [[info:gnus#Window Layout][info:gnus#Window Layout]]. ** nnreddit #+begin_src emacs-lisp (use-package nnreddit - :ensure t) + :straight t) (add-to-list 'gnus-secondary-select-methods '(nnreddit "")) #+end_src ** Demon -- cgit v1.2.3 From 691d1247eef78ff1ef2ebc545977464e131e696b Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 15 Jun 2020 08:13:11 +0200 Subject: Add frozen straight package-versions --- package-versions.el | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 package-versions.el diff --git a/package-versions.el b/package-versions.el new file mode 100644 index 0000000..c3b58b9 --- /dev/null +++ b/package-versions.el @@ -0,0 +1,80 @@ +(("Try" . "8831ded1784df43a2bd56c25ad3d0650cdb9df1d") + ("auctex" . "6abf890a485b2ff734d8f87f38393f9b8f6bbbf6") + ("auth-password-store" . "ff4940c647786914b3cbef69103d96a4ea334111") + ("bbdb" . "45529e315ba861f9df2914f9b88d2f7b991d5595") + ("biblio.el" . "eb9baf1d2bf6a073d24ccb717025baa693e98f3e") + ("cdlatex" . "480387b39f6ddd9cd2a9511ecee064ad8e1dd324") + ("dash.el" . "ea4a4cc7cce7c3b93862a22df8bca8b83052ccbf") + ("deft" . "fca9ea05ef4fdac825e2ad3921baa7042f6b82c8") + ("delight" . "02e73b69708e23053105866a58fe14f75c272dee") + ("diff-hl" . "176f931a9bfc6bc6fc5360c6ed7128ff96b21289") + ("dired-du" . "d6571317673ba44566ba411d26b7af74e3139ff7") + ("dired-hacks" . "f49a8bbf95f70671a74a24f7f4de453b2686be46") + ("dired-sidebar" . "6e569c851418890c21fd37d03a62f85343aa0900") + ("elfeed" . "a2cae98b4f04616c06455b6104d2ca5ff4b86867") + ("elfeed-org" . "77b6bbf222487809813de260447d31c4c59902c9") + ("emacs-async" . "86aef2c38e7d35e8509b7feeee3e989d825eba91") + ("emacs-hide-mode-line" . "88888825b5b27b300683e662fa3be88d954b1cea") + ("emacs-htmlize" . "86f22f211e9230857197c42a9823d3f05381deed") + ("emacs-which-key" . "8b49ae978cceca65967f3544c236f32964ddbed0") + ("emacsmirror-mirror" . "006fbf082e52dd33cb842c9d5fb181de12736142") + ("emacsql" . "a118b6c95af1306f0288a383d274b5dd93efbbda") + ("emacsql-sqlite3" . "1e411fd38a0137553986db209642fe93cae96060") + ("epl" . "78ab7a85c08222cd15582a298a364774e3282ce6") + ("f.el" . "1814209e2ff43cf2e6d38c4cd476218915f550fb") + ("git-auto-commit-mode" . "dd0c2441de0f5ff8c69c8260d9450d0b607e3e55") + ("git-identity.el" . "8471e6f8ef6c502dc999e513b552d6b23974d40d") + ("gnu-elpa-mirror" . "f07e244acca36061cc03c63463246b848748e804") + ("gnuplot" . "f0001c30010b2899e36d7d89046322467e923088") + ("gnuplot-mode" . "601f6392986f0cba332c87678d31ae0d0a496ce7") + ("helm" . "3ff35503a920d8629cf5c9c07647923661f24ba2") + ("helm-bibtex" . "8a0dd9841316793aacddea744d6b8ca4a7857a35") + ("hydra" . "8a9124f80b6919ad5288172b3e9f46c5332763ca") + ("ibuffer-vc" . "1249c1e30cf11badfe032ac3b1058f24ba510ace") + ("key-chord" . "72443e9ff3c4f1c3ccaced3130236801efde3d83") + ("language-detection.el" . "54a6ecf55304fba7d215ef38a4ec96daff2f35a4") + ("ledger-mode" . "f8463744191b4feb9fea54190917663f7ba26102") + ("let-alist" . "ef3c02fa292b6e32769945bbbfb7f2e5ac574b64") + ("magit" . "c9b9afe8b6e92bee763ed1f6843766efaf87094d") + ("magit-gitflow" . "cc41b561ec6eea947fe9a176349fb4f771ed865b") + ("magit-popup" . "b8e886c4f2242d6c58f84d4549af712e86360db1") + ("melpa" . "ee055cc258692a92f727633306adf7df31267479") + ("messages-are-flowing" . "d582a564a63b7b90764ffc5c618bc5300225d0ab") + ("nadvice" . "2dfcf614dc5472fb21e48f93d0ebb4546276377f") + ("notmuch" . "963e363a234f1c8bdf1ae68956f80a2538bee7dc") + ("org" . "a8cc4f72441acd468f400aeb53549735d698f84c") + ("org-bullets" . "767f55feb58b840a5a04eabfc3fbbf0d257c4792") + ("org-caldav" . "8569941a0a5a9393ba51afc8923fd7b77b73fa7a") + ("org-clock-convenience" . "4e522706a90a504c75d377161005f9543575ea02") + ("org-edna" . "8a14af7baadb3e4021d40e2b4ebdcee66dab4783") + ("org-noter" . "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d") + ("org-pdftools" . "8cc15bb8014ed1f047eecc0abd8bf447f86c0505") + ("org-ref" . "9465abc54a296b4b2f745b4bb3a28ec4dad3a0cb") + ("org-reveal" . "84039bb499290926511b04749882ecb5eda45a0c") + ("org-roam" . "87403b330ce713a892e3e35ff4174a8e2727e24d") + ("parsebib" . "3497b6068d78ae15ba1eaf94e4315d18e9ae6b00") + ("pass" . "919d8e3826d556433ab67d4ee21a509d209d1baa") + ("password-store" . "07b169ec32ad6961ed8625a0b932a663abcb01d2") + ("password-store-otp.el" . "04998c8578a060ab4a4e8f46f2ee0aafad4ab4d5") + ("pdf-tools" . "c510442ab89c8a9e9881230eeb364f4663f59e76") + ("peep-dired" . "1d410a4e48db07a942e54d3b83a85c7a7ec0aab3") + ("pinentry" . "cd942f755c38a7ac270ce858bb887ebdd59edd26") + ("pkg-info" . "76ba7415480687d05a4353b27fea2ae02b8d9d61") + ("popup-el" . "9d104d4bbbcb37bbc9d9ce762e74d41174683f86") + ("projectile" . "33bc91e7518fb8cecd89580f16e0ac21799de2c2") + ("s.el" . "43ba8b563bee3426cead0e6d4ddc09398e1a349d") + ("shell-pop-el" . "4b4394037940a890a313d715d203d9ead2d156a6") + ("shr-tag-pre-highlight.el" . "6182f43a36b0f82ba6edcf6e423b5f69a46a814e") + ("spacemacs-theme" . "6c26717c0ec64af08ab3fd81e88ef03003543c5d") + ("speed-of-thought-lisp" . "ed2356a325c7a4a88ec1bd31381c8666e8997e97") + ("spice-mode" . "e5e0644f03f9696f56dd69e2b6979da7f30ed600") + ("straight.el" . "a7f94876b2bf96d2595706270be6630ecc94f0d3") + ("swiper" . "f8b1ab8c0ec331a4f8f6621f9021811075c71332") + ("tablist" . "faab7a035ef2258cc4ea2182f67e3aedab7e2af9") + ("transient" . "88d935c7cb9f175871c4cfea7eef2c0514d03b06") + ("use-package" . "d2640fec376a8458a669e7526e63e5870d875118") + ("use-package-hydra" . "8cd55a1128fbdf6327bb38a199d206225896d146") + ("window-numbering.el" . "10809b3993a97c7b544240bf5d7ce9b1110a1b89") + ("with-editor" . "48ca9bb49a1a7a37e85606de9d327a14030d4380") + ("zetteldeft" . "19943a39e1c5f53dae6fac107ce3a7d2e4c5f2f8")) +:alpha -- cgit v1.2.3 From 3d3eaf1bda816022f0143c59f7e7be2246c648db Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 20 Jun 2020 19:04:45 +0200 Subject: Add rainbow-mode --- emacs-init.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 5ecd5b8..f29d265 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3627,6 +3627,11 @@ End sentences with single spaces. (put 'dired-find-alternate-file 'disabled nil) (put 'narrow-to-region 'disabled nil)) #+end_src +** Rainbow mode +#+begin_src emacs-lisp +(use-package rainbow-mode + :straight t) +#+end_src ** Parentheses #+begin_src emacs-lisp (use-package paren -- cgit v1.2.3 From 1fc514d94b8a96ae89ae36c7018bf9909d886e4c Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 20 Jun 2020 19:04:52 +0200 Subject: Reorder theme settings & default to modus-operandi --- emacs-init.org | 318 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 302 insertions(+), 16 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index f29d265..45eab89 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -304,7 +304,7 @@ Instead of the above code I set the font directly using appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light theme promising high color contrast. I ended up using the =spacemacs-light= and =spacemacs-dark= themes. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (use-package spacemacs-light-theme :no-require t :straight (spacemacs-theme)) @@ -313,13 +313,26 @@ theme promising high color contrast. I ended up using the :straight (spacemacs-theme)) #+end_src -=Face-remap= is a library for basic face remapping. =Buffer-face-mode= -is enabled when using =variable-pitch-mode= to show the face defined -in =variable-pitch= instead of =default=. #+begin_src emacs-lisp -(use-package face-remap - :delight (buffer-face-mode)) +(defcustom fpi/light-theme 'modus-operandi + "My standard light theme.") +(defcustom fpi/dark-theme 'modus-vivendi + "My standard dark theme.") + +(use-package modus-operandi-theme + :straight t) +(use-package modus-vivendi-theme + :straight t) #+end_src +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 fpi/light-theme t) +#+end_src +*** Theme customization +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: To do some custom adjustments to it I use the following macro which adds an advice to ~load-theme~. #+begin_src emacs-lisp @@ -898,16 +911,13 @@ The above macro can be used like this. (:background nil :inherit nil)))) #+end_src -Advice =load-theme= to also update the colors for -=pdf-view-midnight-mode=. -#+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. 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) +*** Diminish buffer-face-mode +=Face-remap= is a library for basic face remapping. =Buffer-face-mode= +is enabled when using =variable-pitch-mode= to show the face defined +in =variable-pitch= instead of =default=. +#+begin_src emacs-lisp +(use-package face-remap + :delight (buffer-face-mode)) #+end_src *** Scaling the height of the =default= face. When switching between monitors with different resolution, scaling the @@ -1075,6 +1085,274 @@ Goes backward if ARG is negative; error if CHAR not found." Having used ido, ivy, icicles and helm in the past, I'm trying to settle for something simple and go back to ido. The settings below are for now mostly copied from [[https://gitlab.com/protesilaos/dotemacs/][Protesilaos Stavrou]]. +*** Minibuffer settings +#+begin_src emacs-lisp +(use-package minibuffer + :config + + ;; Super-powerful completion style for out-of-order groups of matches + ;; using a comprehensive set of matching styles. + (use-package orderless + :straight t + :config + (setq orderless-regexp-separator "[/\s_-]+") + (setq orderless-matching-styles + '(orderless-flex + orderless-strict-leading-initialism + orderless-regexp + orderless-prefixes + orderless-literal)) + + (defun prot/orderless-literal-dispatcher (pattern _index _total) + (when (string-suffix-p "=" pattern) + `(orderless-literal . ,(substring pattern 0 -1)))) + + (defun prot/orderless-initialism-dispatcher (pattern _index _total) + (when (string-suffix-p "," pattern) + `(orderless-strict-leading-initialism . ,(substring pattern 0 -1)))) + + (setq orderless-style-dispatchers '(prot/orderless-literal-dispatcher + prot/orderless-initialism-dispatcher)) + :bind (:map minibuffer-local-completion-map + ("SPC" . nil) ; space should never complete + ("?" . nil))) ; valid regexp character + + (setq completion-styles + '(orderless partial-completion)) + (setq completion-category-defaults nil) + (setq completion-cycle-threshold 3) + (setq completion-flex-nospace nil) + (setq completion-pcm-complete-word-inserts-delimiters t) + (setq completion-pcm-word-delimiters "-_./:| ") + (setq completion-show-help t) + (setq completion-ignore-case t) + (setq read-buffer-completion-ignore-case t) + (setq read-file-name-completion-ignore-case t) + (setq completions-format 'vertical) ; *Completions* buffer + (setq enable-recursive-minibuffers t) + (setq read-answer-short t) + (setq resize-mini-windows t) + + (file-name-shadow-mode 1) + (minibuffer-depth-indicate-mode 1) + (minibuffer-electric-default-mode 1) + + (defun prot/focus-minibuffer () + "Focus the active minibuffer. + +Bind this to `completion-list-mode-map' to M-v to easily jump +between the list of candidates present in the \\*Completions\\* +buffer and the minibuffer (because by default M-v switches to the +completions if invoked from inside the minibuffer." + (interactive) + (let ((mini (active-minibuffer-window))) + (when mini + (select-window mini)))) + + (defun prot/focus-minibuffer-or-completions () + "Focus the active minibuffer or the \\*Completions\\*. + +If both the minibuffer and the Completions are present, this +command will first move per invocation to the former, then the +latter, and then continue to switch between the two. + +The continuous switch is essentially the same as running +`prot/focus-minibuffer' and `switch-to-completions' in +succession." + (interactive) + (let* ((mini (active-minibuffer-window)) + ;; This could be hardened a bit, but I am okay with it. + (completions (or (get-buffer-window "*Completions*") + (get-buffer-window "*Embark Live Occur*")))) + (cond ((and mini + (not (minibufferp))) + (select-window mini nil)) + ((and completions + (not (eq (selected-window) + completions))) + (select-window completions nil))))) + + ;; Technically, this is not specific to the minibuffer, but I define + ;; it here so that you can see how it is also used from inside the + ;; "Completions" buffer + (defun prot/describe-symbol-at-point (&optional arg) + "Get help (documentation) for the symbol at point. + +With a prefix argument, switch to the *Help* window. If that is +already focused, switch to the most recently used window +instead." + (interactive "P") + (let ((symbol (symbol-at-point))) + (when symbol + (describe-symbol symbol))) + (when arg + (let ((help (get-buffer-window "*Help*"))) + (when help + (if (not (eq (selected-window) help)) + (select-window help) + (select-window (get-mru-window))))))) + + ;; This will be deprecated in favour of the `embark' package + (defun prot/completions-kill-save-symbol () + "Add symbol-at-point to the kill ring. + +Intended for use in the \\*Completions\\* buffer. Bind this to a +key in `completion-list-mode-map'." + (interactive) + (kill-new (thing-at-point 'symbol))) + + +;;;; DEPRECATED in favour of the `embark' package (see further below), +;;;; which implements the same functionality in a more efficient way. +;; (defun prot/complete-kill-or-insert-candidate (&optional arg) +;; "Place the matching candidate to the top of the `kill-ring'. +;; This will keep the minibuffer session active. +;; +;; With \\[universal-argument] insert the candidate in the most +;; recently used buffer, while keeping focus on the minibuffer. +;; +;; With \\[universal-argument] \\[universal-argument] insert the +;; candidate and immediately exit all recursive editing levels and +;; active minibuffers. +;; +;; Bind this function in `icomplete-minibuffer-map'." +;; (interactive "*P") +;; (let ((candidate (car completion-all-sorted-completions))) +;; (when (and (minibufferp) +;; (or (bound-and-true-p icomplete-mode) +;; (bound-and-true-p live-completions-mode))) ; see next section +;; (cond ((eq arg nil) +;; (kill-new candidate)) +;; ((= (prefix-numeric-value arg) 4) +;; (with-minibuffer-selected-window (insert candidate))) +;; ((= (prefix-numeric-value arg) 16) +;; (with-minibuffer-selected-window (insert candidate)) +;; (top-level)))))) + + ;; Defines, among others, aliases for common actions to Super-KEY. + ;; Normally these should go in individual package declarations, but + ;; their grouping here makes things easier to understand. + :bind (("s-f" . find-file) + ("s-F" . find-file-other-window) + ("s-d" . dired) + ("s-D" . dired-other-window) + ("s-b" . switch-to-buffer) + ("s-B" . switch-to-buffer-other-window) + ("s-h" . prot/describe-symbol-at-point) + ("s-H" . (lambda () + (interactive) + (prot/describe-symbol-at-point '(4)))) + ("s-v" . prot/focus-minibuffer-or-completions) + :map minibuffer-local-completion-map + ("" . minibuffer-force-complete-and-exit) + ("C-j" . exit-minibuffer) + ;;;; DEPRECATED in favour of the `embark' package + ;; ("M-o w" . prot/complete-kill-or-insert-candidate) + ;; ("M-o i" . (lambda () + ;; (interactive) + ;; (prot/complete-kill-or-insert-candidate '(4)))) + ;; ("M-o j" . (lambda () + ;; (interactive) + ;; (prot/complete-kill-or-insert-candidate '(16)))) + :map completion-list-mode-map + ("h" . prot/describe-symbol-at-point) + ("w" . prot/completions-kill-save-symbol) + ("n" . next-line) + ("p" . previous-line) + ("f" . next-completion) + ("b" . previous-completion) + ("M-v" . prot/focus-minibuffer))) +#+end_src +*** Icomplete +#+begin_src emacs-lisp +(use-package icomplete + :demand + :after minibuffer ; Read that section as well + :config + (setq icomplete-delay-completions-threshold 100) + (setq icomplete-max-delay-chars 2) + (setq icomplete-compute-delay 0.2) + (setq icomplete-show-matches-on-no-input t) + (setq icomplete-hide-common-prefix nil) + (setq icomplete-prospects-height 1) + ;; (setq icomplete-separator " · ") + ;; (setq icomplete-separator " │ ") + ;; (setq icomplete-separator " ┆ ") + ;; (setq icomplete-separator " ¦ ") + (setq icomplete-separator (propertize " ┆ " 'face 'shadow)) + (setq icomplete-with-completion-tables t) + (setq icomplete-in-buffer t) + (setq icomplete-tidy-shadowed-file-names nil) + + (fido-mode -1) ; Emacs 27.1 + (icomplete-mode 1) + + (defun prot/icomplete-minibuffer-truncate () + "Truncate minibuffer lines in `icomplete-mode'. + This should only affect the horizontal layout and is meant to + enforce `icomplete-prospects-height' being set to 1. + + Hook it to `icomplete-minibuffer-setup-hook'." + (when (and (minibufferp) + (bound-and-true-p icomplete-mode)) + (setq truncate-lines t))) + + ;; Note that the the syntax for `use-package' hooks is controlled by + ;; the `use-package-hook-name-suffix' variable. The "-hook" suffix is + ;; not an error of mine. + :hook (icomplete-minibuffer-setup-hook . prot/icomplete-minibuffer-truncate) + :bind (:map icomplete-minibuffer-map + ("" . icomplete-force-complete) + ("" . icomplete-force-complete-and-exit) ; exit with completion + ("C-j" . exit-minibuffer) ; force input unconditionally + ("C-n" . icomplete-forward-completions) + ("" . icomplete-forward-completions) + ("" . icomplete-forward-completions) + ("C-p" . icomplete-backward-completions) + ("" . icomplete-backward-completions) + ("" . icomplete-backward-completions) + ;; The following command is from Emacs 27.1 + ("" . icomplete-fido-backward-updir))) +#+end_src +*** Icomplete-vertical +#+begin_src emacs-lisp +(use-package icomplete-vertical + :straight t + :demand + :after (minibuffer icomplete) ; do not forget to check those as well + :config + (setq icomplete-vertical-prospects-height (/ (frame-height) 6)) + (icomplete-vertical-mode -1) + + (defun prot/kill-ring-yank-complete () + "Insert the selected `kill-ring' item directly at point. +When region is active, `delete-region'. + +Sorting of the `kill-ring' is disabled. Items appear as they +normally would when calling `yank' followed by `yank-pop'." + (interactive) + (let ((kills ; do not sort items + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (display-sort-function . identity) + (cycle-sort-function . identity)) + (complete-with-action + action kill-ring string pred))))) + (icomplete-vertical-do + (:separator 'dotted-line :height (/ (frame-height) 4)) + (when (use-region-p) + (delete-region (region-beginning) (region-end))) + (insert + (completing-read "Yank from kill ring: " kills nil t))))) + + :bind (("s-y" . prot/kill-ring-yank-complete) + :map icomplete-minibuffer-map + ("C-v" . icomplete-vertical-toggle))) +#+end_src +*** Ido +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: #+BEGIN_SRC emacs-lisp (use-package ido :init @@ -1694,6 +1972,13 @@ would be better to unbind them only when in ~pdf-view-mode~. :init (setq pdf-annot-minor-mode-map-prefix "a") :bind (:map pdf-annot-minor-mode-map ("a d" . pdf-annot-delete))) #+END_SRC + +Advice =load-theme= to update the colors for =pdf-view-midnight-mode= +after the theme changes. +#+begin_src emacs-lisp :tangle no :noweb-ref pre-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 ** Latex #+begin_src emacs-lisp (use-package auctex @@ -3709,5 +3994,6 @@ temporary buffer is created. Some stuff that is run after everything else. #+begin_src emacs-lisp +<> <> #+end_src -- cgit v1.2.3 From ed55e86c5869304ed0b38aa1d9a98d7bfebaaedc Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 21 Jun 2020 13:05:56 +0200 Subject: Add org-time-budgets & a Day agenda --- emacs-init.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 45eab89..8bdc0e1 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2236,7 +2236,10 @@ Switch projects and subprojects from NEXT back to TODO" ;; See emacs.christianbaeuerlein.com/my-org-config.html (org-agenda-block-separator 9472) (org-agenda-custom-commands - `(("n" "Agenda and all TODOs" + `(("d" "Day agenda" + ((agenda "" ((org-agenda-span 'day))) + (org-time-budgets-in-agenda-maybe))) + ("n" "Agenda and all TODOs" ((todo "INPROGRESS" ((org-agenda-overriding-header "Inprogress Tasks"))) (agenda) @@ -2311,6 +2314,15 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** Time budgets +Gives an overview of time spent on defined budgets this week. Great to track if you've worked enough hours. To use it add ~(org-time-budgets-in-agenda-maybe)~ after ~(agenda)~ in a custom agenda command. +#+begin_src emacs-lisp +(use-package org-time-budgets + :straight (:host github :repo "fpiper/org-time-budgets" + :branch "develop") + :custom + (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :block workweek)))) +#+end_src *** Column view #+begin_src emacs-lisp (setq org-columns-default-format -- cgit v1.2.3 From 5d5561cf0dc41f5b9824d6ed661fe72e3dbc79ff Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 22 Jun 2020 08:42:43 +0200 Subject: Set compilation to buffer to scroll automatically --- emacs-init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 8bdc0e1..02da35e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3692,6 +3692,8 @@ For now I use this bad code. Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]]. #+begin_src emacs-lisp (use-package compile + :custom + (compilation-scroll-output t) :config (require 'ansi-color) (defun endless/colorize-compilation () -- cgit v1.2.3 From 6f3e0a0d58e18efc771c4b4422d254395c84ab36 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 22 Jun 2020 08:43:38 +0200 Subject: Add support for matlab programming --- emacs-init.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 02da35e..8c6d068 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2014,6 +2014,11 @@ area. (use-package eldoc :delight) #+end_src +*** Matlab +#+begin_src emacs-lisp +(use-package matlab-mode + :straight t) +#+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org TODO and clocking setup is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt -- cgit v1.2.3 From b7da0a3c46e0bfd9dd34e91509b15659d5f6f64c Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 22 Jun 2020 17:05:48 +0200 Subject: Remove non-file buffers from org-refile-targets --- emacs-init.org | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8c6d068..65f7565 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2041,12 +2041,6 @@ Hansen's]] configs. - Babel languages :: Enable more languages to use in org-babel blocks. - Youtube links :: See [[http://endlessparentheses.com/embedding-youtube-videos-with-org-mode-links.html][this blog post]] for more info. - Ellipsis :: I currently use =" "= and previously used ="⚡⚡⚡"=. -- Refile Targets :: Use the full outline path so I can distinguish - headlines with the same name & disable step-wise completion as I - think from the refile target backwards, not from top-level - downwards. Also include the current file's headings as a refile - targets up to a deep level, all agenda files up to a small level and - all open org files up to an even smaller level. - Drawer for Notes :: Notes go into the =NOTES= drawer. Clocking times should stay separate in the =LOGBOOK= drawer. - Track state changes :: Notes when an entry is switched to done when @@ -2100,10 +2094,6 @@ Hansen's]] configs. ("gmap" . "http://maps.google.com/maps?q=%s") ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) (org-ellipsis " ") - (org-refile-use-outline-path 'file) - (org-refile-targets '((nil :maxlevel . 8) - (org-agenda-files :maxlevel . 3) - (org-buffer-list :maxlevel . 2))) (org-outline-path-complete-in-steps nil) (org-log-state-notes-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") @@ -2129,6 +2119,7 @@ Hansen's]] configs. (org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) (org-tags-column 0) (org-image-actual-width '(400)) + <> :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) @@ -2319,6 +2310,22 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** Refile +Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. Also include the current file's headings as a refile targets up to a deep level, all agenda files up to a small level and all open org files up to an even smaller level. + +As refile only works on file-visiting buffers, we need to filter all other org buffers from ~(org-buffer-list)~. +#+begin_src emacs-lisp +(defun fpi/org-file-buffer-list () + "Return a list of org buffers which visit files." + (seq-filter 'buffer-file-name (org-buffer-list))) +#+end_src + +#+begin_src emacs-lisp :noweb-ref org-custom :tangle no +(org-refile-use-outline-path 'file) +(org-refile-targets '((buffer-file-name :maxlevel . 8) + (org-agenda-files :maxlevel . 3) + (fpi/org-file-buffer-list :maxlevel . 2))) +#+end_src *** Time budgets Gives an overview of time spent on defined budgets this week. Great to track if you've worked enough hours. To use it add ~(org-time-budgets-in-agenda-maybe)~ after ~(agenda)~ in a custom agenda command. #+begin_src emacs-lisp -- cgit v1.2.3 From f4e3ba2e38010feffdf66018a862cb4bc60e75d1 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 25 Jun 2020 12:53:28 +0200 Subject: Enable org remote inline images & reorder config --- emacs-init.org | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 65f7565..a6b15b9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2051,8 +2051,6 @@ Hansen's]] configs. NEXT to INPROGRESS - Align tags left :: Fixes problems with line breaking on small window width. -- Inline image width :: Resize images to 400px but respect width - specifications in attribute lines. #+begin_src emacs-lisp (use-package org @@ -2118,7 +2116,6 @@ Hansen's]] configs. ("IDLE" :foreground "magenta" :weight bold))) (org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) (org-tags-column 0) - (org-image-actual-width '(400)) <> :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) @@ -2171,7 +2168,7 @@ Switch projects and subprojects from NEXT back to TODO" (plantuml . t) ;; (hvm . t) (ledger . t))) - :hook (org-babel-after-execute . org-display-inline-images)) + :hook <>) #+end_src #+BEGIN_SRC emacs-lisp (use-package org-noter @@ -2310,6 +2307,20 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** Inline images + +Resize inline images to 400px but respect width specifications in attribute lines. +#+begin_src emacs-lisp :noweb-ref org-custom :tangle no +(org-image-actual-width '(400)) +#+end_src +Also display remote images by downloading them. +#+begin_src emacs-lisp :noweb-ref org-custom :tangle no +(org-display-remote-inline-images 'download) +#+end_src + +#+begin_src emacs-lisp :noweb-ref ob-hooks :tangle no +(org-babel-after-execute . org-display-inline-images) +#+end_src *** Refile Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. Also include the current file's headings as a refile targets up to a deep level, all agenda files up to a small level and all open org files up to an even smaller level. -- cgit v1.2.3 From cea6226bb677db358da6e7d44fce906a9818fc28 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 27 Jun 2020 13:16:29 +0200 Subject: Add personal imap --- emacs-private.el.gpg | Bin 1086 -> 1139 bytes gnus.org | 12 ++++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 6100326..916e28e 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ diff --git a/gnus.org b/gnus.org index 7d6fe19..9dc05f0 100644 --- a/gnus.org +++ b/gnus.org @@ -13,9 +13,7 @@ Load private settings * Config I use =imap= as my primary server. Setup some generic options: #+begin_src emacs-lisp :noweb-ref imap :tangle no -nnimap ,private/imap-name -(nnimap-address ,private/imap-address) -(nnimap-server-port 993) +nnimap ,@private/imap-info (nnimap-stream ssl) (nnir-search-engine imap) #+end_src @@ -48,8 +46,14 @@ Noweb the primary server settings together. <> )) #+end_src -Add local nntp server + +Setup a secondary imap server and a local nntp server I use to fetch +RSS/Atom Feeds asynchronously. #+begin_src emacs-lisp +(add-to-list 'gnus-secondary-select-methods `(nnimap ,@private/personal-imap-info + (nnimap-stream ssl) + (nnir-search-engine imap) + (nnimap-inbox "INBOX"))) (add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) #+end_src Sort by newest first -- cgit v1.2.3 From 160e0738df9f3199cb1d98381fabdc51db53cd50 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 27 Jun 2020 13:26:56 +0200 Subject: Organize gnus.org --- gnus.org | 255 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 124 insertions(+), 131 deletions(-) diff --git a/gnus.org b/gnus.org index 9dc05f0..ad27735 100644 --- a/gnus.org +++ b/gnus.org @@ -11,6 +11,7 @@ Load private settings (load secret-file) #+end_src * Config +** Servers I use =imap= as my primary server. Setup some generic options: #+begin_src emacs-lisp :noweb-ref imap :tangle no nnimap ,@private/imap-info @@ -56,62 +57,14 @@ RSS/Atom Feeds asynchronously. (nnimap-inbox "INBOX"))) (add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) #+end_src -Sort by newest first -#+begin_src emacs-lisp -(setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) - gnus-thread-sort-functions '((not gnus-thread-sort-by-date))) -#+end_src -Gathering loose threads, whose parent is currently not displayed. I find the default ~'adopt~ to be too confusing. -#+begin_src emacs-lisp -(setq gnus-summary-make-false-root 'dummy) -(setq gnus-summary-dummy-line-format " %(: :%) %S -") -(setq gnus-summary-make-false-root-always t) -#+end_src -Also try to connect threads by guessing which articles are missing -#+begin_src emacs-lisp -(setq gnus-fetch-old-headers nil) -(setq gnus-build-sparse-threads 'more) -#+end_src -Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][emacswiki/GnusFormatting)]]. -#+begin_src emacs-lisp -(setq - gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B%s%)\n" - gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M")) - gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references - gnus-sum-thread-tree-false-root "" - gnus-sum-thread-tree-indent " " - gnus-sum-thread-tree-leaf-with-other "├► " - gnus-sum-thread-tree-root "" - gnus-sum-thread-tree-single-leaf "╰► " - gnus-sum-thread-tree-vertical "│") -#+end_src -Unicode reply symbol -#+begin_src emacs-lisp -(setq gnus-summary-to-prefix "→ ") -#+end_src -Sending mail -#+begin_src emacs-lisp :tangle no -(setq message-send-mail-function 'smtpmail-send-it - smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) - smtpmail-auth-credentials '(("smtp.gmail.com" 587 "your-name@gmail.com" nil)) - smtpmail-default-smtp-server "smtp.gmail.com" - smtpmail-smtp-server "smtp.gmail.com" - smtpmail-smtp-service 587 - starttls-use-gnutls t) -#+end_src -Setup for fancy mail splitting. Also see the parameters in ~gnus-select-method~. -#+begin_src emacs-lisp -(setq nnmail-split-methods 'nnimap-split-fancy) - -(setq nnmail-cache-accepted-message-ids t) -(setq nnmail-message-id-cache-length 10000) -#+end_src - +** Options +*** General +**** Startup Load only groups with level < 2 for faster startup. #+begin_src emacs-lisp (setq gnus-activate-level 2) #+end_src +**** Message related Sent mails are read. #+begin_src emacs-lisp (setq gnus-gcc-mark-as-read t) @@ -121,35 +74,6 @@ Save sent mails in my imap folder (setq gnus-message-archive-method "dummy string") (setq gnus-message-archive-group private/imap-sent-folder) #+end_src -Disable indenting a topic. I always do it by accident. -#+begin_src emacs-lisp -(use-package gnus-topic - :config - (defun fpi/gnus-topic-toggle-topic () - "Toggle display of the topic." - (interactive) - (when (gnus-group-topic-p) - (if (equal 'visible - (nth 1 (cadr (gnus-topic-find-topology (gnus-current-topic))))) - (gnus-topic-hide-topic) - (gnus-topic-show-topic)))) - (define-key gnus-topic-mode-map (kbd "") 'fpi/gnus-topic-toggle-topic) - (define-key gnus-topic-mode-map (kbd "TAB") 'fpi/gnus-topic-toggle-topic)) -#+end_src -Function to toggle display of group levels in the group buffer. -#+begin_src emacs-lisp -(defvar gnus-group-line-format-wo-levels nil) -(defun fpi/gnus-group-toggle-levels () - (interactive) - (if gnus-group-line-format-wo-levels - (setq gnus-group-line-format gnus-group-line-format-wo-levels - gnus-group-line-format-wo-levels nil) - (setq gnus-group-line-format-wo-levels gnus-group-line-format - gnus-group-line-format (concat "[%L] " gnus-group-line-format))) - ;; Hack to update display - (gnus-group-get-new-news 0)) -(define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) -#+end_src Enable responding to meeting invites. #+begin_src emacs-lisp (use-package gnus-icalendar @@ -164,6 +88,13 @@ Enable message delaying (scheduling) #+begin_src emacs-lisp (gnus-delay-initialize) #+end_src +***** BBDB integration +Enable =mail-aliases= and create aliases for all mail adresses if an entry has multiple. +#+begin_src emacs-lisp +(add-hook 'message-setup-hook 'bbdb-mail-aliases) +(setq bbdb-mail-alias 'all) +#+end_src +***** Mail encryption & signing Verify mail signatures with known protocols. #+begin_src emacs-lisp (setq mm-verify-option 'known) @@ -172,20 +103,46 @@ Show buttons for result of signature verification & for multipart mails. To show #+begin_src emacs-lisp (setq gnus-buttonized-mime-types '("multipart/signed" "multipart/alternative")) #+end_src -Enable =mail-aliases= and create aliases for all mail adresses if an entry has multiple. -#+begin_src emacs-lisp -(add-hook 'message-setup-hook 'bbdb-mail-aliases) -(setq bbdb-mail-alias 'all) -#+end_src -Don't fetch attachments before showing the message text to avoid long load times with big attachments. +**** Mail splitting +Setup for fancy mail splitting. Also see the parameters in ~gnus-select-method~. #+begin_src emacs-lisp -(setq nnimap-fetch-partial-articles "\\(text/\\|signature\\)") +(setq nnmail-split-methods 'nnimap-split-fancy) + +(setq nnmail-cache-accepted-message-ids t) +(setq nnmail-message-id-cache-length 10000) #+end_src -Workaround for bug with ~gnus-cloud-method~ and ~custom-variable-recalc-variable~ upon reloading the =spacemacs-*= theme. +**** Demon +Background fetching for gnus. See the manual and [[https://www.emacswiki.org/emacs/GnusDemon][emacswiki]]. #+begin_src emacs-lisp -(setq server "nnimap:imsmail") +(defun gnus-demon-scan-news-level (level only) + (let ((win (current-window-configuration)) + (gnus-read-active-file 'some) + (gnus-check-new-newsgroups nil) + (gnus-verbose 2) + (gnus-verbose-backends 5)) + (while-no-input + (unwind-protect + (save-window-excursion + (when (gnus-alive-p) + (with-current-buffer gnus-group-buffer + (gnus-group-get-new-news level only)))) + (set-window-configuration win))))) +(defun gnus-demon-scan-news-2 () + (gnus-demon-scan-news-level 2 nil)) +(defun gnus-demon-scan-news-3 () + (gnus-demon-scan-news-level 3 t)) +(defun gnus-demon-scan-news-4 () + (gnus-demon-scan-news-level 4 t)) +(defun gnus-demon-scan-news-5 () + (gnus-demon-scan-news-level 5 t)) + +(setq gnus-demon-timestep 10) +(gnus-demon-add-handler 'gnus-demon-scan-news-2 3 nil) +(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 t) +(gnus-demon-add-handler 'gnus-demon-scan-news-4 130 1) +(gnus-demon-add-handler 'gnus-demon-scan-news-5 140 1) #+end_src -** Adaptive scoring +**** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) @@ -236,54 +193,79 @@ Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= s gnus-score-decay-constant 1 gnus-score-decay-scale 0.01) #+end_src -** Window Layout -See [[info:gnus#Window Layout][info:gnus#Window Layout]]. +*** Display +Sort by newest first #+begin_src emacs-lisp -(setq gnus-use-full-window nil) +(setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) + gnus-thread-sort-functions '((not gnus-thread-sort-by-date))) #+end_src -** Format Summary buffer lines +Unicode reply symbol #+begin_src emacs-lisp -;; (setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s -;; ") +(setq gnus-summary-to-prefix "→ ") #+end_src -** nnreddit +Function to toggle display of group levels in the group buffer. #+begin_src emacs-lisp -(use-package nnreddit - :straight t) -(add-to-list 'gnus-secondary-select-methods '(nnreddit "")) +(defvar gnus-group-line-format-wo-levels nil) +(defun fpi/gnus-group-toggle-levels () + (interactive) + (if gnus-group-line-format-wo-levels + (setq gnus-group-line-format gnus-group-line-format-wo-levels + gnus-group-line-format-wo-levels nil) + (setq gnus-group-line-format-wo-levels gnus-group-line-format + gnus-group-line-format (concat "[%L] " gnus-group-line-format))) + ;; Hack to update display + (gnus-group-get-new-news 0)) +(define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) #+end_src -** Demon -Background fetching for gnus. See the manual and [[https://www.emacswiki.org/emacs/GnusDemon][emacswiki]]. +**** On threads +Gather loose threads, whose parent is currently not displayed, under a +dummy article. I find the default ~'adopt~ to be too confusing. #+begin_src emacs-lisp -(defun gnus-demon-scan-news-level (level only) - (let ((win (current-window-configuration)) - (gnus-read-active-file 'some) - (gnus-check-new-newsgroups nil) - (gnus-verbose 2) - (gnus-verbose-backends 5)) - (while-no-input - (unwind-protect - (save-window-excursion - (when (gnus-alive-p) - (with-current-buffer gnus-group-buffer - (gnus-group-get-new-news level only)))) - (set-window-configuration win))))) -(defun gnus-demon-scan-news-2 () - (gnus-demon-scan-news-level 2 nil)) -(defun gnus-demon-scan-news-3 () - (gnus-demon-scan-news-level 3 t)) -(defun gnus-demon-scan-news-4 () - (gnus-demon-scan-news-level 4 t)) -(defun gnus-demon-scan-news-5 () - (gnus-demon-scan-news-level 5 t)) - -(setq gnus-demon-timestep 10) -(gnus-demon-add-handler 'gnus-demon-scan-news-2 3 nil) -(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 t) -(gnus-demon-add-handler 'gnus-demon-scan-news-4 130 1) -(gnus-demon-add-handler 'gnus-demon-scan-news-5 140 1) +(setq gnus-summary-make-false-root 'dummy) +(setq gnus-summary-dummy-line-format " %(: :%) %S +") +(setq gnus-summary-make-false-root-always t) +#+end_src +Also try to connect threads by guessing which articles are missing +#+begin_src emacs-lisp +(setq gnus-fetch-old-headers nil) +(setq gnus-build-sparse-threads 'more) +#+end_src +Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][emacswiki/GnusFormatting)]]. +#+begin_src emacs-lisp +(setq + gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B%s%)\n" + gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M")) + gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references + gnus-sum-thread-tree-false-root "" + gnus-sum-thread-tree-indent " " + gnus-sum-thread-tree-leaf-with-other "├► " + gnus-sum-thread-tree-root "" + gnus-sum-thread-tree-single-leaf "╰► " + gnus-sum-thread-tree-vertical "│") +#+end_src +**** Topics +Disable indenting a topic. I always do it by accident. +#+begin_src emacs-lisp +(use-package gnus-topic + :config + (defun fpi/gnus-topic-toggle-topic () + "Toggle display of the topic." + (interactive) + (when (gnus-group-topic-p) + (if (equal 'visible + (nth 1 (cadr (gnus-topic-find-topology (gnus-current-topic))))) + (gnus-topic-hide-topic) + (gnus-topic-show-topic)))) + (define-key gnus-topic-mode-map (kbd "") 'fpi/gnus-topic-toggle-topic) + (define-key gnus-topic-mode-map (kbd "TAB") 'fpi/gnus-topic-toggle-topic)) #+end_src -** Modeline indicator +**** Window Layout +See [[info:gnus#Window Layout][info:gnus#Window Layout]]. +#+begin_src emacs-lisp +(setq gnus-use-full-window nil) +#+end_src +**** Modeline indicator From the [[https://www.emacswiki.org/emacs/GnusNotify][emacswiki Gnus Notify]]. #+begin_quote […] use ~G p~ in the group buffer, then add ~(modeline-notify t)~ […] @@ -449,3 +431,14 @@ contains new messages")) (provide 'gnus-notify) ;;; gnus-notify.el ends here #+end_src +*** Misc +Workaround for bug with ~gnus-cloud-method~ and ~custom-variable-recalc-variable~ upon reloading the =spacemacs-*= theme. +#+begin_src emacs-lisp +(setq server "nnimap:imsmail") +#+end_src +**** nnreddit +#+begin_src emacs-lisp +(use-package nnreddit + :straight t) +(add-to-list 'gnus-secondary-select-methods '(nnreddit "")) +#+end_src -- cgit v1.2.3 From 8e6e3d402bb66e8ca61691bd2d4b1641e4ffaf15 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 26 Jun 2020 18:36:31 +0200 Subject: Create customization themes to change spacemacs themes --- emacs-init.org | 1550 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 958 insertions(+), 592 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index a6b15b9..f74dd8b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -304,7 +304,36 @@ Instead of the above code I set the font directly using appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light theme promising high color contrast. I ended up using the =spacemacs-light= and =spacemacs-dark= themes. -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp +(defcustom fpi/light-theme-list '(spacemacs-light spacemacs-light-customizations) + "List of themes to activate when using a light theme.") +(defcustom fpi/dark-theme-list '(spacemacs-dark spacemacs-dark-customizations) + "List of themes to activate when using a dark theme.") +(defcustom fpi/current-theme 'light + "Currently activated theme variation.") +#+end_src + +Function to load themes based on the ~fpi/current-theme~ setting. +#+begin_src emacs-lisp +(defun fpi/load-themes (&optional theme-variation) + "Load themes based on the value of `fpi/current-theme'. + +Optionally provide THEME-VARIATION to override +`fpi/current-theme'. Loaded themes are based on the value +of `(format \"fpi/%s-theme-list\" fpi/current-theme)'" + (interactive) + (mapc 'disable-theme custom-enabled-themes);; disable all themes + (let* ((theme-variation (or theme-variation fpi/current-theme)) + (themes (eval (intern (format "fpi/%s-theme-list" theme-variation))))) + (mapc (lambda (theme) (load-theme theme t)) themes) + )) +#+end_src +Load the themes. This is written here for clarity, 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 +(fpi/load-themes) +#+end_src +*** Getting themes +#+begin_src emacs-lisp (use-package spacemacs-light-theme :no-require t :straight (spacemacs-theme)) @@ -313,605 +342,942 @@ theme promising high color contrast. I ended up using the :straight (spacemacs-theme)) #+end_src -#+begin_src emacs-lisp -(defcustom fpi/light-theme 'modus-operandi - "My standard light theme.") -(defcustom fpi/dark-theme 'modus-vivendi - "My standard dark theme.") - +#+begin_src emacs-lisp :tangle no (use-package modus-operandi-theme :straight t) (use-package modus-vivendi-theme :straight t) #+end_src -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 fpi/light-theme t) -#+end_src *** Theme customization -:PROPERTIES: -:header-args:emacs-lisp: :tangle no -:END: -To do some custom adjustments to it I use the following macro which -adds an advice to ~load-theme~. -#+begin_src emacs-lisp -(defmacro set-pair-faces (themes consts faces-alist) - "Macro for pair setting of custom faces. -THEMES name the pair (theme-one theme-two). CONSTS sets the variables like - ((sans-font \"Some Sans Font\") ...). FACES-ALIST has the actual faces -like: - ((face1 theme-one-attr theme-two-atrr) - (face2 theme-one-attr nil ) - (face3 nil theme-two-attr) - ...)" +In this section is code to produce a custom theme out of a list of predefined colors and custom face specs. + +First a function to replace colors in the face specs. +#+begin_src emacs-lisp +(defun prep-custom-theme-set-faces (colors faces-alist) (defmacro get-proper-faces () - `(let* (,@consts) + `(let* (,@colors) (backquote ,faces-alist))) - `(progn - ,@(mapcar - (lambda (theme) - `(defadvice load-theme - (after ,(gensym theme) last (loaded-theme &rest args) activate) - (when (equal loaded-theme (quote ,theme)) - (custom-theme-set-faces - (quote ,theme) ;; maybe instead use =user= theme? - ,@(cl-remove-if - (lambda (x) (equal x "NA")) - (mapcar - (lambda (face) - (let ((face-name (car face)) - (face-attrs (nth (cl-position theme themes) (cdr face)))) - (if face-attrs - `(quote (,face-name ((t ,face-attrs)))) - "NA"))) (get-proper-faces))) - )))) - themes))) -#+end_src - -The above macro can be used like this. -#+begin_src emacs-lisp -(set-pair-faces - ;; Themes to cycle in - (spacemacs-dark spacemacs-light) - ;; Variables - ((bg-white "#fbf8ef") - (bg-light "#222425") - (bg-dark "#1c1e1f") - (bg-darker "#1c1c1c") - (fg-white "#ffffff") - (shade-white "#efeae9") - (fg-light "#655370") - (dark-cyan "#008b8b") - (light-green "#4f774f") ;;#3f773f - (dark-green "#1c661c") - (dark-green2 "#002000") - (region-dark "#2d2e2e") - (region "#39393d") - (slate "#8FA1B3") - (keyword "#f92672") - (comment "#525254") - (builtin "#fd971f") - (purple "#9c91e4") - (doc "#727280") - (type "#66d9ef") - (string "#b6e63e") - (gray-dark "#999") - (gray "#bbb") - (sans-font "Source Sans Pro") - (serif-font "Merriweather") - (et-font "EtBookOt") - (sans-mono-font "Hack") - ;; (serif-mono-font "Verily Serif Mono") - (serif-mono-font "cmu typewriter text") - ) + (get-proper-faces)) +#+end_src + +This call now creates a custom theme based on the settings in the sections +[[id:82021d54-89d6-4712-8e5a-df2fc6177c96][Colors]] and [[id:a3b74d3b-675e-426d-b675-e70dcfd3d2b6][Faces]]. These are my customizations to the spacemacs theme. Make sure to manually run these customization blocks after changing a face, as only the result blocks are tangled! +#+begin_src emacs-lisp :tangle no :results code replace :wrap "src emacs-lisp :tangle tangle/spacemacs-dark-customizations-theme.el" +`(progn + (deftheme spacemacs-dark-customizations + "My customizations to spacemacs-dark (Created 2020-06-27)") + (custom-theme-set-faces + 'spacemacs-dark-customizations + ,@(prep-custom-theme-set-faces + (quote + <>) + <>)) + (provide-theme 'spacemacs-dark-customizations)) +#+end_src - ;; (set-face-attribute 'default nil :font "Hack-11") -;; (set-face-attribute 'variable-pitch nil :font "EtBookOt-11") - ;; Settings - ((default - (:family ,sans-mono-font - :background ,bg-dark - :foreground ,bg-white) - (:family ,sans-mono-font - :background ,bg-white - :foreground ,bg-dark - :height 75)) - (variable-pitch - (:family ,sans-font) - (:family ,et-font - :background nil - :foreground ,bg-dark - :height 1.2)) - (header-line - (:background nil :inherit nil) - (:background nil :inherit nil)) - ;; (company-tooltip - ;; (:background ,bg-darker - ;; :foreground ,gray) - ;; nil) - ;; (company-scrollbar-fg - ;; (:background ,comment) - ;; nil) - ;; (company-scrollbar-bg - ;; (:background ,bg-darker) - ;; nil) - ;; (company-tooltip-common - ;; (:foreground ,keyword) - ;; nil) - ;; (company-tootip-annotation - ;; (:foreground ,type) - ;; nil) - ;; (company-tooltip-selection - ;; (:background ,region) - ;; nil) - (show-paren-match - (:background ,keyword - :foreground ,bg-dark) - nil) - (magit-section-heading - (:foreground ,keyword) - nil) - (magit-header-line - (:background nil - :foreground ,bg-dark - :box nil) - (:background nil - :foreground ,bg-white - :box nil)) - (magit-diff-hunk-heading - (:background ,comment - :foreground ,gray) - nil) - (magit-diff-hunk-heading-highlight - (:background ,comment - :foreground ,fg-white) - nil) - (tooltip - (:foreground ,gray - :background ,bg-darker) - nil) - (mode-line - (:background ,bg-darker) - (:background ,bg-white - :box nil)) - (mode-line-inactive - nil - (:box nil)) - (powerline-active1 - nil - (:background ,bg-white)) - (powerline-active2 - nil - (:background ,bg-white)) - (powerline-inactive1 - nil - (:background ,bg-white)) - (powerline-inactive2 - nil - (:background ,bg-white)) - (highlight - (:background ,region - :foreground ,fg-white) - (:background ,shade-white)) - (hl-line - (:background ,region-dark) - nil) - (org-document-title - (:inherit variable-pitch - :height 1.3 - :weight normal - :foreground ,gray) - (:inherit nil - :family ,et-font - :height 1.8 - :foreground ,bg-dark - :underline nil)) - (org-document-info - (:foreground ,gray - :slant italic) - (:height 1.2 - :slant italic)) - (org-archived - nil - (:inherit shadow - :height 0.6)) - (org-level-1 - (:inherit variable-pitch - :height 1.3 - :weight bold - :foreground ,keyword - :background ,bg-dark) - (:inherit nil - :family ,et-font - :height 1.6 - :weight normal - :slant normal - :foreground ,bg-dark)) - (org-level-2 - (:inherit variable-pitch - :weight bold - :height 1.2 - :foreground ,gray - :background ,bg-dark) - (:inherit nil - :family ,et-font - :weight normal - :height 1.3 - :slant italic - :foreground ,bg-dark)) - (org-level-3 - (:inherit variable-pitch - :weight bold - :height 1.1 - :foreground ,slate - :background ,bg-dark) - (:inherit nil - :family ,et-font - :weight normal - :slant italic - :height 1.2 - :foreground ,bg-dark)) - (org-level-4 - (:inherit variable-pitch - :weight bold - :height 1.1 - :foreground ,slate - :background ,bg-dark) - (:inherit nil - :family ,et-font - :weight normal - :slant italic - :height 1.1 - :foreground ,bg-dark)) - (org-level-5 - (:inherit variable-pitch - :weight bold - :height 1.1 - :foreground ,slate - :background ,bg-dark) - nil) - (org-level-6 - (:inherit variable-pitch - :weight bold - :height 1.1 - :foreground ,slate - :background ,bg-dark) - nil) - (org-level-7 - (:inherit variable-pitch - :weight bold - :height 1.1 - :foreground ,slate - :background ,bg-dark) - nil) - (org-level-8 - (:inherit variable-pitch - :weight bold - :height 1.1 - :foreground ,slate - :background ,bg-dark) - nil) - (org-headline-done - (nil) - (:family ,et-font)) - (org-quote - (:background ,bg-dark - :family ,sans-mono-font) - nil) - (org-block - (:background ,bg-dark - :family ,sans-mono-font) - (:background nil - :height 0.9 - :foreground ,bg-dark - :family ,sans-mono-font)) - (org-block-begin-line - (:background ,bg-dark) - (:background nil - :height 0.8 - :family ,sans-mono-font - :foreground ,slate)) - (org-block-end-line - (:background ,bg-dark) - (:background nil - :height 0.8 - :family ,sans-mono-font - :foreground ,slate)) - (org-meta-line - (:foreground ,comment) - (:height 0.8 - :foreground ,gray)) - (org-document-info-keyword - (:foreground ,comment) - (:height 0.8 - :foreground ,gray)) - (org-link - (:underline nil - :weight normal - :foreground ,slate) - (:foreground ,builtin)) - (org-special-keyword - (:height 0.9 - :foreground ,comment) - (:family ,sans-mono-font - :height 0.8)) - (org-property-value - (:height 0.9 - :foreground ,comment) - (:family ,sans-mono-font - :height 0.8)) - (org-drawer - (:height 0.9 - :foreground ,comment) - (:family ,sans-mono-font - :height 0.8)) - (org-todo - (:foreground ,builtin - :background ,bg-dark) - nil) - (org-done - (:inherit variable-pitch - :foreground ,dark-cyan - :background ,bg-dark) - nil) - (org-agenda-current-time - (:foreground ,slate) - nil) - (org-hide - nil - (:foreground ,bg-white)) - (org-indent - (:inherit org-hide) - (:inherit (org-hide fixed-pitch))) - (org-time-grid - (:foreground ,comment) - nil) - (org-warning - (:foreground ,builtin) - nil) - (org-date - nil - (:family ,sans-mono-font - :height 0.8)) - (org-agenda-structure - (:height 1.3 - :foreground ,doc - :weight normal - :inherit variable-pitch) - nil) - (org-agenda-date - (:foreground ,doc) - (:foreground ,doc)) - (org-agenda-date-today - (:height 1.5 - :foreground ,keyword) - (:height 1.2)) - (org-agenda-date-weekend - (:inherit org-agenda-date) - nil) - (org-scheduled - (:foreground ,gray) - (:foreground ,light-green)) - (org-upcoming-deadline - (:foreground ,keyword) - nil) - (org-scheduled-today - (:foreground ,fg-white) - (:foreground ,dark-green)) - (org-scheduled-previously - (:foreground ,slate) - (:foreground ,dark-green2)) - (org-agenda-done - (:inherit nil - :foreground ,doc) - (:foreground ,doc)) - (org-ellipsis - (:underline nil - :foreground ,comment) - (:underline nil - :foreground ,comment)) - (org-tag - (:foreground ,doc) - (:foreground ,doc)) - (org-table - (:background nil - :family ,sans-mono-font) - (:family ,serif-mono-font - :height 0.9 - :background ,bg-white)) - (org-code - (:inherit font-lock-builtin-face) - (:inherit nil - :family ,serif-mono-font - :foreground ,comment - :height 0.9)) - (font-latex-sectioning-0-face - (:foreground ,type - :height 1.2) - nil) - (font-latex-sectioning-1-face - (:foreground ,type - :height 1.1) - nil) - (font-latex-sectioning-2-face - (:foreground ,type - :height 1.1) - nil) - (font-latex-sectioning-3-face - (:foreground ,type - :height 1.0) - nil) - (font-latex-sectioning-4-face - (:foreground ,type - :height 1.0) - nil) - (font-latex-sectioning-5-face - (:foreground ,type - :height 1.0) - nil) - (font-latex-verbatim-face - (:foreground ,builtin) - nil) - (spacemacs-normal-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (spacemacs-evilified-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (spacemacs-lisp-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (spacemacs-emacs-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (spacemacs-motion-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (spacemacs-visual-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (spacemacs-hybrid-face - (:background ,bg-dark - :foreground ,fg-white) - nil) - (bm-persistent-face - (:background ,dark-cyan - :foreground ,fg-white) - nil) - (helm-selection - (:background ,region) - nil) - (helm-match - (:foreground ,keyword) - nil) - (cfw:face-title - (:height 2.0 - :inherit variable-pitch - :weight bold - :foreground ,doc) - nil) - (cfw:face-holiday - (:foreground ,builtin) - nil) - (cfw:face-saturday - (:foreground ,doc - :weight bold) - nil) - (cfw:face-sunday - (:foreground ,doc) - nil) - (cfw:face-periods - (:foreground ,dark-cyan) - nil) - (cfw:face-annotation - (:foreground ,doc) - nil) - (cfw:face-select - (:background ,region) - nil) - (cfw:face-toolbar-button-off - (:foreground ,doc) - nil) - (cfw:face-toolbar-button-on - (:foreground ,type - :weight bold) - nil) - (cfw:face-day-title - (:foreground ,doc) - nil) - (cfw:face-default-content - (:foreground ,dark-cyan) - nil) - (cfw:face-disable - (:foreground ,doc) - nil) - (cfw:face-today - (:background ,region - :weight bold) - nil) - (cfw:face-toolbar - (:inherit default) - nil) - (cfw:face-today-title - (:background ,keyword - :foreground ,fg-white) - nil) - (cfw:face-grid - (:foreground ,comment) - nil) - (cfw:face-header - (:foreground ,keyword - :weight bold) - nil) - (cfw:face-default-day - (:foreground ,fg-white) - nil) - (dired-subtree-depth-1-face - (:background nil) - (:background nil)) - (dired-subtree-depth-2-face - (:background nil) - (:background nil)) - (dired-subtree-depth-3-face - (:background nil) - (:background nil)) - (dired-subtree-depth-4-face - (:background nil) - (:background nil)) - (dired-subtree-depth-5-face - (:background nil) - (:background nil)) - (dired-subtree-depth-6-face - (:background nil) - (:background nil)) - (nlinum-current-line - (:foreground ,builtin) - (:foreground ,bg-dark)) - (vertical-border - (:background ,region - :foreground ,region) - nil) - (which-key-command-description-face - (:foreground ,type) - nil) - (flycheck-error - (:background nil) - nil) - (flycheck-warning - (:background nil) - nil) - (font-lock-string-face - (:foreground ,string) - nil) - (font-lock-comment-face - (:foreground ,doc - :slant italic) - (:background nil - :foreground ,doc - :slant italic)) - (elfeed-search-unread-title-face - (:weight bold) - (:weight bold)) - (helm-ff-symlink - (:foreground ,slate) - nil) - (region - (:background ,region) - nil) - (header-line - (:background nil - :inherit nil) - (:background nil - :inherit nil)))) -#+end_src -*** Diminish buffer-face-mode +#+RESULTS: +#+begin_src emacs-lisp :tangle tangle/spacemacs-dark-customizations-theme.el +(progn + (deftheme spacemacs-dark-customizations "My customizations to spacemacs-dark (Created 2020-06-27)") + (custom-theme-set-faces 'spacemacs-dark-customizations + '(default + ((t + (:family "Hack" :background "#1c1e1f" :foreground "#fbf8ef")))) + '(variable-pitch + ((t + (:family "Source Sans Pro")))) + '(header-line + ((t + (:background nil :inherit nil)))) + '(show-paren-match + ((t + (:background "#f92672" :foreground "#1c1e1f")))) + '(magit-section-heading + ((t + (:foreground "#f92672")))) + '(magit-header-line + ((t + (:background nil :foreground "#1c1e1f" :box nil)))) + '(magit-diff-hunk-heading + ((t + (:background "#525254" :foreground "#bbb")))) + '(magit-diff-hunk-heading-highlight + ((t + (:background "#525254" :foreground "#ffffff")))) + '(tooltip + ((t + (:foreground "#bbb" :background "#1c1c1c")))) + '(mode-line + ((t + (:background "#1c1c1c")))) + '(mode-line-inactive + ((t nil))) + '(powerline-active1 + ((t nil))) + '(powerline-active2 + ((t nil))) + '(powerline-inactive1 + ((t nil))) + '(powerline-inactive2 + ((t nil))) + '(highlight + ((t + (:background "#39393d" :foreground "#ffffff")))) + '(hl-line + ((t + (:background "#2d2e2e")))) + '(org-document-title + ((t + (:inherit variable-pitch :height 1.3 :weight normal :foreground "#bbb")))) + '(org-document-info + ((t + (:foreground "#bbb" :slant italic)))) + '(org-archived + ((t nil))) + '(org-level-1 + ((t + (:inherit variable-pitch :height 1.3 :weight bold :foreground "#f92672" :background "#1c1e1f")))) + '(org-level-2 + ((t + (:inherit variable-pitch :weight bold :height 1.2 :foreground "#bbb" :background "#1c1e1f")))) + '(org-level-3 + ((t + (:inherit variable-pitch :weight bold :height 1.1 :foreground "#8FA1B3" :background "#1c1e1f")))) + '(org-level-4 + ((t + (:inherit variable-pitch :weight bold :height 1.1 :foreground "#8FA1B3" :background "#1c1e1f")))) + '(org-level-5 + ((t + (:inherit variable-pitch :weight bold :height 1.1 :foreground "#8FA1B3" :background "#1c1e1f")))) + '(org-level-6 + ((t + (:inherit variable-pitch :weight bold :height 1.1 :foreground "#8FA1B3" :background "#1c1e1f")))) + '(org-level-7 + ((t + (:inherit variable-pitch :weight bold :height 1.1 :foreground "#8FA1B3" :background "#1c1e1f")))) + '(org-level-8 + ((t + (:inherit variable-pitch :weight bold :height 1.1 :foreground "#8FA1B3" :background "#1c1e1f")))) + '(org-headline-done + (nil)) + '(org-quote + ((t + (:background "#1c1e1f" :family "Hack")))) + '(org-block + ((t + (:background "#1c1e1f" :family "Hack")))) + '(org-block-begin-line + ((t + (:background "#1c1e1f")))) + '(org-block-end-line + ((t + (:background "#1c1e1f")))) + '(org-meta-line + ((t + (:foreground "#525254")))) + '(org-document-info-keyword + ((t + (:foreground "#525254")))) + '(org-link + ((t + (:underline nil :weight normal :foreground "#8FA1B3")))) + '(org-special-keyword + ((t + (:height 0.9 :foreground "#525254")))) + '(org-property-value + ((t + (:height 0.9 :foreground "#525254")))) + '(org-drawer + ((t + (:height 0.9 :foreground "#525254")))) + '(org-todo + ((t + (:foreground "#fd971f" :background "#1c1e1f")))) + '(org-done + ((t + (:inherit variable-pitch :foreground "#008b8b" :background "#1c1e1f")))) + '(org-agenda-current-time + ((t + (:foreground "#8FA1B3")))) + '(org-hide + ((t nil))) + '(org-indent + ((t + (:inherit org-hide)))) + '(org-time-grid + ((t + (:foreground "#525254")))) + '(org-warning + ((t + (:foreground "#fd971f")))) + '(org-date + ((t nil))) + '(org-agenda-structure + ((t + (:height 1.3 :foreground "#727280" :weight normal :inherit variable-pitch)))) + '(org-agenda-date + ((t + (:foreground "#727280")))) + '(org-agenda-date-today + ((t + (:height 1.5 :foreground "#f92672")))) + '(org-agenda-date-weekend + ((t + (:inherit org-agenda-date)))) + '(org-scheduled + ((t + (:foreground "#bbb")))) + '(org-upcoming-deadline + ((t + (:foreground "#f92672")))) + '(org-scheduled-today + ((t + (:foreground "#ffffff")))) + '(org-scheduled-previously + ((t + (:foreground "#8FA1B3")))) + '(org-agenda-done + ((t + (:inherit nil :foreground "#727280")))) + '(org-ellipsis + ((t + (:underline nil :foreground "#525254")))) + '(org-tag + ((t + (:foreground "#727280")))) + '(org-table + ((t + (:background nil :family "Hack")))) + '(org-code + ((t + (:inherit font-lock-builtin-face)))) + '(font-latex-sectioning-0-face + ((t + (:foreground "#66d9ef" :height 1.2)))) + '(font-latex-sectioning-1-face + ((t + (:foreground "#66d9ef" :height 1.1)))) + '(font-latex-sectioning-2-face + ((t + (:foreground "#66d9ef" :height 1.1)))) + '(font-latex-sectioning-3-face + ((t + (:foreground "#66d9ef" :height 1.0)))) + '(font-latex-sectioning-4-face + ((t + (:foreground "#66d9ef" :height 1.0)))) + '(font-latex-sectioning-5-face + ((t + (:foreground "#66d9ef" :height 1.0)))) + '(font-latex-verbatim-face + ((t + (:foreground "#fd971f")))) + '(spacemacs-normal-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(spacemacs-evilified-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(spacemacs-lisp-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(spacemacs-emacs-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(spacemacs-motion-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(spacemacs-visual-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(spacemacs-hybrid-face + ((t + (:background "#1c1e1f" :foreground "#ffffff")))) + '(bm-persistent-face + ((t + (:background "#008b8b" :foreground "#ffffff")))) + '(helm-selection + ((t + (:background "#39393d")))) + '(helm-match + ((t + (:foreground "#f92672")))) + '(cfw:face-title + ((t + (:height 2.0 :inherit variable-pitch :weight bold :foreground "#727280")))) + '(cfw:face-holiday + ((t + (:foreground "#fd971f")))) + '(cfw:face-saturday + ((t + (:foreground "#727280" :weight bold)))) + '(cfw:face-sunday + ((t + (:foreground "#727280")))) + '(cfw:face-periods + ((t + (:foreground "#008b8b")))) + '(cfw:face-annotation + ((t + (:foreground "#727280")))) + '(cfw:face-select + ((t + (:background "#39393d")))) + '(cfw:face-toolbar-button-off + ((t + (:foreground "#727280")))) + '(cfw:face-toolbar-button-on + ((t + (:foreground "#66d9ef" :weight bold)))) + '(cfw:face-day-title + ((t + (:foreground "#727280")))) + '(cfw:face-default-content + ((t + (:foreground "#008b8b")))) + '(cfw:face-disable + ((t + (:foreground "#727280")))) + '(cfw:face-today + ((t + (:background "#39393d" :weight bold)))) + '(cfw:face-toolbar + ((t + (:inherit default)))) + '(cfw:face-today-title + ((t + (:background "#f92672" :foreground "#ffffff")))) + '(cfw:face-grid + ((t + (:foreground "#525254")))) + '(cfw:face-header + ((t + (:foreground "#f92672" :weight bold)))) + '(cfw:face-default-day + ((t + (:foreground "#ffffff")))) + '(dired-subtree-depth-1-face + ((t + (:background nil)))) + '(dired-subtree-depth-2-face + ((t + (:background nil)))) + '(dired-subtree-depth-3-face + ((t + (:background nil)))) + '(dired-subtree-depth-4-face + ((t + (:background nil)))) + '(dired-subtree-depth-5-face + ((t + (:background nil)))) + '(dired-subtree-depth-6-face + ((t + (:background nil)))) + '(nlinum-current-line + ((t + (:foreground "#fd971f")))) + '(vertical-border + ((t + (:background "#39393d" :foreground "#39393d")))) + '(which-key-command-description-face + ((t + (:foreground "#66d9ef")))) + '(flycheck-error + ((t + (:background nil)))) + '(flycheck-warning + ((t + (:background nil)))) + '(font-lock-string-face + ((t + (:foreground "#b6e63e")))) + '(font-lock-comment-face + ((t + (:foreground "#727280" :slant italic)))) + '(elfeed-search-unread-title-face + ((t + (:weight bold)))) + '(helm-ff-symlink + ((t + (:foreground "#8FA1B3")))) + '(region + ((t + (:background "#39393d"))))) + (provide-theme 'spacemacs-dark-customizations)) +#+end_src + +#+begin_src emacs-lisp :tangle no :results code replace :wrap "src emacs-lisp :tangle tangle/spacemacs-light-customizations-theme.el" +`(progn + (deftheme spacemacs-light-customizations + "My customizations to spacemacs-light (Created 2020-06-27)") + (custom-theme-set-faces + 'spacemacs-light-customizations + ,@(prep-custom-theme-set-faces + (quote + <>) + <>)) + (provide-theme 'spacemacs-light-customizations)) +#+end_src + +#+RESULTS: +#+begin_src emacs-lisp :tangle tangle/spacemacs-light-customizations-theme.el +(progn + (deftheme spacemacs-light-customizations "My customizations to spacemacs-light (Created 2020-06-27)") + (custom-theme-set-faces 'spacemacs-light-customizations + '(default + ((t + (:family "Hack" :background "#fbf8ef" :foreground "#1c1e1f")))) + '(variable-pitch + ((t + (:family "EtBookOt" :background nil :foreground "#1c1e1f" :height 1.2)))) + '(header-line + ((t + (:background nil :inherit nil)))) + '(show-paren-match + ((t nil))) + '(magit-section-heading + ((t nil))) + '(magit-header-line + ((t + (:background nil :foreground "#fbf8ef" :box nil)))) + '(magit-diff-hunk-heading + ((t nil))) + '(magit-diff-hunk-heading-highlight + ((t nil))) + '(tooltip + ((t nil))) + '(mode-line + ((t + (:background "#fbf8ef" :box nil)))) + '(mode-line-inactive + ((t + (:box nil)))) + '(powerline-active1 + ((t + (:background "#fbf8ef")))) + '(powerline-active2 + ((t + (:background "#fbf8ef")))) + '(powerline-inactive1 + ((t + (:background "#fbf8ef")))) + '(powerline-inactive2 + ((t + (:background "#fbf8ef")))) + '(highlight + ((t + (:background "#efeae9")))) + '(hl-line + ((t nil))) + '(org-document-title + ((t + (:inherit nil :family "EtBookOt" :height 1.8 :foreground "#1c1e1f" :underline nil)))) + '(org-document-info + ((t + (:height 1.2 :slant italic)))) + '(org-archived + ((t + (:inherit shadow :height 0.6)))) + '(org-level-1 + ((t + (:inherit nil :family "EtBookOt" :height 1.6 :weight normal :slant normal :foreground "#1c1e1f")))) + '(org-level-2 + ((t + (:inherit nil :family "EtBookOt" :weight normal :height 1.3 :slant italic :foreground "#1c1e1f")))) + '(org-level-3 + ((t + (:inherit nil :family "EtBookOt" :weight normal :slant italic :height 1.2 :foreground "#1c1e1f")))) + '(org-level-4 + ((t + (:inherit nil :family "EtBookOt" :weight normal :slant italic :height 1.1 :foreground "#1c1e1f")))) + '(org-level-5 + ((t nil))) + '(org-level-6 + ((t nil))) + '(org-level-7 + ((t nil))) + '(org-level-8 + ((t nil))) + '(org-headline-done + ((t + (:family "EtBookOt")))) + '(org-quote + ((t nil))) + '(org-block + ((t + (:background nil :height 0.9 :foreground "#1c1e1f" :family "Hack")))) + '(org-block-begin-line + ((t + (:background nil :height 0.8 :family "Hack" :foreground "#8FA1B3")))) + '(org-block-end-line + ((t + (:background nil :height 0.8 :family "Hack" :foreground "#8FA1B3")))) + '(org-meta-line + ((t + (:height 0.8 :foreground "#bbb")))) + '(org-document-info-keyword + ((t + (:height 0.8 :foreground "#bbb")))) + '(org-link + ((t + (:foreground "#fd971f")))) + '(org-special-keyword + ((t + (:family "Hack" :height 0.8)))) + '(org-property-value + ((t + (:family "Hack" :height 0.8)))) + '(org-drawer + ((t + (:family "Hack" :height 0.8)))) + '(org-todo + ((t nil))) + '(org-done + ((t nil))) + '(org-agenda-current-time + ((t nil))) + '(org-hide + ((t + (:foreground "#fbf8ef")))) + '(org-indent + ((t + (:inherit + (org-hide fixed-pitch))))) + '(org-time-grid + ((t nil))) + '(org-warning + ((t nil))) + '(org-date + ((t + (:family "Hack" :height 0.8)))) + '(org-agenda-structure + ((t nil))) + '(org-agenda-date + ((t + (:foreground "#727280")))) + '(org-agenda-date-today + ((t + (:height 1.2)))) + '(org-agenda-date-weekend + ((t nil))) + '(org-scheduled + ((t + (:foreground "#4f774f")))) + '(org-upcoming-deadline + ((t nil))) + '(org-scheduled-today + ((t + (:foreground "#1c661c")))) + '(org-scheduled-previously + ((t + (:foreground "#002000")))) + '(org-agenda-done + ((t + (:foreground "#727280")))) + '(org-ellipsis + ((t + (:underline nil :foreground "#525254")))) + '(org-tag + ((t + (:foreground "#727280")))) + '(org-table + ((t + (:family "cmu typewriter text" :height 0.9 :background "#fbf8ef")))) + '(org-code + ((t + (:inherit nil :family "cmu typewriter text" :foreground "#525254" :height 0.9)))) + '(font-latex-sectioning-0-face + ((t nil))) + '(font-latex-sectioning-1-face + ((t nil))) + '(font-latex-sectioning-2-face + ((t nil))) + '(font-latex-sectioning-3-face + ((t nil))) + '(font-latex-sectioning-4-face + ((t nil))) + '(font-latex-sectioning-5-face + ((t nil))) + '(font-latex-verbatim-face + ((t nil))) + '(spacemacs-normal-face + ((t nil))) + '(spacemacs-evilified-face + ((t nil))) + '(spacemacs-lisp-face + ((t nil))) + '(spacemacs-emacs-face + ((t nil))) + '(spacemacs-motion-face + ((t nil))) + '(spacemacs-visual-face + ((t nil))) + '(spacemacs-hybrid-face + ((t nil))) + '(bm-persistent-face + ((t nil))) + '(helm-selection + ((t nil))) + '(helm-match + ((t nil))) + '(cfw:face-title + ((t nil))) + '(cfw:face-holiday + ((t nil))) + '(cfw:face-saturday + ((t nil))) + '(cfw:face-sunday + ((t nil))) + '(cfw:face-periods + ((t nil))) + '(cfw:face-annotation + ((t nil))) + '(cfw:face-select + ((t nil))) + '(cfw:face-toolbar-button-off + ((t nil))) + '(cfw:face-toolbar-button-on + ((t nil))) + '(cfw:face-day-title + ((t nil))) + '(cfw:face-default-content + ((t nil))) + '(cfw:face-disable + ((t nil))) + '(cfw:face-today + ((t nil))) + '(cfw:face-toolbar + ((t nil))) + '(cfw:face-today-title + ((t nil))) + '(cfw:face-grid + ((t nil))) + '(cfw:face-header + ((t nil))) + '(cfw:face-default-day + ((t nil))) + '(dired-subtree-depth-1-face + ((t + (:background nil)))) + '(dired-subtree-depth-2-face + ((t + (:background nil)))) + '(dired-subtree-depth-3-face + ((t + (:background nil)))) + '(dired-subtree-depth-4-face + ((t + (:background nil)))) + '(dired-subtree-depth-5-face + ((t + (:background nil)))) + '(dired-subtree-depth-6-face + ((t + (:background nil)))) + '(nlinum-current-line + ((t + (:foreground "#1c1e1f")))) + '(vertical-border + ((t nil))) + '(which-key-command-description-face + ((t nil))) + '(flycheck-error + ((t nil))) + '(flycheck-warning + ((t nil))) + '(font-lock-string-face + ((t nil))) + '(font-lock-comment-face + ((t + (:background nil :foreground "#727280" :slant italic)))) + '(elfeed-search-unread-title-face + ((t + (:weight bold)))) + '(helm-ff-symlink + ((t nil))) + '(region + ((t nil)))) + (provide-theme 'spacemacs-light-customizations)) +#+end_src + +Now we just have to link the tangled themes to the ~load-path~ +#+BEGIN_SRC shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/spacemacs-dark-customizations-theme.el ~/.emacs.d/ +ln -siv $(pwd)/tangle/spacemacs-light-customizations-theme.el ~/.emacs.d/ +#+END_SRC +**** Colors +:PROPERTIES: +:ID: 82021d54-89d6-4712-8e5a-df2fc6177c96 +:END: +#+begin_src emacs-lisp :noweb-ref colors :tangle no +((bg-white "#fbf8ef") + (bg-light "#222425") + (bg-dark "#1c1e1f") + (bg-darker "#1c1c1c") + (fg-white "#ffffff") + (shade-white "#efeae9") + (fg-light "#655370") + (dark-cyan "#008b8b") + (light-green "#4f774f") ;;#3f773f + (dark-green "#1c661c") + (dark-green2 "#002000") + (region-dark "#2d2e2e") + (region "#39393d") + (slate "#8FA1B3") + (keyword "#f92672") + (comment "#525254") + (builtin "#fd971f") + (purple "#9c91e4") + (doc "#727280") + (type "#66d9ef") + (string "#b6e63e") + (gray-dark "#999") + (gray "#bbb") + (sans-font "Source Sans Pro") + (serif-font "Merriweather") + (et-font "EtBookOt") + (sans-mono-font "Hack") + ;; (serif-mono-font "Verily Serif Mono") + (serif-mono-font "cmu typewriter text") + ) +#+end_src +**** Faces +:PROPERTIES: +:ID: a3b74d3b-675e-426d-b675-e70dcfd3d2b6 +:END: +#+begin_src emacs-lisp :noweb-ref faces-spacemacs-light :tangle no +;; light +'('(default ((t (:family ,sans-mono-font :background ,bg-white :foreground ,bg-dark + ;; :height 75 + )))) + '(variable-pitch ((t (:family ,et-font :background nil :foreground ,bg-dark :height 1.2)))) + '(header-line ((t (:background nil :inherit nil)))) + '(show-paren-match ((t nil))) + '(magit-section-heading ((t nil))) + '(magit-header-line ((t (:background nil :foreground ,bg-white :box nil)))) + '(magit-diff-hunk-heading ((t nil))) + '(magit-diff-hunk-heading-highlight ((t nil))) + '(tooltip ((t nil))) + '(mode-line ((t (:background ,bg-white :box nil)))) + '(mode-line-inactive ((t (:box nil)))) + '(powerline-active1 ((t (:background ,bg-white)))) + '(powerline-active2 ((t (:background ,bg-white)))) + '(powerline-inactive1 ((t (:background ,bg-white)))) + '(powerline-inactive2 ((t (:background ,bg-white)))) + '(highlight ((t (:background ,shade-white)))) + '(hl-line ((t nil))) + '(org-document-title ((t (:inherit nil :family ,et-font :height 1.8 :foreground ,bg-dark :underline nil)))) + '(org-document-info ((t (:height 1.2 :slant italic)))) + '(org-archived ((t (:inherit shadow :height 0.6)))) + '(org-level-1 ((t (:inherit nil :family ,et-font :height 1.6 :weight normal :slant normal :foreground ,bg-dark)))) + '(org-level-2 ((t (:inherit nil :family ,et-font :weight normal :height 1.3 :slant italic :foreground ,bg-dark)))) + '(org-level-3 ((t (:inherit nil :family ,et-font :weight normal :slant italic :height 1.2 :foreground ,bg-dark)))) + '(org-level-4 ((t (:inherit nil :family ,et-font :weight normal :slant italic :height 1.1 :foreground ,bg-dark)))) + '(org-level-5 ((t nil))) + '(org-level-6 ((t nil))) + '(org-level-7 ((t nil))) + '(org-level-8 ((t nil))) + '(org-headline-done ((t (:family ,et-font)))) + '(org-quote ((t nil))) + '(org-block ((t (:background nil :height 0.9 :foreground ,bg-dark :family ,sans-mono-font)))) + '(org-block-begin-line ((t (:background nil :height 0.8 :family ,sans-mono-font :foreground ,slate)))) + '(org-block-end-line ((t (:background nil :height 0.8 :family ,sans-mono-font :foreground ,slate)))) + '(org-meta-line ((t (:height 0.8 :foreground ,gray)))) + '(org-document-info-keyword ((t (:height 0.8 :foreground ,gray)))) + '(org-link ((t (:foreground ,builtin)))) + '(org-special-keyword ((t (:family ,sans-mono-font :height 0.8)))) + '(org-property-value ((t (:family ,sans-mono-font :height 0.8)))) + '(org-drawer ((t (:family ,sans-mono-font :height 0.8)))) + '(org-todo ((t nil))) + '(org-done ((t nil))) + '(org-agenda-current-time ((t nil))) + '(org-hide ((t (:foreground ,bg-white)))) + '(org-indent ((t (:inherit (org-hide fixed-pitch))))) + '(org-time-grid ((t nil))) + '(org-warning ((t nil))) + '(org-date ((t (:family ,sans-mono-font :height 0.8)))) + '(org-agenda-structure ((t nil))) + '(org-agenda-date ((t (:foreground ,doc)))) + '(org-agenda-date-today ((t (:height 1.2)))) + '(org-agenda-date-weekend ((t nil))) + '(org-scheduled ((t (:foreground ,light-green)))) + '(org-upcoming-deadline ((t nil))) + '(org-scheduled-today ((t (:foreground ,dark-green)))) + '(org-scheduled-previously ((t (:foreground ,dark-green2)))) + '(org-agenda-done ((t (:foreground ,doc)))) + '(org-ellipsis ((t (:underline nil :foreground ,comment)))) + '(org-tag ((t (:foreground ,doc)))) + '(org-table ((t (:family ,serif-mono-font :height 0.9 :background ,bg-white)))) + '(org-code ((t (:inherit nil :family ,serif-mono-font :foreground ,comment :height 0.9)))) + '(font-latex-sectioning-0-face ((t nil))) + '(font-latex-sectioning-1-face ((t nil))) + '(font-latex-sectioning-2-face ((t nil))) + '(font-latex-sectioning-3-face ((t nil))) + '(font-latex-sectioning-4-face ((t nil))) + '(font-latex-sectioning-5-face ((t nil))) + '(font-latex-verbatim-face ((t nil))) + '(spacemacs-normal-face ((t nil))) + '(spacemacs-evilified-face ((t nil))) + '(spacemacs-lisp-face ((t nil))) + '(spacemacs-emacs-face ((t nil))) + '(spacemacs-motion-face ((t nil))) + '(spacemacs-visual-face ((t nil))) + '(spacemacs-hybrid-face ((t nil))) + '(bm-persistent-face ((t nil))) + '(helm-selection ((t nil))) + '(helm-match ((t nil))) + '(cfw:face-title ((t nil))) + '(cfw:face-holiday ((t nil))) + '(cfw:face-saturday ((t nil))) + '(cfw:face-sunday ((t nil))) + '(cfw:face-periods ((t nil))) + '(cfw:face-annotation ((t nil))) + '(cfw:face-select ((t nil))) + '(cfw:face-toolbar-button-off ((t nil))) + '(cfw:face-toolbar-button-on ((t nil))) + '(cfw:face-day-title ((t nil))) + '(cfw:face-default-content ((t nil))) + '(cfw:face-disable ((t nil))) + '(cfw:face-today ((t nil))) + '(cfw:face-toolbar ((t nil))) + '(cfw:face-today-title ((t nil))) + '(cfw:face-grid ((t nil))) + '(cfw:face-header ((t nil))) + '(cfw:face-default-day ((t nil))) + '(dired-subtree-depth-1-face ((t (:background nil)))) + '(dired-subtree-depth-2-face ((t (:background nil)))) + '(dired-subtree-depth-3-face ((t (:background nil)))) + '(dired-subtree-depth-4-face ((t (:background nil)))) + '(dired-subtree-depth-5-face ((t (:background nil)))) + '(dired-subtree-depth-6-face ((t (:background nil)))) + '(nlinum-current-line ((t (:foreground ,bg-dark)))) + '(vertical-border ((t nil))) + '(which-key-command-description-face ((t nil))) + '(flycheck-error ((t nil))) + '(flycheck-warning ((t nil))) + '(font-lock-string-face ((t nil))) + '(font-lock-comment-face ((t (:background nil :foreground ,doc :slant italic)))) + '(elfeed-search-unread-title-face ((t (:weight bold)))) + '(helm-ff-symlink ((t nil))) + '(region ((t nil)))) +#+end_src +#+begin_src emacs-lisp :noweb-ref faces-spacemacs-dark :tangle no +;; dark +'('(default ((t (:family ,sans-mono-font :background ,bg-dark :foreground ,bg-white)))) + '(variable-pitch ((t (:family ,sans-font)))) + '(header-line ((t (:background nil :inherit nil)))) + '(show-paren-match ((t (:background ,keyword :foreground ,bg-dark)))) + '(magit-section-heading ((t (:foreground ,keyword)))) + '(magit-header-line ((t (:background nil :foreground ,bg-dark :box nil)))) + '(magit-diff-hunk-heading ((t (:background ,comment :foreground ,gray)))) + '(magit-diff-hunk-heading-highlight ((t (:background ,comment :foreground ,fg-white)))) + '(tooltip ((t (:foreground ,gray :background ,bg-darker)))) + '(mode-line ((t (:background ,bg-darker)))) + '(mode-line-inactive ((t nil))) + '(powerline-active1 ((t nil))) + '(powerline-active2 ((t nil))) + '(powerline-inactive1 ((t nil))) + '(powerline-inactive2 ((t nil))) + '(highlight ((t (:background ,region :foreground ,fg-white)))) + '(hl-line ((t (:background ,region-dark)))) + '(org-document-title ((t (:inherit variable-pitch :height 1.3 :weight normal :foreground ,gray)))) + '(org-document-info ((t (:foreground ,gray :slant italic)))) + '(org-archived ((t nil))) + '(org-level-1 ((t (:inherit variable-pitch :height 1.3 :weight bold :foreground ,keyword :background ,bg-dark)))) + '(org-level-2 ((t (:inherit variable-pitch :weight bold :height 1.2 :foreground ,gray :background ,bg-dark)))) + '(org-level-3 ((t (:inherit variable-pitch :weight bold :height 1.1 :foreground ,slate :background ,bg-dark)))) + '(org-level-4 ((t (:inherit variable-pitch :weight bold :height 1.1 :foreground ,slate :background ,bg-dark)))) + '(org-level-5 ((t (:inherit variable-pitch :weight bold :height 1.1 :foreground ,slate :background ,bg-dark)))) + '(org-level-6 ((t (:inherit variable-pitch :weight bold :height 1.1 :foreground ,slate :background ,bg-dark)))) + '(org-level-7 ((t (:inherit variable-pitch :weight bold :height 1.1 :foreground ,slate :background ,bg-dark)))) + '(org-level-8 ((t (:inherit variable-pitch :weight bold :height 1.1 :foreground ,slate :background ,bg-dark)))) + '(org-headline-done (nil)) + '(org-quote ((t (:background ,bg-dark :family ,sans-mono-font)))) + '(org-block ((t (:background ,bg-dark :family ,sans-mono-font)))) + '(org-block-begin-line ((t (:background ,bg-dark)))) + '(org-block-end-line ((t (:background ,bg-dark)))) + '(org-meta-line ((t (:foreground ,comment)))) + '(org-document-info-keyword ((t (:foreground ,comment)))) + '(org-link ((t (:underline nil :weight normal :foreground ,slate)))) + '(org-special-keyword ((t (:height 0.9 :foreground ,comment)))) + '(org-property-value ((t (:height 0.9 :foreground ,comment)))) + '(org-drawer ((t (:height 0.9 :foreground ,comment)))) + '(org-todo ((t (:foreground ,builtin :background ,bg-dark)))) + '(org-done ((t (:inherit variable-pitch :foreground ,dark-cyan :background ,bg-dark)))) + '(org-agenda-current-time ((t (:foreground ,slate)))) + '(org-hide ((t nil))) + '(org-indent ((t (:inherit org-hide)))) + '(org-time-grid ((t (:foreground ,comment)))) + '(org-warning ((t (:foreground ,builtin)))) + '(org-date ((t nil))) + '(org-agenda-structure ((t (:height 1.3 :foreground ,doc :weight normal :inherit variable-pitch)))) + '(org-agenda-date ((t (:foreground ,doc)))) + '(org-agenda-date-today ((t (:height 1.5 :foreground ,keyword)))) + '(org-agenda-date-weekend ((t (:inherit org-agenda-date)))) + '(org-scheduled ((t (:foreground ,gray)))) + '(org-upcoming-deadline ((t (:foreground ,keyword)))) + '(org-scheduled-today ((t (:foreground ,fg-white)))) + '(org-scheduled-previously ((t (:foreground ,slate)))) + '(org-agenda-done ((t (:inherit nil :foreground ,doc)))) + '(org-ellipsis ((t (:underline nil :foreground ,comment)))) + '(org-tag ((t (:foreground ,doc)))) + '(org-table ((t (:background nil :family ,sans-mono-font)))) + '(org-code ((t (:inherit font-lock-builtin-face)))) + '(font-latex-sectioning-0-face ((t (:foreground ,type :height 1.2)))) + '(font-latex-sectioning-1-face ((t (:foreground ,type :height 1.1)))) + '(font-latex-sectioning-2-face ((t (:foreground ,type :height 1.1)))) + '(font-latex-sectioning-3-face ((t (:foreground ,type :height 1.0)))) + '(font-latex-sectioning-4-face ((t (:foreground ,type :height 1.0)))) + '(font-latex-sectioning-5-face ((t (:foreground ,type :height 1.0)))) + '(font-latex-verbatim-face ((t (:foreground ,builtin)))) + '(spacemacs-normal-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(spacemacs-evilified-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(spacemacs-lisp-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(spacemacs-emacs-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(spacemacs-motion-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(spacemacs-visual-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(spacemacs-hybrid-face ((t (:background ,bg-dark :foreground ,fg-white)))) + '(bm-persistent-face ((t (:background ,dark-cyan :foreground ,fg-white)))) + '(helm-selection ((t (:background ,region)))) + '(helm-match ((t (:foreground ,keyword)))) + '(cfw:face-title ((t (:height 2.0 :inherit variable-pitch :weight bold :foreground ,doc)))) + '(cfw:face-holiday ((t (:foreground ,builtin)))) + '(cfw:face-saturday ((t (:foreground ,doc :weight bold)))) + '(cfw:face-sunday ((t (:foreground ,doc)))) + '(cfw:face-periods ((t (:foreground ,dark-cyan)))) + '(cfw:face-annotation ((t (:foreground ,doc)))) + '(cfw:face-select ((t (:background ,region)))) + '(cfw:face-toolbar-button-off ((t (:foreground ,doc)))) + '(cfw:face-toolbar-button-on ((t (:foreground ,type :weight bold)))) + '(cfw:face-day-title ((t (:foreground ,doc)))) + '(cfw:face-default-content ((t (:foreground ,dark-cyan)))) + '(cfw:face-disable ((t (:foreground ,doc)))) + '(cfw:face-today ((t (:background ,region :weight bold)))) + '(cfw:face-toolbar ((t (:inherit default)))) + '(cfw:face-today-title ((t (:background ,keyword :foreground ,fg-white)))) + '(cfw:face-grid ((t (:foreground ,comment)))) + '(cfw:face-header ((t (:foreground ,keyword :weight bold)))) + '(cfw:face-default-day ((t (:foreground ,fg-white)))) + '(dired-subtree-depth-1-face ((t (:background nil)))) + '(dired-subtree-depth-2-face ((t (:background nil)))) + '(dired-subtree-depth-3-face ((t (:background nil)))) + '(dired-subtree-depth-4-face ((t (:background nil)))) + '(dired-subtree-depth-5-face ((t (:background nil)))) + '(dired-subtree-depth-6-face ((t (:background nil)))) + '(nlinum-current-line ((t (:foreground ,builtin)))) + '(vertical-border ((t (:background ,region :foreground ,region)))) + '(which-key-command-description-face ((t (:foreground ,type)))) + '(flycheck-error ((t (:background nil)))) + '(flycheck-warning ((t (:background nil)))) + '(font-lock-string-face ((t (:foreground ,string)))) + '(font-lock-comment-face ((t (:foreground ,doc :slant italic)))) + '(elfeed-search-unread-title-face ((t (:weight bold)))) + '(helm-ff-symlink ((t (:foreground ,slate)))) + '(region ((t (:background ,region))))) +#+end_src +*** Misc +**** Diminish buffer-face-mode =Face-remap= is a library for basic face remapping. =Buffer-face-mode= is enabled when using =variable-pitch-mode= to show the face defined in =variable-pitch= instead of =default=. @@ -919,7 +1285,7 @@ in =variable-pitch= instead of =default=. (use-package face-remap :delight (buffer-face-mode)) #+end_src -*** Scaling the height of the =default= face. +**** Scaling the height of the =default= face. When switching between monitors with different resolution, scaling the =default= face can be used to in-/decreases the size of text and UI elements (modeline, …) to a more readable size. -- cgit v1.2.3 From 4cebcc5c2d79662608262f391b288f1a70678d3b Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 28 Jun 2020 10:32:51 +0200 Subject: Fix some use-package calls --- emacs-init.org | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index f74dd8b..a2ae1c0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2347,9 +2347,8 @@ after the theme changes. #+end_src ** Latex #+begin_src emacs-lisp -(use-package auctex - :no-require t - :straight t) +(use-package tex-site + :straight auctex) #+end_src =cdlatex= depends on =texmath.el=. The docstring of =cdlatex= says @@ -2382,8 +2381,8 @@ area. #+end_src *** Matlab #+begin_src emacs-lisp -(use-package matlab-mode - :straight t) +(use-package matlab + :straight matlab-mode) #+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org -- cgit v1.2.3 From 7afeedf2333d8780a43bd440a642b22944228c7c Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 28 Jun 2020 10:33:29 +0200 Subject: Add magit-blame to diff-hl hydra --- emacs-init.org | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index a2ae1c0..0a7f8dc 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2071,10 +2071,10 @@ navigate and revert hunks directly from the buffer. Use =g= to open " Diff-hl: _n_: next hunk _s_tage hunk _g_: Magit status - _p_: previous hunk _r_evert hunk _q_uit - ^ ^ _P_opup hunk _Q_uit and deactivate git-gutter - _a_: first hunk - _e_: last hunk _A_mend mode + _p_: previous hunk _r_evert hunk _b_: Magit blame popup + ^ ^ _P_opup hunk ^ ^ + _a_: first hunk ^ ^ _q_uit + _e_: last hunk _A_mend mode _Q_uit and deactivate git-gutter " ("n" diff-hl-next-hunk) ("p" diff-hl-previous-hunk) @@ -2087,6 +2087,7 @@ navigate and revert hunks directly from the buffer. Use =g= to open ("P" diff-hl-diff-goto-hunk) ("A" diff-hl-amend-mode) ("g" magit-status :color blue) + ("b" magit-blame :color blue) ("q" nil :color blue) ("Q" (diff-hl-mode -1) :color blue)) -- cgit v1.2.3 From 7009acda2889c6167dd68b765fb5212935113068 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:25:41 +0200 Subject: Fix gnus icalendar org file location --- gnus.org | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gnus.org b/gnus.org index ad27735..84d5a33 100644 --- a/gnus.org +++ b/gnus.org @@ -79,7 +79,7 @@ Enable responding to meeting invites. (use-package gnus-icalendar :config (gnus-icalendar-setup) - (setq gnus-icalendar-org-capture-file "~/win/Documents/sync/appointments.org") + (setq gnus-icalendar-org-capture-file "~/sync/appointments.org") (setq gnus-icalendar-org-capture-headline '("Calendar")) ;;make sure to create Calendar heading first (gnus-icalendar-org-setup) ) @@ -203,20 +203,6 @@ Unicode reply symbol #+begin_src emacs-lisp (setq gnus-summary-to-prefix "→ ") #+end_src -Function to toggle display of group levels in the group buffer. -#+begin_src emacs-lisp -(defvar gnus-group-line-format-wo-levels nil) -(defun fpi/gnus-group-toggle-levels () - (interactive) - (if gnus-group-line-format-wo-levels - (setq gnus-group-line-format gnus-group-line-format-wo-levels - gnus-group-line-format-wo-levels nil) - (setq gnus-group-line-format-wo-levels gnus-group-line-format - gnus-group-line-format (concat "[%L] " gnus-group-line-format))) - ;; Hack to update display - (gnus-group-get-new-news 0)) -(define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) -#+end_src **** On threads Gather loose threads, whose parent is currently not displayed, under a dummy article. I find the default ~'adopt~ to be too confusing. @@ -260,6 +246,20 @@ Disable indenting a topic. I always do it by accident. (define-key gnus-topic-mode-map (kbd "") 'fpi/gnus-topic-toggle-topic) (define-key gnus-topic-mode-map (kbd "TAB") 'fpi/gnus-topic-toggle-topic)) #+end_src +Function to toggle display of group levels in the group buffer. +#+begin_src emacs-lisp +(defvar gnus-group-line-format-wo-levels nil) +(defun fpi/gnus-group-toggle-levels () + (interactive) + (if gnus-group-line-format-wo-levels + (setq gnus-group-line-format gnus-group-line-format-wo-levels + gnus-group-line-format-wo-levels nil) + (setq gnus-group-line-format-wo-levels gnus-group-line-format + gnus-group-line-format (concat "[%L] " gnus-group-line-format))) + ;; Hack to update display + (gnus-group-get-new-news 0)) +(define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) +#+end_src **** Window Layout See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp -- cgit v1.2.3 From acfe6ccbf01d3a2fa2bac662cda37af0c2825e6e Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:26:00 +0200 Subject: Add dired-git-info --- emacs-init.org | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0a7f8dc..8ba97f6 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1928,6 +1928,13 @@ behaviour while inside a regular dired buffer. (peep-dired-ignored-extensions '("mkv" "webm" "mp4" "mp3" "ogg" "iso"))) #+END_SRC +*** dired git info +#+begin_src emacs-lisp +(use-package dired-git-info + :straight t + :bind (:map dired-mode-map + (")" . dired-git-info-mode))) +#+end_src *** dired-x Some additional features that are shipped with Emacs. @@ -1940,8 +1947,6 @@ Some additional features that are shipped with Emacs. (dired-mode . (lambda () (setq dired-clean-confirm-killing-deleted-buffers t)))) #+END_SRC - - *** dired-subtree + The tab key will expand or contract the subdirectory at point. + =C-TAB= will behave just like org-mode handles its headings: hit it -- cgit v1.2.3 From e58f2164507ca27aa53efa706ee7592631ee99f7 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:26:09 +0200 Subject: Add magit forge --- emacs-init.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 8ba97f6..6881cdf 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2041,6 +2041,12 @@ Only highlight the changes within a line, not the whole line. :custom (magit-diff-refine-hunk 'all)) #+END_SRC +**** Forge +#+begin_src emacs-lisp +(use-package forge + :after magit + :straight t) +#+end_src **** gitflow Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitflow]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 1d6e11eb1f52c0ae9d504844616189fc5f7864bd Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:26:15 +0200 Subject: Add a week agenda --- emacs-init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 6881cdf..dae6b87 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2609,6 +2609,8 @@ Switch projects and subprojects from NEXT back to TODO" `(("d" "Day agenda" ((agenda "" ((org-agenda-span 'day))) (org-time-budgets-in-agenda-maybe))) + ("w" "Week agenda" + ((agenda "" ((org-agenda-span 'week))))) ("n" "Agenda and all TODOs" ((todo "INPROGRESS" ((org-agenda-overriding-header "Inprogress Tasks"))) -- cgit v1.2.3 From 333360e8f8d9ff5b69373e52a7e334448f0460c3 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:26:22 +0200 Subject: Increase depth of refile levels for agenda files --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index dae6b87..0df2db7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2713,7 +2713,7 @@ As refile only works on file-visiting buffers, we need to filter all other org b #+begin_src emacs-lisp :noweb-ref org-custom :tangle no (org-refile-use-outline-path 'file) (org-refile-targets '((buffer-file-name :maxlevel . 8) - (org-agenda-files :maxlevel . 3) + (org-agenda-files :maxlevel . 5) (fpi/org-file-buffer-list :maxlevel . 2))) #+end_src *** Time budgets -- cgit v1.2.3 From 7c8270c8de5f756892d32caf2f6bf183f9399f67 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:28:45 +0200 Subject: Extract org capture templates & setup org-expiry --- emacs-init.org | 269 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 175 insertions(+), 94 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0df2db7..ed1b139 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2655,9 +2655,6 @@ Switch projects and subprojects from NEXT back to TODO" (use-package org-collector) (use-package ox) (use-package ol-notmuch) -(use-package org-expiry - :custom - (org-expiry-handler-function 'org-expiry-archive-subtree)) (use-package org-habit) #+end_src #+begin_src emacs-lisp @@ -2838,6 +2835,9 @@ Set some prettify symbols for org mode. (("C-c n a" . orb-note-actions)))) #+end_src *** Org-edna +:PROPERTIES: +:ID: fd3936c7-9fc5-42d0-990d-32024e23b22f +:END: =Org-edna= is a great tool to manage =TODO= dependencies. I mainly use it to mark tasks as =NEXT= after switching another task to =DONE=. The functions below are taken from Josh's Emacs Config over at [[https://github.com/mm--/dot-emacs/blob/master/jmm-org-config.org][Github]]. He @@ -2934,27 +2934,41 @@ content syncing upon commit. Templates #+BEGIN_SRC emacs-lisp (use-package org-capture - :custom ( - (org-journal-file (format "~/sync/journal/%s.org" (nth 2 (calendar-current-date)))) - (org-capture-templates - `(("j" "Journal") - ("jj" "Journal Entry (Link)" - entry - (file+olp+datetree - ,org-journal-file) - ;; "** %<%H:%M> %a\n %i%? \n%:description\n%:elfeed-entry-content\n%:elfeed-entry-date\n%:elfeed-entry-meta\n%:elfeed-entry-title\n%:elfeed-entry-enclosures\n%:elfeed-entry-tags" ) - "** %<%H:%M> %a + :custom + ((org-journal-file (format "~/sync/journal/%s.org" (nth 2 (calendar-current-date)))) + (org-capture-templates + `( +<>)) + (org-capture-templates-contexts + '( + <>)))) +#+END_SRC +**** Templates +***** Journal +Capture templates for journal entries. Mostly to just keep track of things I have looked at and which may be interesting later, but do not warrant a zettel right now. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("j" "Journal") +("jj" "Journal Entry (Link)" + entry + (file+olp+datetree + ,org-journal-file) + ;; "** %<%H:%M> %a\n %i%? \n%:description\n%:elfeed-entry-content\n%:elfeed-entry-date\n%:elfeed-entry-meta\n%:elfeed-entry-title\n%:elfeed-entry-enclosures\n%:elfeed-entry-tags" ) + "** %<%H:%M> %a %i%?" ) - ("je" "Journal Entry" - entry - (file+olp+datetree - ,org-journal-file) - "** %<%H:%M> %? +("je" "Journal Entry" + entry + (file+olp+datetree + ,org-journal-file) + "** %<%H:%M> %? %i" ) - ("i" "Interrupt" - entry - (id "802014b3-fddf-4090-b140-7fb62cb982f2") - "** Interrupt: %? +#+END_SRC +***** Interrupts +For interruptions. These are saved in a global refile file and to be sorted to their appropriate place. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("i" "Interrupt" + entry + (file "~/sync/refile.org") + "** Interrupt: %? :PROPERTIES: :CREATED: %U :SOURCE: %a @@ -2962,92 +2976,118 @@ Templates :LOGBOOK: :END: " -:clock-in t -:clock-resume t) - ("a" "Appointment" - entry - (id "802014b3-fddf-4090-b140-7fb62cb982f2") - "** %? + :clock-in t + :clock-resume t) +#+END_SRC +***** Appointments +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("a" "Appointment" + entry + (id "802014b3-fddf-4090-b140-7fb62cb982f2") + "** %? :PROPERTIES: :CREATED: %U :DATE: %^t +<> :SOURCE: %a :END: " - ) - ("b" "Bibtex entry" - entry - (id "efc97963-b714-4020-94b6-c23ad2a286ee") - (function fpi/add-org-from-doi)) - ("r" "Reply" - entry - (file "~/sync/refile.org") - "* REPLY: %:from: %:subject + ) +#+END_SRC +***** Tasks +Instead of project related capture templates, I use the same template for all tasks and refile them manually to where they belong. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("t" "Task" + entry + (file "~/sync/refile.org") + "** NEXT %? :PROPERTIES: :CREATED: %U +<> :SOURCE: %a :END: -%? -" - ) - ("c" "Checkout") - ("cr" ".. & read" - entry - (file "~/sync/refile.org") - "* TODO %a :READLIST: +%i") +#+END_SRC +***** Plans & Ideas +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("p" "Plans/Ideas" + entry + (file "~/sync/refile.org") + "*** PLANNING %? +:PROPERTIES: +:CREATED: %U +<> +:SOURCE: %a +:END: +%i") +#+END_SRC +***** Reply to Mail +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("r" "Respond" entry (file "~/sync/refile.org") + "* NEXT Respond to %:from on %:subject +:PROPERTIES: +:CREATED: %U +<> +:END: +%a" :immediate-finish t) +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates-contexts +("r" ((in-mode . "gnus-summary-mode") + (in-mode . "gnus-article-mode"))) +#+END_SRC +***** Interesting stuff I have to look at later +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("c" "Checkout") +("cr" ".. & read" + entry + (file "~/sync/refile.org") + "* TODO %a :READLIST: :PROPERTIES: :CREATED: %U +<> +:SOURCE: %a :END: -%?") - ;; ("a" "Appointment" entry (file "~/sync/a.org") - ;; "* %i%?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%^t") - ;; ("t" "Soonish task" entry (file "~/sync/refile.org") - ;; "* NEXT %?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%i") - ;; ("s" "Shelve something" entry (file+headline "~/sync/t.org" "Shelf") - ;; "* NEXT %?%(and (org-id-get-create) nil)\n:PROPERTIES:\n:CREATED: %U%(when %a \"\n:SOURCE: %a\")\n:END:\n%i") - ;; ;; ("r" "respond" entry (file "~/sync/refile.org") - ;; ;; "* NEXT Respond to %:from on %:subject\n:PROPERTIES:\n:CREATED: %U\n:END:\n%a\n" :clock-in t :clock-resume t :immediate-finish t) - ;; ("r" "respond" entry (file "~/sync/refile.org") - ;; "* NEXT Respond to %:from on %:subject\n:PROPERTIES:\n:CREATED: %U\n:END:\n%a\n" :immediate-finish t) - ;; ("n" "note" entry (file "~/sync/refile.org") - ;; "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t) - ;; ("j" "Journal/Interruptions" entry (file+olp+datetree "~/sync/diary.org") - ;; "* %?\n%U\n" :clock-in t :clock-resume t) - ;; ("h" "Habit" entry (file "~/sync/refile.org") - ;; "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n") - ;; ("m" "Meeting" entry (file "~/sync/refile.org") - ;; "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) - ;; ("p" "Phone call" entry (file "~/sync/refile.org") - ;; "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t) - - ;; ("c" "Item to Current Clocked Task" item (clock) - ;; "%i%?" :empty-lines 1) - ;; ("K" "Kill-ring to Current Clocked Task" plain (clock) - ;; "%c" :immediate-finish t :empty-lines 1) - - ;; ("p" "Gcal Appointment" entry (file "~/.emacs.d/gcal.org") - ;; "* %?\n%^T\n") - - ;; ("z" "Zettel" entry (file "~/zettel.org") - ;; "* %i%? %(and (org-id-get-create) nil) - ;; :PROPERTIES:\n :CREATED: %u\n :END:\n ") - - ;; ("l" "Ledger") - ;; ("lb" "Bank" plain (file ,(format "~/.personal/f/%s.ledger" (format-time-string "%Y"))) - ;; ,my/org-ledger-card-template - ;; :empty-lines 1 - ;; :immediate-finish t) - ;; ("lc" "Cash" plain (file ,(format "~/.personal/f/%s.ledger" (format-time-string "%Y"))) - ;; ,my/org-ledger-cash-template - ;; :empty-lines 1 - ;; :immediate-finish t) - ) - ) - (org-capture-templates-contexts - '(("r" ((in-mode . "gnus-summary-mode") - (in-mode . "gnus-article-mode"))))))) +%? +") +#+END_SRC +***** Ledger transactions +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("l" "Ledger") + ("lb" "Bank" plain (file ,(format "~/.personal/f/%s.ledger" (format-time-string "%Y"))) + ,private/org-ledger-card-template + :empty-lines 1 + :immediate-finish t) + ("lc" "Cash" plain (file ,(format "~/.personal/f/%s.ledger" (format-time-string "%Y"))) + ,private/org-ledger-cash-template + :empty-lines 1 + :immediate-finish t) #+END_SRC -Setup for floating capture window. For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]]. +***** Old templates +Templates I no longer use, but may be interesting. +#+BEGIN_SRC emacs-lisp :tangle no +("n" "note" entry (file "~/sync/refile.org") + "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t) +("j" "Journal/Interruptions" entry (file+olp+datetree "~/sync/diary.org") + "* %?\n%U\n" :clock-in t :clock-resume t) +("h" "Habit" entry (file "~/sync/refile.org") + "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n") +("m" "Meeting" entry (file "~/sync/refile.org") + "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) +("p" "Phone call" entry (file "~/sync/refile.org") + "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t) + +("c" "Item to Current Clocked Task" item (clock) + "%i%?" :empty-lines 1) +("K" "Kill-ring to Current Clocked Task" plain (clock) + "%c" :immediate-finish t :empty-lines 1) +("p" "Gcal Appointment" entry (file "~/.emacs.d/gcal.org") + "* %?\n%^T\n") +("z" "Zettel" entry (file "~/zettel.org") + "* %i%? %(and (org-id-get-create) nil) +:PROPERTIES:\n:CREATED: %u\n:END:\n") +#+END_SRC +**** Setup for floating capture window. For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]]. #+begin_src emacs-lisp (defun fpi/make-floating-frame (&optional width height minibuffer name) (interactive) @@ -3077,6 +3117,38 @@ Setup for floating capture window. For reference see [[https://www.windley.com/a (org-capture) (remove-hook 'org-capture-mode-hook 'delete-other-windows)) #+end_src +*** Org Expiry +This is an easy way to (semi-)automatically archive no longer relevant entries. + +I want to archive entries sometime after they are set to =DONE=. I first thought about using [[id:fd3936c7-9fc5-42d0-990d-32024e23b22f][Org Edna]]'s =TRIGGER= keyword: +: :TRIGGER: self set-property("EXPIRY" "some-date") +But unfortunately it does not support evaluating lisp for the property value. Therefore either an absolute expiry date has to be known when setting the =TRIGGER= or one needs to use a relative date. + +To come by with relatives dates I use the =CLOSED= property as reference for org-expiry when evaluating relative timestamps. The relative timestamp can then already be set directly in the capture template. Ten days gives me enough time to check whether the content is no longer important and to review the clocked times. +#+begin_src fundamental :noweb-ref org-capture-template-properties +:EXPIRY: +10d +#+end_src +As I do not always mark appointments as =DONE=, I set the =CLOSED= property already in the capture template (to the same time as the actual date). This is currently bugged.. +#+begin_src fundamental :noweb-ref org-capture-template-closed +CLOSED: %\\1 +#+end_src + +#+begin_src emacs-lisp +(use-package org-expiry + :after org + :straight (org-plus-contrib) + :custom + (org-expiry-handler-function 'org-expiry-archive-subtree) + (org-expiry-inactive-timestamps t) + (org-expiry-created-property-name "CLOSED")) +;; (defun fpi/org-insert-expiry (&optional date) +;; (interactive) +;; (let ((date (or date "fri"))) +;; (with-temp-buffer +;; (org-insert-time-stamp (org-read-date nil t "fri") nil t) +;; (buffer-string)))) +#+end_src +(org-read-date nil nil ".") *** Ricing #+begin_src emacs-lisp (setq line-spacing 0.1) @@ -3146,6 +3218,15 @@ time in a bibtex src block in the heading. The src blocks are tangled to compile into a separate =.bib= file. The function below creates new entries from a given doi and is called in my respective capture template. + +Here is my capture template. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("b" "Bibtex entry" + entry + (id "efc97963-b714-4020-94b6-c23ad2a286ee") + (function fpi/add-org-from-doi)) +#+END_SRC +And the function to create the file. #+begin_src emacs-lisp (defun fpi/add-org-from-doi (&optional doi) "Get bibtex entry from doi and format as Org header with -- cgit v1.2.3 From e1fdf7757e12a0abe90a5a9568d5bb110fa653b6 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:29:17 +0200 Subject: Add more org-time-budgets --- emacs-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index ed1b139..8899445 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2720,7 +2720,9 @@ Gives an overview of time spent on defined budgets this week. Great to track if :straight (:host github :repo "fpiper/org-time-budgets" :branch "develop") :custom - (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :block workweek)))) + (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :block workweek) + (:title "Research" :match "+work+research" :budget "24:00" :block total-only) + (:title "Teaching" :match "+work+teaching" :budget "8:00" :block total-only)))) #+end_src *** Column view #+begin_src emacs-lisp -- cgit v1.2.3 From 5e29df1426a7d88f64619b51e7a4dd7f360b3914 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 29 Jun 2020 08:44:06 +0200 Subject: Add function to properly load & toggle the theme --- emacs-init.org | 51 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8899445..d2f55ff 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -304,17 +304,24 @@ Instead of the above code I set the font directly using appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light theme promising high color contrast. I ended up using the =spacemacs-light= and =spacemacs-dark= themes. -#+begin_src emacs-lisp + +This is written here for clarity, but only executed at the end of my +init files, after some variables which depend on the current theme are +defined, for example ~pdf-view-midnight-colors~. +#+NAME: themes +#+begin_src emacs-lisp :tangle no +<> (defcustom fpi/light-theme-list '(spacemacs-light spacemacs-light-customizations) "List of themes to activate when using a light theme.") (defcustom fpi/dark-theme-list '(spacemacs-dark spacemacs-dark-customizations) "List of themes to activate when using a dark theme.") (defcustom fpi/current-theme 'light - "Currently activated theme variation.") + "Currently activated theme variation." + :set #'fpi/set-and-reload-theme) #+end_src -Function to load themes based on the ~fpi/current-theme~ setting. -#+begin_src emacs-lisp +Functions to load themes based on the ~fpi/current-theme~ setting and to toggle the current theme between light and dark. +#+begin_src emacs-lisp :noweb-ref theme-functions :tangle no (defun fpi/load-themes (&optional theme-variation) "Load themes based on the value of `fpi/current-theme'. @@ -325,12 +332,24 @@ of `(format \"fpi/%s-theme-list\" fpi/current-theme)'" (mapc 'disable-theme custom-enabled-themes);; disable all themes (let* ((theme-variation (or theme-variation fpi/current-theme)) (themes (eval (intern (format "fpi/%s-theme-list" theme-variation))))) - (mapc (lambda (theme) (load-theme theme t)) themes) - )) + (mapc (lambda (theme) (load-theme theme t)) themes))) +(defun fpi/set-and-reload-theme (symbol value) + "Set SYMBOL to VALUE and update themes. + +Set SYMBOL to VALUE with `set-default'if it is not already set to +that value and update the loaded themes afterwards." + (when (not (and (boundp symbol) (eq (eval symbol) value))) + (set-default symbol value) + (fpi/load-themes))) +(defun fpi/toggle-theme () + "Toggle between light and dark theme." + (interactive) + (if (eq fpi/current-theme 'light) + (customize-save-variable 'fpi/current-theme 'dark) + (customize-save-variable 'fpi/current-theme 'light))) #+end_src -Load the themes. This is written here for clarity, 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 -(fpi/load-themes) +#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings +(define-key fpi/toggle-map "dt" #'fpi/toggle-theme) #+end_src *** Getting themes #+begin_src emacs-lisp @@ -362,7 +381,7 @@ First a function to replace colors in the face specs. This call now creates a custom theme based on the settings in the sections [[id:82021d54-89d6-4712-8e5a-df2fc6177c96][Colors]] and [[id:a3b74d3b-675e-426d-b675-e70dcfd3d2b6][Faces]]. These are my customizations to the spacemacs theme. Make sure to manually run these customization blocks after changing a face, as only the result blocks are tangled! -#+begin_src emacs-lisp :tangle no :results code replace :wrap "src emacs-lisp :tangle tangle/spacemacs-dark-customizations-theme.el" +#+begin_src emacs-lisp :tangle no :results code replace :wrap "src emacs-lisp :tangle tangle/spacemacs-dark-customizations-theme.el" :exports both `(progn (deftheme spacemacs-dark-customizations "My customizations to spacemacs-dark (Created 2020-06-27)") @@ -707,7 +726,7 @@ This call now creates a custom theme based on the settings in the sections (provide-theme 'spacemacs-dark-customizations)) #+end_src -#+begin_src emacs-lisp :tangle no :results code replace :wrap "src emacs-lisp :tangle tangle/spacemacs-light-customizations-theme.el" +#+begin_src emacs-lisp :tangle no :results code replace :wrap "src emacs-lisp :tangle tangle/spacemacs-light-customizations-theme.el" :exports both `(progn (deftheme spacemacs-light-customizations "My customizations to spacemacs-light (Created 2020-06-27)") @@ -2353,10 +2372,12 @@ would be better to unbind them only when in ~pdf-view-mode~. Advice =load-theme= to update the colors for =pdf-view-midnight-mode= after the theme changes. -#+begin_src emacs-lisp :tangle no :noweb-ref pre-load-theme +#+NAME: theme-dependent-vars +#+begin_src emacs-lisp :tangle no (defadvice load-theme (after update-pdf-view-midnight-color activate) - (setq pdf-view-midnight-colors `(,(face-attribute 'default :foreground) . ,(face-attribute 'default :background)))) + (customize-save-variable 'pdf-view-midnight-colors `(,(face-attribute 'default :foreground) . ,(face-attribute 'default :background)))) #+end_src + ** Latex #+begin_src emacs-lisp (use-package tex-site @@ -4493,6 +4514,6 @@ temporary buffer is created. Some stuff that is run after everything else. #+begin_src emacs-lisp -<> -<> +<> +<> #+end_src -- cgit v1.2.3 From a460e55eb34906700bfac034ddb0b6ddf06720aa Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 1 Jul 2020 19:32:16 +0200 Subject: Dumb fix for org-roam link faces calling tramp --- emacs-init.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index d2f55ff..7ed76fe 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2847,8 +2847,13 @@ Set some prettify symbols for org mode. ("C-c n f" . org-roam-find-file) ("C-c n g" . org-roam-show-graph)) :map org-mode-map - (("C-c n i" . org-roam-insert)))) + (("C-c n i" . org-roam-insert))) + :config (defun org-roam--roam-file-link-face (path) + "Return `org-link'" + 'org-link) + ) #+end_src +Fix for hanging emacs. The original function calls file-exist-p which opens a slow tramp connection. **** org-roam-bibtex #+begin_src emacs-lisp :tangle no (use-package org-roam-bibtex -- cgit v1.2.3 From 5b77fb5a4cd57be9bf29c9bdcaf7a2e9c23ca2b5 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 3 Jul 2020 13:47:01 +0200 Subject: Change org-mode repository to my github fork --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 7ed76fe..e2602f6 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2452,7 +2452,7 @@ Hansen's]] configs. #+begin_src emacs-lisp (use-package org - :straight (org-plus-contrib) + :straight (org-plus-contrib :host github :repo "fpiper/org-mode" :branch "develop" :local-repo "org" :files (:defaults "contrib/lisp/*.el")) :delight (org-cdlatex-mode) :bind (("C-c c" . org-capture) -- cgit v1.2.3 From ab9b61c1b42f86c28c75537ca14a58a633287b72 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 3 Jul 2020 13:47:14 +0200 Subject: Update package versions --- package-versions.el | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/package-versions.el b/package-versions.el index c3b58b9..d6a3ef5 100644 --- a/package-versions.el +++ b/package-versions.el @@ -1,14 +1,18 @@ (("Try" . "8831ded1784df43a2bd56c25ad3d0650cdb9df1d") + ("alert" . "7046393272686c7a1a9b3e7f7b1d825d2e5250a6") ("auctex" . "6abf890a485b2ff734d8f87f38393f9b8f6bbbf6") ("auth-password-store" . "ff4940c647786914b3cbef69103d96a4ea334111") + ("avy" . "2dde8b71a0feb366c8ee5e2a1400a0d3a0f06424") ("bbdb" . "45529e315ba861f9df2914f9b88d2f7b991d5595") ("biblio.el" . "eb9baf1d2bf6a073d24ccb717025baa693e98f3e") ("cdlatex" . "480387b39f6ddd9cd2a9511ecee064ad8e1dd324") + ("closql" . "9371635bc3e259b73a075985ebbfc58b45fa5e9d") ("dash.el" . "ea4a4cc7cce7c3b93862a22df8bca8b83052ccbf") ("deft" . "fca9ea05ef4fdac825e2ad3921baa7042f6b82c8") ("delight" . "02e73b69708e23053105866a58fe14f75c272dee") ("diff-hl" . "176f931a9bfc6bc6fc5360c6ed7128ff96b21289") ("dired-du" . "d6571317673ba44566ba411d26b7af74e3139ff7") + ("dired-git-info" . "b47f2b0c3a6cb9b7a62a4ee2605a492e512d40a9") ("dired-hacks" . "f49a8bbf95f70671a74a24f7f4de453b2686be46") ("dired-sidebar" . "6e569c851418890c21fd37d03a62f85343aa0900") ("elfeed" . "a2cae98b4f04616c06455b6104d2ca5ff4b86867") @@ -22,8 +26,11 @@ ("emacsql-sqlite3" . "1e411fd38a0137553986db209642fe93cae96060") ("epl" . "78ab7a85c08222cd15582a298a364774e3282ce6") ("f.el" . "1814209e2ff43cf2e6d38c4cd476218915f550fb") + ("forge" . "048efbba83b1df591de0487202ff968250ea4fc5") + ("ghub" . "3da5d8827f6b697ef71dca0a44eb8134689c1dad") ("git-auto-commit-mode" . "dd0c2441de0f5ff8c69c8260d9450d0b607e3e55") - ("git-identity.el" . "8471e6f8ef6c502dc999e513b552d6b23974d40d") + ("git-identity.el" . "eec910b2a5459345321b5b9d166383f1323501f5") + ("gntp.el" . "767571135e2c0985944017dc59b0be79af222ef5") ("gnu-elpa-mirror" . "f07e244acca36061cc03c63463246b848748e804") ("gnuplot" . "f0001c30010b2899e36d7d89046322467e923088") ("gnuplot-mode" . "601f6392986f0cba332c87678d31ae0d0a496ce7") @@ -31,18 +38,22 @@ ("helm-bibtex" . "8a0dd9841316793aacddea744d6b8ca4a7857a35") ("hydra" . "8a9124f80b6919ad5288172b3e9f46c5332763ca") ("ibuffer-vc" . "1249c1e30cf11badfe032ac3b1058f24ba510ace") + ("icomplete-vertical" . "a5871d39c5850ac4d9aac48350eaa1d31f3aaef7") ("key-chord" . "72443e9ff3c4f1c3ccaced3130236801efde3d83") ("language-detection.el" . "54a6ecf55304fba7d215ef38a4ec96daff2f35a4") ("ledger-mode" . "f8463744191b4feb9fea54190917663f7ba26102") ("let-alist" . "ef3c02fa292b6e32769945bbbfb7f2e5ac574b64") - ("magit" . "c9b9afe8b6e92bee763ed1f6843766efaf87094d") + ("log4e" . "7df0c1ff4656f8f993b87064b1567618eadb5546") + ("magit" . "8b45756390e43bfc3247dd85bf5f7738516e569a") ("magit-gitflow" . "cc41b561ec6eea947fe9a176349fb4f771ed865b") ("magit-popup" . "b8e886c4f2242d6c58f84d4549af712e86360db1") + ("markdown-mode" . "399df42755ccf31cecb61c9f5d8ad72bc30d7e4b") + ("matlab-mode" . "e14d97df706049ea2e2d6e5b515fdbd08cd94dd3") ("melpa" . "ee055cc258692a92f727633306adf7df31267479") ("messages-are-flowing" . "d582a564a63b7b90764ffc5c618bc5300225d0ab") - ("nadvice" . "2dfcf614dc5472fb21e48f93d0ebb4546276377f") ("notmuch" . "963e363a234f1c8bdf1ae68956f80a2538bee7dc") - ("org" . "a8cc4f72441acd468f400aeb53549735d698f84c") + ("orderless" . "1f1e0380e2a8cd4fc29b8cc2e00cb01b56d86fbc") + ("org" . "583012b5e129ca79c05109ba68c37f17ffca4930") ("org-bullets" . "767f55feb58b840a5a04eabfc3fbbf0d257c4792") ("org-caldav" . "8569941a0a5a9393ba51afc8923fd7b77b73fa7a") ("org-clock-convenience" . "4e522706a90a504c75d377161005f9543575ea02") @@ -52,6 +63,7 @@ ("org-ref" . "9465abc54a296b4b2f745b4bb3a28ec4dad3a0cb") ("org-reveal" . "84039bb499290926511b04749882ecb5eda45a0c") ("org-roam" . "87403b330ce713a892e3e35ff4174a8e2727e24d") + ("org-time-budgets" . "207dda6308cfc73e16dcfd84237a560c27428beb") ("parsebib" . "3497b6068d78ae15ba1eaf94e4315d18e9ae6b00") ("pass" . "919d8e3826d556433ab67d4ee21a509d209d1baa") ("password-store" . "07b169ec32ad6961ed8625a0b932a663abcb01d2") @@ -62,6 +74,7 @@ ("pkg-info" . "76ba7415480687d05a4353b27fea2ae02b8d9d61") ("popup-el" . "9d104d4bbbcb37bbc9d9ce762e74d41174683f86") ("projectile" . "33bc91e7518fb8cecd89580f16e0ac21799de2c2") + ("rainbow-mode" . "f780ddb18c2a73a666d093f606df92058e5601ea") ("s.el" . "43ba8b563bee3426cead0e6d4ddc09398e1a349d") ("shell-pop-el" . "4b4394037940a890a313d715d203d9ead2d156a6") ("shr-tag-pre-highlight.el" . "6182f43a36b0f82ba6edcf6e423b5f69a46a814e") @@ -72,6 +85,7 @@ ("swiper" . "f8b1ab8c0ec331a4f8f6621f9021811075c71332") ("tablist" . "faab7a035ef2258cc4ea2182f67e3aedab7e2af9") ("transient" . "88d935c7cb9f175871c4cfea7eef2c0514d03b06") + ("treepy.el" . "306f7031d26e4ebfc9ff36614acdc6993f3e23c3") ("use-package" . "d2640fec376a8458a669e7526e63e5870d875118") ("use-package-hydra" . "8cd55a1128fbdf6327bb38a199d206225896d146") ("window-numbering.el" . "10809b3993a97c7b544240bf5d7ce9b1110a1b89") -- cgit v1.2.3 From 070f4284de76c2ac7b8f8011a5e810e2dd014564 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 7 Jul 2020 19:41:51 +0200 Subject: Add next weeks agenda view --- emacs-init.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index e2602f6..67d6abe 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2629,9 +2629,16 @@ Switch projects and subprojects from NEXT back to TODO" (org-agenda-custom-commands `(("d" "Day agenda" ((agenda "" ((org-agenda-span 'day))) - (org-time-budgets-in-agenda-maybe))) - ("w" "Week agenda" + (org-time-budgets-in-agenda-maybe) + (tags-todo "/+INPROGRESS" + ((org-agenda-overriding-header "Active Tasks"))))) + ("w" . "Week agendas") + ("ww" "Standard week agenda" ((agenda "" ((org-agenda-span 'week))))) + ("wn" "Next Week's agenda" + ((agenda "" ((org-agenda-span 'week) + (org-agenda-start-day "mon"))) + (tags-todo "+work"))) ("n" "Agenda and all TODOs" ((todo "INPROGRESS" ((org-agenda-overriding-header "Inprogress Tasks"))) -- cgit v1.2.3 From dc53548cf32dbd963f68e48064593d900df1c64c Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 7 Jul 2020 19:42:06 +0200 Subject: Enable resetting checkboxes for repeating task --- emacs-init.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 67d6abe..cd0b1de 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2711,6 +2711,21 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** org-checklist +#+begin_quote +This file provides some functions for handing repeated tasks which involve +checking off a list of items. By setting the RESET_CHECK_BOXES property in an +item, when the TODO state is set to done all checkboxes under that item are +cleared. If the LIST_EXPORT_BASENAME property is set, a file will be created +using the value of that property plus a timestamp, containing all the items +in the list which are not checked. Additionally the user will be prompted to +print the list. +#+end_quote +#+begin_src emacs-lisp +(use-package org-checklist + :after org + :straight (org-plus-contrib)) +#+end_src *** Inline images Resize inline images to 400px but respect width specifications in attribute lines. -- cgit v1.2.3 From 29cb3385a9b60603ce9b040db1fa8ce49f38facb Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 7 Jul 2020 19:43:35 +0200 Subject: Add gnorb to combine gnus, org & bbdb --- emacs-init.org | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- gnus.org | 31 ++++++++++++++++++++--- 2 files changed, 105 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index cd0b1de..77a5662 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2585,7 +2585,8 @@ Switch projects and subprojects from NEXT back to TODO" :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)) + :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) + <>) (use-package org-clock :custom (org-clock-out-remove-zero-time-clocks t) @@ -2726,6 +2727,78 @@ print the list. :after org :straight (org-plus-contrib)) #+end_src +*** Gnorb +:PROPERTIES: +:ID: 990e2668-11d6-45eb-9c9b-1dc0b89b556d +:END: +This combines [[file:gnus.org][Gnus]] conversations with Org mode for note taking and [[id:390b66e5-b123-4cb1-9a56-61e41d7a818a][BBDB]] for contact information. +#+begin_src emacs-lisp +(use-package gnorb + :straight t + :config + (gnorb-install-defaults) + :custom + <>) +#+end_src +To setup =gnorb= we need to do several things according to [[info:gnorb#Tracking Setup][the manual]]: +1. Activate the gnus registry with ~(gnus-registry-initialize)~ +2. Make sure global id tracking in org-id is enabled + #+begin_src emacs-lisp :noweb-ref org-id-custom :tangle no + (org-id-track-globally t) + #+end_src +3. Add nngnorb to ~gnus-secondary-select-methods~ +4. Call ~(gnorb-tracking-initialize)~. As this requires =gnus= to be loaded, this is called in =gnus.org= +5. Set gnorb saved messages groups + #+begin_src emacs-lisp :tangle no :noweb-ref gnorb-custom + (gnorb-gnus-sent-groups '("nnimap+imsmail:INBOX/work" "nnimap+imsmail:Gesendete ELemente")) + #+end_src +6. Set todo capture template + #+begin_src emacs-lisp :tangle no :noweb-ref gnorb-custom + (gnorb-gnus-new-todo-capture-key "t") + #+end_src + +Default keybindings: +#+begin_example emacs-lisp +(global-set-key (kbd "C-c A") 'gnorb-restore-layout) +(eval-after-load "gnorb-bbdb" + '(progn + (define-key bbdb-mode-map (kbd "C-c S") #'gnorb-bbdb-mail-search) + (define-key bbdb-mode-map (kbd "C-c l") #'gnorb-bbdb-open-link) + (define-key bbdb-mode-map [remap bbdb-mail] #'gnorb-bbdb-mail) + (eval-after-load "gnorb-org" + (org-defkey org-mode-map (kbd "C-c C") #'gnorb-org-contact-link)))) +(eval-after-load "gnorb-org" + '(progn + (org-defkey org-mode-map (kbd "C-c t") #'gnorb-org-handle-mail) + (org-defkey org-mode-map (kbd "C-c v") #'gnorb-org-view) + (org-defkey org-mode-map (kbd "C-c E") #'gnorb-org-email-subtree) + (setq gnorb-org-agenda-popup-bbdb t) + (eval-after-load "org-agenda" + '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") #'gnorb-org-handle-mail) + (org-defkey org-agenda-mode-map (kbd "C-c v") #'gnorb-org-view))))) +(eval-after-load "gnorb-gnus" + '(progn + (define-key gnus-summary-mime-map "a" #'gnorb-gnus-article-org-attach) + (define-key gnus-summary-mode-map (kbd "C-c t") #'gnorb-gnus-incoming-do-todo) + (define-key gnus-summary-mode-map (kbd "C-c v") #'gnorb-gnus-view) + (define-key gnus-summary-mode-map (kbd "C-c C-t") #'gnorb-gnus-tag-message) + (define-key gnus-summary-limit-map (kbd "g") #'gnorb-gnus-insert-tagged-messages) + (define-key gnus-summary-limit-map (kbd "G") #'gnorb-gnus-insert-tracked-messages) + (setq gnorb-gnus-capture-always-attach t) + (push '("attach to org heading" . gnorb-gnus-mime-org-attach) + gnus-mime-action-alist) + (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading") + gnus-mime-button-commands) + (setq gnus-mime-button-map + (let ((map (make-sparse-keymap))) + (dolist (c gnus-mime-button-commands) + (define-key map (cadr c) (car c))) + map)))) +(eval-after-load "message" + '(progn + (define-key message-mode-map (kbd "C-c t") #'gnorb-gnus-outgoing-do-todo))) +#+end_example + *** Inline images Resize inline images to 400px but respect width specifications in attribute lines. @@ -4187,6 +4260,9 @@ For now I use this bad code. (footnote-section-tag "")) #+end_src ** BBDB +:PROPERTIES: +:ID: 390b66e5-b123-4cb1-9a56-61e41d7a818a +:END: #+begin_src emacs-lisp (use-package bbdb :straight t) diff --git a/gnus.org b/gnus.org index 84d5a33..d59780f 100644 --- a/gnus.org +++ b/gnus.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:emacs-lisp :tangle tangle/gnus.el +#+PROPERTY: header-args:emacs-lisp :tangle tangle/gnus.el :noweb yes #+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" ln -siv $(pwd)/tangle/gnus.el ~/.gnus.el @@ -56,6 +56,7 @@ RSS/Atom Feeds asynchronously. (nnir-search-engine imap) (nnimap-inbox "INBOX"))) (add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) +<> #+end_src ** Options *** General @@ -193,6 +194,30 @@ Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= s gnus-score-decay-constant 1 gnus-score-decay-scale 0.01) #+end_src +**** Registry +Use the [[info:gnus#The Gnus Registry][Gnus Registry]]. This is required to use [[id:990e2668-11d6-45eb-9c9b-1dc0b89b556d][Gnorb]]. +#+begin_src emacs-lisp +(gnus-registry-initialize) +#+end_src +#+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods +(add-to-list 'gnus-secondary-select-methods '(nngnorb "Gnorb server")) +#+end_src +Enable gnorb tracking +#+begin_src emacs-lisp +(gnorb-tracking-initialize) +#+end_src +Hint for existing relevant tracked conversations in the summary buffer (see [[info:gnorb#Hinting in Gnus][info:gnorb#Hinting in Gnus]]). Already tracked messages are marked with =&= and new maybe relevant messages with =¡=. +#+begin_src fundamental :tangle no :noweb-ref gnorb-summary-line-format +%ug +#+end_src +Display [[info:gnorb#Tagging Messages and Contacts][message tags]] in the summary line. Stop other summary line content at column 120 and insert the tags after. +#+begin_src fundamental :tangle no :noweb-ref gnorb-summary-tags +%-120=%uG +#+end_src +Also automatically set message tags +#+begin_src emacs-lisp +(setq gnorb-gnus-auto-tag-messages t) +#+end_src *** Display Sort by newest first #+begin_src emacs-lisp @@ -220,8 +245,8 @@ Also try to connect threads by guessing which articles are missing Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][emacswiki/GnusFormatting)]]. #+begin_src emacs-lisp (setq - gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B%s%)\n" - gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M")) + gnus-summary-line-format "%U%R%z<> %(%&user-date; %-15,15f %B%s%) <>\n" + gnus-user-date-format-alist '((t . "%y-%m-%d %H:%M")) gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references gnus-sum-thread-tree-false-root "" gnus-sum-thread-tree-indent " " -- cgit v1.2.3 From 99f445575ec26b13b1803a2bc24c3b2e8a445866 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 8 Jul 2020 16:25:10 +0200 Subject: Fix gnorb in summary-line-format --- gnus.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index d59780f..71f7041 100644 --- a/gnus.org +++ b/gnus.org @@ -244,8 +244,10 @@ Also try to connect threads by guessing which articles are missing #+end_src Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][emacswiki/GnusFormatting)]]. #+begin_src emacs-lisp -(setq - gnus-summary-line-format "%U%R%z<> %(%&user-date; %-15,15f %B%s%) <>\n" +(setq gnus-summary-line-format (concat "%U%R%z" + "<>" + " %(%&user-date; %-15,15f %B%s%) " + "<>" "\n") gnus-user-date-format-alist '((t . "%y-%m-%d %H:%M")) gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references gnus-sum-thread-tree-false-root "" -- cgit v1.2.3 From 6903fe548d3625e1497e999a6bc71931bb2370d7 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 8 Jul 2020 16:25:31 +0200 Subject: Enable gnus cloud --- gnus.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnus.org b/gnus.org index 71f7041..d8aaa0f 100644 --- a/gnus.org +++ b/gnus.org @@ -218,6 +218,14 @@ Also automatically set message tags #+begin_src emacs-lisp (setq gnorb-gnus-auto-tag-messages t) #+end_src +**** Gnus Cloud +The [[info:gnus#The Gnus Cloud][Gnus Cloud]] lets you synchronize marks and general data (whatever that is) across different machines. This seems more complete than manually (with Nextcloud, …) syncing the news related files (=~/.newsrc.eld=, =~/News=, …). + +To enable it go to the gnus server buffer and mark the servers to be synced with =i= and the (imap) server which is used as host with =I=. +#+begin_src emacs-lisp +(setq gnus-cloud-method (concat "nnimap:" (car private/personal-imap-info))) +#+end_src +Commands to interact with the gnus cloud are prefixed with =~= in the group buffer. *** Display Sort by newest first #+begin_src emacs-lisp -- cgit v1.2.3 From 2831cc8d569b4f66e21aa7383cb6c9bf3f4127be Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 8 Jul 2020 16:25:38 +0200 Subject: Reorganize adaptive scoring & remove scoring on from --- gnus.org | 79 +++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/gnus.org b/gnus.org index d8aaa0f..6f0302b 100644 --- a/gnus.org +++ b/gnus.org @@ -145,44 +145,67 @@ Background fetching for gnus. See the manual and [[https://www.emacswiki.org/ema #+end_src **** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. +***** Score File Setup #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) (setq gnus-adaptive-word-length-limit 5) (setq gnus-adaptive-word-no-group-words t) (setq gnus-summary-mark-below -300) (setq gnus-default-adaptive-score-alist - '((gnus-unread-mark) - (gnus-ticked-mark) - (gnus-dormant-mark) - (gnus-del-mark (subject -50)) - (gnus-read-mark (from 5) (subject 100)) - (gnus-expirable-mark) - (gnus-killed-mark (subject -300)) - (gnus-kill-file-mark) - (gnus-ancient-mark) - (gnus-low-score-mark) - (gnus-catchup-mark (subject -40)))) + '( + <>)) (setq gnus-default-adaptive-word-score-alist `((,gnus-read-mark . 5) (,gnus-catchup-mark . -5) (,gnus-killed-mark . -15) - (,gnus-del-mark . -10))) -(setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) -#+end_src -Scoring List for Groups with various From Senders: -#+begin_example -'((gnus-unread-mark) - (gnus-ticked-mark (from 4)) - (gnus-dormant-mark (from 5)) - (gnus-del-mark (from -4) (subject -1)) - (gnus-read-mark (from 4) (subject 2)) - (gnus-expirable-mark (from -1) (subject -1)) - (gnus-killed-mark (from -1) (subject -3) (followup -1)) - (gnus-kill-file-mark) - (gnus-ancient-mark) - (gnus-low-score-mark) - (gnus-catchup-mark (from -1) (subject -1))) -#+end_example + (,gnus-del-mark . -10)) + ) +;; (setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) +#+end_src +****** Using different (adaptive) scoring files for different groups +To define different adaptive scoring files for different groups I set [[info:gnus#Home Score File][home score files]] based on the group name. +#+begin_src emacs-lisp +(setq gnus-home-score-file + '(("^nnimap" "nnimap.SCORE") ;; w/ author scoring + ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring + ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring + )) +(setq gnus-home-adapt-file + '(("^nnimap" "nnimap.ADAPT") + ("gmane" "nntp_gmane.ADAPT") + ("^nntp\\+localhost" "nntp_global.ADAPT"))) +#+end_src +Scoring based on the =from= header does not make sense for rss feeds with only one author or newsgroups with unset author. These files therefore contain my default adaptive scoring rules with or without =from= scoring. +#+NAME: gnus-adaptive-scoring-w-from +#+begin_src emacs-lisp :tangle no :eval never +(gnus-unread-mark) +(gnus-ticked-mark (from 4)) +(gnus-dormant-mark (from 5)) +(gnus-del-mark (from -4) (subject -50)) +(gnus-read-mark (from 5) (subject 100)) +(gnus-expirable-mark) +(gnus-killed-mark (from -5) (subject -300) (followup -150)) +(gnus-kill-file-mark) +(gnus-ancient-mark) +(gnus-low-score-mark) +(gnus-catchup-mark (from -2) (subject -40)) +#+end_src +#+NAME: gnus-adaptive-scoring-wo-from +#+begin_src emacs-lisp :tangle no :eval never +(gnus-unread-mark) +(gnus-ticked-mark) +(gnus-dormant-mark) +(gnus-del-mark (subject -50)) +(gnus-read-mark (subject 100)) +(gnus-expirable-mark) +(gnus-killed-mark (subject -300) (followup -150)) +(gnus-kill-file-mark) +(gnus-ancient-mark) +(gnus-low-score-mark) +(gnus-catchup-mark (subject -40)) +#+end_src +Unfortunately setting these on a per group basis does not work currently as it would (at least) override the word scoring setting. So I stick with the same adaptive scoring rules for all groups set above. +***** Misc Options To ensure filenames compatible with Windows and stuff: #+begin_src emacs-lisp (setq nnheader-file-name-translation-alist '((?: . ?_) (?[ . ?_) (?] . ?_))) -- cgit v1.2.3 From 4b426f02920646ffac2f46a3759d87362e8799ea Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 8 Jul 2020 16:30:02 +0200 Subject: Add a basic Makefile --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a3a7693 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +.PHONY: merge tangle + +merge: + tangle/merge.sh + +tangle: + tangle/tangle.sh + +link: + tangle/link.sh -- cgit v1.2.3 From 07911468c09a7fe25fce4ff79ded5d05826504d5 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 8 Jul 2020 16:44:30 +0200 Subject: Add .ADAPT files to gnus-cloud --- gnus.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnus.org b/gnus.org index 6f0302b..c070a3b 100644 --- a/gnus.org +++ b/gnus.org @@ -249,6 +249,9 @@ To enable it go to the gnus server buffer and mark the servers to be synced with (setq gnus-cloud-method (concat "nnimap:" (car private/personal-imap-info))) #+end_src Commands to interact with the gnus cloud are prefixed with =~= in the group buffer. +#+begin_src emacs-lisp +(setq gnus-cloud-synced-files '("~/.authinfo.gpg" "~/.gnus.registry.eieio" (:directory "~/News" :match ".*.\\(SCORE\\|ADAPT\\)"))) +#+end_src *** Display Sort by newest first #+begin_src emacs-lisp -- cgit v1.2.3 From 46b5b761bf161539c3f44cd7dbecf4114c4372ea Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 10 Jul 2020 17:46:20 +0200 Subject: Set visible Bell --- emacs-init.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 77a5662..fe10500 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -237,9 +237,10 @@ only. #+end_src ** GUI Interface Disable most of the user interface. - #+BEGIN_SRC emacs-lisp (use-package emacs + :custom + <> :config (tooltip-mode -1) (tool-bar-mode -1) @@ -247,6 +248,12 @@ Disable most of the user interface. (scroll-bar-mode -1) ) #+END_SRC + +Audible bell is useless when the sound is turned off and annoying when sound is on. Instead use visible bell. +#+begin_src emacs-lisp :tangle no :noweb-ref emacs-custom +(visible-bell t) +#+end_src + In /awesomewm/ and other tiling window managers the emacs window leaves a gap at the bottom. This removes it. #+BEGIN_SRC emacs-lisp -- cgit v1.2.3 From b31b02c8b881e9554db2c839924fc7883b61382c Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 10 Jul 2020 17:47:02 +0200 Subject: Increase refile targets level some more No performance impact yet.. --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index fe10500..0e9a27d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2832,8 +2832,8 @@ As refile only works on file-visiting buffers, we need to filter all other org b #+begin_src emacs-lisp :noweb-ref org-custom :tangle no (org-refile-use-outline-path 'file) -(org-refile-targets '((buffer-file-name :maxlevel . 8) - (org-agenda-files :maxlevel . 5) +(org-refile-targets '((buffer-file-name :maxlevel . 12) + (org-agenda-files :maxlevel . 10) (fpi/org-file-buffer-list :maxlevel . 2))) #+end_src *** Time budgets -- cgit v1.2.3 From fb1790bd6228617b18aa7b43913078f985cfbcc4 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 10 Jul 2020 17:47:28 +0200 Subject: Add function to open bibtex pdf or directory Fallback to dired to let me execute `git annex get` on the missing pdf --- emacs-init.org | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 0e9a27d..5ce60a9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3333,12 +3333,26 @@ A small function to toggle the encryption state of the current entry. #+begin_src emacs-lisp (use-package org-ref :straight t + :bind (:map org-mode-map (("C-c n p" . fpi/open-bibtex-pdf-or-directory))) :custom (org-ref-bibliography-notes nil) (org-ref-notes-function 'org-ref-notes-function-many-files) (org-ref-notes-directory "~/git/projects/zettel/Lit") (org-ref-default-bibliography '("~/git/projects/personal/bib.bib")) - (org-ref-pdf-directory "~/git/projects/personal/Lit/")) + (org-ref-pdf-directory "~/git/projects/personal/Lit/") + :config + (defun fpi/open-bibtex-pdf-or-directory () + (interactive) + (save-excursion + (bibtex-beginning-of-entry) + (let* ((bibtex-expand-strings t) + (entry (bibtex-parse-entry t)) + (key (reftex-get-bib-field "=key=" entry)) + (pdf (funcall org-ref-get-pdf-filename-function key))) + (if (file-exists-p pdf) + (org-open-link-from-string (format "[[file:%s]]" pdf)) + (dired (file-name-directory pdf)) + (ding)))))) #+end_src ***** Capturing entries I store my bibtex references in an org file together with my notes. In -- cgit v1.2.3 From 160090f58e9e2b3a6d535f41008f8aca63a1bf95 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jul 2020 16:28:54 +0200 Subject: Update org-time-budgets definition to :blocks syntax --- emacs-init.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 5ce60a9..75dedac 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2843,9 +2843,9 @@ Gives an overview of time spent on defined budgets this week. Great to track if :straight (:host github :repo "fpiper/org-time-budgets" :branch "develop") :custom - (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :block workweek) - (:title "Research" :match "+work+research" :budget "24:00" :block total-only) - (:title "Teaching" :match "+work+teaching" :budget "8:00" :block total-only)))) + (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) + (:title "Research" :match "+work+research" :budget "24:00" :blocks (nil week)) + (:title "Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week))))) #+end_src *** Column view #+begin_src emacs-lisp -- cgit v1.2.3 From b91ce7e27af3c0163d21cff34a17a554fef527e2 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 13 Jul 2020 19:15:03 +0200 Subject: Refile custom agendas & add fancy "o" agenda --- emacs-init.org | 172 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 49 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 75dedac..e2b134c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2635,55 +2635,12 @@ Switch projects and subprojects from NEXT back to TODO" ;; See emacs.christianbaeuerlein.com/my-org-config.html (org-agenda-block-separator 9472) (org-agenda-custom-commands - `(("d" "Day agenda" - ((agenda "" ((org-agenda-span 'day))) - (org-time-budgets-in-agenda-maybe) - (tags-todo "/+INPROGRESS" - ((org-agenda-overriding-header "Active Tasks"))))) - ("w" . "Week agendas") - ("ww" "Standard week agenda" - ((agenda "" ((org-agenda-span 'week))))) - ("wn" "Next Week's agenda" - ((agenda "" ((org-agenda-span 'week) - (org-agenda-start-day "mon"))) - (tags-todo "+work"))) - ("n" "Agenda and all TODOs" - ((todo "INPROGRESS" - ((org-agenda-overriding-header "Inprogress Tasks"))) - (agenda) - (tags-todo "+soon+LEVEL=2" - ((org-agenda-overriding-header "2nd Level /Soon/ Tasks"))) - (tags-todo "+soon" - ((org-agenda-overriding-header "All /Soon/ Tasks"))) - (tags-todo "+shelve") - (tags-todo "+habit") - (todo "IDLE") - (tags-todo "-habit-shelve-soon-idle"))) - ("r" "Refile entries" ((tags "+REFILE"))) - ("i" "Idle Actions" - ((tags-todo "IDLE-READLIST-WATCH" - ((org-agenda-overriding-header "Idle Tasks") - (org-agenda-skip-function 'bh/skip-project-tasks) - (org-agenda-sorting-strategy - '(todo-state-down effort-up)))) - (tags-todo "READLIST" - ((org-agenda-overriding-header "Idle Reading List") - (org-agenda-sorting-strategy - '(todo-state-down effort-up)))) - (tags-todo "WATCH" - ((org-agenda-overriding-header "Things to Watch") - (org-agenda-skip-function 'bh/skip-project-tasks) - (org-agenda-sorting-strategy - '(todo-state-down effort-up)))))) - ("z" "Todos in org-roam-dir" - ((alltodo "" - ((org-agenda-files (fpi/collect-org-directories-recursively org-roam-directory)))))) - ("c" "Agenda and all todos in current directory" - ((agenda "" - ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))) - (alltodo "" - ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))))))) - ) + `( + <> + ))) +#+end_src + +#+begin_src emacs-lisp (use-package ob-core :custom (org-confirm-babel-evaluate nil)) @@ -2693,6 +2650,7 @@ Switch projects and subprojects from NEXT back to TODO" (use-package ol-notmuch) (use-package org-habit) #+end_src + #+begin_src emacs-lisp (use-package org-inlinetask) #+end_src @@ -2719,6 +2677,122 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** Org agenda custom commands +**** Task-related agendas +Simple day agenda with =INPROGRESS= tasks +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("d" "Day agenda" + ((agenda "" ((org-agenda-span 'day))) + (org-time-budgets-in-agenda-maybe) + (tags-todo "/+INPROGRESS" + ((org-agenda-overriding-header "Active Tasks"))))) +#+end_src +Agenda with all open tasks +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("n" "Agenda and all TODOs" + ((todo "INPROGRESS" + ((org-agenda-overriding-header "Inprogress Tasks"))) + (agenda) + (tags-todo "+soon+LEVEL=2" + ((org-agenda-overriding-header "2nd Level /Soon/ Tasks"))) + (tags-todo "+soon" + ((org-agenda-overriding-header "All /Soon/ Tasks"))) + (tags-todo "+shelve") + (tags-todo "+habit") + (todo "IDLE") + (tags-todo "-habit-shelve-soon-idle"))) +#+end_src +***** Fancy agenda to choose todays tasks +Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("o" "My Agenda" + ((agenda "" ((org-agenda-block-separator ? ) + (org-agenda-overriding-header "\n⚡ Deadlines:\n⎺⎺⎺⎺⎺⎺⎺⎺⎺") + (org-agenda-skip-function '(org-agenda-skip-entry-if 'notdeadline)) + (org-agenda-format-date (lambda (date) "")))) + (agenda* "" ((org-agenda-block-separator ? ) + (org-agenda-skip-function '(fpi/org-agenda-skip-if-not-today)) + (org-deadline-warning-days 0) + (org-agenda-todo-ignore-timestamp 'all) + (org-agenda-start-day "+0d") + (org-agenda-span 1) + (org-agenda-overriding-header "⚡ Schedule:\n⎺⎺⎺⎺⎺⎺⎺⎺⎺") + (org-agenda-repeating-timestamp-show-all nil) + (org-agenda-remove-tags t) + (org-agenda-use-time-grid t) + ;; (org-agenda-prefix-format " %-3i %30b %t%s") + (org-agenda-todo-keyword-format " ☐ ") + (org-agenda-current-time-string "⮜┈┈┈┈┈┈┈ now") + (org-agenda-scheduled-leaders '("" "")) + (org-agenda-time-grid (quote ((daily today remove-match) + (0900 1200 1500 1800 2100) + " " "┈┈┈┈┈┈┈┈┈┈┈┈┈"))))) + (org-time-budgets-in-agenda-maybe) + (agenda "" ((org-agenda-block-separator ? ) + (org-agenda-overriding-header "\n⚡ Scheduled Tasks:\n⎺⎺⎺⎺⎺⎺⎺⎺⎺") + (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled)) + (org-agenda-use-time-grid nil) + (org-agenda-format-date (lambda (date) "")))) + )) +#+end_src +#+begin_src emacs-lisp +(defun fpi/org-agenda-skip-if-not-today () + "Skip all scheduled entries and deadlines not due for today." + (let ((subtree-end (save-excursion (org-end-of-subtree t))) + (deadline-day + (when (org-entry-get nil "DEADLINE") + (time-to-days + (org-time-string-to-time + (org-entry-get nil "DEADLINE"))))) + (scheduled-day + (when (org-entry-get nil "SCHEDULED") + (time-to-days + (org-time-string-to-time + (org-entry-get nil "SCHEDULED"))))) + (now (time-to-days (current-time)))) + (and (or (and deadline-day + (not (= deadline-day now))) + (and scheduled-day + (not (= scheduled-day now)))) + subtree-end))) +#+end_src +**** Week agendas +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("w" . "Week agendas") +("ww" "Standard week agenda" + ((agenda "" ((org-agenda-span 'week))))) +("wn" "Next Week's agenda" + ((agenda "" ((org-agenda-span 'week) + (org-agenda-start-day "mon"))) + (tags-todo "+work"))) +#+end_src +**** Misc agendas +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("r" "Refile entries" ((tags "+REFILE"))) +("i" "Idle Actions" + ((tags-todo "IDLE-READLIST-WATCH" + ((org-agenda-overriding-header "Idle Tasks") + (org-agenda-skip-function 'bh/skip-project-tasks) + (org-agenda-sorting-strategy + '(todo-state-down effort-up)))) + (tags-todo "READLIST" + ((org-agenda-overriding-header "Idle Reading List") + (org-agenda-sorting-strategy + '(todo-state-down effort-up)))) + (tags-todo "WATCH" + ((org-agenda-overriding-header "Things to Watch") + (org-agenda-skip-function 'bh/skip-project-tasks) + (org-agenda-sorting-strategy + '(todo-state-down effort-up)))))) +("z" "Todos in org-roam-dir" + ((alltodo "" + ((org-agenda-files (fpi/collect-org-directories-recursively org-roam-directory)))))) +("c" "Agenda and all todos in current directory" + ((agenda "" + ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))) + (alltodo "" + ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))))) +#+end_src *** org-checklist #+begin_quote This file provides some functions for handing repeated tasks which involve -- cgit v1.2.3 From 70e238d8fc6cf67d7e413f15b657d67a6a400b72 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 14 Jul 2020 11:18:00 +0200 Subject: Update variable name --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index e2b134c..1ca6195 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2498,7 +2498,7 @@ Hansen's]] configs. ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1"))) (org-ellipsis " ") (org-outline-path-complete-in-steps nil) - (org-log-state-notes-into-drawer "NOTES") + (org-log-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") (org-log-done 'time) (org-log-redeadline 'time) -- cgit v1.2.3 From bbe9ac6ad57ee8225f1310af620d6fea8ed1d919 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 14 Jul 2020 11:18:52 +0200 Subject: Fix biblio mode map key binding --- emacs-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 1ca6195..fc57fa7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3474,7 +3474,9 @@ Here's a function to easily copy a doi from the results of =crossref-lookup=. (let ((doi (alist-get 'doi (cdr (biblio--selection-metadata-at-point))))) (kill-new doi) (message "Copied doi %s" doi))) -(define-key biblio-selection-mode-map "d" #'fpi/biblio-get-doi) +(use-package biblio + :bind (:map biblio-selection-mode-map + ("d" . fpi/biblio-get-doi))) #+end_src *** Todo settings - WAITING tasks are waiting on the completion of other tasks -- cgit v1.2.3 From 55c46ecce2478c88e5213bcd3a0d441aef200507 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 14 Jul 2020 16:50:25 +0200 Subject: Make git ignore *.patch files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 12e29f7..f757d17 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -tangle/* \ No newline at end of file +tangle/* +*.patch \ No newline at end of file -- cgit v1.2.3 From a965137b4b6fe572f4f5daee467000dd8404200c Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 15 Jul 2020 21:53:02 +0200 Subject: Add a script to pull from origin with rebase --- Makefile | 6 ++++++ README.org | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/Makefile b/Makefile index a3a7693..92b04f5 100644 --- a/Makefile +++ b/Makefile @@ -8,3 +8,9 @@ tangle: link: tangle/link.sh + +fetch: + git fetch + +pull: + tangle/pull.sh diff --git a/README.org b/README.org index 34ca2b7..c199c9e 100644 --- a/README.org +++ b/README.org @@ -25,6 +25,14 @@ git branch -a | grep -v -e +$ -e master | sed "s/[ *] //" | xargs git merge git push --force origin master #+end_src +To integrate changes from =origin= perform a rebase instead of merge +to loose the old merge commit but keep any local changes. + +#+begin_src shell :shebang "#!/bin/bash" :tangle tangle/pull.sh +git fetch +git rebase origin/master master +#+end_src + ** Updating all tangled files This script (re-)tangles all =.org= and =.org.gpg= files in the current directory. Run this in case the org files were updated outside -- cgit v1.2.3 From 8871fcd011884ed8e30cb572eb0a4d42acedf776 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 15 Jul 2020 22:05:44 +0200 Subject: Add dots script --- README.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.org b/README.org index c199c9e..893befd 100644 --- a/README.org +++ b/README.org @@ -100,3 +100,18 @@ rm $catFile $symlinkFile #+end_src + +** =dots= script +I place this script in my =PATH= to execute commands in the dotfiles +directory from anywhere. + +#+begin_src shell :shebang "#!/bin/bash" :tangle tangle/dots.sh +cd ~/git/projects/dotfiles +$@ +#+end_src + +Create a symlink for this script. + +#+BEGIN_SRC sh :tangle tangle/symlink.sh :results silent :shebang "#!/bin/bash" +ln -siv $(pwd)/tangle/dots.sh ~/.local/bin/dots +#+END_SRC -- cgit v1.2.3 From 622e94a68126d7670a2dd40317e23730fccc153b Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 15 Jul 2020 22:41:26 +0200 Subject: Add make install target for fresh installations --- Makefile | 9 +++++++-- README.org | 11 ++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 92b04f5..033ac9a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ -.PHONY: merge tangle +.PHONY: merge install link tangle fetch pull merge: tangle/merge.sh -tangle: +install: tangle link + +tangle: tangle/tangle.sh tangle/tangle.sh link: @@ -14,3 +16,6 @@ fetch: pull: tangle/pull.sh + +tangle/tangle.sh: README.org + emacs --batch --eval "(and (require 'org) (org-babel-tangle-file \"README.org\"))" diff --git a/README.org b/README.org index 893befd..0afa693 100644 --- a/README.org +++ b/README.org @@ -9,7 +9,16 @@ The symlinks can be created by manually running the appropriate [[https://orgmod source block in each configuration file or by running the scripts below. -** Git Setup +** Initial setup +After cloning this repository run + +#+begin_example shell +make install +#+end_example + +to setup the tangled config files and create the necessary symlinks. + +** Git setup This repository somewhat abuses git branches. Every program's configuration lives in its own separate branch. All branches are then merged into =master= using an [[https://git-scm.com/docs/merge-strategies#Documentation/merge-strategies.txt-octopus][octopus merge]]. To keep the git history -- cgit v1.2.3 From 4fcde17f96ada0c57ca42bb094f6ff5ae428f77e Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jul 2020 08:55:22 +0200 Subject: Add explicit make targets for readme tangles --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 033ac9a..8455a6a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ +dst_readme := tangle.sh merge.sh pull.sh link.sh dots.sh + .PHONY: merge install link tangle fetch pull -merge: +merge: tangle/merge.sh tangle/merge.sh install: tangle link @@ -8,14 +10,14 @@ install: tangle link tangle: tangle/tangle.sh tangle/tangle.sh -link: +link: tangle/link.sh tangle/link.sh fetch: git fetch -pull: +pull: tangle/pull.sh tangle/pull.sh -tangle/tangle.sh: README.org +$(addprefix tangle/,$(dst_readme)) &: README.org emacs --batch --eval "(and (require 'org) (org-babel-tangle-file \"README.org\"))" -- cgit v1.2.3 From 4caf1bae12abfb55dfe2ba43e4640e5044e5ef08 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jul 2020 22:49:33 +0200 Subject: Add support function for org-babel workflow --- emacs-init.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index fc57fa7..5831b64 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2980,6 +2980,14 @@ Gives an overview of time spent on defined budgets this week. Great to track if ("" . org-clock-convenience-fill-gap) ("" . org-clock-convenience-fill-gap-both))) #+end_src +*** Babel +This function is handy to use in header arguments to create names based on the current org heading. E.g. =:var data=(fpi/format-headline "/tmp/prefix_")= +#+begin_src emacs-lisp +(defun fpi/format-headline (&optional pre post) + (let ((pre (or pre "")) + (post (or post ""))) + (format "%s%s%s" pre (nth 4 (org-heading-components)) post))) +#+end_src *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal -- cgit v1.2.3 From 4b28a9ac4cee99d10acdaf7b1af2ae409b5b02e8 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 17 Jul 2020 17:02:00 +0200 Subject: Add keyboard-quit-strong to avoid C-g C-g C-g C-g --- emacs-init.org | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 5831b64..87e9c03 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1469,8 +1469,29 @@ Goes backward if ARG is negative; error if CHAR not found." (backward-char) (forward-char)) (point)))) + <> :bind (:map global-map - ("M-z" . zap-up-to-char))) + ("M-z" . zap-up-to-char) + <> + )) +#+end_src +Use a hard ~keyboard-quit~. This is from Jeff Norden ([[https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00326.html][Message on emacs-devel]]). +#+begin_src emacs-lisp :tangle no :noweb-ref simple-config +(defun keyboard-quit-strong () + "Run `keyboard-quit' to return emacs to a more responsive state. +If repeated twice in a row, run `top-level' instead, to also exit +any recursive editing levels." + (interactive) + (when (eq last-command 'keyboard-quit-strong) + (setq this-command 'top-level) ;dis-arm a 3rd C-g + (ding) + (top-level)) + ;; Not reached after `top-level'. (A rare behavior in lisp.) + (keyboard-quit)) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref simple-bindings +("C-g" . keyboard-quit-strong) #+end_src * Selection and search methods ** Completion frameworks -- cgit v1.2.3 From 4b463f72a0483fb0bdd217c5df7a7f849c6a5f60 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 15 Jul 2020 13:26:23 +0200 Subject: Bundle task organization related settings --- emacs-init.org | 330 +++++++++++++++++++++++++++------------------------------ 1 file changed, 155 insertions(+), 175 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 87e9c03..f3a0f44 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2521,25 +2521,6 @@ Hansen's]] configs. (org-outline-path-complete-in-steps nil) (org-log-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") - (org-log-done 'time) - (org-log-redeadline 'time) - (org-log-reschedule 'time) - (org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") - (sequence "S(s)" "DONE(d)") - (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") - (sequence "TODO(t)" "|" "DONE(d)") - (sequence "IDLE(a)"))) - (org-use-fast-todo-selection t) - (org-todo-keyword-faces - '(("NEXT" :foreground "light blue" :weight bold) - ("INPROGRESS" :foreground "burlywood" :weight bold) - ("DONE" :foreground "forest green" :weight bold) - ("WAITING" :foreground "orange" :weight bold) - ("ICEBOX" :foreground "orange" :weight normal) - ("CANCELLED" :foreground "forest green" :weight bold) - ("MEETING" :foreground "yellow" :weight bold) - ("PHONE" :foreground "yellow" :weight bold) - ("IDLE" :foreground "magenta" :weight bold))) (org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) (org-tags-column 0) <> @@ -2698,8 +2679,86 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src -*** Org agenda custom commands -**** Task-related agendas +*** Task organization +**** Todo settings +- WAITING tasks are waiting on the completion of other tasks +- NEXT tasks can be picked up +- INPROGRESS are current tasks with time clocked +- DONE are complete tasks +- ICEBOX tasks are on ice for whatever reason + +TODO->DONE cycle is for habits.\\ +Idle states cover things to do for time in between, checking the +inbox, reading news, … + +Phonecalls? + +#+BEGIN_SRC dot :file /tmp/todo.png +digraph hierarch{ + node [shape=box] + // Tasks, Projects + PLANNING -> NEXT, INPROGRESS, ICEBOX + WAITING -> NEXT -> INPROGRESS -> DONE, WAITING, ICEBOX + NEXT -> WAITING -> INPROGRESS, ICEBOX + NEXT -> ICEBOX, DONE + + // stuff for idle time + IDLE -> IDLE + //NEXT -> DONE + + // Phonecalls, Meetings + PHONE -> DONE, CANCELED + MEETING -> DONE, CANCELED +} +#+END_SRC + +#+RESULTS: +[[file:/tmp/todo.png]] + +#+begin_src emacs-lisp :noweb-ref org-custom :tangle no +(org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") + (sequence "S(s)" "DONE(d)") + (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") + (sequence "TODO(t)" "|" "DONE(d)") + (sequence "IDLE(a)"))) +(org-use-fast-todo-selection t) +(org-todo-keyword-faces + '(("NEXT" :foreground "light blue" :weight bold) + ("INPROGRESS" :foreground "burlywood" :weight bold) + ("DONE" :foreground "forest green" :weight bold) + ("WAITING" :foreground "orange" :weight bold) + ("ICEBOX" :foreground "orange" :weight normal) + ("CANCELLED" :foreground "forest green" :weight bold) + ("MEETING" :foreground "yellow" :weight bold) + ("PHONE" :foreground "yellow" :weight bold) + ("IDLE" :foreground "magenta" :weight bold))) +#+end_src + +Switch a todo entry from NEXT to INPROGRESS when clocking in. +#+begin_src emacs-lisp :tangle no +(setq org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) +(defun bh/clock-in-to-inprogress (kw) + "Switch a task from NEXT to INPROGRESS when clocking in. +Skips capture tasks, projects, and subprojects. +Switch projects and subprojects from NEXT back to TODO" + (when (not (and (boundp 'org-capture-mode) org-capture-mode)) + (cond + ((and (member (org-get-todo-state) (list "NEXT")) + (bh/is-task-p)) + "INPROGRESS") + ((and (member (org-get-todo-state) (list "NEXT")) + (bh/is-project-p)) + "INPROGRESS")))) +#+end_src +***** State changes +Track state changes to done & changes to schedules and deadlines. +#+begin_src emacs-lisp :tangle no :noweb-ref org-custom +(org-log-done 'time) +(org-log-redeadline 'time) +(org-log-reschedule 'time) +#+end_src +**** Org agenda custom commands +***** Task-related agendas Simple day agenda with =INPROGRESS= tasks #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("d" "Day agenda" @@ -2723,7 +2782,7 @@ Agenda with all open tasks (todo "IDLE") (tags-todo "-habit-shelve-soon-idle"))) #+end_src -***** Fancy agenda to choose todays tasks +****** Fancy agenda to choose todays tasks Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("o" "My Agenda" @@ -2777,7 +2836,7 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (not (= scheduled-day now)))) subtree-end))) #+end_src -**** Week agendas +***** Week agendas #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("w" . "Week agendas") ("ww" "Standard week agenda" @@ -2787,7 +2846,7 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (org-agenda-start-day "mon"))) (tags-todo "+work"))) #+end_src -**** Misc agendas +***** Misc agendas #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("r" "Refile entries" ((tags "+REFILE"))) ("i" "Idle Actions" @@ -2814,6 +2873,78 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (alltodo "" ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))))) #+end_src +**** Refile +Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. Also include the current file's headings as a refile targets up to a deep level, all agenda files up to a small level and all open org files up to an even smaller level. + +As refile only works on file-visiting buffers, we need to filter all other org buffers from ~(org-buffer-list)~. +#+begin_src emacs-lisp +(defun fpi/org-file-buffer-list () + "Return a list of org buffers which visit files." + (seq-filter 'buffer-file-name (org-buffer-list))) +#+end_src + +#+begin_src emacs-lisp :noweb-ref org-custom :tangle no +(org-refile-use-outline-path 'file) +(org-refile-targets '((buffer-file-name :maxlevel . 12) + (org-agenda-files :maxlevel . 10) + (fpi/org-file-buffer-list :maxlevel . 2))) +#+end_src +**** Time budgets +Gives an overview of time spent on defined budgets this week. Great to track if you've worked enough hours. To use it add ~(org-time-budgets-in-agenda-maybe)~ after ~(agenda)~ in a custom agenda command. +#+begin_src emacs-lisp +(use-package org-time-budgets + :straight (:host github :repo "fpiper/org-time-budgets" + :branch "develop") + :custom + (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) + (:title "Research" :match "+work+research" :budget "24:00" :blocks (nil week)) + (:title "Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week))))) +#+end_src +**** Column view +#+begin_src emacs-lisp +(setq org-columns-default-format + "%50ITEM(Task) %5Effort(Effort){:} %5CLOCKSUM %3PRIORITY %20DEADLINE %20SCHEDULED %20TIMESTAMP %TODO %CATEGORY %TAGS") +#+end_src +**** Clocking +***** Combine adjacent clock lines +#+begin_src emacs-lisp +(defun fpi/org-clock-join-last-clock () + "Join current clock with last one if start/end point match." + (save-mark-and-excursion + (beginning-of-line) + (let* ((eol (save-excursion (end-of-line) (point))) + (boi (progn (re-search-forward "\\[" eol t) (backward-char) (point))) + (eoi (progn (re-search-forward "\\]" eol t) (point))) + (i (buffer-substring-no-properties boi eoi)) ;; last clock-in-time + (boc (progn (re-search-forward "\\[" eol t) (backward-char) (point))) + (eoc (progn (re-search-forward "\\]" eol t) (point))) + (c (buffer-substring-no-properties boc eoc))) ;; last clock-out-time (equals org-clock-out-time if last clock) + (next-line) + (end-of-line) + (let* ((bol (save-excursion (beginning-of-line) (point))) + (eoo (progn (re-search-backward "\\]" bol t) (forward-char) (point))) + (boo (progn (re-search-backward "\\[" bol t) (point))) + (o (buffer-substring-no-properties boo eoo))) ;; last-last clock-out-time + (when (equal i o) + (delete-region boo eoo) + ;; (insert (format-time-string (org-time-stamp-format t t) org-clock-out-time)) + (insert c) + (org-evaluate-time-range) + (previous-line) + (delete-region (save-excursion (beginning-of-line) (backward-char) (point)) eol) + (message (format "Joined nearby clocks at %s" i))))))) +(add-hook 'org-clock-out-hook 'fpi/org-clock-join-last-clock) +#+end_src +***** org-clock-convenience +#+begin_src emacs-lisp +(use-package org-clock-convenience + :straight t + :bind (:map org-agenda-mode-map + ("" . org-clock-convenience-timestamp-up) + ("" . org-clock-convenience-timestamp-down) + ("" . org-clock-convenience-fill-gap) + ("" . org-clock-convenience-fill-gap-both))) +#+end_src *** org-checklist #+begin_quote This file provides some functions for handing repeated tasks which involve @@ -2915,38 +3046,6 @@ Also display remote images by downloading them. #+begin_src emacs-lisp :noweb-ref ob-hooks :tangle no (org-babel-after-execute . org-display-inline-images) #+end_src -*** Refile -Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. Also include the current file's headings as a refile targets up to a deep level, all agenda files up to a small level and all open org files up to an even smaller level. - -As refile only works on file-visiting buffers, we need to filter all other org buffers from ~(org-buffer-list)~. -#+begin_src emacs-lisp -(defun fpi/org-file-buffer-list () - "Return a list of org buffers which visit files." - (seq-filter 'buffer-file-name (org-buffer-list))) -#+end_src - -#+begin_src emacs-lisp :noweb-ref org-custom :tangle no -(org-refile-use-outline-path 'file) -(org-refile-targets '((buffer-file-name :maxlevel . 12) - (org-agenda-files :maxlevel . 10) - (fpi/org-file-buffer-list :maxlevel . 2))) -#+end_src -*** Time budgets -Gives an overview of time spent on defined budgets this week. Great to track if you've worked enough hours. To use it add ~(org-time-budgets-in-agenda-maybe)~ after ~(agenda)~ in a custom agenda command. -#+begin_src emacs-lisp -(use-package org-time-budgets - :straight (:host github :repo "fpiper/org-time-budgets" - :branch "develop") - :custom - (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) - (:title "Research" :match "+work+research" :budget "24:00" :blocks (nil week)) - (:title "Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week))))) -#+end_src -*** Column view -#+begin_src emacs-lisp -(setq org-columns-default-format - "%50ITEM(Task) %5Effort(Effort){:} %5CLOCKSUM %3PRIORITY %20DEADLINE %20SCHEDULED %20TIMESTAMP %TODO %CATEGORY %TAGS") -#+end_src *** org-caldav #+begin_src emacs-lisp (use-package org-caldav @@ -2961,46 +3060,6 @@ Gives an overview of time spent on defined budgets this week. Great to track if (org-caldav-exclude-tags '(nocal)) ) #+end_src -*** Clocking -**** Combine adjacent clock lines -#+begin_src emacs-lisp -(defun fpi/org-clock-join-last-clock () - "Join current clock with last one if start/end point match." - (save-mark-and-excursion - (beginning-of-line) - (let* ((eol (save-excursion (end-of-line) (point))) - (boi (progn (re-search-forward "\\[" eol t) (backward-char) (point))) - (eoi (progn (re-search-forward "\\]" eol t) (point))) - (i (buffer-substring-no-properties boi eoi)) ;; last clock-in-time - (boc (progn (re-search-forward "\\[" eol t) (backward-char) (point))) - (eoc (progn (re-search-forward "\\]" eol t) (point))) - (c (buffer-substring-no-properties boc eoc))) ;; last clock-out-time (equals org-clock-out-time if last clock) - (next-line) - (end-of-line) - (let* ((bol (save-excursion (beginning-of-line) (point))) - (eoo (progn (re-search-backward "\\]" bol t) (forward-char) (point))) - (boo (progn (re-search-backward "\\[" bol t) (point))) - (o (buffer-substring-no-properties boo eoo))) ;; last-last clock-out-time - (when (equal i o) - (delete-region boo eoo) - ;; (insert (format-time-string (org-time-stamp-format t t) org-clock-out-time)) - (insert c) - (org-evaluate-time-range) - (previous-line) - (delete-region (save-excursion (beginning-of-line) (backward-char) (point)) eol) - (message (format "Joined nearby clocks at %s" i))))))) -(add-hook 'org-clock-out-hook 'fpi/org-clock-join-last-clock) -#+end_src -**** org-clock-convenience -#+begin_src emacs-lisp -(use-package org-clock-convenience - :straight t - :bind (:map org-agenda-mode-map - ("" . org-clock-convenience-timestamp-up) - ("" . org-clock-convenience-timestamp-down) - ("" . org-clock-convenience-fill-gap) - ("" . org-clock-convenience-fill-gap-both))) -#+end_src *** Babel This function is handy to use in header arguments to create names based on the current org heading. E.g. =:var data=(fpi/format-headline "/tmp/prefix_")= #+begin_src emacs-lisp @@ -3507,85 +3566,6 @@ Here's a function to easily copy a doi from the results of =crossref-lookup=. :bind (:map biblio-selection-mode-map ("d" . fpi/biblio-get-doi))) #+end_src -*** Todo settings -- WAITING tasks are waiting on the completion of other tasks -- NEXT tasks can be picked up -- INPROGRESS are current tasks with time clocked -- DONE are complete tasks -- ICEBOX tasks are on ice for whatever reason - -TODO->DONE cycle is for habits.\\ -Idle states cover things to do for time in between, checking the -inbox, reading news, … - -Phonecalls? - -#+BEGIN_SRC dot :file /tmp/todo.png -digraph hierarch{ - node [shape=box] - // Tasks, Projects - PLANNING -> NEXT, INPROGRESS, ICEBOX - WAITING -> NEXT -> INPROGRESS -> DONE, WAITING, ICEBOX - NEXT -> WAITING -> INPROGRESS, ICEBOX - NEXT -> ICEBOX, DONE - - // stuff for idle time - IDLE -> IDLE - //NEXT -> DONE - - // Phonecalls, Meetings - PHONE -> DONE, CANCELED - MEETING -> DONE, CANCELED -} -#+END_SRC - -#+RESULTS: -[[file:/tmp/todo.png]] - -#+BEGIN_SRC emacs-lisp :tangle no -(setq org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") - (sequence "S(s)" "DONE(d)") - (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") - (sequence "TODO(t)" "|" "DONE(d)") - (sequence "IDLE(a)"))) -(setq org-use-fast-todo-selection t) - - -(setq org-todo-keyword-faces - '(("NEXT" :foreground "light blue" :weight bold) - ("INPROGRESS" :foreground "burlywood" :weight bold) - ("DONE" :foreground "forest green" :weight bold) - ("WAITING" :foreground "orange" :weight bold) - ("ICEBOX" :foreground "orange" :weight normal) - ("CANCELLED" :foreground "forest green" :weight bold) - ("MEETING" :foreground "yellow" :weight bold) - ("PHONE" :foreground "yellow" :weight bold) - ("IDLE" :foreground "magenta" :weight bold))) -#+END_SRC - -Switch a todo entry from NEXT to INPROGRESS when clocking in. -#+begin_src emacs-lisp :tangle no -(setq org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) -(defun bh/clock-in-to-inprogress (kw) - "Switch a task from NEXT to INPROGRESS when clocking in. -Skips capture tasks, projects, and subprojects. -Switch projects and subprojects from NEXT back to TODO" - (when (not (and (boundp 'org-capture-mode) org-capture-mode)) - (cond - ((and (member (org-get-todo-state) (list "NEXT")) - (bh/is-task-p)) - "INPROGRESS") - ((and (member (org-get-todo-state) (list "NEXT")) - (bh/is-project-p)) - "INPROGRESS")))) -#+end_src -**** State changes -Track state changes to done & changes to schedules and deadlines. -#+begin_src emacs-lisp :tangle no -(setq org-log-done 'time) -(setq org-log-redeadline 'time) -(setq org-log-reschedule 'time) -#+end_src *** Toggle drawer visibility #+begin_src emacs-lisp (setq fpi/org-meta-heading-info-store nil) -- cgit v1.2.3 From 401a3d11b8a155d9f75507c3e5faa020d33ad961 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jul 2020 08:39:19 +0200 Subject: Update todo keywords for projects, ... Add ACTIVE keyword to use for projects. HOLD for project tasks waiting for other tasks. --- emacs-init.org | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index f3a0f44..dd7a764 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2716,21 +2716,23 @@ digraph hierarch{ [[file:/tmp/todo.png]] #+begin_src emacs-lisp :noweb-ref org-custom :tangle no -(org-todo-keywords '((sequence "PLANNING(p)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") - (sequence "S(s)" "DONE(d)") - (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)") - (sequence "TODO(t)" "|" "DONE(d)") - (sequence "IDLE(a)"))) +(org-todo-keywords '((sequence "HOLD(h)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") ;;todos + (sequence "PLANNING(p)" "TODO(t)" "ACTIVE(a)" "|" "CANCELLED(c)" "DONE(d)") ;;projects + (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)" "DONE(d)") + (sequence "TODO(t)" "|" "DONE(d)") ;;habits + (sequence "IDLE(b)"))) (org-use-fast-todo-selection t) (org-todo-keyword-faces - '(("NEXT" :foreground "light blue" :weight bold) + '(("HOLD" :foreground "light gray" :weight bold) + ("NEXT" :foreground "light blue" :weight bold) ("INPROGRESS" :foreground "burlywood" :weight bold) + ("ACTIVE" :foreground "chocolate" :weight bold) ("DONE" :foreground "forest green" :weight bold) ("WAITING" :foreground "orange" :weight bold) ("ICEBOX" :foreground "orange" :weight normal) ("CANCELLED" :foreground "forest green" :weight bold) - ("MEETING" :foreground "yellow" :weight bold) - ("PHONE" :foreground "yellow" :weight bold) + ("MEETING" :foreground "yellow3" :weight bold) + ("PHONE" :foreground "yellow3" :weight bold) ("IDLE" :foreground "magenta" :weight bold))) #+end_src -- cgit v1.2.3 From 7429d4edea4219ba0b5b8565ad2bd6752c20e2c7 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 20 Jul 2020 11:03:11 +0200 Subject: Collect safe-local-variable-values definitions --- emacs-init.org | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index dd7a764..59e3812 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -92,8 +92,7 @@ header argument in the source code. ;; 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) ;; For use on Windows via SSH X-Forwarding @@ -1406,6 +1405,29 @@ Remember where point is in a file. (kept-old-versions 2) (create-lockfiles nil)) #+end_src +** Local variables +#+begin_src emacs-lisp +(use-package files + :custom + <> + ) +#+end_src + +[[info:emacs#File Variables][File Variables]] are useful to ensure same behaviour in some files with different emacs configurations or to change behaviour from the default for one file. +Some settings could be harmful to emacs and the underlying system. Therefore many settings have to be declared as safe before using them. +#+begin_src emacs-lisp :tangle no :noweb-ref files-custom +(safe-local-variable-values + '((whitespace-style face trailing space-before-tab indentation empty space-after-tab newline-mark) + (eval set-window-buffer nil (current-buffer)) + (right-margin-width . 2) + (left-margin-width . 2) + (line-spacing . 0.2) + (after-save-hook org-babel-tangle) + (header-line-format . " ") + (after-save-hook . (org-babel-tangle)) + <> +)) +#+end_src ** Personal keymap Unfortunately =C-c [a-z]= is not always a safe place for user-defined @@ -2160,15 +2182,12 @@ some safe local variable values. :delight :straight t :custom - (gac-automatically-push-p nil) - :config - (add-to-list 'safe-local-variable-values - '(eval add-hook - (quote after-save-hook) - (quote gac-after-save-func) - t t)) - (add-to-list 'safe-local-variable-values - '(git-auto-commit-mode . t))) + (gac-automatically-push-p nil)) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref safe-local-variable-values +(git-auto-commit-mode . t) +(gac-debounce-interval . 600) #+end_src ** Projectile -- cgit v1.2.3 From 37ea381b194325aeab99dc0fe5b3e41e6c15e960 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 20 Jul 2020 10:57:57 +0200 Subject: Enable twoway org <-> caldav sync --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 59e3812..2ef5161 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3076,9 +3076,9 @@ Also display remote images by downloading them. (org-caldav-calendar-id private/calendar-id) (org-caldav-inbox "~/sync/w.org") (org-caldav-files nil) - (org-caldav-sync-direction 'cal->org) + (org-caldav-sync-direction 'twoway) (org-caldav-delete-calendar-entries 'never) - (org-caldav-exclude-tags '(nocal)) + (org-caldav-exclude-tags nil) ) #+end_src *** Babel -- cgit v1.2.3 From 86378d27977c5220f01b6b63fbfeca1add6d18e5 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 20 Jul 2020 10:58:10 +0200 Subject: Disable byte-compilation for org-time-budgets Byte compiling breaks due to my poorly defined function. --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 2ef5161..8944598 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2915,7 +2915,8 @@ Gives an overview of time spent on defined budgets this week. Great to track if #+begin_src emacs-lisp (use-package org-time-budgets :straight (:host github :repo "fpiper/org-time-budgets" - :branch "develop") + :branch "develop" + :no-byte-compile t) :custom (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) (:title "Research" :match "+work+research" :budget "24:00" :blocks (nil week)) -- cgit v1.2.3 From fef3d648c965670e832888a8aa41b5621437cbe6 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 22 Jul 2020 10:26:49 +0200 Subject: Set no-inheritance tags in the proper location --- emacs-init.org | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8944598..ee1e26b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -30,10 +30,13 @@ disable ~buffer-auto-save-file-name~ for the files. (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 +#+BEGIN_SRC emacs-lisp :noweb-ref org-custom-no-inheritance-tags :tangle no +"crypt" +#+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 @@ -2542,11 +2545,14 @@ Hansen's]] configs. (org-clock-into-drawer "LOGBOOK") (org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) (org-tags-column 0) + (org-tags-exclude-from-inheritance '( + <> + )) <> :config (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) - (add-to-list 'org-tags-exclude-from-inheritance "MARKED") + ;; (add-to-list 'org-tags-exclude-from-inheritance "MARKED") (defun bh/clock-in-to-inprogress (kw) "Switch a task from NEXT to INPROGRESS when clocking in. Skips capture tasks, projects, and subprojects. -- cgit v1.2.3 From 769cd83a080d9babe7433ac524a08127cdb8e755 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 22 Jul 2020 10:27:10 +0200 Subject: Use other-window for org src edits --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index ee1e26b..c4c4923 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2631,7 +2631,7 @@ Switch projects and subprojects from NEXT back to TODO" ) (use-package org-src :custom - (org-src-window-setup 'current-window) + (org-src-window-setup 'other-window) (org-src-fontify-natively t) (org-src-tab-acts-natively t) (org-edit-src-content-indentation 0)) -- cgit v1.2.3 From e618ef15ef52fd5af24705b0993659e7ce4396b2 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 22 Jul 2020 10:27:40 +0200 Subject: Delight org-edna --- emacs-init.org | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index c4c4923..432ff48 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3158,17 +3158,12 @@ Fix for hanging emacs. The original function calls file-exist-p which opens a sl :PROPERTIES: :ID: fd3936c7-9fc5-42d0-990d-32024e23b22f :END: -=Org-edna= is a great tool to manage =TODO= dependencies. I mainly use -it to mark tasks as =NEXT= after switching another task to =DONE=. The -functions below are taken from Josh's Emacs Config over at [[https://github.com/mm--/dot-emacs/blob/master/jmm-org-config.org][Github]]. He -wrote wrote a =edna-finder= which allows link descriptions and a nice -hydra to manage the various =org-edna= properties. I call it in my -[[id:22750e48-aaee-4f60-bdce-1d511ebe3375][context aware hydra]] when on an org headline. For more functions and -explanations checkout his config. +=Org-edna= is a great tool to manage =TODO= dependencies. I mainly use it to mark tasks as =NEXT= after switching another task to =DONE=. The functions below are taken from Josh's Emacs Config over at [[https://github.com/mm--/dot-emacs/blob/master/jmm-org-config.org][Github]]. He wrote a =edna-finder= which allows link descriptions and a nice hydra to manage the various =org-edna= properties. I call it in my [[id:22750e48-aaee-4f60-bdce-1d511ebe3375][context aware hydra]] when on an org headline. For more functions and explanations checkout his config. #+begin_src emacs-lisp (use-package org-edna :straight t :after org + :delight :config (org-edna-load) (defun org-edna-finder/link-ids (&rest ids) -- cgit v1.2.3 From d530df8b9ae88d15a6426b9008e25fbe5de82ebc Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 22 Jul 2020 10:27:46 +0200 Subject: Make time-budgets display fancier --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 432ff48..7eee49c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2925,8 +2925,8 @@ Gives an overview of time spent on defined budgets this week. Great to track if :no-byte-compile t) :custom (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) - (:title "Research" :match "+work+research" :budget "24:00" :blocks (nil week)) - (:title "Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week))))) + (:title "├Research" :match "+work+research" :budget "24:00" :blocks (nil week)) + (:title "╰Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week))))) #+end_src **** Column view #+begin_src emacs-lisp -- cgit v1.2.3 From ad75caf16749bf2435ffa7a12661059f133cfad2 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 22 Jul 2020 10:32:03 +0200 Subject: Add git annex support Mostly copied from https://github.com/mm--/dot-emacs/blob/master/jmm-emacs.org --- emacs-init.org | 334 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 333 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 7eee49c..660e3be 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1946,7 +1946,10 @@ confines of word boundaries (e.g. multiple words)." :hook (dired-mode . dired-hide-details-mode) (dired-mode . hl-line-mode) - (dired-mode . auto-revert-mode)) + (dired-mode . auto-revert-mode) + :bind (:map dired-mode-map + <> + )) (use-package find-dired :after dired @@ -2074,6 +2077,335 @@ of src_shell{getconf "PATH"}. See [[elisp:(describe-variable (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) #+end_src ** Git +*** Git annex +There are some great ressources on [[https://git-annex.branchable.com/][git-annex]] integration in emacs in [[https://github.com/mm--/dot-emacs/blob/master/jmm-emacs.org][Josh's config]]. Most of my configuration is copied from there. +#+begin_src emacs-lisp +(use-package git-annex + :straight t + :config + <> + :bind + (:map git-annex-dired-map + <>) + :after (dired)) +#+end_src +**** Actions to lock/unlock files +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings +("l" . git-annex-dired-lock-files) +("u" . git-annex-dired-unlock-files) +#+end_src +=git-annex.el= defines a handy macro to define generic =git-annex= CLI calls. +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-config +(git-annex-dired-do-to-files "lock" "Annex: locked %d file(s)") +(git-annex-dired-do-to-files "unlock" "Annex: unlocked %d file(s)") +#+end_src +**** Fix faces +=git-annex.el= kinda clobbers ~dired-marked-face~ and ~dired-flagged-face~. This fixes that. +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-config +(progn + (add-to-list 'dired-font-lock-keywords + (list "^[*].+ -> .*\\.git/annex/" + '("\\(.+\\)\\( -> .+\\)" (dired-move-to-filename) nil + (1 dired-marked-face) + (2 git-annex-dired-annexed-invisible)))) + (add-to-list 'dired-font-lock-keywords + (list "^[D].+ -> .*\\.git/annex/" + '("\\(.+\\)\\( -> .+\\)" (dired-move-to-filename) nil + (1 dired-flagged-face) + (2 git-annex-dired-annexed-invisible))))) +#+end_src +**** Make it easy to add metadata tags in git-annex +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings +("t" . jmm/dired-git-annex-tag) +#+end_src +Git-annex has a pretty cool ability to tag files and filter directory views based on metadata. It's kind of a pain to tag files, though, so here's a function that adds some autocompletion to tagging files. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-config +(defvar-local jmm/git-annex-directory-tags nil + "Current git-annex tags set in the directory, as a list.") + +(defun jmm/dired-git-annex-current-tags (file-list &optional intersection) + "Get current git-annex tag for each file in FILE-LIST. With + optional argument INTERSECTION, only show tags all files share in common." + (let* ((metadata (with-output-to-string + (with-current-buffer + standard-output + (apply #'process-file "git" nil t nil "annex" "metadata" "--json" file-list)))) + (json-array-type 'list) + (jsonout (-map 'json-read-from-string (split-string metadata "\n" t)))) + (-reduce (if intersection '-intersection '-union) (--map (cdr (assoc 'tag (cdr (assoc 'fields it)))) jsonout)))) + +(defun jmm/dired-git-annex-tag (file-list tags &optional arg) + "Add git-annex TAGS to each file in FILE-LIST. +Used as an interactive command, prompt for a list of tags for all +files, showing the current tags all files currently have in common." + (interactive + (let* ((files (dired-get-marked-files t current-prefix-arg)) + (shared-tags (jmm/dired-git-annex-current-tags files t)) + ;; Cache directory tags + (current-tags (or jmm/git-annex-directory-tags + (setq jmm/git-annex-directory-tags + (or (jmm/dired-git-annex-current-tags '("--all")) '(""))))) + (crm-separator " ") + (crm-local-completion-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map crm-local-completion-map) + (define-key map " " 'self-insert-command) + map)) + (tags (completing-read-multiple + "Tags: " (--map (concat it crm-separator) current-tags) + nil nil + (when shared-tags (mapconcat 'identity shared-tags " "))))) + (setq jmm/git-annex-directory-tags (-union tags jmm/git-annex-directory-tags)) + (list files tags current-prefix-arg))) + (let ((args (cl-loop for x in tags + append (list "-t" x)))) + (-each file-list + (lambda (file) + (apply #'call-process "git" nil nil nil "annex" "metadata" (append args (list file))))) + (message (format "Tagged %d file(s)" (length file-list))))) +#+END_SRC +**** Mark unavailable files +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings +("*") +("* a" . jmm/dired-mark-git-annex-available-files) +("* u" . jmm/dired-mark-git-annex-unavailable-files) +#+end_src + +When you use this in combination with ~dired-do-kill-lines~ (by default bound to ~k~), it's easy to hide files that aren't present in the current annex repository. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-config +(defun jmm/dired-mark-git-annex-unavailable-files () + "Mark git-annex files that are not present." + (interactive) + (dired-mark-if + (and (looking-at-p ".* -> \\(.*\\.git/annex/.+\\)") + (not (file-exists-p (file-truename (dired-get-filename t))))) + "unavailable file")) + +(defun jmm/dired-mark-git-annex-available-files () + "Mark git-annex files that are present." + (interactive) + (dired-mark-if + (and (looking-at-p ".* -> \\(.*\\.git/annex/.+\\)") + (file-exists-p (file-truename (dired-get-filename t)))) + "available file")) +#+END_SRC +**** Mark git-annex files with git-annex-matching-options +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref dired-bindings +("% a" . jmm/dired-mark-files-git-annex-matching) +#+END_SRC + +This command makes it easy to mark dired files using ~git-annex-matching-options~. + +For instance, you could find files that are in a certain remote using ~--in=remote~ or mark/unmark files that have a certain tag using ~--metadata tag=sometag~. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-config +(defun jmm/dired-mark-files-git-annex-matching (matchingoptions &optional marker-char) + "Mark all files that match git annex's MATCHINGOPTIONS for use in later commands. +A prefix argument means to unmark them instead. +`.' and `..' are never marked." + (interactive + (list (read-string (concat (if current-prefix-arg "Unmark" "Mark") + " files matching (git annex match expression): ") + nil 'jmm-dired-annex-matchingoptions-history) + (if current-prefix-arg ?\040))) + (let ((dired-marker-char (or marker-char dired-marker-char))) + (dired-mark-if + (and (not (looking-at-p dired-re-dot)) + (not (eolp)) ; empty line + (let ((fn (dired-get-filename nil t))) + (when (and fn (not (file-directory-p fn))) + (message "Checking %s" fn) + (s-present? (shell-command-to-string + (mapconcat + #'identity + (list "git annex find" matchingoptions (shell-quote-argument fn)) + " ")))))) + "matching file"))) +#+END_SRC +**** Real file size +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: +Dired by default only shows the symlink file size. While it can be told to dereference symbolic links with the =-L= flag this only works on annexed files if they are present on the current machine. +Settings this flag causes more problems than it solves. Instead Josh has derived the functions below to determine the file size. I do not use them for now, but copied them here for future reference/usage. +***** Get git-annex file sizes +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings +("s" . jmm/dired-git-annex-print-human-file-size) +#+end_src +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-config +(defun jmm/git-annex-file-target (filename) + "If FILENAME is a git annex file, return its symlink target." + (-when-let (symname (and filename + (file-symlink-p filename))) + (when (string-match-p ".*\\.git/annex/.+" symname) + symname))) + +(defun jmm/dired-git-annex-file-target () + "If the dired file at point is a git annex file, return its symlink target." + (jmm/git-annex-file-target (dired-get-filename nil t))) + +(defun jmm/git-annex-file-size (filename) + "Try to determine the size of the git annex file FILENAME." + (-when-let (target (jmm/git-annex-file-target filename)) + (or (save-match-data + (when (string-match "SHA256E-s\\([0-9]+\\)--" target) + (string-to-number (match-string 1 target)))) + (-some-> (expand-file-name target (file-name-directory filename)) + file-attributes + file-attribute-size)))) + +(defun jmm/dired-git-annex-print-human-file-size () + "Try to print the human readable file size of the dired git-annex file at point." + (interactive) + (let* ((filename (dired-get-filename nil t)) + (string-file (file-name-nondirectory filename))) + (-if-let (filesize (-some-> (jmm/git-annex-file-size filename) + file-size-human-readable)) + (message "%s - %s" filesize string-file) + (message "Can't determine git annex file size of %s" string-file)))) +#+END_SRC +***** Show git-annex file sizes in dired +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings +("S" . jmm/dired-git-annex-add-real-file-sizes) +#+end_src + +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-config +;; Based off of `dired--align-all-files' +(defun jmm/dired-git-annex-add-real-file-sizes () + "Go through all the git-annex files in dired, replace the +symlink file size with the real file size, then try to align +everything." + (interactive) + (require 'dired-aux) + (let ((regexp directory-listing-before-filename-regexp)) + (save-excursion + (goto-char (point-min)) + (dired-goto-next-file) + (while (or (dired-move-to-filename) + (progn (save-restriction + (narrow-to-region (dired-subdir-min) (dired-subdir-max)) + (dired--align-all-files)) + (dired-next-subdir 1 t) + (dired-goto-next-file) + (dired-move-to-filename))) + (let ((inhibit-read-only t)) + (when (and (jmm/dired-git-annex-file-target) + (re-search-backward regexp (line-beginning-position) t)) + (goto-char (match-beginning 0)) + (-when-let (newsize (-some-> (jmm/git-annex-file-size (dired-get-filename nil t)) + file-size-human-readable)) + (search-backward-regexp "[[:space:]]" nil t) + (when (re-search-forward "[[:space:]]+\\([^[:space:]]+\\)[[:space:]]" nil t) + (goto-char (match-beginning 1)) + (delete-region (point) (match-end 1)) + (insert-and-inherit newsize)))) + (forward-line)))))) +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle no +;; (add-hook 'dired-mode-hook #'jmm/dired-git-annex-add-real-file-sizes) +;; (add-hook 'dired-after-readin-hook #'jmm/dired-git-annex-add-real-file-sizes) +#+END_SRC +***** Sort dired by file size +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-config +(defun jmm/dired-dir-files-beginning () + "First point where there's a filename on the line. Beginning of line." + (save-excursion + (goto-char (dired-subdir-min)) + (dired-goto-next-file) + (beginning-of-line) + (point))) + +(defun jmm/dired-dir-files-end () + "Last point where there's a filename. End of line." + (save-excursion + (goto-char (dired-subdir-max)) + (while (not (dired-get-filename nil t)) + (dired-previous-line nil)) + (end-of-line) + (point))) + +(defun jmm/dired-file-size () + "Return the file size of a file at point (for sorting). Takes +into account git-annex files." + (let* ((filename (dired-get-filename nil t)) + (string-file (file-name-nondirectory filename))) + (or (jmm/git-annex-file-size filename) + (file-attribute-size (file-attributes filename))))) + +;; TODO: Should just try to directly use the field listed. +(defun jmm/dired-sort-size (&optional ascending) + "Sort some dired lines by size (consider annex sizes). +With optional argument ASCENDING, sort by ascending file size. (I +like going the other way around usually.)" + (interactive "P") + (let (buffer-read-only + (beg (jmm/dired-dir-files-beginning)) + (end (jmm/dired-dir-files-end))) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (goto-char (point-min)) + (sort-subr (not ascending) + 'forward-line 'end-of-line + #'jmm/dired-file-size nil))))) +#+END_SRC +**** Browsing URLs for git-annex files +#+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings +("b" . jmm/git-annex-browse-url) +#+end_src +#+BEGIN_SRC emacs-lisp +;; TODO: Process multiple files at once? +(defun jmm/git-annex-whereis-info (filename) + "Get information about where a git-annex file exists. +Returns a parsed json list from whereis." + (let* ((json-array-type 'list) + (whereisdata (shell-command-to-string + (mapconcat + #'identity + (list "git annex whereis --json" (shell-quote-argument filename)) + " ")))) + (when (s-present? whereisdata) + (json-read-from-string whereisdata)))) + +(defun jmm/git-annex-urls (filename) + "Get the git-annex web urls for FILENAME." + (-some->> (jmm/git-annex-whereis-info filename) + (assoc-default 'whereis) + (-mapcat (lambda (x) (assoc-default 'urls x))) + (-map (lambda (s) (s-chop-prefix "yt:" s))))) + +(defun jmm/git-annex-browse-url () + "Browse the first git-annex web urls for file at point." + (interactive) + (let* ((filename (dired-get-filename nil t)) + (filestr (file-name-nondirectory filename))) + (-if-let (url (car (jmm/git-annex-urls filename))) + (progn + (message "Opening url: %s" url) + (jmm/org-open-link-alternate-browser #'browse-url url)) + (user-error "No url found for %s" filestr)))) +#+END_SRC +**** Eshell helper functions +Helper functions to open dired view from eshell or list =git-annex= files which match a search. +#+BEGIN_SRC emacs-lisp +(defun jmm/git-annex-find-files (&rest args) + "Generate a list of git annex files that match ARGS. +For example, ARGS could be \"--in=here\"" + (-remove #'s-blank? + (s-split "\0" + (shell-command-to-string (mapconcat #'identity + (append '("git annex find --print0") args) + " "))))) +(defun eshell/dga (&rest args) + "Show a `dired' buffer of git annex files that match ARGS. +For example, ARGS could be \"--in=here\"" + (dired (cons "." (apply #'jmm/git-annex-find-files args)))) + +(defun eshell/gaf (&rest args) + "Return a list of git annex files that match ARGS. +For example, ARGS could be \"--in=here\"" + (apply #'jmm/git-annex-find-files args)) +#+END_SRC *** Magit #+BEGIN_SRC emacs-lisp (use-package magit -- cgit v1.2.3 From da085e587776c84938ae38cd10003921b319ba06 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 23 Jul 2020 07:59:54 +0200 Subject: Make tangling of readme silent --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8455a6a..f7412b5 100644 --- a/Makefile +++ b/Makefile @@ -19,5 +19,6 @@ fetch: pull: tangle/pull.sh tangle/pull.sh +.SILENT: $(addprefix tangle/,$(dst_readme)) $(addprefix tangle/,$(dst_readme)) &: README.org - emacs --batch --eval "(and (require 'org) (org-babel-tangle-file \"README.org\"))" + emacs --batch --eval "(and (require 'org) (org-babel-tangle-file \"README.org\"))" &> /dev/null -- cgit v1.2.3 From ce3fac717205457c35eb486501754cc681127c9e Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 23 Jul 2020 10:38:59 +0200 Subject: [WIP] Add basic version of async tangling --- .dir-locals.el | 7 +++++++ emacs-init.org | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..05bfae2 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,7 @@ +;;; Directory Local Variables +;;; For more information see (info "(emacs) Directory Variables") + +((org-mode . ((eval . (add-hook 'before-save-hook + (lambda nil + (fpi/tangle-async)) + nil t))))) diff --git a/emacs-init.org b/emacs-init.org index 660e3be..abff790 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -47,8 +47,21 @@ they are tangled upon save I use this function. (expand-file-name "git/projects/dotfiles/" (getenv "HOME"))) (org-babel-tangle) (message "%s tangled" buffer-file-name))) +(defmacro fpi/tangle-async (&optional file) + "Tangle FILE with a separate emacs instance. -(add-hook 'org-mode-hook (lambda () (add-hook 'before-save-hook #'fpi/tangle-dotfiles nil t)) t) +Note that this does not respect any customization of the tangle +process in your init file as it is not loaded. This uses the +emacs-async library." + (interactive) + (let ((file (or file (buffer-file-name)))) + (and file + (not (file-remote-p file)) + `(async-start + (lambda () + (require 'org) + (org-babel-tangle-file ,file) + 'ignore))))) #+END_SRC As I use =org-crypt= all =.org= files need to be decrypted before tangling, saved without encrypting and encrypted after tangling and -- cgit v1.2.3 From dbb51aa392c3a13ebaa9bcfe31b67814a2424686 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 23 Jul 2020 10:39:28 +0200 Subject: Add capture template which gets link title from web --- emacs-init.org | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index abff790..29df84a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3333,6 +3333,16 @@ print the list. :after org :straight (org-plus-contrib)) #+end_src +*** Handling web urls +**** org-web-tools +:PROPERTIES: +:ID: dc4129ff-6d76-4f12-926f-c62a687a39ec +:END: +This provides functions to get webpage title or content for org mode links. +#+begin_src emacs-lisp +(use-package org-web-tools + :straight t) +#+end_src *** Gnorb :PROPERTIES: :ID: 990e2668-11d6-45eb-9c9b-1dc0b89b556d @@ -3603,25 +3613,38 @@ Templates '( <>)))) #+END_SRC + **** Templates +:PROPERTIES: +:header-args:emacs-lisp: :eval never +:END: ***** Journal Capture templates for journal entries. Mostly to just keep track of things I have looked at and which may be interesting later, but do not warrant a zettel right now. #+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates ("j" "Journal") -("jj" "Journal Entry (Link)" +("jj" "Link Current buffer" entry (file+olp+datetree ,org-journal-file) ;; "** %<%H:%M> %a\n %i%? \n%:description\n%:elfeed-entry-content\n%:elfeed-entry-date\n%:elfeed-entry-meta\n%:elfeed-entry-title\n%:elfeed-entry-enclosures\n%:elfeed-entry-tags" ) "** %<%H:%M> %a %i%?" ) -("je" "Journal Entry" +("je" "Manual Entry" entry (file+olp+datetree ,org-journal-file) "** %<%H:%M> %? %i" ) #+END_SRC +To get the title from the url in =kill-ring= I use [[id:dc4129ff-6d76-4f12-926f-c62a687a39ec][org-web-tools]]. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates +("jw" "Web Link from kill-ring" + entry + (file+olp+datetree + ,org-journal-file) + "** %<%H:%M> %(org-web-tools--org-link-for-url (org-web-tools--get-first-url))%? +%i") +#+END_SRC ***** Interrupts For interruptions. These are saved in a global refile file and to be sorted to their appropriate place. #+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates -- cgit v1.2.3 From 71194e54cd50a20d6d1dbe7e883e5a07ec6150e2 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 10:11:25 +0200 Subject: Add experimental way to reduce amount of tangling Works by saving the git commit hash upon tangling. Currently this does not record if tangling fails for some reason. --- .gitignore | 1 + Makefile | 5 ++++- README.org | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f757d17..0aca97e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ tangle/* +hash/* *.patch \ No newline at end of file diff --git a/Makefile b/Makefile index f7412b5..d381bbf 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ dst_readme := tangle.sh merge.sh pull.sh link.sh dots.sh -.PHONY: merge install link tangle fetch pull +.PHONY: merge install link tangle fetch pull clean merge: tangle/merge.sh tangle/merge.sh @@ -10,6 +10,9 @@ install: tangle link tangle: tangle/tangle.sh tangle/tangle.sh +clean: + rm hash/* + link: tangle/link.sh tangle/link.sh diff --git a/README.org b/README.org index 0afa693..77f7917 100644 --- a/README.org +++ b/README.org @@ -1,3 +1,4 @@ +#+PROPERTY: header-args:shell :noweb yes * My dotfiles The config files are organized in [[https://www.gnu.org/software/emacs/][emacs]] [[https://orgmode.org/][org mode]] files. They are tangled and symlinked to the appropriate directories. @@ -60,6 +61,12 @@ configuration files and it also needs to be loaded & setup. For details see [[file:emacs-init.org::org-crypt-tangle-setup][emacs-init.org]]. #+begin_src shell :shebang "#!/bin/bash" :tangle tangle/tangle.sh +files=$(ls *.org *.org.gpg) + +<> + +echo "Tangling files:$tanglefiles ..." + emacs --batch --eval="\ (progn (require 'org) (require 'org-crypt) @@ -74,7 +81,58 @@ emacs --batch --eval="\ (org-encrypt-entries) (save-without-hook))) (let ((org-confirm-babel-evaluate nil)) - (mapc 'org-babel-tangle-file (split-string \"$(ls *.org *.org.gpg)\"))))" + (mapc 'org-babel-tangle-file (split-string \"$tanglefiles\"))))" +#+end_src + +*** Saving commit hashes to reduce tangling +To reduce the amount of unnecessary tangling, save the commit hash +upon tangling and check it before tangling again. + +Get the commit hash of a file using ~git log~. + +#+NAME: gethash +#+begin_src shell +function gethash { + git log -n 1 --pretty=format:%H -- $1 +} +#+end_src + +We can save all commit hashes by looping over all files. + +#+NAME: savehashes +#+begin_src shell +HASHDIR="hash" +<> +for file in $files +do + gethash $file > $HASHDIR/$file +done +#+end_src + +But we really want to check the saved hash against the current hash +first. If they do not match keep the file for tangling. + +#+NAME: checkhashes +#+begin_src shell +HASHDIR="hash" +tanglefiles="" +<> + +exec 3>&2 +exec 2> /dev/null # disable stderr + +for file in $files +do + if [ $(cat $HASHDIR/$file) == $(gethash $file) ] + then + : # noop + else # if strings not equal or ~cat~ fails + tanglefiles="$tanglefiles $file" + gethash $file > $HASHDIR/$file # save hash + fi +done + +exec 2>&3 #reset stderr #+end_src ** Creating symlinks -- cgit v1.2.3 From c14e6cbe6cf89151b1b32e0f98512ce646a5ecfb Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 11:11:32 +0200 Subject: Add olivetti mode --- emacs-init.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 29df84a..b8cc871 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4615,6 +4615,16 @@ Support for HTML code blocks with proper syntax highlighting. See [[https://gith (advice-add 'eww-display-html :around 'eww-display-html--override-shr-external-rendering-functions)))) #+END_SRC +** Writing Setup +*** Olivetti Mode +#+begin_src emacs-lisp +(use-package olivetti + :straight t + :custom + (olivetti-body-width 0.65) + ;; (olivetti-minimum-body-width 70) + ) +#+end_src ** Email For the setup of external mail specific programs see [[file:mail.org]]. *** Sending mail -- cgit v1.2.3 From 4feeef8a1dc4394315ad84a0db2af0fe7b22556d Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 11:11:42 +0200 Subject: Make org only show h:mm durations and no days --- emacs-init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index b8cc871..ac8ebcd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3451,6 +3451,13 @@ This function is handy to use in header arguments to create names based on the c (post (or post ""))) (format "%s%s%s" pre (nth 4 (org-heading-components)) post))) #+end_src +*** Durations +#+begin_src emacs-lisp +(use-package org-duration + :after org + :custom + (org-duration-format '(("h" . t) ("min" . t) (special . h:mm)))) +#+end_src *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal -- cgit v1.2.3 From 3d0579ebe218bfe2a2bef553579465b92f88a9c2 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 11:11:58 +0200 Subject: Make gnorb use org-refile-targets --- emacs-init.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index ac8ebcd..5200e15 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3414,7 +3414,11 @@ Default keybindings: '(progn (define-key message-mode-map (kbd "C-c t") #'gnorb-gnus-outgoing-do-todo))) #+end_example - +**** More refile targets +Make gnorb consider the same refile targets as org. +#+begin_src emacs-lisp :tangle no :noweb-ref gnorb-custom +(gnorb-gnus-trigger-refile-targets org-refile-targets) +#+end_src *** Inline images Resize inline images to 400px but respect width specifications in attribute lines. -- cgit v1.2.3 From be0d464d273d8b8544cbfffabb42eb76f1884131 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 11:12:46 +0200 Subject: Add table of contents to readme --- README.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.org b/README.org index 77f7917..77ba004 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,14 @@ #+PROPERTY: header-args:shell :noweb yes +* Contents :QUOTE:TOC_2_gh: +#+BEGIN_QUOTE +- [[#my-dotfiles][My dotfiles]] + - [[#initial-setup][Initial setup]] + - [[#git-setup][Git setup]] + - [[#updating-all-tangled-files][Updating all tangled files]] + - [[#creating-symlinks][Creating symlinks]] + - [[#dots-script][=dots= script]] +#+END_QUOTE + * My dotfiles The config files are organized in [[https://www.gnu.org/software/emacs/][emacs]] [[https://orgmode.org/][org mode]] files. They are tangled and symlinked to the appropriate directories. -- cgit v1.2.3 From da22c0447699fa864413b0758483a29735fd8de2 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 11:12:09 +0200 Subject: Add automatic table of contents --- emacs-init.org | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 5200e15..7c6c155 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1,4 +1,65 @@ #+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-init.el :results silent :noweb yes +* Contents :QUOTE:TOC_2_gh: +#+BEGIN_QUOTE +- [[#overview][Overview]] + - [[#about-this-document][About this document]] +- [[#base-settings][Base settings]] + - [[#setup-load-path][Setup load path]] + - [[#meta-packages][Meta packages]] + - [[#gui-interface][GUI Interface]] + - [[#font][Font]] + - [[#theme--faces][Theme & Faces]] + - [[#user-info][User info]] + - [[#desktop-module][Desktop module]] + - [[#customize][Customize]] + - [[#file-and-input-history][File and input history]] + - [[#local-variables][Local variables]] + - [[#personal-keymap][Personal keymap]] + - [[#base-commands-simpleel][Base commands (simple.el)]] +- [[#selection-and-search-methods][Selection and search methods]] + - [[#completion-frameworks][Completion frameworks]] + - [[#isearch-enhancements][isearch enhancements]] +- [[#directory-project-buffer-window-management][Directory, project, buffer, window management]] + - [[#dired][Dired]] + - [[#tramp][Tramp]] + - [[#git][Git]] + - [[#projectile][Projectile]] + - [[#working-with-buffers][Working with buffers]] + - [[#window-configuration][Window configuration]] + - [[#file-encryption][File encryption]] +- [[#applications-and-utilities][Applications and utilities]] + - [[#calendar][Calendar]] + - [[#pdfs][PDFs]] + - [[#latex][Latex]] + - [[#programming-languages][Programming languages]] + - [[#org-mode][Org mode]] + - [[#deft][Deft]] + - [[#shell][Shell]] + - [[#grep][Grep]] + - [[#proced][Proced]] + - [[#pass][Pass]] + - [[#ledger][Ledger]] + - [[#elfeed][Elfeed]] + - [[#plotting-data][Plotting data]] + - [[#html-renderer][HTML renderer]] + - [[#writing-setup][Writing Setup]] + - [[#email][Email]] + - [[#footnote-mode][Footnote Mode]] + - [[#bbdb][BBDB]] + - [[#spellcheck][Spellcheck]] + - [[#compile][Compile]] + - [[#context-aware-hydra][Context aware hydra]] +- [[#language-settings][Language settings]] +- [[#interface][Interface]] + - [[#general][General]] + - [[#rainbow-mode][Rainbow mode]] + - [[#parentheses][Parentheses]] + - [[#whitespace][Whitespace]] + - [[#undo][Undo]] + - [[#electric-stuff][Electric stuff]] +- [[#wrapping-up][Wrapping up]] +#+END_QUOTE + * Overview ** About this document This files contains all the elisp code normally placed in the .emacs @@ -4005,6 +4066,12 @@ Here's a function to easily copy a doi from the results of =crossref-lookup=. (mw-org-hide-meta-heading-info))) (define-key fpi/toggle-map "m" #'fpi/org-toggle-meta-info-lines) #+end_src +*** Table of contents in org +#+begin_src emacs-lisp +(use-package toc-org + :straight t + :hook (org-mode . toc-org-mode)) +#+end_src *** Workflow My current workflow is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt Hansen's]] configs. -- cgit v1.2.3 From 03bbd2ce46baf5ab4a900c12b6f5453e1662e427 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jul 2020 11:35:28 +0200 Subject: Disable twoway caldav sync.. It sucks --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 7c6c155..12d036e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3503,7 +3503,7 @@ Also display remote images by downloading them. (org-caldav-calendar-id private/calendar-id) (org-caldav-inbox "~/sync/w.org") (org-caldav-files nil) - (org-caldav-sync-direction 'twoway) + (org-caldav-sync-direction 'cal->org) (org-caldav-delete-calendar-entries 'never) (org-caldav-exclude-tags nil) ) -- cgit v1.2.3 From c7415dcfcb4282902996125399bd1261d9372b37 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jul 2020 11:35:42 +0200 Subject: Add a keybinding for olivetti mode --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 12d036e..2de6bbd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4703,6 +4703,10 @@ Support for HTML code blocks with proper syntax highlighting. See [[https://gith ;; (olivetti-minimum-body-width 70) ) #+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings +(define-key fpi/toggle-map "do" #'olivetti-mode) +#+end_src ** Email For the setup of external mail specific programs see [[file:mail.org]]. *** Sending mail -- cgit v1.2.3 From c7fa8bd0319449f2f6acfa31cea111f0b1e1d098 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:10:09 +0200 Subject: Add some ignored words for adaptive scoring --- gnus.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnus.org b/gnus.org index c070a3b..736fa57 100644 --- a/gnus.org +++ b/gnus.org @@ -217,6 +217,13 @@ Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= s gnus-score-decay-constant 1 gnus-score-decay-scale 0.01) #+end_src +****** Ignored Words +Do not score on some common german words. I extracted these from my score file after a few weeks of using scoring. +#+begin_src emacs-lisp +(setq gnus-ignored-adaptive-words + '("loswerden" "teilweise" "übernahme" "betrieb" "kündigt" "schnittstelle" "abgewendet" "hälfte" "massiv" "massivst" "angeblich" "verschleppt" "startup" "auslistung" "wichtiger" "öffentliches" "verwenden" "asynchron" "lieber" "arbeite" "zahlreiche" "november" "entscheidung" "käufer" "findet" "mittlere" "vorstoß" "starker" "erreicht" "letzte" "geplant" "september" "nachfolger" "ankündigen" "mildern" "antrieb" "lassen" "aufsteigen" "entdeckt" "hinweise" "bedingungen" "miniserie" "funktioniert" "umfragen" "angreifbare" "fiasko" "prüfstand" "sparsamer" "steigt" "zugangsdaten" "tutorial" "details" "verfahren" "verschiebt" "enorme" "schlechtere" "erwarten" "optimierungen" "aushalten" "kratzer" "stürze" "gelöscht" "getestet" "stalker" "showcase" "warnung" "maßnahmenplan" "konstruieren" "deutsches" "großen" "probefahrt" "interesse" "preise" "verteilt" "leaken" "günstiger" "umgerüstet" "ausflug" "edition" "definitive" "schützen" "zeiten" "größte" "sicherer" "falsches" "schnelles" "wollte" "angebunden" "externe" "aktualisiertes" "zweiten" "limitiert" "überraschend" "unsicher" "schonfrist" "strukturiert" "historisches" "riesige" "gründet" "mitarbeiter" "geleakt" "mutmaßlichem" "idiotensicher" "stunden" "zornige" "schwächer" "funktionierende" "meinen" "meisten" "geringer" "gewinnen" "rennen" "halten" "synchronisation" "normal" "riesiges" "bessere" "enthält" "integriert" "project" "zurücknehmen" "verursacht" "bleibt" "angeschlossene" "verbrauchen" "berichtet" "ausmachen" "unterschied" "stoppen" "weiterhin" "ausschluss" "schaffen" "exklusives" "riesiger" "keinen" "verbesserter" "steckt" "kündigen" "dienste" "erwägt" "dürfen" "demonstriert" "unerlaubter" "möglichkeiten" "unendlicher" "unbegrenzte" "vermehrt" "greift" "veröffentlicht" "komplett" "warten" "blockiert" "freier" "erscheinen" "reicht" "fliegen" "eigene" "erweitert" "sollen" "könnte" "erscheint" "können" "arbeiten" "eigenen" "lieferbar" "kostet" "kommen" "startet" "zurück" "bestätigt" "schnell" "bietet" "unterstützen" "zahlen" "bekommt" "ersten" "schneller" "verkauft" "kaufen" "machen" "vorgestellt" "bringt" "offenbar" "geräte" "präsentiert" "videos" "stellt" "schließt" "werden" "erhält" "wieder" "endlich" "verfügbar" "deutsche" + )) +#+end_src **** Registry Use the [[info:gnus#The Gnus Registry][Gnus Registry]]. This is required to use [[id:990e2668-11d6-45eb-9c9b-1dc0b89b556d][Gnorb]]. #+begin_src emacs-lisp -- cgit v1.2.3 From ba50c87d9092724138eadb52943280594abe1ffe Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:10:25 +0200 Subject: Adjust adaptive scoring rules --- gnus.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnus.org b/gnus.org index 736fa57..de2a60d 100644 --- a/gnus.org +++ b/gnus.org @@ -155,10 +155,10 @@ See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https: '( <>)) (setq gnus-default-adaptive-word-score-alist - `((,gnus-read-mark . 5) - (,gnus-catchup-mark . -5) + `((,gnus-read-mark . 10) + (,gnus-catchup-mark . -4) (,gnus-killed-mark . -15) - (,gnus-del-mark . -10)) + (,gnus-del-mark . -8)) ) ;; (setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) #+end_src -- cgit v1.2.3 From de9a2d58187d81731d36d358a71fae6b8f53918f Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 11:24:25 +0200 Subject: Fix some text --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 2de6bbd..94de490 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3673,7 +3673,6 @@ content syncing upon commit. (org-attach-git-annex-cutoff 0)) #+end_src *** Org-Capture -Templates #+BEGIN_SRC emacs-lisp (use-package org-capture :custom @@ -3842,7 +3841,8 @@ Templates I no longer use, but may be interesting. "* %i%? %(and (org-id-get-create) nil) :PROPERTIES:\n:CREATED: %u\n:END:\n") #+END_SRC -**** Setup for floating capture window. For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]]. +**** Setup for floating capture window +For reference see [[https://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml][here]]. #+begin_src emacs-lisp (defun fpi/make-floating-frame (&optional width height minibuffer name) (interactive) -- cgit v1.2.3 From 7935118c35c5f4a6f7b9928556dd402e1a6380c7 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:12:30 +0200 Subject: Add notification upon finish async tangling --- emacs-init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 94de490..84e3375 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -121,7 +121,9 @@ emacs-async library." `(async-start (lambda () (require 'org) + (require 'org-clock) (org-babel-tangle-file ,file) + (org-notify (format "Tangled %s" ,file)) 'ignore))))) #+END_SRC As I use =org-crypt= all =.org= files need to be decrypted before -- cgit v1.2.3 From c989b777886f10b5835f9aa6effc0245f8dacbf3 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:12:52 +0200 Subject: Adjust org-scheduled-previously face --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 84e3375..e119110 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -975,7 +975,7 @@ This call now creates a custom theme based on the settings in the sections (:foreground "#1c661c")))) '(org-scheduled-previously ((t - (:foreground "#002000")))) + (:foreground "#002900")))) '(org-agenda-done ((t (:foreground "#727280")))) @@ -1125,7 +1125,7 @@ ln -siv $(pwd)/tangle/spacemacs-light-customizations-theme.el ~/.emacs.d/ (dark-cyan "#008b8b") (light-green "#4f774f") ;;#3f773f (dark-green "#1c661c") - (dark-green2 "#002000") + (dark-green2 "#002900") (region-dark "#2d2e2e") (region "#39393d") (slate "#8FA1B3") -- cgit v1.2.3 From a1c1db3c72b10a9953fdacf34377be62581becb6 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:18:46 +0200 Subject: Add more safe local variables --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index e119110..f6667a6 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1497,7 +1497,11 @@ Some settings could be harmful to emacs and the underlying system. Therefore man #+begin_src emacs-lisp :tangle no :noweb-ref files-custom (safe-local-variable-values '((whitespace-style face trailing space-before-tab indentation empty space-after-tab newline-mark) + (whitespace-style face trailing space-before-tab indentation empty space-after-tab) (eval set-window-buffer nil (current-buffer)) + (eval add-hook 'before-save-hook (lambda nil (fpi/tangle-async)) nil t) + (org-attach-preferred-new-method . dir) + (org-attach-use-inheritance . t) (right-margin-width . 2) (left-margin-width . 2) (line-spacing . 0.2) -- cgit v1.2.3 From 7bec659f21b54e23f6f46fe184e5e910d652b07e Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:19:05 +0200 Subject: Add a key to insert org link for the url in clipboard --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index f6667a6..2f4505b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3410,6 +3410,10 @@ This provides functions to get webpage title or content for org mode links. (use-package org-web-tools :straight t) #+end_src +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(define-key fpi-map "l" #'org-web-tools-insert-link-for-url) +#+end_src + *** Gnorb :PROPERTIES: :ID: 990e2668-11d6-45eb-9c9b-1dc0b89b556d -- cgit v1.2.3 From 01e2ce0b94fa3a4964cbb5ee96ec5a88a94d7cfb Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:23:20 +0200 Subject: Fix header arg in capture templates section --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 2f4505b..8b16237 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3697,7 +3697,7 @@ content syncing upon commit. **** Templates :PROPERTIES: -:header-args:emacs-lisp: :eval never +:header-args:emacs-lisp: :eval never :noweb yes :END: ***** Journal Capture templates for journal entries. Mostly to just keep track of things I have looked at and which may be interesting later, but do not warrant a zettel right now. -- cgit v1.2.3 From d2fee18824c17bc325a1760ccaca3a6e90454a1e Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 19:02:29 +0200 Subject: Refile spellcheck section & auto turn on flyspell --- emacs-init.org | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8b16237..76af5f5 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -46,10 +46,10 @@ - [[#email][Email]] - [[#footnote-mode][Footnote Mode]] - [[#bbdb][BBDB]] - - [[#spellcheck][Spellcheck]] - [[#compile][Compile]] - [[#context-aware-hydra][Context aware hydra]] - [[#language-settings][Language settings]] + - [[#spellcheck][Spellcheck]] - [[#interface][Interface]] - [[#general][General]] - [[#rainbow-mode][Rainbow mode]] @@ -4886,16 +4886,6 @@ For now I use this bad code. (lambda () (define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field))) #+end_src -** Spellcheck -#+begin_src emacs-lisp -(use-package ispell - :config - (setq ispell-program-name "/usr/bin/hunspell") - (setq ispell-dictionary "en_US,de_DE") - (ispell-set-spellchecker-params) - (ispell-hunspell-add-multi-dic "en_US,de_DE") - ) -#+end_src ** Compile Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]]. #+begin_src emacs-lisp @@ -5121,6 +5111,28 @@ End sentences with single spaces. #+begin_src emacs-lisp (setq sentence-end-double-space nil) #+end_src +** Spellcheck +#+begin_src emacs-lisp +(use-package ispell + :config + (setq ispell-program-name "/usr/bin/hunspell") + (setq ispell-dictionary "en_US,de_DE") + (ispell-set-spellchecker-params) + (ispell-hunspell-add-multi-dic "en_US,de_DE") + ) +#+end_src +*** Flyspell +Setup mainly from [[https://github.com/howardabrams/dot-files/blob/master/emacs.org][Howard Abrams]]. +#+begin_src emacs-lisp +(use-package flyspell + :delight + :init + (add-hook 'prog-mode-hook 'flyspell-prog-mode) + (dolist (hook '(text-mode-hook org-mode-hook)) + (add-hook hook (lambda () (flyspell-mode 1)))) + (dolist (hook '(change-log-mode-hook log-edit-mode-hook org-agenda-mode-hook)) + (add-hook hook (lambda () (flyspell-mode -1))))) +#+end_src * Interface ** General #+begin_src emacs-lisp -- cgit v1.2.3 From 4fb2d2ad96d062e197fa860ce81981a25ff88cb7 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 19:03:01 +0200 Subject: Refile writing setup section --- emacs-init.org | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 76af5f5..125bcb7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -42,7 +42,6 @@ - [[#elfeed][Elfeed]] - [[#plotting-data][Plotting data]] - [[#html-renderer][HTML renderer]] - - [[#writing-setup][Writing Setup]] - [[#email][Email]] - [[#footnote-mode][Footnote Mode]] - [[#bbdb][BBDB]] @@ -57,6 +56,7 @@ - [[#whitespace][Whitespace]] - [[#undo][Undo]] - [[#electric-stuff][Electric stuff]] + - [[#writing-setup][Writing Setup]] - [[#wrapping-up][Wrapping up]] #+END_QUOTE @@ -4703,20 +4703,6 @@ Support for HTML code blocks with proper syntax highlighting. See [[https://gith (advice-add 'eww-display-html :around 'eww-display-html--override-shr-external-rendering-functions)))) #+END_SRC -** Writing Setup -*** Olivetti Mode -#+begin_src emacs-lisp -(use-package olivetti - :straight t - :custom - (olivetti-body-width 0.65) - ;; (olivetti-minimum-body-width 70) - ) -#+end_src - -#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings -(define-key fpi/toggle-map "do" #'olivetti-mode) -#+end_src ** Email For the setup of external mail specific programs see [[file:mail.org]]. *** Sending mail @@ -5224,6 +5210,20 @@ temporary buffer is created. (electric-pair-mode 1) (electric-quote-mode -1)) #+end_src +** Writing Setup +*** Olivetti Mode +#+begin_src emacs-lisp +(use-package olivetti + :straight t + :custom + (olivetti-body-width 0.65) + ;; (olivetti-minimum-body-width 70) + ) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings +(define-key fpi/toggle-map "do" #'olivetti-mode) +#+end_src * Wrapping up Some stuff that is run after everything else. -- cgit v1.2.3 From 5e21e29be6e91a1ef82cfa5c48dfb39cc6fb36e6 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 20:00:43 +0200 Subject: Disable customize based theme loading After load-theme customize recalculates user set variables. Including the current-theme variable, calling the set function several times & messing it up.. --- emacs-init.org | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 125bcb7..6ab1606 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -401,8 +401,9 @@ defined, for example ~pdf-view-midnight-colors~. (defcustom fpi/dark-theme-list '(spacemacs-dark spacemacs-dark-customizations) "List of themes to activate when using a dark theme.") (defcustom fpi/current-theme 'light - "Currently activated theme variation." - :set #'fpi/set-and-reload-theme) + "Currently activated theme variation.") + +(fpi/load-themes) #+end_src Functions to load themes based on the ~fpi/current-theme~ setting and to toggle the current theme between light and dark. @@ -418,20 +419,15 @@ of `(format \"fpi/%s-theme-list\" fpi/current-theme)'" (let* ((theme-variation (or theme-variation fpi/current-theme)) (themes (eval (intern (format "fpi/%s-theme-list" theme-variation))))) (mapc (lambda (theme) (load-theme theme t)) themes))) -(defun fpi/set-and-reload-theme (symbol value) - "Set SYMBOL to VALUE and update themes. - -Set SYMBOL to VALUE with `set-default'if it is not already set to -that value and update the loaded themes afterwards." - (when (not (and (boundp symbol) (eq (eval symbol) value))) - (set-default symbol value) - (fpi/load-themes))) (defun fpi/toggle-theme () "Toggle between light and dark theme." (interactive) (if (eq fpi/current-theme 'light) - (customize-save-variable 'fpi/current-theme 'dark) - (customize-save-variable 'fpi/current-theme 'light))) + (progn + (customize-save-variable 'fpi/current-theme 'dark) + (fpi/load-themes)) + (customize-save-variable 'fpi/current-theme 'light) + (fpi/load-themes))) #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings (define-key fpi/toggle-map "dt" #'fpi/toggle-theme) @@ -2836,8 +2832,12 @@ Advice =load-theme= to update the colors for =pdf-view-midnight-mode= after the theme changes. #+NAME: theme-dependent-vars #+begin_src emacs-lisp :tangle no -(defadvice load-theme (after update-pdf-view-midnight-color activate) - (customize-save-variable 'pdf-view-midnight-colors `(,(face-attribute 'default :foreground) . ,(face-attribute 'default :background)))) +(defun update-pdf-view-midnight-color (&rest arg) + (customize-save-variable + 'pdf-view-midnight-colors + `(,(face-attribute 'default :foreground) . ,(face-attribute 'default :background)))) +(advice-add 'load-theme :after + #'update-pdf-view-midnight-color) #+end_src ** Latex -- cgit v1.2.3 From 1c2942bbbb3fcf035fd9788407eeab33673737ae Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:23:46 +0200 Subject: Make olivetti mode scale better in small windows --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 6ab1606..e4ccc74 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5215,8 +5215,9 @@ temporary buffer is created. #+begin_src emacs-lisp (use-package olivetti :straight t + :delight :custom - (olivetti-body-width 0.65) + (olivetti-body-width 80) ;; (olivetti-minimum-body-width 70) ) #+end_src -- cgit v1.2.3 From 077cde89d72ea895ddb7b9624a4d6336f6d9e6ae Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 27 Jul 2020 20:33:46 +0200 Subject: [WIP] Improve font setup --- emacs-init.org | 260 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 232 insertions(+), 28 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index e4ccc74..b8e8047 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -384,6 +384,218 @@ Instead of the above code I set the font directly using (set-face-attribute 'default nil :font "Hack-11") #+end_src +#+begin_src emacs-lisp +(use-package emacs + :commands (prot/font-set-face-attribute + prot/font-set-fonts + prot/font-set-font-size-family + prot/font-fonts-dwim) + :config + (setq x-underline-at-descent-line t) + (setq underline-minimum-offset 1) + + (defconst prot/font-fontconfig-params + "embeddedbitmap=false:autohint=false:hintstyle=hintslight" + "Additional parameters for the given font family. +These are specific to the fontconfig backend for GNU/Linux systems.") + + (defvar prot/font-set-fonts-hook nil + "Hook that is called after setting fonts. +See, for example, `prot/font-set-fonts'.") + + ;; The idea with this association list is to use font combinations + ;; that are suitable to the given point size and intended function. + ;; Basically, I have three modes: my laptop's small screen, my laptop + ;; attached to a larger external monitor in a desktop setup (my normal + ;; case), and when I do presentations (i.e. my videos on Emacs). + ;; + ;; I find that at smaller sizes the open and wide proportions of + ;; Hack+FiraGO combined with their more intense typographic colour + ;; work best, while the more compact Iosevka+Source Sans Pro are + ;; better at larger point sizes. The "desktop" combo is ideal for use + ;; on a larger monitor at a regular point size. The latter is what I + ;; typically use to write prose or code. + ;; + ;; Note that the "Hack" typeface mentioned here is my patched version + ;; of it, which uses some alternative glyphs, is built on top of the + ;; latest dev branch, and is meant to improve both the Roman and + ;; Italic variants (alt glyphs are part of the Hack project): + ;; https://gitlab.com/protesilaos/hackfontmod + (defconst prot/font-sizes-families-alist + '(("laptop" . (10.5 "Hack" "Source Sans Pro" 1)) + ("desktop" . (13 "Hack" "Alegreya" 4)) + ("presentation" . (19 "Iosevka SS08" "Source Sans Pro" 1))) + "Alist of desired point sizes and their typefaces. +Each association consists of a display type mapped to a point +size, followed by monospaced and proportionately-spaced font +names, and a difference in desired size between the latter two to +account for their innate differences in proportions (this number +represents pixels and is found empirically). + +The monospaced typeface is meant to be applied to the `default' +and `fixed-pitch' faces. The proportionately-space font is +intended for the `variable-pitch' face.") + + (defun prot/font-set-face-attribute (face family size &optional params) + "Set FACE font to FAMILY at SIZE with optional PARAMS." + (let ((params (if params + params + prot/font-fontconfig-params))) + (set-face-attribute + `,face nil :font + (format "%s-%s:%s" family (number-to-string size) params)))) + + + + + + (defun prot/font-set-fonts (&optional points font-mono font-var) + "Set default font size using presets. + +POINTS is the font's point size, represented as either '10' or +'10.5'. FONT-MONO should be a monospaced typeface, due to the +alignment requirements of the `fixed-pitch' face. FONT-VAR could +be a proportionately-spaced typeface or even a monospaced one, +since the `variable-pitch' it applies to is not supposed to be +spacing-sensitive. Both families must be represented as a string +holding the family's name." + (interactive) + (let* ((data prot/font-sizes-families-alist) + (displays (mapcar #'car data)) + (choice (if points + points + (completing-read "Pick display size: " displays nil t))) + (size (if points + points + (nth 1 (assoc `,choice data)))) + (mono (if font-mono + font-mono + (if (member choice displays) + (nth 2 (assoc `,choice data)) + nil))) + (var (if font-var + font-var + (if (member choice displays) + (nth 3 (assoc `,choice data)) + nil))) + (adjust (nth 4 (assoc `,choice data)))) + (when window-system + (dolist (face '(default fixed-pitch)) + (prot/font-set-face-attribute `,face mono size)) + (prot/font-set-face-attribute 'variable-pitch var (+ size adjust)))) + (run-hooks 'prot/font-switch-fonts-hook)) + + (defvar prot/font-monospaced-fonts-list + '("Hack" "Iosevka SS08" "Iosevka Slab" "Source Code Pro" + "Ubuntu Mono" "Fantasque Sans Mono" "DejaVu Sans Mono" + "Fira Code" "Victor Mono" "Roboto Mono") + "List of typefaces for coding. +See `prot/font-set-font-size-family' for how this is used.") + + (defun prot/font-set-font-size-family () + "Set point size and main typeface. +This command is intended for testing various font families at +some common point sizes. + +See `prot/font-set-fonts' for the function I would normally use +or `prot/font-fonts-dwim' which just wraps this one with that." + (interactive) + (let* ((fonts prot/font-monospaced-fonts-list) + (font (completing-read "Select main font: " fonts nil t)) + (nums (list 13 14 15 16)) + (sizes (mapcar 'number-to-string nums)) + (size (completing-read "Select or insert number: " sizes nil)) + (var (face-attribute 'variable-pitch :family))) + (dolist (face '(default fixed-pitch)) + (prot/font-set-face-attribute face font (string-to-number size))) + (prot/font-set-face-attribute 'variable-pitch var (string-to-number size)) + (run-hooks 'prot/font-switch-fonts-hook))) + + (defun prot/font-fonts-dwim (&optional arg) + "Set fonts interactively. +This is just a wrapper around `prot/font-set-fonts' and +`prot/font-set-font-size-family', whose sole purpose is to +economise on dedicated key bindings." + (interactive "P") + (if arg + (prot/font-set-font-size-family) + (prot/font-set-fonts))) + + (defvar prot/font-fonts-line-spacing-alist + '(("Iosevka SS08" . 1) + ("Iosevka Slab" . 1) + ("Source Code Pro" . 1) + ("Ubuntu Mono" . 2)) + "Font families in need of extra `line-spacing'. +See `prot/font-line-spacing' for how this is used.") + + (defvar prot/font-fonts-bold-weight-alist + '(("Source Code Pro" . semibold)) + "Font families in need of a variegated weight for `bold'. +See `prot/font-bold-face' for how this is used.") + + (defmacro prot/font-adjustment (fn doc alist cond1 cond2) + "Macro for functions that employ `prot/font-switch-fonts-hook'. +NAME is the name of the resulting function. DOC is its +docstring. ALIST is an assosiation list of cons cells. COND1 +and COND2 is the body of an `if' statement's 'if' and 'then' part +respectively." + `(defun ,fn () + ,doc + (let* ((data ,alist) + (fonts (mapcar #'car data)) + ;; REVIEW This should be adjusted to account for the + ;; possibility of a distinct font family for the `bold' + ;; face. + (font (face-attribute 'default :family)) + (x (cdr (assoc font data)))) + (if (member font fonts) + ,cond1 + ,cond2)))) + + (prot/font-adjustment + prot/font-line-spacing + "Determine desirable `line-spacing', based on font family." + prot/font-fonts-line-spacing-alist + (setq-default line-spacing `,x) + (setq-default line-spacing nil)) + + ;; XXX This will not work with every theme, but only those that + ;; inherit the `bold' face instead of specifying a weight property. + ;; The intent is to configure this once and have it propagate wherever + ;; a heavier weight is displayed. My Modus themes handle this + ;; properly. + (prot/font-adjustment + prot/font-bold-face + "Determine weight for the `bold' face, based on font family." + prot/font-fonts-bold-weight-alist + (set-face-attribute 'bold nil :weight `,x) + (set-face-attribute 'bold nil :weight 'bold)) + + (defun prot/font-fonts-per-monitor () + "Use font settings based on screen size. +Meant to be used at some early initialisation stage, such as with +`after-init-hook'." + (let* ((display (if (<= (display-pixel-width) 1366) + "laptop" + "desktop")) + (data prot/font-sizes-families-alist) + (size (cadr (assoc `,display data))) + (mono (nth 2 (assoc `,display data))) + (var (nth 3 (assoc `,display data))) + (adjust (nth 4 (assoc `,display data)))) + (dolist (face '(default fixed-pitch)) + (prot/font-set-face-attribute face mono size)) + (prot/font-set-face-attribute 'variable-pitch var (+ size adjust)) + (run-hooks 'prot/font-switch-fonts-hook))) + + :hook ((after-init-hook . prot/font-fonts-per-monitor) + (prot/font-set-fonts-hook . prot/font-line-spacing) + (prot/font-set-fonts-hook . prot/font-bold-face)) + ;; Awkward key because I do not need it very often. Maybe once a day. + ;; The "C-c f" is used elsewhere. + :bind ("C-c F" . prot/font-fonts-dwim)) +#+end_src ** Theme & Faces =hc-zenburn= is the theme I chose for a long time. Lately I started to appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light @@ -825,12 +1037,6 @@ This call now creates a custom theme based on the settings in the sections (progn (deftheme spacemacs-light-customizations "My customizations to spacemacs-light (Created 2020-06-27)") (custom-theme-set-faces 'spacemacs-light-customizations - '(default - ((t - (:family "Hack" :background "#fbf8ef" :foreground "#1c1e1f")))) - '(variable-pitch - ((t - (:family "EtBookOt" :background nil :foreground "#1c1e1f" :height 1.2)))) '(header-line ((t (:background nil :inherit nil)))) @@ -872,7 +1078,7 @@ This call now creates a custom theme based on the settings in the sections ((t nil))) '(org-document-title ((t - (:inherit nil :family "EtBookOt" :height 1.8 :foreground "#1c1e1f" :underline nil)))) + (:inherit nil :height 1.8 :foreground "#1c1e1f" :underline nil)))) '(org-document-info ((t (:height 1.2 :slant italic)))) @@ -881,16 +1087,16 @@ This call now creates a custom theme based on the settings in the sections (:inherit shadow :height 0.6)))) '(org-level-1 ((t - (:inherit nil :family "EtBookOt" :height 1.6 :weight normal :slant normal :foreground "#1c1e1f")))) + (:height 1.6 :weight normal :slant normal :foreground "#1c1e1f")))) '(org-level-2 ((t - (:inherit nil :family "EtBookOt" :weight normal :height 1.3 :slant italic :foreground "#1c1e1f")))) + (:weight normal :height 1.3 :slant italic :foreground "#1c1e1f")))) '(org-level-3 ((t - (:inherit nil :family "EtBookOt" :weight normal :slant italic :height 1.2 :foreground "#1c1e1f")))) + (:weight normal :slant italic :height 1.2 :foreground "#1c1e1f")))) '(org-level-4 ((t - (:inherit nil :family "EtBookOt" :weight normal :slant italic :height 1.1 :foreground "#1c1e1f")))) + (:weight normal :slant italic :height 1.1 :foreground "#1c1e1f")))) '(org-level-5 ((t nil))) '(org-level-6 @@ -899,9 +1105,6 @@ This call now creates a custom theme based on the settings in the sections ((t nil))) '(org-level-8 ((t nil))) - '(org-headline-done - ((t - (:family "EtBookOt")))) '(org-quote ((t nil))) '(org-block @@ -983,10 +1186,10 @@ This call now creates a custom theme based on the settings in the sections (:foreground "#727280")))) '(org-table ((t - (:family "cmu typewriter text" :height 0.9 :background "#fbf8ef")))) + (:inherit fixed-pitch :height 0.9 :background "#fbf8ef")))) '(org-code ((t - (:inherit nil :family "cmu typewriter text" :foreground "#525254" :height 0.9)))) + (:inherit fixed-pitch :foreground "#525254" :height 0.9)))) '(font-latex-sectioning-0-face ((t nil))) '(font-latex-sectioning-1-face @@ -1148,10 +1351,11 @@ ln -siv $(pwd)/tangle/spacemacs-light-customizations-theme.el ~/.emacs.d/ :END: #+begin_src emacs-lisp :noweb-ref faces-spacemacs-light :tangle no ;; light -'('(default ((t (:family ,sans-mono-font :background ,bg-white :foreground ,bg-dark - ;; :height 75 - )))) - '(variable-pitch ((t (:family ,et-font :background nil :foreground ,bg-dark :height 1.2)))) +'( + ;; '(default ((t (:family ,sans-mono-font :background ,bg-white :foreground ,bg-dark + ;; ;; :height 75 + ;; )))) + ;; '(variable-pitch ((t (:family ,et-font :background nil :foreground ,bg-dark :height 1.2)))) '(header-line ((t (:background nil :inherit nil)))) '(show-paren-match ((t nil))) '(magit-section-heading ((t nil))) @@ -1167,18 +1371,18 @@ ln -siv $(pwd)/tangle/spacemacs-light-customizations-theme.el ~/.emacs.d/ '(powerline-inactive2 ((t (:background ,bg-white)))) '(highlight ((t (:background ,shade-white)))) '(hl-line ((t nil))) - '(org-document-title ((t (:inherit nil :family ,et-font :height 1.8 :foreground ,bg-dark :underline nil)))) + '(org-document-title ((t (:inherit nil :height 1.8 :foreground ,bg-dark :underline nil)))) '(org-document-info ((t (:height 1.2 :slant italic)))) '(org-archived ((t (:inherit shadow :height 0.6)))) - '(org-level-1 ((t (:inherit nil :family ,et-font :height 1.6 :weight normal :slant normal :foreground ,bg-dark)))) - '(org-level-2 ((t (:inherit nil :family ,et-font :weight normal :height 1.3 :slant italic :foreground ,bg-dark)))) - '(org-level-3 ((t (:inherit nil :family ,et-font :weight normal :slant italic :height 1.2 :foreground ,bg-dark)))) - '(org-level-4 ((t (:inherit nil :family ,et-font :weight normal :slant italic :height 1.1 :foreground ,bg-dark)))) + '(org-level-1 ((t (:height 1.6 :weight normal :slant normal :foreground ,bg-dark)))) + '(org-level-2 ((t (:weight normal :height 1.3 :slant italic :foreground ,bg-dark)))) + '(org-level-3 ((t (:weight normal :slant italic :height 1.2 :foreground ,bg-dark)))) + '(org-level-4 ((t (:weight normal :slant italic :height 1.1 :foreground ,bg-dark)))) '(org-level-5 ((t nil))) '(org-level-6 ((t nil))) '(org-level-7 ((t nil))) '(org-level-8 ((t nil))) - '(org-headline-done ((t (:family ,et-font)))) + ;; '(org-headline-done ((t (:family ,et-font)))) '(org-quote ((t nil))) '(org-block ((t (:background nil :height 0.9 :foreground ,bg-dark :family ,sans-mono-font)))) '(org-block-begin-line ((t (:background nil :height 0.8 :family ,sans-mono-font :foreground ,slate)))) @@ -1208,8 +1412,8 @@ ln -siv $(pwd)/tangle/spacemacs-light-customizations-theme.el ~/.emacs.d/ '(org-agenda-done ((t (:foreground ,doc)))) '(org-ellipsis ((t (:underline nil :foreground ,comment)))) '(org-tag ((t (:foreground ,doc)))) - '(org-table ((t (:family ,serif-mono-font :height 0.9 :background ,bg-white)))) - '(org-code ((t (:inherit nil :family ,serif-mono-font :foreground ,comment :height 0.9)))) + '(org-table ((t (:inherit fixed-pitch :height 0.9 :background ,bg-white)))) + '(org-code ((t (:inherit fixed-pitch :foreground ,comment :height 0.9)))) '(font-latex-sectioning-0-face ((t nil))) '(font-latex-sectioning-1-face ((t nil))) '(font-latex-sectioning-2-face ((t nil))) -- cgit v1.2.3 From f6cb4d704a31f9d23edd9644d34a863ff14aacb0 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:24:22 +0200 Subject: [WIP] Add first base version of prose minor mode --- emacs-init.org | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index b8e8047..a91a2ea 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3190,7 +3190,9 @@ Switch projects and subprojects from NEXT back to TODO" (use-package org-indent :delight :custom - (org-startup-indented t)) + (org-startup-indented t) + <> + ) #+end_src #+begin_src emacs-lisp (use-package ob @@ -5415,7 +5417,33 @@ temporary buffer is created. (electric-quote-mode -1)) #+end_src ** Writing Setup -*** Olivetti Mode +I gather all settings related to writing in a minor mode. +#+begin_src emacs-lisp +(define-minor-mode prose-mode + "Toggle some settings for text based buffers." + :init-value nil + :lighter " ✎" + (if prose-mode + (progn + (olivetti-mode 1) + (set-window-fringes (selected-window) 0 0) + (variable-pitch-mode 1) + ) + (olivetti-mode -1) + (set-window-fringes (selected-window) nil) + (variable-pitch-mode -1) + )) +#+end_src +The mode is enabled for all =text-mode= based buffers by default. +#+begin_src emacs-lisp +(add-hook 'text-mode-hook 'prose-mode) +#+end_src +Also set an easy keybinding to toggle it manually. +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(define-key fpi/toggle-map "p" #'prose-mode) +#+end_src + +Olivetti mode is used to center text in the buffer. This somehow helps with writing. #+begin_src emacs-lisp (use-package olivetti :straight t @@ -5426,8 +5454,16 @@ temporary buffer is created. ) #+end_src -#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings -(define-key fpi/toggle-map "do" #'olivetti-mode) +For org-mode also reduce indentation by =org-indent-mode= as described [[https://explog.in/notes/writingsetup.html][here]]. +#+begin_src emacs-lisp :noweb-ref org-indent-custom :tangle no +(org-indent-indentation-per-level 1) +#+end_src +These settings are also from the above blog post, but mainly manually set what =org-indent-mode= does anyway. +#+begin_src emacs-lisp :noweb-ref org-custom :tangle no +(org-adapt-indentation nil) +(org-hide-leading-stars t) +(org-hide-emphasis-markers t) +(org-cycle-separator-lines 1) #+end_src * Wrapping up -- cgit v1.2.3 From ab3de4324bd56cde6916e183e9670f684e6f6fa8 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:44:32 +0200 Subject: Add dotfiles patch files to gnus cloud --- gnus.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnus.org b/gnus.org index de2a60d..907a387 100644 --- a/gnus.org +++ b/gnus.org @@ -257,7 +257,10 @@ To enable it go to the gnus server buffer and mark the servers to be synced with #+end_src Commands to interact with the gnus cloud are prefixed with =~= in the group buffer. #+begin_src emacs-lisp -(setq gnus-cloud-synced-files '("~/.authinfo.gpg" "~/.gnus.registry.eieio" (:directory "~/News" :match ".*.\\(SCORE\\|ADAPT\\)"))) +(setq gnus-cloud-synced-files '("~/.authinfo.gpg" + "~/.gnus.registry.eieio" + (:directory "~/News" :match ".*.\\(SCORE\\|ADAPT\\)") + (:directory "~/git/projects/dotfiles" :match "[0-9]+-.*\\.patch"))) #+end_src *** Display Sort by newest first -- cgit v1.2.3 From 9f362946f2b94a93fb63f0865f2ceff2b85af03e Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 3 Aug 2020 10:57:44 +0200 Subject: [Testing] Disable format=flowed --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index a91a2ea..bf2d1c0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4983,7 +4983,7 @@ Hard new lines are identified using a ~hard~ text property and displayed as =⏎=. We need to make sure all newlines inserted by message initialization (signature, ...) also have this text property. For now I use this bad code. -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (use-package messages-are-flowing :straight t :config (add-hook 'message-mode-hook 'messages-are-flowing-use-and-mark-hard-newlines)) -- cgit v1.2.3 From 65ece137e8505e59bd52ff0f0e12bea16b14c7bc Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 3 Aug 2020 18:05:14 +0200 Subject: Rebind shell-pop --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index bf2d1c0..cd8ee60 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4633,7 +4633,7 @@ To open and hide a shell quickly I use =shell-pop=. #+begin_src emacs-lisp (use-package shell-pop :straight t - :bind (("C-!" . shell-pop)) + :bind (("C->" . shell-pop)) :custom (shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda nil (eshell)))))) #+end_src -- cgit v1.2.3 From cc23eaf639fbf2c8d8d05e223f15701a82135ee5 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 5 Aug 2020 12:06:56 +0200 Subject: Add more time budget definitions --- emacs-init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index cd8ee60..ec3d73f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3544,7 +3544,10 @@ Gives an overview of time spent on defined budgets this week. Great to track if :custom (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) (:title "├Research" :match "+work+research" :budget "24:00" :blocks (nil week)) - (:title "╰Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week))))) + (:title "├Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week)) + (:title "├Reading" :match "+work+read" :budget "0" :blocks (day week)) + (:title "╰Shaved Yaks" :match "+work+nonprod" :budget "0" :blocks (day week)) + (:title "Personal" :match "+nowork-nonprod" :budget "5:00" :blocks (nil week))))) #+end_src **** Column view #+begin_src emacs-lisp -- cgit v1.2.3 From 4f36e2c080825f43eb7afa5f0592711ac97cc9c7 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 22 Aug 2020 18:13:47 +0200 Subject: Set ox-icalendar to always create ids for caldav --- emacs-init.org | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index ec3d73f..8995856 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3713,20 +3713,6 @@ Also display remote images by downloading them. #+begin_src emacs-lisp :noweb-ref ob-hooks :tangle no (org-babel-after-execute . org-display-inline-images) #+end_src -*** org-caldav -#+begin_src emacs-lisp -(use-package org-caldav - :straight t - :custom - (org-caldav-url private/calendar-url) - (org-caldav-calendar-id private/calendar-id) - (org-caldav-inbox "~/sync/w.org") - (org-caldav-files nil) - (org-caldav-sync-direction 'cal->org) - (org-caldav-delete-calendar-entries 'never) - (org-caldav-exclude-tags nil) -) -#+end_src *** Babel This function is handy to use in header arguments to create names based on the current org heading. E.g. =:var data=(fpi/format-headline "/tmp/prefix_")= #+begin_src emacs-lisp @@ -3755,6 +3741,29 @@ This function is handy to use in header arguments to create names based on the c #+begin_src emacs-lisp (use-package ol-bbdb) #+end_src +*** icalendar support +While =org-caldav= offers syncing with caldav servers it relies on =ox-icalendar= to convert between org entries and icalendar events. +**** org-caldav +#+begin_src emacs-lisp +(use-package org-caldav + :straight t + :custom + (org-caldav-url private/calendar-url) + (org-caldav-calendar-id private/calendar-id) + (org-caldav-inbox "~/sync/w.org") + (org-caldav-files nil) + (org-caldav-sync-direction 'cal->org) + (org-caldav-delete-calendar-entries 'never) + (org-caldav-exclude-tags nil) +) +#+end_src +**** ox-icalendar +#+begin_src emacs-lisp +(use-package ox-icalendar + :after org + :custom + (org-icalendar-store-UID t)) +#+end_src *** prettify symbols Set some prettify symbols for org mode. #+begin_src emacs-lisp -- cgit v1.2.3 From fdbc4e7f214335e39bddd2842808e0871ef666aa Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 22 Aug 2020 18:35:43 +0200 Subject: Add function to create svg screenshots --- emacs-init.org | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 8995856..c7025e3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -47,6 +47,7 @@ - [[#bbdb][BBDB]] - [[#compile][Compile]] - [[#context-aware-hydra][Context aware hydra]] + - [[#minor-utilities][Minor utilities]] - [[#language-settings][Language settings]] - [[#spellcheck][Spellcheck]] - [[#interface][Interface]] @@ -5310,6 +5311,23 @@ _q_ quit _r_ remove result _e_ examplify region ("/" ibuffer-filter-disable "disable") ("b" hydra-ibuffer-main/body "back" :color blue)) #+END_SRC +** Minor utilities +*** Screenshots / -casts +[[https://gitlab.com/ambrevar/emacs-gif-screencast][Here]] is a guide to creating emacs gif screencasts. + +If compiled with =cairo= support emacs can directly create svg screenshots ([[https://www.reddit.com/r/emacs/comments/idz35e/emacs_27_can_take_svg_screenshots_of_itself/][source]]). +#+begin_src emacs-lisp +(defun screenshot-svg () + "Save a screenshot of the current frame as an SVG image. +Saves to a temp file and puts the filename in the kill ring." + (interactive) + (let* ((filename (make-temp-file "Emacs-" nil ".svg")) + (data (x-export-frames nil 'svg))) + (with-temp-file filename + (insert data)) + (kill-new filename) + (message filename))) +#+end_src * Language settings End sentences with single spaces. #+begin_src emacs-lisp -- cgit v1.2.3 From fb7a691e9638874382adae288299b5193368cbaa Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Aug 2020 12:54:57 +0200 Subject: Do not save journal creation date in the headline --- emacs-init.org | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index c7025e3..d2492e2 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3927,13 +3927,19 @@ Capture templates for journal entries. Mostly to just keep track of things I hav (file+olp+datetree ,org-journal-file) ;; "** %<%H:%M> %a\n %i%? \n%:description\n%:elfeed-entry-content\n%:elfeed-entry-date\n%:elfeed-entry-meta\n%:elfeed-entry-title\n%:elfeed-entry-enclosures\n%:elfeed-entry-tags" ) - "** %<%H:%M> %a + "** %a +:PROPERTIES: +:CREATED: %U +:END: %i%?" ) ("je" "Manual Entry" entry (file+olp+datetree ,org-journal-file) - "** %<%H:%M> %? + "** %? +:PROPERTIES: +:CREATED: %U +:END: %i" ) #+END_SRC To get the title from the url in =kill-ring= I use [[id:dc4129ff-6d76-4f12-926f-c62a687a39ec][org-web-tools]]. @@ -3942,7 +3948,10 @@ To get the title from the url in =kill-ring= I use [[id:dc4129ff-6d76-4f12-926f- entry (file+olp+datetree ,org-journal-file) - "** %<%H:%M> %(org-web-tools--org-link-for-url (org-web-tools--get-first-url))%? + "** %(org-web-tools--org-link-for-url (org-web-tools--get-first-url))%? +:PROPERTIES: +:CREATED: %U +:END: %i") #+END_SRC ***** Interrupts -- cgit v1.2.3 From aaefc71b6e7a58fcd13e0db1e1f01cf6b2a7f55a Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Aug 2020 13:04:27 +0200 Subject: Create directory to save hashes if it does not exist --- README.org | 1 + 1 file changed, 1 insertion(+) diff --git a/README.org b/README.org index 77ba004..645e312 100644 --- a/README.org +++ b/README.org @@ -125,6 +125,7 @@ first. If they do not match keep the file for tangling. #+NAME: checkhashes #+begin_src shell HASHDIR="hash" +mkdir -p $HASHDIR tanglefiles="" <> -- cgit v1.2.3 From cfeec023d5a401756773657cf3f86aacaca87c0b Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Aug 2020 13:06:36 +0200 Subject: Add make target for dev+ branch --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d381bbf..db682d6 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,16 @@ dst_readme := tangle.sh merge.sh pull.sh link.sh dots.sh -.PHONY: merge install link tangle fetch pull clean +.PHONY: merge dev install link tangle fetch pull clean merge: tangle/merge.sh tangle/merge.sh +dev: + git fetch + git rebase origin/dev+ dev+ + git rebase master dev+ + git push --force origin dev+ + install: tangle link tangle: tangle/tangle.sh -- cgit v1.2.3 From 14ffbb4a37f34277583a3d80cb30bb760e914790 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 23 Aug 2020 12:53:28 +0200 Subject: Add function to partially download from gnus cloud --- gnus.org | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 9 deletions(-) diff --git a/gnus.org b/gnus.org index 907a387..f2e2cc6 100644 --- a/gnus.org +++ b/gnus.org @@ -249,18 +249,72 @@ Also automatically set message tags (setq gnorb-gnus-auto-tag-messages t) #+end_src **** Gnus Cloud -The [[info:gnus#The Gnus Cloud][Gnus Cloud]] lets you synchronize marks and general data (whatever that is) across different machines. This seems more complete than manually (with Nextcloud, …) syncing the news related files (=~/.newsrc.eld=, =~/News=, …). +The [[info:gnus#The Gnus Cloud][Gnus Cloud]] lets you synchronize marks and general data (whatever that is) across different machines. +This seems more complete than manually (with Nextcloud, …) syncing the news related files (=~/.newsrc.eld=, =~/News=, …).+ To enable it go to the gnus server buffer and mark the servers to be synced with =i= and the (imap) server which is used as host with =I=. -#+begin_src emacs-lisp -(setq gnus-cloud-method (concat "nnimap:" (car private/personal-imap-info))) -#+end_src + Commands to interact with the gnus cloud are prefixed with =~= in the group buffer. -#+begin_src emacs-lisp -(setq gnus-cloud-synced-files '("~/.authinfo.gpg" - "~/.gnus.registry.eieio" - (:directory "~/News" :match ".*.\\(SCORE\\|ADAPT\\)") - (:directory "~/git/projects/dotfiles" :match "[0-9]+-.*\\.patch"))) + +#+begin_src emacs-lisp :noweb yes +(use-package gnus-cloud + :custom + (gnus-cloud-method (concat "nnimap:" (car private/personal-imap-info))) + (gnus-cloud-synced-files '("~/.authinfo.gpg" + ;; "~/.gnus.registry.eieio" + ;; (:directory "~/News" :match ".*.\\(SCORE\\|ADAPT\\)") + (:directory "~/git/projects/dotfiles" :match "[0-9]+-.*\\.patch"))) + (gnus-cloud-storage-method 'epg) + :config + <> + ) +#+end_src + +***** Only download specific files +Gnus Cloud sync all newsrc data and the specified files. Sometimes one would only want to download and update only specific files without overwriting all newsrc data. + +This function is very similar to ~gnus-cloud-download-data~ but takes a regexp to match against filenames. Note that it does not update ~gnus-cloud-sequence~ (for now). So when only doing partial downloads repeatedly you may need to update ~gnus-cloud-sequence~ manually. +#+begin_src emacs-lisp :noweb-ref gnus-cloud-config +(defun fpi/gnus-cloud-download-some (regexp &optional sequence-override) + "Download and install files matching REGEXP." + (interactive "sRegexp to match: ") + (let ((articles nil) + (highest-sequence-seen gnus-cloud-sequence) + chunks) + (dolist (header (gnus-cloud-available-chunks)) + (let ((this-sequence (gnus-cloud-chunk-sequence (mail-header-subject header)))) + (when (> this-sequence (or sequence-override gnus-cloud-sequence -1)) + + (if (string-match (format "storage-method: %s" gnus-cloud-storage-method) + (mail-header-subject header)) + (progn + (push (mail-header-number header) articles) + (setq highest-sequence-seen (max highest-sequence-seen this-sequence))) + (gnus-message 1 "Skipping article %s because it didn't match the Gnus Cloud method %s: %s" + (mail-header-number header) + gnus-cloud-storage-method + (mail-header-subject header)))))) + (when articles + (nnimap-request-articles (nreverse articles) gnus-cloud-group-name) + (with-current-buffer nntp-server-buffer + (goto-char (point-min)) + (while (re-search-forward "^Gnus-Cloud-Version " nil t) + (beginning-of-line) + (push (gnus-cloud-parse-chunk) chunks) + (forward-line 1)))) + (mapcar (lambda (chunk) (fpi/gnus-cloud-update-some chunk regexp)) chunks))) + +(defun fpi/gnus-cloud-update-some (elems regexp) + (dolist (elem elems) + (let ((type (plist-get elem :type)) + (name (plist-get elem :file-name))) + (when (and (memq type '(:delete :file)) + (with-temp-buffer + (insert name) + (beginning-of-buffer) + (re-search-forward regexp nil t))) + (message "Match: Updating %s" name) + (gnus-cloud-update-file elem type))))) +(define-key gnus-group-mode-map (kbd "~ p") 'fpi/gnus-cloud-download-some) #+end_src *** Display Sort by newest first -- cgit v1.2.3 From 8fe2fbb28fbe36e6e44679f1bb0d9bd7f31751b8 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:54:03 +0200 Subject: Use IMAP namespaces to distinguish IMAP servers --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index f2e2cc6..990eac0 100644 --- a/gnus.org +++ b/gnus.org @@ -58,6 +58,10 @@ RSS/Atom Feeds asynchronously. (add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) <> #+end_src + +#+begin_src emacs-lisp +(setq nnimap-use-namespaces t) +#+end_src ** Options *** General **** Startup -- cgit v1.2.3 From 8e16453b4a7cd2644ac3a35ea8d7885bfed0846b Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:54:51 +0200 Subject: Slim down registry to only mail groups --- gnus.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gnus.org b/gnus.org index 990eac0..d5556d9 100644 --- a/gnus.org +++ b/gnus.org @@ -233,6 +233,21 @@ Use the [[info:gnus#The Gnus Registry][Gnus Registry]]. This is required to use #+begin_src emacs-lisp (gnus-registry-initialize) #+end_src +Remove some groups from being saved to the registry +#+begin_src emacs-lisp +(setq gnus-registry-split-strategy 'majority) +(setq gnus-registry-ignored-groups + '(("^nnreddit" t) + ("^nntp" t) + ("delayed$" t) + ("drafts$" t) + ("queue$" t) + ("INBOX$" t) + ("^nnmairix:" t) + ("^nnir:" t) + ("archive" t) + )) +#+end_src #+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods (add-to-list 'gnus-secondary-select-methods '(nngnorb "Gnorb server")) #+end_src -- cgit v1.2.3 From 00f5d351509e13e2bd190a9b5250514523672f26 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:55:05 +0200 Subject: Delight gnus-topic mode --- gnus.org | 1 + 1 file changed, 1 insertion(+) diff --git a/gnus.org b/gnus.org index d5556d9..4f5a600 100644 --- a/gnus.org +++ b/gnus.org @@ -378,6 +378,7 @@ Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][em Disable indenting a topic. I always do it by accident. #+begin_src emacs-lisp (use-package gnus-topic + :delight :config (defun fpi/gnus-topic-toggle-topic () "Toggle display of the topic." -- cgit v1.2.3 From bcfafcfd59a5f88116d4f1cd47839d1698cc5e3c Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:49:27 +0200 Subject: Exclude ATTACH from tag inheritance --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index d2492e2..519cf20 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3901,6 +3901,10 @@ content syncing upon commit. :custom (org-attach-git-annex-cutoff 0)) #+end_src +Also exclude =ATTACH= from the inherited tags +#+begin_src emacs-lisp :tangle no :noweb-ref org-custom-no-inheritance-tags +"ATTACH" +#+end_src *** Org-Capture #+BEGIN_SRC emacs-lisp (use-package org-capture -- cgit v1.2.3 From 5fb3e577358ad0be302e1d0fc8dba515d2204692 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:49:40 +0200 Subject: Don't refill text with eww Let prose-mode to the refilling instead --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 519cf20..1123872 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4916,7 +4916,7 @@ tools. (browse-url-browser-function 'eww-browse-url) (browse-url-generic-program "firefox") (shr-external-browser 'browse-url-generic) - (shr-width (current-fill-column)) + (shr-width 900) (shr-max-image-proportion 0.4) (shr-use-colors nil) (shr-use-fonts nil) ) -- cgit v1.2.3 From 0deffbcd9a115168e1d2f355ee54f69a349d427b Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:50:33 +0200 Subject: Smaller contact info in bbdb pop up --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 1123872..deef3bd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5087,6 +5087,7 @@ For now I use this bad code. (bbdb-mua-auto-update-init 'gnus 'message) (setq bbdb-mua-pop-up 'horiz) +(setq bbdb-pop-up-layout 'one-line) ;; size of the bbdb popup (setq bbdb-pop-up-window-size 0.15) (setq bbdb-mua-pop-up-window-size 0.15) -- cgit v1.2.3 From 8c8987aa86993c100b20414a46e3dfcf7dc57cd0 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:51:14 +0200 Subject: Add whole-line-or-region & redtick packages --- emacs-init.org | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index deef3bd..40bb8ff 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5342,6 +5342,20 @@ Saves to a temp file and puts the filename in the kill ring." (kill-new filename) (message filename))) #+end_src +*** Whole-line-or-region +#+begin_src emacs-lisp +(use-package whole-line-or-region + :straight t + :config + (whole-line-or-region-global-mode 1) + (delight 'whole-line-or-region-local-mode nil t)) +#+end_src +*** Pomodoro / Redtick +#+begin_src emacs-lisp +(use-package redtick + :straight t + :config (redtick-mode 1)) +#+end_src * Language settings End sentences with single spaces. #+begin_src emacs-lisp -- cgit v1.2.3 From 409e09d585c974038801b62f9c9909e109136810 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:51:30 +0200 Subject: Add a mode to toggle between space and tab indentation --- emacs-init.org | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 40bb8ff..1e337eb 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5416,8 +5416,33 @@ I do not really care about spaces versus tabs most of the time. I only want it to be consistent within a file. #+begin_src emacs-lisp (use-package emacs + :config + (define-minor-mode tab-mode + "Toggle tab and space based indentation." + :init-value nil + :lighter " »" + (if tab-mode + (progn + (setq indent-tabs-mode t) + (setq tab-width 4) + ) + (setq indent-tabs-mode nil) + (setq tab-width 8) + )) + (defun enable-tab-mode () + (tab-mode 1)) + (defun disable-tab-mode () + (tab-mode -1)) :custom - (indent-tabs-mode nil)) + (indent-tabs-mode nil) + ;; (tab-width 4) + ;; (tab-mode 1) + :hook + (prog-mode . enable-tab-mode) + (emacs-lisp-mode . disable-tab-mode) + (lisp-mode . disable-tab-mode) + (matlab-mode . enable-tab-mode) + ) #+end_src Instead of =$= use =⏎= to indicate newlines #+begin_src emacs-lisp -- cgit v1.2.3 From f860cc0d756a713e9371892bb51cf33a5c767692 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:52:20 +0200 Subject: Add functions to split window left and above --- emacs-init.org | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 1e337eb..6f6badd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2885,13 +2885,24 @@ 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 - :init - <> - :custom - (fit-window-to-buffer-horizontally t) - :bind (:map fpi-map ("s" . fit-window-to-buffer)) - ) +(use-package emacs % windows.el does not (provide 'windows) + :init + <> + :custom + (fit-window-to-buffer-horizontally t) + :config + (defun split-window-left (&optional size) + (interactive "P") + (split-window-right size) + (other-window 1)) + (defun split-window-above (&optional size) + (interactive "P") + (split-window-below size) + (other-window 1)) + :bind + (:map global-map ("C-x C-3" . split-window-left)) + (:map global-map ("C-x C-2" . split-window-above)) + (:map fpi-map ("s" . fit-window-to-buffer))) #+end_src *** Window rules #+begin_src emacs-lisp :noweb-ref window -- cgit v1.2.3 From 4116684e3b3d900bfa77fef1f99d602fec088f04 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:53:29 +0200 Subject: Slim down time budgets as it was too slow --- emacs-init.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 6f6badd..9f7705b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3557,8 +3557,7 @@ Gives an overview of time spent on defined budgets this week. Great to track if (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) (:title "├Research" :match "+work+research" :budget "24:00" :blocks (nil week)) (:title "├Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week)) - (:title "├Reading" :match "+work+read" :budget "0" :blocks (day week)) - (:title "╰Shaved Yaks" :match "+work+nonprod" :budget "0" :blocks (day week)) + (:title "╰Reading" :match "+work+read" :budget "5:00" :blocks (workday week)) (:title "Personal" :match "+nowork-nonprod" :budget "5:00" :blocks (nil week))))) #+end_src **** Column view -- cgit v1.2.3 From 71b8eb226d6eea7226cfbb7ceb760f5a2ffc8e5a Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:49:14 +0200 Subject: Add org-protocol capture templates --- emacs-init.org | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 9f7705b..4b15bd1 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4016,7 +4016,7 @@ Instead of project related capture templates, I use the same template for all ta #+END_SRC ***** Plans & Ideas #+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates -("p" "Plans/Ideas" +("P" "Plans/Ideas" entry (file "~/sync/refile.org") "*** PLANNING %? @@ -4069,6 +4069,21 @@ Instead of project related capture templates, I use the same template for all ta :empty-lines 1 :immediate-finish t) #+END_SRC +***** org-protocol +#+begin_src emacs-lisp :tangle no :noweb-ref org-capture-templates + ("p" "Protocol" entry (file+olp+datetree ,org-journal-file) + "* %^{Title} +:PROPERTIES: +:SOURCE: %c +:CREATED: %U +:END: +#+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?") +("L" "Protocol Link" entry (file+olp+datetree ,org-journal-file) + "* %? [[%:link][%:description]] +:PROPERTIES: +:CREATED: %U +:END:") +#+end_src ***** Old templates Templates I no longer use, but may be interesting. #+BEGIN_SRC emacs-lisp :tangle no -- cgit v1.2.3 From d511e2d575505d8513ce70c646108a4616951fa0 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 21 Sep 2020 09:42:05 +0200 Subject: Add update target to combine pull and dev --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index db682d6..8f504ea 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ dst_readme := tangle.sh merge.sh pull.sh link.sh dots.sh -.PHONY: merge dev install link tangle fetch pull clean +.PHONY: merge update dev install link tangle fetch pull clean merge: tangle/merge.sh tangle/merge.sh +update: pull dev + dev: git fetch git rebase origin/dev+ dev+ -- cgit v1.2.3 From 6550179743ed2f8a9958ec731d63c7b74aa8bddd Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 1 Sep 2020 12:54:46 +0200 Subject: Delight whitespace-mode, which-key-mode --- emacs-init.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 4b15bd1..4237164 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -300,9 +300,10 @@ to get a list of available commands. =which-key= shows these in a small popup, which I think is more handy. #+begin_src emacs-lisp (use-package which-key - :delight :straight t - :custom (which-key-idle-delay 0.4) + :custom + (which-key-idle-delay 0.4) + (which-key-lighter "") :config (which-key-mode 1)) #+end_src *** Try @@ -5472,6 +5473,7 @@ want it to be consistent within a file. Instead of =$= use =⏎= to indicate newlines #+begin_src emacs-lisp (use-package whitespace + :delight :custom (whitespace-display-mappings '((space-mark 32 [183] [46]) -- cgit v1.2.3 From 569d7a8415f8a593b98818d095e18c0d2c4ab67d Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:34:18 +0200 Subject: Add header-info package --- emacs-init.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4237164..6883fa3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -339,7 +339,15 @@ leaves a gap at the bottom. This removes it. #+BEGIN_SRC emacs-lisp (setq frame-resize-pixelwise t) #+END_SRC -*** Remove mode line clutter +*** Mode Line & Header Line +=header-info= is an easy way to move part of the mode line information to the header line instead. + +#+begin_src emacs-lisp +(use-package header-info + :straight (:host github :repo "fpiper/header-info" + :branch "master")) +#+end_src +**** Remove mode line clutter #+begin_src emacs-lisp (use-package delight :straight t -- cgit v1.2.3 From 7132df64865d81a89472f1c1dae19e6b0ce35dbc Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:34:41 +0200 Subject: Try setting projectile cache & disable it for now projectile causes lag on remote files due to repeatedly calling `file-remote-p` --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 6883fa3..e07a8ab 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2825,8 +2825,9 @@ some safe local variable values. (setq projectile-indexing-method 'alien) (setq projectile-enable-caching t) (setq projectile-completion-system 'ido) + (setq projectile-file-exists-local-cache-expire (* 5 60)) :config - (projectile-mode 1) + ;; (projectile-mode 1) :bind (("C-c p" . projectile-command-map))) #+END_SRC ** Working with buffers -- cgit v1.2.3 From 37d825800e780a241a5fbd8c4e8d66e960a20cb1 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 16:23:08 +0200 Subject: Fix comment syntax --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index e07a8ab..89201f9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2895,7 +2895,7 @@ better performance. =fit-window-to-buffer= automatically shrinks the current buffer based on the amount of displayed text. #+begin_src emacs-lisp -(use-package emacs % windows.el does not (provide 'windows) +(use-package emacs ;; windows.el does not (provide 'windows) :init <> :custom -- cgit v1.2.3 From 96d05ed465c3d3ec2ca6a86e0f62f348f86af452 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:07:43 +0200 Subject: Enable use of hi-lock map in matlab-mode --- emacs-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 89201f9..e256e1d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3103,7 +3103,9 @@ area. *** Matlab #+begin_src emacs-lisp (use-package matlab - :straight matlab-mode) + :straight matlab-mode + :config + (unbind-key "M-s" matlab-mode-map)) #+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org -- cgit v1.2.3 From 6449e821e8c7bceedb221d36765a9c51659ea515 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:09:34 +0200 Subject: Make fit-window-to-buffer consider olivetti mode --- emacs-init.org | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index e256e1d..36afbf4 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2892,6 +2892,9 @@ better performance. (ibuffer-do-sort-by-alphabetic))))) #+end_src ** Window configuration +:PROPERTIES: +:ID: 99f1af26-1383-43c1-8408-9a13c495925e +:END: =fit-window-to-buffer= automatically shrinks the current buffer based on the amount of displayed text. #+begin_src emacs-lisp @@ -2912,7 +2915,8 @@ on the amount of displayed text. :bind (:map global-map ("C-x C-3" . split-window-left)) (:map global-map ("C-x C-2" . split-window-above)) - (:map fpi-map ("s" . fit-window-to-buffer))) + <> + ) #+end_src *** Window rules #+begin_src emacs-lisp :noweb-ref window @@ -5586,6 +5590,24 @@ These settings are also from the above blog post, but mainly manually set what = (org-hide-emphasis-markers t) (org-cycle-separator-lines 1) #+end_src + +While I generally use ~fit-window-to-buffer~ (bound to =C-z s=) to fit a buffer to its content width (see [[id:99f1af26-1383-43c1-8408-9a13c495925e][Window configuration]]), buffers in =prose-mode= can reduced to ~olivetti-body-width~ if it is an integer. +#+begin_src emacs-lisp +(defun fpi/fit-window-to-buffer (&optional WINDOW MAX-HEIGHT MIN-HEIGHT MAX-WIDTH MIN-WIDTH PRESERVE-SIZE) + "Wrapper around `fit-window-to-buffer' which considers `olivetti-mode'. + +If `olivetti-body-width' is a number fit the window width to it instead of the actual line width." + (interactive) + (let ((max-width (when (and olivetti-mode (numberp olivetti-body-width)) + (round (* 1.03 olivetti-body-width))))) + (fit-window-to-buffer (selected-window) nil nil max-width nil) + )) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings +(define-key 'fpi-map (kbd "s") 'fpi/fit-window-to-buffer) +#+end_src + * Wrapping up Some stuff that is run after everything else. -- cgit v1.2.3 From 6c2f7b38c00515575617a639177d8b1a9a0f6ae3 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 21 Sep 2020 10:25:48 +0200 Subject: Forward messages as mime type --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index 36afbf4..49605d5 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4994,6 +4994,7 @@ I use =msmtp= to send mail. (message-sendmail-envelope-from 'header) (message-sendmail-f-is-evil nil) (message-kill-buffer-on-exit t) + (message-forward-as-mime t) :hook (message-mode . footnote-mode)) (use-package sendmail :custom -- cgit v1.2.3 From 56a173029321ad033c2326c3d3dddd3022dc95cb Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:13:50 +0200 Subject: Add general org-protocol setup --- emacs-init.org | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 49605d5..de60cf7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4086,6 +4086,41 @@ Instead of project related capture templates, I use the same template for all ta :immediate-finish t) #+END_SRC ***** org-protocol +:PROPERTIES: +:ID: 28704dfb-7647-43ac-b96f-5967383d1188 +:END: +Org-protocol is an easy way to capture stuff from outside emacs. +#+begin_src emacs-lisp +(use-package org-protocol) +#+end_src +To install the handler for =org-protocol://= URIs under linux you probably need a =.desktop= file similar to the one below. Place it under =~/.local/share/applications= and run src_shell{update-desktop-database}. +# #+HEADER: :tangle ~/.local/share/applications/org-protocol.desktop +#+begin_src conf +[Desktop Entry] +Version=1.0 +Encoding=UTF-8 +Name=Org Protocol +Comment=OrgProtocol URI handler +Exec=/home/fpi/.local/bin/emacsclient %u +Type=Application +Terminal=false +MimeType=x-scheme-handler/org-protocol;⏎ +#+end_src +Under Windows install a registry key. The example below works for Emacs running under WSL. Place it in a =.reg= file and open it with the registry editor to install. +# #+HEADER: :tangle ~/win/tmp/org-protocol.reg +#+begin_src conf +REGEDIT4 + +[HKEY_CLASSES_ROOT\org-protocol] +@="URL:Org Protocol" +"URL Protocol"="" +[HKEY_CLASSES_ROOT\org-protocol\shell] +[HKEY_CLASSES_ROOT\org-protocol\shell\open] +[HKEY_CLASSES_ROOT\org-protocol\shell\open\command] +@="\"C:\\Windows\\System32\\wsl.exe\" emacsclient \"%1\"" +#+end_src + +To be compatible with [[https://github.com/sprig/org-capture-extension][this chromium/firefox extension]] I use these capture templates: #+begin_src emacs-lisp :tangle no :noweb-ref org-capture-templates ("p" "Protocol" entry (file+olp+datetree ,org-journal-file) "* %^{Title} -- cgit v1.2.3 From c359bbf6aedb1b8ba3a764889e3d8cfa18c13abe Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:15:44 +0200 Subject: Add Functions to create zettel from IEEE capture --- emacs-init.org | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index de60cf7..f5f0d20 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4292,10 +4292,14 @@ A small function to toggle the encryption state of the current entry. (entry (bibtex-parse-entry t)) (key (reftex-get-bib-field "=key=" entry)) (pdf (funcall org-ref-get-pdf-filename-function key))) + (message "%s" pdf) (if (file-exists-p pdf) (org-open-link-from-string (format "[[file:%s]]" pdf)) - (dired (file-name-directory pdf)) - (ding)))))) + ;; try to get pdf + (or (let ((doi-utils-open-pdf-after-download t)) + (doi-utils-get-bibtex-entry-pdf)) + (progn (dired (file-name-directory pdf)) + (ding)))))))) #+end_src ***** Capturing entries I store my bibtex references in an org file together with my notes. In @@ -4347,6 +4351,93 @@ Here's a function to easily copy a doi from the results of =crossref-lookup=. :bind (:map biblio-selection-mode-map ("d" . fpi/biblio-get-doi))) #+end_src +***** org-protocol conversion +Capturing new entries with org-protocol is convenient. To convert the result of [[id:28704dfb-7647-43ac-b96f-5967383d1188][my capture templates]] to a valid entry, we have to extract the doi. +#+begin_src emacs-lisp +(defun fpi/ieee-to-doi (url) + "Get doi from an ieeexplore.ieee.org page." + (let* ((meta (with-current-buffer (url-retrieve-synchronously url) + (goto-char 1) + (search-forward "global.document.metadata=") + (kill-sexp) + (pop kill-ring))) + (json (json-read-from-string meta))) + (alist-get 'doi json))) +#+end_src +Other keys which IEEE returns are: +#+begin_example +(mapcar (lambda (l) (car l)) json) +(userInfo authors isbn articleNumber dbTime metrics purchaseOptions getProgramTermsAccepted sections formulaStrippedArticleTitle allowComments pdfUrl keywords abstract pubLink doiLink rightsLink pdfPath startPage endPage publicationTitle displayPublicationTitle doi issueLink isGetArticle isGetAddressInfoCaptured isMarketingOptIn applyOUPFilter pubTopics publisher isOUP isFreeDocument isSAE isNow isCustomDenial conferenceDate isDynamicHtml isStandard displayDocTitle isNotDynamicOrStatic isPromo htmlAbstractLink xploreDocumentType chronOrPublicationDate isConference isOpenAccess persistentLink isEarlyAccess htmlLink publicationDate isJournal isBook isBookWithoutChapters isChapter isStaticHtml isMorganClaypool isProduct isEphemera accessionNumber dateOfInsertion isACM isSMPTE startPage openAccessFlag ephemeraFlag title confLoc accessionNumber html_flag ml_html_flag sourcePdf content_type mlTime chronDate xplore-pub-id pdfPath isNumber rightsLinkFlag dateOfInsertion contentType publicationDate publicationNumber citationCount xplore-issue articleId publicationTitle sections onlineDate conferenceDate publicationYear subType _value lastupdate mediaPath endPage displayPublicationTitle doi) +#+end_example +Combining this with other functions allows us to do the whole conversion. In the future the citation information can be directly from extracted from the retrieved webpage instead of over the doi. +#+begin_src emacs-lisp +(defun fpi/convert-capture-bib () + "Convert current org-protocol ieee capture to bib." + (interactive) + (let ((rep (fpi/get-capture-bib-replacement))) + (kill-region (point-min) (point-max)) + (insert rep) + )) +(defun fpi/get-capture-bib-replacement () + (save-excursion + (goto-char (point-min)) + (org-next-link) + (let* ((link (org-element-context)) + (url (concat (org-element-property :type link) + ":" + (org-element-property :path link)))) + (fpi/add-org-from-doi + (fpi/ieee-to-doi url))))) + +(defun fpi/format-org-roam-from-doi (&optional doi) + "Get bibtex entry from doi and format for org-roam. Also downloads the +pdf if available." + (let* ((doi (or doi (read-string "Enter doi: "))) + (content (replace-regexp-in-string "\n$" "" (doi-utils-doi-to-bibtex-string doi))) + (cleaned (with-temp-buffer + (insert content) + (org-ref-clean-bibtex-entry) + (org-bibtex-read) + (buffer-substring (point-min) (point-max)))) + (parsed (reftex-parse-bibtex-entry cleaned)) + (key (org-ref-reftex-get-bib-field "&key" parsed)) + (first (when (string-match "^\\(.*?\\)_" key) (match-string 1 key))) + (title (org-ref-reftex-get-bib-field "title" parsed))) + (setq fpi//capture-bibtex-key key) + (with-temp-buffer + (org-mode) + (insert (format "#+TITLE: %s: %s\n" first title)) + (insert (format "#+ROAM_KEY: cite:%s\n\n" key)) + ;; (org-bibtex-write) + (goto-char (point-max)) + (insert "#+BEGIN_SRC bibtex\n") + (insert cleaned) + (insert "\n#+END_SRC\n") + (list key + (buffer-substring (point-min) (point-max)))))) + +(defun fpi/create-org-roam-from-doi (&optional doi) + (interactive) + (let* ((resp (fpi/format-org-roam-from-doi doi)) + (key (car resp)) + (content (cadr resp))) + (find-file (expand-file-name (format "Lit/%s.org" key) org-roam-directory)) + (org-mode) + (insert content))) + +(defun fpi/create-org-roam-from-protocol-capture () + "Create a org-roam entry from an org-protocol capture buffer." + (interactive) + (save-excursion + (goto-char (point-min)) + (org-next-link) + (let* ((link (org-element-context)) + (url (concat (org-element-property :type link) + ":" + (org-element-property :path link)))) + (fpi/create-org-roam-from-doi + (fpi/ieee-to-doi url))))) +#+end_src *** Toggle drawer visibility #+begin_src emacs-lisp (setq fpi/org-meta-heading-info-store nil) -- cgit v1.2.3 From 5809819860236e5fa36cce5f20624668fd46f88d Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 30 Sep 2020 10:59:33 +0200 Subject: Disable auto-fill-mode in message-mode --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index f5f0d20..df2f765 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5121,6 +5121,7 @@ I use =msmtp= to send mail. (message-sendmail-f-is-evil nil) (message-kill-buffer-on-exit t) (message-forward-as-mime t) + (message-fill-column nil) ;; to disable auto-fill-mode :hook (message-mode . footnote-mode)) (use-package sendmail :custom -- cgit v1.2.3 From 6517bb2063a7a537588925f7d6fb8346fb73bc5a Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 30 Sep 2020 10:59:48 +0200 Subject: Add spice-mode to auto-mode-alist --- emacs-init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index df2f765..737c385 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5135,7 +5135,10 @@ I use =msmtp= to send mail. (use-package mm-decode :config (use-package spice-mode - :straight t) + :straight t + :config + (add-to-list 'auto-mode-alist '("\\.cir$" . spice-mode)) + (add-to-list 'auto-mode-alist '("\\.scs$" . spice-mode))) (defun mm-display-spice-inline (handle) "Show an spice mode text from HANDLE inline." (mm-display-inline-fontify handle 'spice-mode)) -- cgit v1.2.3 From bb2f692dade71a8edd806e6d04f00ccf5ffc8b4f Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 6 Oct 2020 11:34:54 +0200 Subject: Add nnrss to ignored gnus registry groups --- gnus.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnus.org b/gnus.org index 4f5a600..aebf113 100644 --- a/gnus.org +++ b/gnus.org @@ -237,7 +237,8 @@ Remove some groups from being saved to the registry #+begin_src emacs-lisp (setq gnus-registry-split-strategy 'majority) (setq gnus-registry-ignored-groups - '(("^nnreddit" t) + '(("^nnrss" t) + ("^nnreddit" t) ("^nntp" t) ("delayed$" t) ("drafts$" t) -- cgit v1.2.3 From 13017cef0b63e4669ff1d3a039fd3380c8e404aa Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 6 Oct 2020 11:31:34 +0200 Subject: Fix git-annex use-package call Apparently :bind is called before :config --- emacs-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 737c385..0b60ada 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2374,10 +2374,12 @@ There are some great ressources on [[https://git-annex.branchable.com/][git-anne :straight t :config <> + :after (dired)) +(use-package git-annex :bind (:map git-annex-dired-map <>) - :after (dired)) + ) #+end_src **** Actions to lock/unlock files #+begin_src emacs-lisp :tangle no :noweb-ref git-annex-dired-bindings -- cgit v1.2.3 From 74b3176c568479d630a2887c5c1a9d8c8200cbd5 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 6 Oct 2020 11:33:39 +0200 Subject: Match size of org inline images to olivetti width At least on my display resolution.. --- emacs-init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 0b60ada..546bb5f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3732,7 +3732,7 @@ Make gnorb consider the same refile targets as org. Resize inline images to 400px but respect width specifications in attribute lines. #+begin_src emacs-lisp :noweb-ref org-custom :tangle no -(org-image-actual-width '(400)) +(org-image-actual-width '(600)) #+end_src Also display remote images by downloading them. #+begin_src emacs-lisp :noweb-ref org-custom :tangle no @@ -5675,6 +5675,9 @@ temporary buffer is created. (electric-quote-mode -1)) #+end_src ** Writing Setup +:PROPERTIES: +:ID: 9746c4dd-52d9-47fa-943b-7aa58601f22b +:END: I gather all settings related to writing in a minor mode. #+begin_src emacs-lisp (define-minor-mode prose-mode -- cgit v1.2.3 From 34f73c6877c195b5b0dedfa44d77e473a503147e Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 9 Oct 2020 12:30:45 +0200 Subject: Add ob-spice and ob-spectre packages --- emacs-init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 546bb5f..782542f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3225,6 +3225,16 @@ Switch projects and subprojects from NEXT back to TODO" ) #+end_src #+begin_src emacs-lisp +(use-package ob-spice + :straight (:host github :repo "fpiper/ob-spice" + :branch "master")) +#+end_src + +#+begin_src emacs-lisp +(use-package ob-spectre + :load-path "~/git/projects/ob-spectre") +#+end_src +#+begin_src emacs-lisp (use-package ob :config (org-babel-do-load-languages 'org-babel-load-languages @@ -3236,6 +3246,7 @@ Switch projects and subprojects from NEXT back to TODO" (gnuplot . t) (dot . t) (spice . t) + (spectre . t) (C . t) (calc . t) (latex . t) -- cgit v1.2.3 From 35f5af8a2d271c4993b269a9e8b69653106673a8 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 9 Oct 2020 12:33:23 +0200 Subject: Extend org-roam config --- emacs-init.org | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 6 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 782542f..be80a69 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3821,6 +3821,7 @@ Set some prettify symbols for org mode. (add-hook 'org-mode-hook 'fpi/add-org-prettify-symbols) #+end_src *** org-roam +Org-roam mainly provides a display of backlinks to the current file. This allows the creation of a one-subject-per-file Zettelkasten. #+begin_src emacs-lisp (use-package org-roam :straight t @@ -3829,18 +3830,56 @@ Set some prettify symbols for org mode. (after-init . org-roam-mode) :custom (org-roam-directory "~/git/projects/zettel/") + (org-roam-tag-sources '(prop last-directory)) + (org-roam-buffer-width 0.2) + (org-roam-graph-exclude-matcher "index.org") + (org-roam-graph-viewer + (lambda (file) + (let ((org-roam-graph-viewer "/mnt/c/Program Files/Mozilla Firefox/firefox.exe")) + (org-roam-graph--open (concat "file://///wsl$/Debian" file))))) + (org-roam-capture-templates + '(("d" "default" plain #'org-roam-capture--get-point "%?" :file-name "%<%Y%m%d%H%M%S>-${slug}" :head "#+title: ${title} +" :unnarrowed t) + ("b" "bib" plain #'org-roam-capture--get-point + "%(fpi/org-roam-get-last-content)" + :file-name "Lit/%(fpi/org-roam-get-key \"${title}\")" + :head "" + :unnarowed t))) + (org-roam-capture-ref-templates + '(("r" "ref" plain #'org-roam-capture--get-point "%?" :file-name "Ref/${slug}" :head "#+title: ${title}\n#+ROAM_KEY: ${ref}\n " :unnarrowed t))) :bind (:map org-roam-mode-map (("C-c n l" . org-roam) + ("C-c n u" . org-roam-unlinked-references) ("C-c n f" . org-roam-find-file) - ("C-c n g" . org-roam-show-graph)) + ("C-c n g" . org-roam-graph) + ("C-c n d" . org-roam-doctor) + ("C-c n G" . fpi/org-roam-graph-with-exclude) + ("C-c n t g" . fpi/org-roam-toggle-graph-executable) + ("C-c n x" . org-roam-jump-to-index) + ) :map org-mode-map (("C-c n i" . org-roam-insert))) - :config (defun org-roam--roam-file-link-face (path) - "Return `org-link'" - 'org-link) - ) + :config + (defun org-roam--file-link-face (path) + "Return `org-link'" + 'org-link) + (defun fpi/org-roam-toggle-graph-executable () + (interactive) + (setq org-roam-graph-executable (if (equal org-roam-graph-executable "dot") + "neato" + "dot")) + (message "Set org-roam graphing tool to %s" org-roam-graph-executable)) + (defun fpi/org-roam-graph-with-exclude (&optional arg file node-query) + (interactive "P") + (let ((org-roam-graph-exclude-matcher (completing-read "Exclude matcher to use: " nil))) + (org-roam-graph arg file node-query))) +) +#+end_src +Overwriting ~org-roam--file-link-face~ is a crude fix for hanging emacs. The original function calls file-exist-p which opens a slow tramp connection. +**** org-roam-protocol +#+begin_src emacs-lisp +(use-package org-roam-protocol) #+end_src -Fix for hanging emacs. The original function calls file-exist-p which opens a slow tramp connection. **** org-roam-bibtex #+begin_src emacs-lisp :tangle no (use-package org-roam-bibtex @@ -4429,6 +4468,31 @@ pdf if available." (list key (buffer-substring (point-min) (point-max)))))) +(defun fpi/org-roam-format-from-doi (&optional doi) + (let* ((doi (or doi (read-string "Enter doi: ")))) + (setq fpi/org-roam-last-captured-doi doi) + (fpi/format-org-roam-from-doi doi))) + +(defvar fpi/org-roam-last-content nil) +(defvar fpi/org-roam-last-key nil) +(defun fpi/org-roam-get-key (doi) + (let* ((resp (fpi/format-org-roam-from-doi doi)) + (key (car resp)) + (content (cadr resp))) + (setq fpi/org-roam-last-content content) + key)) +(defun fpi/org-roam-get-last-content () + fpi/org-roam-last-content) +(defun fpi/org-roam-get-last-key () + fpi/org-roam-last-key) +(defun fpi/org-roam-get-content (doi) + (let* ((resp (fpi/format-org-roam-from-doi doi)) + (key (car resp)) + (content (cadr resp))) + (setq fpi/org-roam-last-content content) + (setq fpi/org-roam-last-key key) + content)) + (defun fpi/create-org-roam-from-doi (&optional doi) (interactive) (let* ((resp (fpi/format-org-roam-from-doi doi)) -- cgit v1.2.3 From 378a1aece7e821f5b397201b38dada6aec2ce047 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 9 Oct 2020 12:33:57 +0200 Subject: Reenable org-roam-bibex & fix bibtex paths --- emacs-init.org | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index be80a69..e55cf9a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3881,13 +3881,24 @@ Overwriting ~org-roam--file-link-face~ is a crude fix for hanging emacs. The ori (use-package org-roam-protocol) #+end_src **** org-roam-bibtex -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp (use-package org-roam-bibtex :straight t + :delight :hook (org-roam-mode . org-roam-bibtex-mode) :bind (:map org-mode-map - (("C-c n a" . orb-note-actions)))) -#+end_src + (("C-c n a" . orb-note-actions))) + :after bibtex + :config + (defun bibtex-autokey-get-year () + "Return year field contents as a string obeying `bibtex-autokey-year-length'." + (let* ((yearfield (bibtex-autokey-get-field "year")) + (yearfield (when (equal yearfield "") + (substring (bibtex-autokey-get-field "date") 0 4)))) + (substring yearfield (max 0 (- (length yearfield) + bibtex-autokey-year-length)))))) +#+end_src +Rewrite of ~bibtex-autokey-get-year~ is a crude way to get bibtex to recognize =date= fields as year. *** Org-edna :PROPERTIES: :ID: fd3936c7-9fc5-42d0-990d-32024e23b22f @@ -4316,10 +4327,11 @@ A small function to toggle the encryption state of the current entry. (bibtex-autokey-titlewords 3) (bibtex-autokey-titlewords-stretch 1) (bibtex-autokey-titleword-length 5) + (bibtex-completion-library-path "~/git/projects/personal/Lit") :config (bibtex-set-dialect 'BibTeX)) -(setq bibtex-completion-bibliography "~/git/projects/zettel/Lit/bib.bib") +(setq bibtex-completion-bibliography "~/git/projects/personal/bib.bib") (setq bibtex-completion-notes-path "~/git/projects/zettel/Lit") (setq bibtex-completion-notes-extension ".org") -- cgit v1.2.3 From 02a6837efe67fac64d0e93a294e1ba86bb59e297 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 13 Oct 2020 14:53:57 +0200 Subject: Add magit to project.el prompt --- emacs-init.org | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index e55cf9a..46372d3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -23,7 +23,7 @@ - [[#dired][Dired]] - [[#tramp][Tramp]] - [[#git][Git]] - - [[#projectile][Projectile]] + - [[#projects][Projects]] - [[#working-with-buffers][Working with buffers]] - [[#window-configuration][Window configuration]] - [[#file-encryption][File encryption]] @@ -2816,9 +2816,26 @@ some safe local variable values. (git-auto-commit-mode . t) (gac-debounce-interval . 600) #+end_src -** Projectile - -#+BEGIN_SRC emacs-lisp +** Projects +*** project.el +#+begin_src emacs-lisp +(use-package project + :init + (defun fpi/project-magit () + (interactive) + (magit-status (project-root (project-current t)))) + :custom + (project-switch-commands + '((?f "Find file" project-find-file) + (?g "Find regexp" project-find-regexp) + (?d "Dired" project-dired) + (?m "Magit" fpi/project-magit) + (?v "VC-Dir" project-vc-dir) + (?e "Eshell" project-eshell)))) +#+end_src +*** Projectile +Projectile should be fully replaceable with =project.el=. Though some packages may still use projectile as dependency.. +#+BEGIN_SRC emacs-lisp :tangle no (use-package projectile :straight t :delight '(:eval (concat " " (projectile-project-name))) -- cgit v1.2.3 From b4cb3a93487181152160ba13b50ee12e353e2e43 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 14 Oct 2020 10:27:02 +0200 Subject: Expand update target to also merge and rebase --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8f504ea..7578e04 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ dst_readme := tangle.sh merge.sh pull.sh link.sh dots.sh -.PHONY: merge update dev install link tangle fetch pull clean +.PHONY: update merge dev install link tangle fetch pull clean + +update: pull merge dev + git rebase dev+ work+ merge: tangle/merge.sh tangle/merge.sh -update: pull dev - dev: git fetch git rebase origin/dev+ dev+ -- cgit v1.2.3 From 9f041083becdcb6d9225054e2185fd43a3f551b0 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 30 Oct 2020 19:33:54 +0100 Subject: Add link as ROAM_KEY for roam-protocol ref captures --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 46372d3..3d6e4ed 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4213,7 +4213,8 @@ To be compatible with [[https://github.com/sprig/org-capture-extension][this chr "* %? [[%:link][%:description]] :PROPERTIES: :CREATED: %U -:END:") +:END: +#+ROAM_KEY: %:link") #+end_src ***** Old templates Templates I no longer use, but may be interesting. -- cgit v1.2.3 From 18d64469d5f0be8f049be0131e07fb2a86c68fca Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 6 Nov 2020 16:56:17 +0100 Subject: Add function to toggle org time budgets --- emacs-init.org | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 3d6e4ed..b0cb36f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3599,12 +3599,26 @@ Gives an overview of time spent on defined budgets this week. Great to track if :straight (:host github :repo "fpiper/org-time-budgets" :branch "develop" :no-byte-compile t) - :custom - (org-time-budgets '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) + :config + (setq fpi/dense-time-budgets + '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) + (:title "Personal" :match "+nowork-nonprod" :budget "5:00" :blocks (nil week)))) + (setq fpi/wide-time-budgets + '((:title "Work" :match "+work-nowork" :budget "40:00" :blocks (workday week)) (:title "├Research" :match "+work+research" :budget "24:00" :blocks (nil week)) (:title "├Teaching" :match "+work+teaching" :budget "8:00" :blocks (nil week)) (:title "╰Reading" :match "+work+read" :budget "5:00" :blocks (workday week)) - (:title "Personal" :match "+nowork-nonprod" :budget "5:00" :blocks (nil week))))) + (:title "Personal" :match "+nowork-nonprod" :budget "5:00" :blocks (nil week)))) + (setq org-time-budgets fpi/wide-time-budgets) + (defun fpi/toggle-time-budgets () + "Toggle between dense and wide time budgets." + (interactive) + (if (eq org-time-budgets fpi/wide-time-budgets) + (progn + (setq org-time-budgets fpi/dense-time-budgets) + (message "Set dense time budgets")) + (setq org-time-budgets fpi/wide-time-budgets) + (message "Set wide time budgets")))) #+end_src **** Column view #+begin_src emacs-lisp -- cgit v1.2.3 From bf7d0a09d6e0eaac029b43d976126164e786910b Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 19 Dec 2020 18:32:54 +0100 Subject: Add mkdir before tangling --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7578e04..51c279a 100644 --- a/Makefile +++ b/Makefile @@ -33,4 +33,5 @@ pull: tangle/pull.sh .SILENT: $(addprefix tangle/,$(dst_readme)) $(addprefix tangle/,$(dst_readme)) &: README.org + mkdir tangle emacs --batch --eval "(and (require 'org) (org-babel-tangle-file \"README.org\"))" &> /dev/null -- cgit v1.2.3 From e814dad98db5611ce055339499f2578f2c380c71 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 27 Nov 2020 10:58:55 +0100 Subject: Add rgb function --- gnuplot.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnuplot.org b/gnuplot.org index 04973f5..0146e61 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -26,6 +26,11 @@ set style data lp set macros #+end_src + +Here is a handy function to define colors with individual rgb integers instead of the hex notation. Example usage: ~plot x w l lc rgb rgb(255,80,0)~. Alternatively gnuplot also supports hsv colors with ~hsv2rgb(h,s,v)~. +#+begin_src gnuplot +rgb(r,g,b) = 65536 * int(r) + 256 * int(g) + int(b) +#+end_src * Interactive Label Placement [[http://www.gnuplotting.org/interactive-label-placing/][Source]]. I adapted the =label_loop= function to newer gnuplot syntax & added functionality for multiple arguments. The function call to -- cgit v1.2.3 From f0bfa75c969fbb09fd000932ea1b10b2d7ba724a Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:35:24 +0100 Subject: Make gnus articles use prose-mode --- gnus.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.org b/gnus.org index aebf113..996a1c0 100644 --- a/gnus.org +++ b/gnus.org @@ -411,6 +411,11 @@ See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp (setq gnus-use-full-window nil) #+end_src +**** Article Display +#+begin_src emacs-lisp +(use-package gnus-art + :hook (gnus-article-mode . prose-mode)) +#+end_src **** Modeline indicator From the [[https://www.emacswiki.org/emacs/GnusNotify][emacswiki Gnus Notify]]. #+begin_quote -- cgit v1.2.3 From 84b92d9a7b3638f9afa6db822c18b350c26126b4 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 19 Dec 2020 18:36:30 +0100 Subject: Add symlinks for gnus state files --- gnus.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnus.org b/gnus.org index 996a1c0..d3dc7c3 100644 --- a/gnus.org +++ b/gnus.org @@ -4,7 +4,14 @@ ln -siv $(pwd)/tangle/gnus.el ~/.gnus.el #+end_src -Load private settings +I use =nextcloud= to synchronize gnus state files across devices. Alternatively one may use [[info:gnus#The Gnus Cloud][info:gnus#Gnus Cloud]]. Here i symlink the relevant files/directories to my synchronization directory. +#+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv ~/sync/gnus/News ~/News +ln -siv ~/sync/gnus/.newsrc.eld ~/.newsrc.eld +ln -siv ~/sync/gnus/.gnus.registry.eieio ~/.gnus.registry.eieio +#+end_src + +Load private settings. #+begin_src emacs-lisp (setq secret-file (expand-file-name "emacs-private.el.gpg" user-emacs-directory)) -- cgit v1.2.3 From a8072e98168d365de32753ab6388b2b6a8a0ec08 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:51:16 +0100 Subject: Only create tangle directory if it does not exist --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 51c279a..0eb9bc8 100644 --- a/Makefile +++ b/Makefile @@ -33,5 +33,5 @@ pull: tangle/pull.sh .SILENT: $(addprefix tangle/,$(dst_readme)) $(addprefix tangle/,$(dst_readme)) &: README.org - mkdir tangle + mkdir -p tangle emacs --batch --eval "(and (require 'org) (org-babel-tangle-file \"README.org\"))" &> /dev/null -- cgit v1.2.3 From ee59296fb919806374eb9d1a3eba2d2d895bfc73 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:50:51 +0100 Subject: [WIP] Add local maildir --- gnus.org | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/gnus.org b/gnus.org index d3dc7c3..6f069f8 100644 --- a/gnus.org +++ b/gnus.org @@ -55,19 +55,36 @@ Noweb the primary server settings together. )) #+end_src -Setup a secondary imap server and a local nntp server I use to fetch -RSS/Atom Feeds asynchronously. +To avoid confusion I enable namespaces for imap groups. +#+begin_src emacs-lisp +(setq nnimap-use-namespaces t) +#+end_src +*** Secondary servers #+begin_src emacs-lisp +<> +#+end_src +**** Personal mailbox +#+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods (add-to-list 'gnus-secondary-select-methods `(nnimap ,@private/personal-imap-info (nnimap-stream ssl) (nnir-search-engine imap) (nnimap-inbox "INBOX"))) +#+end_src +**** RSS/Atom over nntp +Setup a secondary imap server and a local nntp server I use to fetch +RSS/Atom Feeds asynchronously. +#+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods (add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) -<> #+end_src -#+begin_src emacs-lisp -(setq nnimap-use-namespaces t) +**** Harddrive Maildir +This is still WIP, because the =nnmaildir= backend sucks. +#+begin_src emacs-lisp :tangle no +(add-to-list 'gnus-secondary-select-methods + '(nnmaildir "Local Maildir" + (directory "~/.nnmaildir") + (gnus-search-engine gnus-search-notmuch + (config-file "~/.notmuch-config")))) #+end_src ** Options *** General -- cgit v1.2.3 From ab11f2adb7b37d1ac35a1d567f802fa21279df66 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 21 Jan 2021 16:31:17 +0100 Subject: Rename gnus group buffer --- emacs-init.org | 7 +++++++ gnus.org | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 77a5662..d90f994 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4253,6 +4253,13 @@ For now I use this bad code. (goto-char (point-max)) (or (bolp) (newline))))) #+END_SRC +*** Gnus +The customization for gnus is located in [[file:gnus.org][gnus.org]] and loaded from there upon startup. + +I change the group buffer to something more memorable. This needs to be set before gnus is started and therefore only setting it in gnus.org is not sufficient. +#+begin_src emacs-lisp +(setq gnus-group-buffer "*Gnus*") +#+end_src ** Footnote Mode #+begin_src emacs-lisp (use-package footnote diff --git a/gnus.org b/gnus.org index 6f069f8..c2a47c3 100644 --- a/gnus.org +++ b/gnus.org @@ -370,6 +370,10 @@ Unicode reply symbol #+begin_src emacs-lisp (setq gnus-summary-to-prefix "→ ") #+end_src +Rename the group buffer to something more memorable. This is not intended to be customized. So some bugs may occur. So far it only seems important to set it before starting gnus the first time. So e.g. set it in your main emacs =init.el=. +#+begin_src emacs-lisp +(setq gnus-group-buffer "*Gnus*") +#+end_src **** On threads Gather loose threads, whose parent is currently not displayed, under a dummy article. I find the default ~'adopt~ to be too confusing. -- cgit v1.2.3 From 11a6cee033925a42ac7a574224b7aa8341cd7cb4 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 14 Jan 2021 15:01:42 +0100 Subject: Add more ssh hosts --- ssh_config.org.gpg | Bin 998 -> 1000 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index 5761bec..ef3dcf0 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From 02c605d87e2b97955c2e8b3fe737f8615cfb4b83 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 27 Jan 2021 11:00:07 +0100 Subject: Make scoring section more generic --- gnus.org | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gnus.org b/gnus.org index c2a47c3..1a7f454 100644 --- a/gnus.org +++ b/gnus.org @@ -171,8 +171,20 @@ Background fetching for gnus. See the manual and [[https://www.emacswiki.org/ema (gnus-demon-add-handler 'gnus-demon-scan-news-4 130 1) (gnus-demon-add-handler 'gnus-demon-scan-news-5 140 1) #+end_src -**** Adaptive scoring -See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. +**** Scoring +To define different scoring files for different groups I set [[info:gnus#Home Score File][home score files]] based on the group name. +#+begin_src emacs-lisp +(setq gnus-home-score-file + '(("^nnimap" "nnimap.SCORE") ;; w/ author scoring + ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring + ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring + )) +(setq gnus-home-adapt-file + '(("^nnimap" "nnimap.ADAPT") + ("gmane" "nntp_gmane.ADAPT") + ("^nntp\\+localhost" "nntp_global.ADAPT"))) +#+end_src +For information about adaptive scoring see [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. ***** Score File Setup #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) @@ -190,19 +202,7 @@ See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https: ) ;; (setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) #+end_src -****** Using different (adaptive) scoring files for different groups -To define different adaptive scoring files for different groups I set [[info:gnus#Home Score File][home score files]] based on the group name. -#+begin_src emacs-lisp -(setq gnus-home-score-file - '(("^nnimap" "nnimap.SCORE") ;; w/ author scoring - ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring - ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring - )) -(setq gnus-home-adapt-file - '(("^nnimap" "nnimap.ADAPT") - ("gmane" "nntp_gmane.ADAPT") - ("^nntp\\+localhost" "nntp_global.ADAPT"))) -#+end_src +****** Scoring rules Scoring based on the =from= header does not make sense for rss feeds with only one author or newsgroups with unset author. These files therefore contain my default adaptive scoring rules with or without =from= scoring. #+NAME: gnus-adaptive-scoring-w-from #+begin_src emacs-lisp :tangle no :eval never @@ -245,7 +245,7 @@ Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= s gnus-score-decay-constant 1 gnus-score-decay-scale 0.01) #+end_src -****** Ignored Words +***** Ignored Words Do not score on some common german words. I extracted these from my score file after a few weeks of using scoring. #+begin_src emacs-lisp (setq gnus-ignored-adaptive-words -- cgit v1.2.3 From 053a3445ffbf21fab758bf44cc568db52d174d4d Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 31 Jan 2021 15:09:56 +0100 Subject: Keep temporary score rules for longer --- gnus.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.org b/gnus.org index 1a7f454..d0bc434 100644 --- a/gnus.org +++ b/gnus.org @@ -185,6 +185,11 @@ To define different scoring files for different groups I set [[info:gnus#Home Sc ("^nntp\\+localhost" "nntp_global.ADAPT"))) #+end_src For information about adaptive scoring see [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. + +Temporary scores by default expire after 7 days. I want a slightly longer threshold. +#+begin_src emacs-lisp +(setq gnus-score-expiry-days 14) +#+end_src ***** Score File Setup #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) -- cgit v1.2.3 From e57df7a5e6950f00a4f3581bc914705d2132d499 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 31 Jan 2021 15:09:32 +0100 Subject: Add pam-gnupg to unlock gpg/ssh keys after login --- gpg-agent.org | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/gpg-agent.org b/gpg-agent.org index 75493fa..51f6cec 100644 --- a/gpg-agent.org +++ b/gpg-agent.org @@ -3,6 +3,7 @@ #+BEGIN_SRC sh :tangle tangle/symlink.sh :results silent :shebang "#!/bin/bash" ln -siv $(pwd)/tangle/gpg-agent.conf ~/.gnupg/gpg-agent.conf ln -siv $(pwd)/tangle/sshcontrol ~/.gnupg/sshcontrol +ln -siv $(pwd)/tangle/pam-gnupg ~/.config/pam-gnupg #+END_SRC @@ -25,6 +26,26 @@ allow-loopback-pinentry enable-ssh-support #+end_src -#+begin_src conf :tangle tangle/sshcontrol +#+begin_src conf :tangle tangle/sshcontrol :comments no +4AFDEF6B35160F892F61666CE891B2456D755807 +#+end_src +* Unlocking upon login + +[[https://github.com/cruegge/pam-gnupg][pam-gnupg]] is an alternative to =gnome-keyring= to unlock gpg keys upon login. This only works when user and gpg key share the same passphrase. + +Start it by adding this to the relevant login pam files (in =/etc/pam.d=). +#+begin_src conf :tangle no +auth optional pam_gnupg.so store-only +session optional pam_gnupg.so +#+end_src +Allow preset passphrases for =pam-gnupg=. +#+begin_src conf +allow-preset-passphrase +#+end_src + + +The =pam-gnupg= config file only contains a list of keygrips of keys you want to unlock upon login. It works for both gpg and ssh keys. +#+begin_src conf :tangle tangle/pam-gnupg :comments no +DE37E13DE16DB3219D74410F4C20021624CC19E3 4AFDEF6B35160F892F61666CE891B2456D755807 #+end_src -- cgit v1.2.3 From f6c84e8b7f077879b050fb96afa635985efe3316 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 6 May 2021 11:29:20 +0200 Subject: Update gnuplot configuration (new colors, …) - New colors based on the podo colorblind friendly colorsequence - Running average functions - Standard Grid, Border, Tics settings - More macros for init, … --- gnuplot.org | 86 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/gnuplot.org b/gnuplot.org index 0146e61..b1d7e42 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -5,37 +5,91 @@ First create a symlink to the desired config location. #+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" ln -siv $(pwd)/tangle/.gnuplot ~/ #+end_src -* Main configuration +* General Configuration +Start off by resetting most settings. #+begin_src gnuplot reset +#+end_src -set style line 1 lc rgb '#cb1a0e' pt 1 ps 1 lt 1 lw 2 # --- red -set style line 2 lc rgb '#5e9c36' pt 6 ps 1 lt 1 lw 2 # --- green -set style line 3 lc 3 pt 1 ps 1 lt 1 lw 2 # --- blue -set style line 4 lc 7 pt 6 ps 1 lt 1 lw 2 # --- black -set style line 5 lc 9 pt 1 ps 1 lt 1 lw 2 # --- grey -set style line 6 lc 4 pt 1 ps 1 lt 1 lw 2 # --- pink -set style line 11 lc rgb '#808080' lt 1 -set border 3 back ls 11 -set tics nomirror -set style line 12 lc rgb '#808080' lt 0 lw 1 -set grid back ls 12 - -set style increment user +Plot data using linepoints and make solid regions transparent. +#+begin_src gnuplot set style data lp +set style fill transparent solid 0.4 noborder +#+end_src +Enable macros and make gnuplot interpret =NaN= as missing data. +#+begin_src gnuplot set macros +set datafile missing NaN +#+end_src + +A macro to easily reset gnuplot and also reload my settings. +#+begin_src gnuplot +init="load '~/.gnuplot'" #+end_src Here is a handy function to define colors with individual rgb integers instead of the hex notation. Example usage: ~plot x w l lc rgb rgb(255,80,0)~. Alternatively gnuplot also supports hsv colors with ~hsv2rgb(h,s,v)~. #+begin_src gnuplot rgb(r,g,b) = 65536 * int(r) + 256 * int(g) + int(b) #+end_src + +When setting the column using a variable you can not use the shorthand syntax ~$2~. Instead setup a function so I only have to write ~c(i)~ instead of ~column(i)~. +#+begin_src gnuplot +c(a)=column(a) +#+end_src + +A collection of functions that can calculate a running average. +#+begin_src gnuplot +# running averages +samples(x,n) = $0>(n-1) ? n : ($0+1) +init(x)=(back1=back2=back3=back4=back5=back6=back7=back8=back9=back10=back11=back12=sum=0) +avg1(x)=(back1=x,back1) +avg2(x)=(back2=back1,(avg1(x)+back2)/samples($0,2)) +avg3(x)=(back3=back2,(samples($0,2)*avg2(x)+back3)/samples($0,3)) +avg4(x)=(back4=back3,(samples($0,3)*avg3(x)+back4)/samples($0,4)) +avg5(x)=(back5=back4,(samples($0,4)*avg4(x)+back5)/samples($0,5)) +avg6(x)=(back6=back5,(samples($0,5)*avg5(x)+back6)/samples($0,6)) +avg7(x)=(back7=back6,(samples($0,6)*avg6(x)+back7)/samples($0,7)) +avg8(x)=(back8=back7,(samples($0,7)*avg7(x)+back8)/samples($0,8)) +avg9(x)=(back9=back8,(samples($0,8)*avg8(x)+back9)/samples($0,9)) +avg10(x)=(back10=back9,(samples($0,9)*avg9(x)+back10)/samples($0,10)) +avg11(x)=(back11=back10,(samples($0,10)*avg10(x)+back11)/samples($0,11)) +avg12(x)=(back12=back11,(samples($0,11)*avg11(x)+back12)/samples($0,12)) +#+end_src +* Colors +=podo= is a good standard colorblind friendly colorsequence. +#+begin_src gnuplot +# use colorblind friendly colorsequence +set colorsequence podo +#+end_src + +I just reorder the =podo= colors, mainly to make black not the default color. +#+begin_src gnuplot +# use colorsequence podo but reorder some colors +set linetype 1 lc rgb "#0072b2" lw 2 pt 1 ps default +set linetype 2 lc rgb "#d55e00" lw 2 pt 2 ps default +set linetype 3 lc rgb "#009e73" lw 2 pt 3 ps default +set linetype 4 lc rgb "#cc79a7" lw 2 pt 4 ps default +set linetype 5 lc rgb "#56b4e9" lw 2 pt 5 ps default +set linetype 6 lc rgb "#e69f00" lw 2 pt 6 ps default +set linetype 7 lc rgb "#f0e442" lw 2 pt 7 ps default +set linetype 8 lc rgb "black" lw 2 pt 8 ps default +#+end_src +* Grid, Border, Tics +I store the default grid, border and tics settings in the =gbt= variable. So I can easily reset these with the macro call ~@gbt~. The =gbt(col)= function also allows setting grid and border to some other color, but needs to be called using eval, e.g. ~eval(gbt("black"))~. +#+begin_src gnuplot +# grid border tics settings +# call @gbt for defaults +# call eval(gbt("color")) to use color instead of default +gbt(col)=sprintf("set tics nomirror; set border 3 back lc '%s'; set grid back lw 1 lc '%s'",col,col) +gbt="set tics nomirror; set border 3 back lc 'gray50'; set grid back lw 1 lc 'gray50'" +@gbt +#+end_src * Interactive Label Placement [[http://www.gnuplotting.org/interactive-label-placing/][Source]]. I adapted the =label_loop= function to newer gnuplot syntax & added functionality for multiple arguments. The function call to -=label_loop= is stored inside a string and can then be executeds as a -macro like this: src_gnuplot{@iLabel "label1" "label2"}. +=label_loop= is stored inside a string and can then be executed as a +macro like this: ~@iLabel "label1" "label2"~ #+begin_src gnuplot iLabel = "call '~/git/projects/dotfiles/tangle/label_loop.gp " -- cgit v1.2.3 From 53ca8cf510a123ed8b3eef3bbe847f9f1b40793b Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 15 May 2021 14:46:57 +0200 Subject: Add ledger report script for plotting w/ gnuplot --- ledgerrc.org | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/ledgerrc.org b/ledgerrc.org index ec44d5e..34bedd6 100644 --- a/ledgerrc.org +++ b/ledgerrc.org @@ -1,8 +1,32 @@ #+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent #+begin_src conf ---file ~/.personal/f/ledger/main.ledger +--file ~/git/projects/ledger/main.ledger #+end_src -#+begin_src shell :tangle tangle/symlink.sh :shebang "#!/bin/bash" +#+begin_src shell :tangle tangle/symlink.sh :shebang "#!/bin/bash" :results silent ln -siv $(pwd)/tangle/.ledgerrc ~/ +ln -siv $(pwd)/tangle/report ~/.local/bin/ +#+end_src + +The =report= script can be used for simple plotting of ledger output using gnuplot. This is taken directly from the ledger git repo. +#+begin_src shell :tangle tangle/report :shebang "#!/usr/bin/env sh" +# This script facilities plotting of a ledger register report. If you +# use OS/X, and have AquaTerm installed, you will probably want to set +# LEDGER_TERM to "aqua". +# +# Examples of use: +# +# report -j -M reg food # plot monthly food costs +# report -J reg checking # plot checking account balance + +if [ -z "$LEDGER_TERM" ]; then + LEDGER_TERM="wxt persist" +fi + +(cat <(n-1) ? n : ($0+1) init(x)=(back1=back2=back3=back4=back5=back6=back7=back8=back9=back10=back11=back12=sum=0) +if(init(0)){} # what is the best way to run functions without showing output? avg1(x)=(back1=x,back1) avg2(x)=(back2=back1,(avg1(x)+back2)/samples($0,2)) avg3(x)=(back3=back2,(samples($0,2)*avg2(x)+back3)/samples($0,3)) -- cgit v1.2.3 From f9179aa6bd96155d101ad89977c2006a39bf508f Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:33:15 +0100 Subject: BCC self and use general search syntax Also remove fix for old gnus-cloud bug --- gnus.org | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gnus.org b/gnus.org index d0bc434..dae6d1a 100644 --- a/gnus.org +++ b/gnus.org @@ -94,6 +94,11 @@ Load only groups with level < 2 for faster startup. (setq gnus-activate-level 2) #+end_src **** Message related +Bcc self to archive sent messages & ensure proper sending +#+begin_src emacs-lisp +(setq message-default-mail-headers + (format "Bcc: %s\n" user-mail-address)) +#+end_src Sent mails are read. #+begin_src emacs-lisp (setq gnus-gcc-mark-as-read t) @@ -140,6 +145,11 @@ Setup for fancy mail splitting. Also see the parameters in ~gnus-select-method~. (setq nnmail-cache-accepted-message-ids t) (setq nnmail-message-id-cache-length 10000) #+end_src +**** Search +Use gnus search language. See [[info:gnus#Search Queries][gnus#Search Queries]] for info. +#+begin_src emacs-lisp +(setq gnus-search-use-parsed-queries t) +#+end_src **** Demon Background fetching for gnus. See the manual and [[https://www.emacswiki.org/emacs/GnusDemon][emacswiki]]. #+begin_src emacs-lisp @@ -616,10 +626,6 @@ contains new messages")) ;;; gnus-notify.el ends here #+end_src *** Misc -Workaround for bug with ~gnus-cloud-method~ and ~custom-variable-recalc-variable~ upon reloading the =spacemacs-*= theme. -#+begin_src emacs-lisp -(setq server "nnimap:imsmail") -#+end_src **** nnreddit #+begin_src emacs-lisp (use-package nnreddit -- cgit v1.2.3 From 8f8f115ad2b7bf024e670ec656e7f478839d2680 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:33:00 +0100 Subject: [WIP] Add basis of s/mime email encryption --- emacs-init.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index b0cb36f..9f82340 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5266,6 +5266,28 @@ I use =msmtp= to send mail. (add-to-list 'mm-inline-media-tests '("application/x-wine-extension-cir" mm-display-spice-inline identity)) (add-to-list 'mm-inlined-types "application/x-wine-extension-cir")) #+end_src +**** S/MIME +Mail signing and encrypting with S/MIME needs a =gpgsm= setup and =smime.el=. + +One can either use =EasyPG= or =OpenSSL= as external implementations. +#+begin_src emacs-lisp :tangle no +(mml-smime-use 'epg) +#+end_src + +#+begin_src emacs-lisp :tangle no +(mml-default-encrypt-method "smime") +(mml-default-sign-method "smime") +#+end_src + + + +#+begin_src emacs-lisp :tangle no +(use-package smime + :custom + (smime-CA-directory "~/certs/trusted") + (smime-certificate-directory "~/certs") + ) +#+end_src *** MUA/Notmuch After using =mu4e= as my mail user agent for a while I switched to -- cgit v1.2.3 From 4eb11796e1a1233597476d61fed814550744d365 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:33:27 +0100 Subject: [WIP] Add some notification related packages --- emacs-init.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 9f82340..9da3cfd 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5775,6 +5775,15 @@ Instead of =$= use =⏎= to indicate newlines [187 9] [92 9])))) #+end_src +** Notifications +#+begin_src emacs-lisp +(use-package sauron + :straight t) +(use-package alert + :straight t) +(use-package org-alert + :straight t) +#+end_src ** Undo Emacs undo mechanic can be confusing. =undo-tree= is a great package -- cgit v1.2.3 From 7d6798c7e74991a5e79b79faee7e5b4562b3d8d7 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:33:42 +0100 Subject: Make „“ act electric --- emacs-init.org | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 9da3cfd..0b407fb 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5811,10 +5811,13 @@ temporary buffer is created. (use-package electric :init (setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit) - (setq electric-pair-pairs '((34 . 34) - (8216 . 8217) - (8220 . 8221) - (171 . 187))) + (setq electric-pair-pairs '((?\" . ?\") + (?‘ . ?’) + (?“ . ?”) + (?« . ?») + (?„ . ?“) + (?‚ . ?‘) + )) (setq electric-pair-skip-self 'electric-pair-default-skip-self) (setq electric-quote-context-sensitive t) (setq electric-quote-paragraph t) -- cgit v1.2.3 From 395363ab7522589a1d98af828376a0d14372449c Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:35:24 +0100 Subject: Make gnus articles use prose-mode --- gnus.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.org b/gnus.org index aebf113..996a1c0 100644 --- a/gnus.org +++ b/gnus.org @@ -411,6 +411,11 @@ See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp (setq gnus-use-full-window nil) #+end_src +**** Article Display +#+begin_src emacs-lisp +(use-package gnus-art + :hook (gnus-article-mode . prose-mode)) +#+end_src **** Modeline indicator From the [[https://www.emacswiki.org/emacs/GnusNotify][emacswiki Gnus Notify]]. #+begin_quote -- cgit v1.2.3 From 67ae5fd1922dcf6d44ca6f337126e810309022ef Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 19 Dec 2020 18:39:05 +0100 Subject: Extract straight recipe for org --- emacs-init.org | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0b407fb..643d640 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3163,9 +3163,17 @@ Hansen's]] configs. - Align tags left :: Fixes problems with line breaking on small window width. +I use a org version with some custom patches. Rather than using something like =el-patch=, I host my version on github for now and update it every so often. This recipe for org is used in all coming =straight.el= calls. +#+begin_src emacs-lisp :noweb-ref org-recipe :tangle no +(org-plus-contrib :host github :repo "fpiper/org-mode" :branch "develop" + ;;:local-repo "org" :files (:defaults "contrib/lisp/*.el") + ) +#+end_src + #+begin_src emacs-lisp (use-package org - :straight (org-plus-contrib :host github :repo "fpiper/org-mode" :branch "develop" :local-repo "org" :files (:defaults "contrib/lisp/*.el")) + :straight + <> :delight (org-cdlatex-mode) :bind (("C-c c" . org-capture) @@ -3678,7 +3686,8 @@ print the list. #+begin_src emacs-lisp (use-package org-checklist :after org - :straight (org-plus-contrib)) + :straight + <>) #+end_src *** Handling web urls **** org-web-tools @@ -3909,7 +3918,8 @@ Org-roam mainly provides a display of backlinks to the current file. This allows Overwriting ~org-roam--file-link-face~ is a crude fix for hanging emacs. The original function calls file-exist-p which opens a slow tramp connection. **** org-roam-protocol #+begin_src emacs-lisp -(use-package org-roam-protocol) +(use-package org-roam-protocol + :after org-roam) #+end_src **** org-roam-bibtex #+begin_src emacs-lisp @@ -4304,7 +4314,8 @@ CLOSED: %\\1 #+begin_src emacs-lisp (use-package org-expiry :after org - :straight (org-plus-contrib) + :straight + <> :custom (org-expiry-handler-function 'org-expiry-archive-subtree) (org-expiry-inactive-timestamps t) -- cgit v1.2.3 From 8082136f84f474f74c507b9053605ab534a5f3b6 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 19 Dec 2020 18:39:39 +0100 Subject: Remove elfeed in favor of gnus --- emacs-init.org | 144 --------------------------------------------------------- 1 file changed, 144 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 643d640..c19d02a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -39,7 +39,6 @@ - [[#proced][Proced]] - [[#pass][Pass]] - [[#ledger][Ledger]] - - [[#elfeed][Elfeed]] - [[#plotting-data][Plotting data]] - [[#html-renderer][HTML renderer]] - [[#email][Email]] @@ -5040,149 +5039,6 @@ Here is a good [[https://www.reddit.com/r/emacs/comments/8x4xtt][reddit thread]] I also use some =org-capture= templates to quickly capture transactions. They are defined in [[file:emacs-private.el.gpg::4][emacs-private.el.gpg]]. -** Elfeed - -#+BEGIN_SRC emacs-lisp -(use-package elfeed - :straight t - :init - (setq elfeed-db-directory "~/.emacs.d/elfeed") - :custom - (elfeed-enclosure-default-dir "~/Downloads") - (elfeed-search-clipboard-type 'CLIPBOARD) - (elfeed-search-title-max-width (current-fill-column)) - (elfeed-search-title-min-width 30) - (elfeed-search-trailing-width 16) - (elfeed-show-truncate-long-urls t) - (elfeed-show-unique-buffers t) - :config - (defalias 'elfeed-toggle-star - (elfeed-expose #'elfeed-search-toggle-all 'star)) - (defun fpi/elfeed-search-show-entry-in-bg (entry) - (interactive (list (elfeed-search-selected :ignore-region))) - (elfeed-search-show-entry entry) - (bury-buffer)) - :bind - (:map elfeed-search-mode-map - ("m" . elfeed-toggle-star) - ("o" . fpi/elfeed-search-show-entry-in-bg) - ("j" . mz/make-and-run-elfeed-hydra) - )) -#+END_SRC -Some feeds I want to automatically mark as read. This way I can look -at them whenever I want to, but they don't show up in the unread search. -#+BEGIN_SRC emacs-lisp -(defun elfeed-mark-all-as-read () - (interactive) - (save-excursion - (mark-whole-buffer) - (elfeed-search-untag-all-unread))) -(defun elfeed-mark-search-read (search-string) - "Mark all results of SEARCH-STRING as read." - (interactive) - (elfeed) - (let ((filter elfeed-search-filter)) - (elfeed-search-set-filter search-string) - (elfeed-mark-all-as-read) - (elfeed-search-set-filter filter) - (bury-buffer))) -#+END_SRC -Now execute this whenever feeds are fetched -#+BEGIN_SRC emacs-lisp -(defun my/elfeed-mark-read (entry) - "Tag ENTRY as read if it contains certain tags" - (when (member 'tRaffic (elfeed-entry-tags entry)) - (elfeed-untag entry 'unread) - )) -(add-hook 'elfeed-new-entry-hook 'my/elfeed-mark-read) -#+END_SRC -*** Elfeed Org -Load elfeed org after adding ~my/elfeed-mark-read~ to -~elfeed-new-entry-hook~. New entries need to get tagged by elfeed org -first before marking them unread based on their tag. -#+BEGIN_SRC emacs-lisp -(use-package elfeed-org - :straight t - :config - (elfeed-org) - (setq rmh-elfeed-org-files (list "~/.emacs.d/elfeed.org"))) -#+END_SRC -*** Hydra -This creates a smart hydra based on all available tags (see -https://cestlaz.github.io/posts/using-emacs-31-elfeed-3/). -#+BEGIN_SRC emacs-lisp -(defun z/hasCap (s) "" - (let ((case-fold-search nil)) - (string-match-p "[[:upper:]]" s) - )) -(defun z/get-hydra-option-key (s) - "returns single upper case letter (converted to lower) or first" - (interactive) - (let ( (loc (z/hasCap s))) - (if loc - (downcase (substring s loc (+ loc 1))) - (substring s 0 1) - ))) - -;; (active blogs cs eDucation emacs local misc sports star tech unread webcomics) -(defun mz/make-elfeed-cats (tags) - "Returns a list of lists. Each one is line for the hydra configuratio in the form - (c function hint)" - (interactive) - (mapcar (lambda (tag) - (let* ( - (tagstring (symbol-name tag)) - (c (z/get-hydra-option-key tagstring)) - ) - (list c (append '(elfeed-search-set-filter) (list (format "@6-months-ago +%s" tagstring) ))tagstring ))) - tags)) -(defmacro mz/make-elfeed-hydra () - `(defhydra mz/hydra-elfeed () - "filter" - ,@(mz/make-elfeed-cats (elfeed-db-get-all-tags)) - ("*" (elfeed-search-set-filter "@6-months-ago +star") "Starred") - ("M" elfeed-toggle-star "Mark") - ("A" (elfeed-search-set-filter "@6-months-ago") "All") - ("T" (elfeed-search-set-filter "@1-day-ago") "Today") - ("Q" bjm/elfeed-save-db-and-bury "Quit Elfeed" :color blue) - ("q" nil "quit" :color blue) - )) -(defun mz/make-and-run-elfeed-hydra () - "" - (interactive) - (mz/make-elfeed-hydra) - (mz/hydra-elfeed/body)) -#+END_SRC - -*** Youtube to Vlc -Open a entry with vlc -#+BEGIN_SRC emacs-lisp -(defface elfeed-youtube - '((t :foreground "#a9f")) - "Marks YouTube videos in Elfeed." - :group 'elfeed) - -(push '(youtube elfeed-youtube) - elfeed-search-face-alist) - -(defun elfeed-show-vlc () - "Play the current entry with vlc." - (interactive) - (pop-to-buffer (shell-command (format "vlc %s &" (elfeed-entry-link elfeed-show-entry))))) - -(defun elfeed-search-vlc () - "Play the current entry with vlc." - (interactive) - (let ((entries (elfeed-search-selected))) - (dolist (entry entries) - (shell-command (format "vlc %s &" (elfeed-entry-link entry))) - (elfeed-untag entry 'unread) - (elfeed-search-update-entry entry) - (unless (use-region-p) (forward-line))))) - -(define-key elfeed-show-mode-map "v" 'elfeed-show-vlc) -(define-key elfeed-search-mode-map "v" 'elfeed-search-vlc) -#+END_SRC ** Plotting data =gnuplot= is a great option for plotting any kind of data, no matter -- cgit v1.2.3 From fc055499f305d0a3d2d961bc875d8d7f2ac733b8 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 19 Dec 2020 18:36:30 +0100 Subject: Add symlinks for gnus state files --- gnus.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnus.org b/gnus.org index 996a1c0..d3dc7c3 100644 --- a/gnus.org +++ b/gnus.org @@ -4,7 +4,14 @@ ln -siv $(pwd)/tangle/gnus.el ~/.gnus.el #+end_src -Load private settings +I use =nextcloud= to synchronize gnus state files across devices. Alternatively one may use [[info:gnus#The Gnus Cloud][info:gnus#Gnus Cloud]]. Here i symlink the relevant files/directories to my synchronization directory. +#+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +ln -siv ~/sync/gnus/News ~/News +ln -siv ~/sync/gnus/.newsrc.eld ~/.newsrc.eld +ln -siv ~/sync/gnus/.gnus.registry.eieio ~/.gnus.registry.eieio +#+end_src + +Load private settings. #+begin_src emacs-lisp (setq secret-file (expand-file-name "emacs-private.el.gpg" user-emacs-directory)) -- cgit v1.2.3 From d76076020b849ffc2c0fdf2cd67b55269aa8ae99 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 2 Jan 2021 15:20:13 +0100 Subject: Add bbdb symlink --- emacs-init.org | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index c19d02a..84e6840 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -66,11 +66,13 @@ This files contains all the elisp code normally placed in the .emacs file. It and the =init.el= file are then symlinked to my =~/.emacs.d/= directory. Instead of symlinking the files could also be directly tangled to =~/.emacs.d/=. -#+BEGIN_SRC shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +#+BEGIN_SRC shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" :noweb yes ln -siv $(pwd)/emacs-init.org ~/.emacs.d/ ln -siv $(pwd)/tangle/emacs-init.el ~/.emacs.d/ +ln -siv $(pwd)/tangle/init-exwm.el ~/.emacs.d/ ln -siv $(pwd)/emacs-private.el.gpg ~/.emacs.d/ ln -siv $(pwd)/tangle/init.el ~/.emacs.d/ +<> #+END_SRC An often seen setup is to use ~org-babel-load-file~ in =init.el= to @@ -5287,6 +5289,10 @@ For now I use this bad code. (lambda () (define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field))) #+end_src +To synchronize the database across devices I symlink it to my central synchronization directory: +#+begin_src shell :noweb-ref symlinks :tangle no +ln -siv ~/sync/bbdb/bbdb ~/.emacs.d/1 +#+end_src ** Compile Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 7a2846be0bdc8fee0259b145e2557bf18e779f5a Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 2 Jan 2021 15:20:23 +0100 Subject: Remove ~/.emacs.d/lisp from load path --- emacs-init.org | 6 ------ 1 file changed, 6 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 84e6840..3171aec 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4,7 +4,6 @@ - [[#overview][Overview]] - [[#about-this-document][About this document]] - [[#base-settings][Base settings]] - - [[#setup-load-path][Setup load path]] - [[#meta-packages][Meta packages]] - [[#gui-interface][GUI Interface]] - [[#font][Font]] @@ -198,11 +197,6 @@ Notable configs: - [[http://doc.norang.ca/org-mode.html][Bernt Hansen]] * Base settings -** 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") -#+END_SRC ** Meta packages Packages that don't do anything by themselves, but can be used to help with other package definition and customization. -- cgit v1.2.3 From 6146afda7e492d8308ec3e0369b78a89eedaaa5c Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 2 Jan 2021 15:21:48 +0100 Subject: Disable save password prompt from auth-source --- emacs-init.org | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 3171aec..ea8b991 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -36,7 +36,7 @@ - [[#shell][Shell]] - [[#grep][Grep]] - [[#proced][Proced]] - - [[#pass][Pass]] + - [[#passwords][Passwords]] - [[#ledger][Ledger]] - [[#plotting-data][Plotting data]] - [[#html-renderer][HTML renderer]] @@ -4973,7 +4973,13 @@ Built-in process monitor. (proced-descend t) (proced-filter 'user)) #+END_SRC -** Pass +** Passwords +*** [[info:auth#Top][auth-source]] +#+begin_src emacs-lisp +(use-package auth-source + :custom (auth-source-save-behavior nil)) +#+end_src +*** Pass Emacs interface & mode for the password manager [[https://www.passwordstore.org/][pass/password-store]]. The emacs =pass= package provides a nice buffer listing all stored passwords files and also a good mode to edit them. The @@ -4999,7 +5005,7 @@ prefix to my custom keymap. (call-interactively 'password-store-copy))) :bind (:map fpi-map ("p" . fpi/password-store-copy-pass-or-field))) #+end_src -*** auth-password-store/auth-source-pass +**** auth-password-store/auth-source-pass A password-store backend for the Emacs [[info:auth#Top][auth-source]] library which normally uses the =~/.authinfo= file. For correct setup of password-store files see [[https://rkm.id.au/2015/07/07/integrating-password-store-with-emacs/#fnr.1][here]] and in its [[https://github.com/DamienCassou/auth-password-store][github repo]]. For remote hosts -- cgit v1.2.3 From 06889c7c95969d6c79d1af53e1374838a91593c8 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 2 Jan 2021 15:22:04 +0100 Subject: Add clock capture which clocks into any heading --- emacs-init.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index ea8b991..407625e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4083,6 +4083,13 @@ To get the title from the url in =kill-ring= I use [[id:dc4129ff-6d76-4f12-926f- :END: %i") #+END_SRC +***** Clock +#+begin_src emacs-lisp :tangle no :noweb-ref org-capture-templates +("c" "Clock" + plain + (file "~/sync/refile.org") + "%(fpi/org-clock-in-heading)") +#+end_src ***** Interrupts For interruptions. These are saved in a global refile file and to be sorted to their appropriate place. #+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates @@ -4159,8 +4166,8 @@ Instead of project related capture templates, I use the same template for all ta #+END_SRC ***** Interesting stuff I have to look at later #+BEGIN_SRC emacs-lisp :tangle no :noweb-ref org-capture-templates -("c" "Checkout") -("cr" ".. & read" +("C" "Checkout") +("Cr" ".. & read" entry (file "~/sync/refile.org") "* TODO %a :READLIST: -- cgit v1.2.3 From 51ed178f7993ca3042f2fabbb4c999d9db8fa976 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 2 Jan 2021 15:22:27 +0100 Subject: Add basic support for custom device configurations Each device config is stored in the form ("hostname" (:type desktop :wm awesome :key value)) --- emacs-init.org | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 407625e..844abb0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -6,6 +6,9 @@ - [[#base-settings][Base settings]] - [[#meta-packages][Meta packages]] - [[#gui-interface][GUI Interface]] + - [[#devices][Devices]] + - [[#server][Server]] + - [[#exwm][Exwm]] - [[#font][Font]] - [[#theme--faces][Theme & Faces]] - [[#user-info][User info]] @@ -362,6 +365,51 @@ it calls ~force-mode-line-update~. (help-mode . hide-mode-line-mode)) (global-set-key (kbd "C-c m") 'hide-mode-line-mode) #+end_src +** Devices +To support different settings on different devices storing some device information seems useful. +#+begin_src emacs-lisp +(setq fpi/current-device (system-name)) +(setq fpi/devices + '(("pan" + (:type desktop + :wm exwm)) + ("xcarb" + (:type mobile)) + )) +(defun fpi/device-info (device prop) + "Return property PROP of DEVICE as stored in `fpi/devices'." + (let ((info (cadr (assoc device fpi/devices)))) + (plist-get info prop))) +(defun fpi/current-device-info (prop) + "Return property PROP of current device." + (let ((info (cadr (assoc fpi/current-device fpi/devices)))) + (plist-get info prop))) +#+end_src +Now we can easily extract info on the current device. +#+begin_src emacs-lisp :tangle no :exports both :results replace +(fpi/device-info "pan" :type) +#+end_src + +#+RESULTS: +: desktop + +** Server +#+begin_src emacs-lisp :tangle no +(use-package server + :config + (unless (server-running-p) (server-start))) +#+end_src +** Exwm +The previous sections cover all basic settings which may be useful when loading =exwm=. +My =exwm= configurations are in [[file:init-exwm.org][init-exwm.org]] and we can load the tangled version here. In the future I may convert it into a standalone package. +#+begin_src emacs-lisp +(when (eq (fpi/current-device-info :wm) 'exwm) + (load (concat user-emacs-directory "init-exwm.el")) +#+end_src +Also enable =exwm=. This does nothing if =emacs= is not started +#+begin_src emacs-lisp + (exwm-enable)) +#+end_src ** Font I am still not quite sure on my choice of font. -- cgit v1.2.3 From 5fdea9cabfb29645af73d9a36c37a2fbc1f9dea1 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:46:32 +0100 Subject: Add org-roam-todo --- emacs-init.org | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 844abb0..99ce35c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3939,6 +3939,7 @@ Org-roam mainly provides a display of backlinks to the current file. This allows ("C-c n G" . fpi/org-roam-graph-with-exclude) ("C-c n t g" . fpi/org-roam-toggle-graph-executable) ("C-c n x" . org-roam-jump-to-index) + <> ) :map org-mode-map (("C-c n i" . org-roam-insert))) @@ -3956,9 +3957,25 @@ Org-roam mainly provides a display of backlinks to the current file. This allows (interactive "P") (let ((org-roam-graph-exclude-matcher (completing-read "Exclude matcher to use: " nil))) (org-roam-graph arg file node-query))) -) + <> + ) #+end_src Overwriting ~org-roam--file-link-face~ is a crude fix for hanging emacs. The original function calls file-exist-p which opens a slow tramp connection. + +The idea of ~fpi/org-roam-todo~ is from a post by [[https://oremacs.com/2020/12/31/happy-new-year/][aboabo]]. It lists all open todos in zettelkasten entries and is a (faster) alternative to running an todo agenda with ~org-agenda-files~ set to ~org-roam-directory~. +#+begin_src emacs-lisp :tangle no :noweb-ref org-roam-config +(defun fpi/org-roam-todo () + (interactive) + (setq unread-command-events + (listify-key-sequence (kbd "C-c C-o M->"))) + (counsel-rg "^\\*+ \\(NEXT\\|TODO\\)" org-roam-directory "--sort modified")) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref org-roam-bindings +("C-c n t" . fpi/org-roam-todo) +#+end_src + + **** org-roam-protocol #+begin_src emacs-lisp (use-package org-roam-protocol -- cgit v1.2.3 From 1253da5efb3a9f212d806336cdc4e790677f7aea Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:48:30 +0100 Subject: Show sauron in same frame when using exwm --- emacs-init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 99ce35c..4392955 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -56,6 +56,7 @@ - [[#rainbow-mode][Rainbow mode]] - [[#parentheses][Parentheses]] - [[#whitespace][Whitespace]] + - [[#notifications][Notifications]] - [[#undo][Undo]] - [[#electric-stuff][Electric stuff]] - [[#writing-setup][Writing Setup]] @@ -5723,7 +5724,9 @@ Instead of =$= use =⏎= to indicate newlines ** Notifications #+begin_src emacs-lisp (use-package sauron - :straight t) + :straight t + :custom + (sauron-separate-frame (not (eq (fpi/current-device-info :wm) 'exwm)))) (use-package alert :straight t) (use-package org-alert -- cgit v1.2.3 From 609e78703b9c796f23b921309636140d29fafe87 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:49:21 +0100 Subject: Fix sentence --- emacs-init.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 4392955..568e2bb 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -393,7 +393,6 @@ Now we can easily extract info on the current device. #+RESULTS: : desktop - ** Server #+begin_src emacs-lisp :tangle no (use-package server @@ -407,7 +406,7 @@ My =exwm= configurations are in [[file:init-exwm.org][init-exwm.org]] and we can (when (eq (fpi/current-device-info :wm) 'exwm) (load (concat user-emacs-directory "init-exwm.el")) #+end_src -Also enable =exwm=. This does nothing if =emacs= is not started +Also enable =exwm=. This does nothing if =emacs= is not started as window manager. #+begin_src emacs-lisp (exwm-enable)) #+end_src -- cgit v1.2.3 From 569f39e08cb584160754896ed72ee84aa5045b72 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:49:55 +0100 Subject: Update exwm config & add .desktop entry, exwm-start --- init-exwm.org | 92 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/init-exwm.org b/init-exwm.org index 792dcbe..73a4500 100644 --- a/init-exwm.org +++ b/init-exwm.org @@ -1,19 +1,59 @@ #+PROPERTY: header-args:emacs-lisp :results silent -,#+PROPERTY: header-args:emacs-lisp :tangle tangle/init-exwm.el +#+PROPERTY: header-args:emacs-lisp :tangle tangle/init-exwm.el -When stating the client from .xinitrc, `save-buffer-kill-terminal' will +* Starting EXWM +Either start exwm in =.xinitrc= or if using a display manager setup a desktop file similar to this: +#+HEADER: :tangle /sudo::/usr/share/xsessions/exwm.desktop +#+begin_src conf +[Desktop Entry] +Name=EXWM +Comment=Emacs X Window Manager +TryExec=exwm-start +Exec=exwm-start +Type=Application +#+end_src +With the =exwm-start= script: +#+HEADER: :tangle /sudo::/usr/local/bin/exwm-start +#+begin_src shell :tangle-mode (identity #o755) +#!/usr/bin/env sh + +export VISUAL=emacsclient +export EDITOR="$VISUAL" + +# exec dbus-launch --exit-with-session emacs --eval "(progn (load \"/home/fpi/git/projects/dotfiles/tangle/init-exwm.el\") (exwm-enable))" +# exec dbus-launch --exit-with-session emacs +gpg-agent --daemon +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + +exec dbus-launch --exit-with-session /home/fpi/.local/bin/emacs +#+end_src +* EXWM config +#+begin_src emacs-lisp +(use-package exwm + :straight t) +#+end_src +When starting the client from .xinitrc, `save-buffer-kill-terminal' will force-kill Emacs before it can run through `kill-emacs-hook'. #+BEGIN_SRC emacs-lisp (global-set-key (kbd "C-x C-c") 'save-buffers-kill-emacs) #+END_SRC - - set keyboard #+BEGIN_SRC emacs-lisp (shell-command "setxkbmap -layout \"de(neo),us,ru,de\"") #+END_SRC -* functions + +** Monitor setup +#+BEGIN_SRC emacs-lisp +(use-package exwm-randr + :config + (setq exwm-randr-workspace-output-plist '(0 "DP1" 1 "DisplayPort-5")) + ;; (when (equal system-name "pan") + ;; (start-process-shell-command "xrandr" nil "xrandr --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --off --output HDMI-A-0 --off --output DisplayPort-3 --mode 2560x1440 --pos 0x612 --rotate normal --output DisplayPort-4 --off --output DisplayPort-5 --mode 2560x1440 --pos 2560x0 --rotate right --output DisplayPort-6 --off") + ;; (exwm-workspace-add)) + (exwm-randr-enable)) +#+END_SRC +** functions #+BEGIN_SRC emacs-lisp (defun ambrevar/switch-to-last-buffer () "Switch to last open buffer in current window." @@ -72,7 +112,7 @@ configuration was previously save, restore that configuration." (setq single-window--last-configuration (current-window-configuration)) (delete-other-windows))) #+END_SRC -** Window swapping +*** Window swapping #+BEGIN_SRC emacs-lisp (defun ambrevar/swap-windows (&optional w1 w2) "If 2 windows are up, swap them. @@ -119,7 +159,7 @@ If W2 is a window too, swap both." (interactive) (ambrevar/swap-windows (window-in-direction 'right))) #+END_SRC -** Volume & Brightness +*** Volume & Brightness #+BEGIN_SRC emacs-lisp (defun exwm-brightness (incdec) (shell-command (concat "xbacklight " incdec "10")) @@ -151,13 +191,13 @@ If W2 is a window too, swap both." :urgency 'low :timeout 550)) #+END_SRC -** XF86 Multimedia keys +*** XF86 Multimedia keys #+BEGIN_SRC emacs-lisp (defun exwm-xf86audio (cmd) ;; Control Spotify (shell-command (concat "dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player." cmd))) #+END_SRC -** Browser switching +*** Browser switching #+BEGIN_SRC emacs-lisp (defun fpi/helm-exwm-switch (class &optional program other-window) "Switch to some EXWM windows belonging to CLASS. @@ -198,11 +238,12 @@ See `helm-exwm-switch'." "firefox")) browse-url-generic-program)) #+END_SRC -* config +** config Time & Battery display #+BEGIN_SRC emacs-lisp (display-time) -(display-battery-mode) +(when (eq (fpi/current-device-info :type) 'mobile) + (display-battery-mode)) #+END_SRC Rename buffer to window title.\\ Spotify's title does not include "spotify" while playing music so just @@ -229,7 +270,8 @@ Non-floating resizing with mouse #+END_SRC System tray #+BEGIN_SRC emacs-lisp -(require 'exwm-systemtray) +(use-package exwm-systemtray + :straight exwm) (exwm-systemtray-enable) (setq exwm-systemtray-height 16) #+END_SRC @@ -243,7 +285,7 @@ List all buffers (setq exwm-workspace-show-all-buffers t) (setq exwm-layout-show-all-buffers t) #+END_SRC -** Helm +*** Helm #+BEGIN_SRC emacs-lisp :results silent (with-eval-after-load 'helm ;; Need `with-eval-after-load' here since 'helm-map is not defined in 'helm-config. @@ -259,11 +301,12 @@ List all buffers ;;(exwm-input-set-key (kbd "s-G") 'ambrevar/helm-grep-git-all-or-ag) ) -(use-package helm-exwm) +(use-package helm-exwm + :straight t) (exwm-input-set-key (kbd "s-w") #'fpi/helm-exwm-switch-browser) (exwm-input-set-key (kbd "s-W") #'helm-exwm-switch-browser-other-window) #+END_SRC -** Keys +*** Keys Global bindings #+BEGIN_SRC emacs-lisp (exwm-input-set-key (kbd "s-K") #'exwm-reset) @@ -313,7 +356,7 @@ XF86 Multimedia Keys (exwm-input--set-key [XF86AudioNext] (lambda () (interactive) (exwm-xf86audio "Next"))) (exwm-input--set-key [XF86AudioPrev] (lambda () (interactive) (exwm-xf86audio "Previous"))) #+END_SRC -*** Local bindings +**** Local bindings #+BEGIN_SRC emacs-lisp (push ?\s- exwm-input-prefix-keys) (define-key exwm-mode-map (kbd "s-SPC") #'exwm-floating-toggle-floating) @@ -328,7 +371,7 @@ Allow access to my personal keymap. (push ?\C-z exwm-input-prefix-keys) #+END_SRC -*** Simulation keys +**** Simulation keys #+BEGIN_SRC emacs-lisp (setq exwm-input-simulation-keys '(([?\C-b] . [left]) @@ -342,14 +385,7 @@ Allow access to my personal keymap. ([?\C-d] . [delete]))) ;;([?\C-k] . [S-end delete]))) ; doesn't work in tilix #+END_SRC -** Multiple monitors -#+BEGIN_SRC emacs-lisp -(require 'exwm-randr) -(setq exwm-randr-workspace-output-plist - '(0 "DP1" 1 "HDMI1" 2 "HDMI2" 3 "eDP1")) -(exwm-randr-enable) -#+END_SRC -** Configure helm-raise-command +*** Configure helm-raise-command ~(shell-command "emacsclient -e ...")~ does not work. Advice ~helm-run-or-raise~ instead and overshadow ~shell-command~. @@ -372,7 +408,7 @@ For now ~helm-run-or-raise~ is redefined after helm is loaded in ;; (setq helm-raise-command "emacsclient -e '(fpi/switch-to-proc-buffer \"%s\")'") (setq helm-raise-command t) #+end_src -** Screenshots +*** Screenshots UncleDave has a nice exwm configuration in his [[https://github.com/daedreth/UncleDavesEmacs/blob/master/config.org][config]]. These snippets are taken from there. @@ -380,7 +416,7 @@ A nice alternative for screenshots in org-mode is ~org-screenshot.el~. It uses ~scrot~ to take screenshots of windows and insert a link the image into the current org buffer. -*** Screenshotting the entire screen +**** Screenshotting the entire screen #+BEGIN_SRC emacs-lisp (defun daedreth/take-screenshot () "Takes a fullscreen screenshot of the current workspace" @@ -398,7 +434,7 @@ image into the current org buffer. (global-set-key (kbd "") 'daedreth/take-screenshot) #+END_SRC -*** Screenshotting a region +**** Screenshotting a region #+BEGIN_SRC emacs-lisp (defun daedreth/take-screenshot-region () "Takes a screenshot of a region selected by the user." -- cgit v1.2.3 From ff54dbbaa1087db7d45aaf5725801098eed20618 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 15:50:51 +0100 Subject: [WIP] Add local maildir --- gnus.org | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/gnus.org b/gnus.org index d3dc7c3..6f069f8 100644 --- a/gnus.org +++ b/gnus.org @@ -55,19 +55,36 @@ Noweb the primary server settings together. )) #+end_src -Setup a secondary imap server and a local nntp server I use to fetch -RSS/Atom Feeds asynchronously. +To avoid confusion I enable namespaces for imap groups. +#+begin_src emacs-lisp +(setq nnimap-use-namespaces t) +#+end_src +*** Secondary servers #+begin_src emacs-lisp +<> +#+end_src +**** Personal mailbox +#+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods (add-to-list 'gnus-secondary-select-methods `(nnimap ,@private/personal-imap-info (nnimap-stream ssl) (nnir-search-engine imap) (nnimap-inbox "INBOX"))) +#+end_src +**** RSS/Atom over nntp +Setup a secondary imap server and a local nntp server I use to fetch +RSS/Atom Feeds asynchronously. +#+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods (add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) -<> #+end_src -#+begin_src emacs-lisp -(setq nnimap-use-namespaces t) +**** Harddrive Maildir +This is still WIP, because the =nnmaildir= backend sucks. +#+begin_src emacs-lisp :tangle no +(add-to-list 'gnus-secondary-select-methods + '(nnmaildir "Local Maildir" + (directory "~/.nnmaildir") + (gnus-search-engine gnus-search-notmuch + (config-file "~/.notmuch-config")))) #+end_src ** Options *** General -- cgit v1.2.3 From 47fac1cc9670e13f18fab2677adcc097633ffdce Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 21 Jan 2021 15:52:33 +0100 Subject: Enable exwm if $DESKTOP_SESSION is exwm ... and not a TUI --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 568e2bb..d4b3d02 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -403,7 +403,8 @@ Now we can easily extract info on the current device. The previous sections cover all basic settings which may be useful when loading =exwm=. My =exwm= configurations are in [[file:init-exwm.org][init-exwm.org]] and we can load the tangled version here. In the future I may convert it into a standalone package. #+begin_src emacs-lisp -(when (eq (fpi/current-device-info :wm) 'exwm) +(when (and (equal (getenv "DESKTOP_SESSION") "exwm") + (eq window-system 'x)) (load (concat user-emacs-directory "init-exwm.el")) #+end_src Also enable =exwm=. This does nothing if =emacs= is not started as window manager. -- cgit v1.2.3 From 539d52ecf1bf96b95129e881afd032c7d2b3564c Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 21 Jan 2021 15:53:09 +0100 Subject: Fix conflict in C-c n t binding --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index d4b3d02..6d5d674 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3972,8 +3972,9 @@ The idea of ~fpi/org-roam-todo~ is from a post by [[https://oremacs.com/2020/12/ (counsel-rg "^\\*+ \\(NEXT\\|TODO\\)" org-roam-directory "--sort modified")) #+end_src +As =C-c n t= is already taken as prefix for roam related toggle commands, use =o= (mnemonic: “open”) instead. #+begin_src emacs-lisp :tangle no :noweb-ref org-roam-bindings -("C-c n t" . fpi/org-roam-todo) +("C-c n o" . fpi/org-roam-todo) #+end_src -- cgit v1.2.3 From a8e61222ba0aa56839bcad50a00910872986cdbd Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 21 Jan 2021 15:56:40 +0100 Subject: Add spray for speed reading --- emacs-init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 6d5d674..e4e08c4 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -47,6 +47,7 @@ - [[#footnote-mode][Footnote Mode]] - [[#bbdb][BBDB]] - [[#compile][Compile]] + - [[#speed-reading][Speed reading]] - [[#context-aware-hydra][Context aware hydra]] - [[#minor-utilities][Minor utilities]] - [[#language-settings][Language settings]] @@ -5382,6 +5383,12 @@ Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-c compilation-filter-start (point)))) :hook (compilation-filter . endless/colorize-compilation)) #+END_src +** Speed reading +=spray= offers an interface similar to the [[https://ds300.github.io/jetzt/][jetzt]] browser based speed reader. +#+begin_src emacs-lisp +(use-package spray + :straight (:host nil :repo "https://git.sr.ht/~iank/spray/")) +#+end_src ** Context aware hydra :PROPERTIES: :ID: 22750e48-aaee-4f60-bdce-1d511ebe3375 -- cgit v1.2.3 From b9cb7037b581f1ea35d0948c9c27b0d28fdd06ef Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 21 Jan 2021 16:00:07 +0100 Subject: Add garbage collection settings --- emacs-init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index e4e08c4..c4b3f3b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -12,6 +12,7 @@ - [[#font][Font]] - [[#theme--faces][Theme & Faces]] - [[#user-info][User info]] + - [[#garbage-collection][Garbage collection]] - [[#desktop-module][Desktop module]] - [[#customize][Customize]] - [[#file-and-input-history][File and input history]] @@ -1670,7 +1671,15 @@ Set ~user-full-name~ and ~user-mail-address~. These are set in (setq user-full-name private/user-full-name user-mail-address private/user-mail-address) #+end_src - +** Garbage collection +Give a message when Emacs does garbage collection and increase the thresholds for triggering it. +#+begin_src emacs-lisp +(use-package emacs + :custom + (garbage-collection-messages t) + (gc-cons-threshold 800000000) + (gc-cons-percentage 0.3)) +#+end_src ** Desktop module This saves the state emacs was in. #+begin_src emacs-lisp -- cgit v1.2.3 From 7a0b6415eac5416cef37a0325b6bd4cc1e63fbcc Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 21 Jan 2021 16:31:17 +0100 Subject: Rename gnus group buffer --- emacs-init.org | 7 +++++++ gnus.org | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index c4b3f3b..326bc1c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5338,6 +5338,13 @@ For now I use this bad code. (goto-char (point-max)) (or (bolp) (newline))))) #+END_SRC +*** Gnus +The customization for gnus is located in [[file:gnus.org][gnus.org]] and loaded from there upon startup. + +I change the group buffer to something more memorable. This needs to be set before gnus is started and therefore only setting it in gnus.org is not sufficient. +#+begin_src emacs-lisp +(setq gnus-group-buffer "*Gnus*") +#+end_src ** Footnote Mode #+begin_src emacs-lisp (use-package footnote diff --git a/gnus.org b/gnus.org index 6f069f8..c2a47c3 100644 --- a/gnus.org +++ b/gnus.org @@ -370,6 +370,10 @@ Unicode reply symbol #+begin_src emacs-lisp (setq gnus-summary-to-prefix "→ ") #+end_src +Rename the group buffer to something more memorable. This is not intended to be customized. So some bugs may occur. So far it only seems important to set it before starting gnus the first time. So e.g. set it in your main emacs =init.el=. +#+begin_src emacs-lisp +(setq gnus-group-buffer "*Gnus*") +#+end_src **** On threads Gather loose threads, whose parent is currently not displayed, under a dummy article. I find the default ~'adopt~ to be too confusing. -- cgit v1.2.3 From a2ea0847bb39932338b73428f38863084cd2c96d Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 4 Jan 2021 16:11:50 +0100 Subject: Add another device configuration --- emacs-init.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 326bc1c..3ecbe4a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -378,6 +378,9 @@ To support different settings on different devices storing some device informati :wm exwm)) ("xcarb" (:type mobile)) + ("DESKTOP-PM1PPEC" + (:type mobile) + (:os win10)) )) (defun fpi/device-info (device prop) "Return property PROP of DEVICE as stored in `fpi/devices'." -- cgit v1.2.3 From 7477fa02cdcef50f802bf070cac288fb922edc6f Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 25 Jan 2021 13:50:34 +0100 Subject: Add magit forge support for private gitlab instances --- emacs-init.org | 8 +++++++- emacs-private.el.gpg | Bin 1139 -> 1184 bytes 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 3ecbe4a..de5fbe3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2798,7 +2798,13 @@ Only highlight the changes within a line, not the whole line. #+begin_src emacs-lisp (use-package forge :after magit - :straight t) + :straight t + :config + <>) +#+end_src +Non-standard forges need to be added to ~forge-alist~ manually. +#+begin_src emacs-lisp :tangle no :noweb-ref forge-config +(append forge-alist private/magit-forges) #+end_src **** gitflow Add support for [[https://nvie.com/posts/a-successful-git-branching-model/][gitflow]]. diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 916e28e..1deb591 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 434192837a0acdc4fecee9204352c40e63626820 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 31 Jan 2021 15:10:23 +0100 Subject: Reduce garbage collection threshold --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index de5fbe3..c241fc9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1680,7 +1680,7 @@ Give a message when Emacs does garbage collection and increase the thresholds fo (use-package emacs :custom (garbage-collection-messages t) - (gc-cons-threshold 800000000) + (gc-cons-threshold 80000000) (gc-cons-percentage 0.3)) #+end_src ** Desktop module -- cgit v1.2.3 From f8da89ee31f287410ee1503702af8f9256d27046 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 27 Jan 2021 11:00:07 +0100 Subject: Make scoring section more generic --- gnus.org | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gnus.org b/gnus.org index c2a47c3..1a7f454 100644 --- a/gnus.org +++ b/gnus.org @@ -171,8 +171,20 @@ Background fetching for gnus. See the manual and [[https://www.emacswiki.org/ema (gnus-demon-add-handler 'gnus-demon-scan-news-4 130 1) (gnus-demon-add-handler 'gnus-demon-scan-news-5 140 1) #+end_src -**** Adaptive scoring -See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. +**** Scoring +To define different scoring files for different groups I set [[info:gnus#Home Score File][home score files]] based on the group name. +#+begin_src emacs-lisp +(setq gnus-home-score-file + '(("^nnimap" "nnimap.SCORE") ;; w/ author scoring + ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring + ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring + )) +(setq gnus-home-adapt-file + '(("^nnimap" "nnimap.ADAPT") + ("gmane" "nntp_gmane.ADAPT") + ("^nntp\\+localhost" "nntp_global.ADAPT"))) +#+end_src +For information about adaptive scoring see [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. ***** Score File Setup #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) @@ -190,19 +202,7 @@ See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https: ) ;; (setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) #+end_src -****** Using different (adaptive) scoring files for different groups -To define different adaptive scoring files for different groups I set [[info:gnus#Home Score File][home score files]] based on the group name. -#+begin_src emacs-lisp -(setq gnus-home-score-file - '(("^nnimap" "nnimap.SCORE") ;; w/ author scoring - ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring - ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring - )) -(setq gnus-home-adapt-file - '(("^nnimap" "nnimap.ADAPT") - ("gmane" "nntp_gmane.ADAPT") - ("^nntp\\+localhost" "nntp_global.ADAPT"))) -#+end_src +****** Scoring rules Scoring based on the =from= header does not make sense for rss feeds with only one author or newsgroups with unset author. These files therefore contain my default adaptive scoring rules with or without =from= scoring. #+NAME: gnus-adaptive-scoring-w-from #+begin_src emacs-lisp :tangle no :eval never @@ -245,7 +245,7 @@ Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= s gnus-score-decay-constant 1 gnus-score-decay-scale 0.01) #+end_src -****** Ignored Words +***** Ignored Words Do not score on some common german words. I extracted these from my score file after a few weeks of using scoring. #+begin_src emacs-lisp (setq gnus-ignored-adaptive-words -- cgit v1.2.3 From 1ff5fcde58d3fee13476307f775f6a4cd9ead7af Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 31 Jan 2021 15:09:56 +0100 Subject: Keep temporary score rules for longer --- gnus.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.org b/gnus.org index 1a7f454..d0bc434 100644 --- a/gnus.org +++ b/gnus.org @@ -185,6 +185,11 @@ To define different scoring files for different groups I set [[info:gnus#Home Sc ("^nntp\\+localhost" "nntp_global.ADAPT"))) #+end_src For information about adaptive scoring see [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. + +Temporary scores by default expire after 7 days. I want a slightly longer threshold. +#+begin_src emacs-lisp +(setq gnus-score-expiry-days 14) +#+end_src ***** Score File Setup #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) -- cgit v1.2.3 From f50caf82a207c8af3a1c337685af7665bede1888 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 9 Mar 2021 13:03:35 +0100 Subject: Set orb-template to auto-format notes from org-ref --- emacs-init.org | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index c241fc9..3deb808 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4011,6 +4011,8 @@ As =C-c n t= is already taken as prefix for roam related toggle commands, use =o :bind (:map org-mode-map (("C-c n a" . orb-note-actions))) :after bibtex + :custom + <> :config (defun bibtex-autokey-get-year () "Return year field contents as a string obeying `bibtex-autokey-year-length'." @@ -4018,9 +4020,37 @@ As =C-c n t= is already taken as prefix for roam related toggle commands, use =o (yearfield (when (equal yearfield "") (substring (bibtex-autokey-get-field "date") 0 4)))) (substring yearfield (max 0 (- (length yearfield) - bibtex-autokey-year-length)))))) + bibtex-autokey-year-length))))) + <>) #+end_src Rewrite of ~bibtex-autokey-get-year~ is a crude way to get bibtex to recognize =date= fields as year. + +Upon showing the notes of an entry with org-ref an appropriate org-roam note file is automatically created using ~orb-edit-notes~. Here I customize the template for my use. +#+begin_src emacs-lisp :tangle no :noweb-ref orb-custom +(orb-templates + '(("r" "ref" plain #'org-roam-capture--get-point + "\n%?\n\n#+BEGIN_SRC bibtex\n%(fpi/orb-capture--get-bibtex-entry)\n#+END_SRC" + :file-name "${citekey}" :head "#+TITLE: %(fpi/orb-capture--get-first-citekey): ${title}\n#+ROAM_KEY: ${ref} +" :unnarrowed t)) +) +#+END_SRC +Here are the functions used. +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref orb-config +(defun fpi/orb-capture--get-bibtex-entry () + "Return bibtex entry for the roam citekey in current buffer" + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^#\\+ROAM_KEY: cite:\\(.*?\\)[\s\n]") + (let ((key (match-string 1))) + (org-ref-get-bibtex-entry key))))) +(defun fpi/orb-capture--get-first-citekey () + "Return first part of the roam citekey in current buffer" + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^#\\+ROAM_KEY: cite:\\(.*?\\)[\s\n]") + (let ((key (match-string 1))) + (when (string-match "^\\(.*?\\)_" key) (match-string 1 key)))))) +#+end_src *** Org-edna :PROPERTIES: :ID: fd3936c7-9fc5-42d0-990d-32024e23b22f -- cgit v1.2.3 From ffc4549e70b4ad87de574f8cd411caf6d972d29d Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:08:58 +0100 Subject: Add lsp-mode (and other programming utilities) --- emacs-init.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 3deb808..aba9ad3 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3171,6 +3171,21 @@ does not have it. So =auctex= has to deliver this dependency instead. '("circuitikz" "\\begin{circuitikz}\nAUTOLABEL\n?\n\\end{circuitikz}" nil)))) #+end_src ** Programming languages +*** Utilities +Various utilities which ease programming in some languages. +#+begin_src emacs-lisp +(use-package yasnippet + :straight t) +(use-package yasnippet-snippets + :straight t) +(use-package company + :straight t) +#+end_src + +#+begin_src emacs-lisp +(use-package lsp-mode + :straight t) +#+end_src *** Emacs lisp =Speed of thought= makes writing lisp so easy. No more snippets needed. -- cgit v1.2.3 From 43a1cdad4f6d1ea0bba53fe907d99fca165ffe1e Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:09:19 +0100 Subject: Add support for rust development Due to the support for org-babel, rustic-mode requires org and therefore needs to be loaded after it. (As org needs to be initialized by the use-package call to work properly with straight.el) --- emacs-init.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index aba9ad3..372078b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3208,6 +3208,12 @@ area. :config (unbind-key "M-s" matlab-mode-map)) #+end_src +*** Rust +#+begin_src emacs-lisp +(use-package rustic + :straight t + :after org) +#+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org TODO and clocking setup is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt -- cgit v1.2.3 From a25a41213fb9948d5e99f122a3e7e51589a741db Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:10:14 +0100 Subject: Strip some meta information from deft results --- emacs-init.org | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 372078b..8e4a986 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5058,7 +5058,31 @@ creation. (deft-default-extension "org") (deft-use-filename-as-title nil) (deft-recursive t) - (deft-use-filter-string-for-filename t))) + (deft-use-filter-string-for-filename t) + <>)) +#+end_src +Most org files start with meta information on lines starting with ~#+~, but also sometimes ~:PROPERTIES:~ drawers. We can exclude these lines from the preview content =Deft= displays with regular expressions. I first noticed this setting in [[https://github.com/hsinhaoyu/.emacs.d/blob/master/config.org][this config by hsin-hao yu]]. Define ~deft-strip-summary-regexp~ to match a group of expressions. +#+begin_src emacs-lisp :tangle no :noweb-ref deft-custom +(deft-strip-summary-regexp + (rx (group (or + space + <> + )))) +#+end_src + +Match ~#+~ based meta lines. +#+begin_src emacs-lisp :tangle no :noweb-ref deft-strip-summary-regexps +(seq bol "#+" (+ (any alpha ?_)) ?: (* any) eol) +#+end_src +Match all drawer lines, including the content. +#+begin_src emacs-lisp :tangle no :noweb-ref deft-strip-summary-regexps +(seq bol ?: (*? (not ?:)) ?: (*? (or any "\n")) ":END:") +#+end_src +Match some formatted standard additional information at the start of files. +#+begin_src emacs-lisp :tangle no :noweb-ref deft-strip-summary-regexps +(seq bol "- tags ::" (* any) eol) +(seq bol "- links ::" (* any) eol) +(seq bol "- source ::" (* any) eol) #+end_src [[https://github.com/EFLS/zetteldeft][Zetteldeft]] provides further functions to search and link between -- cgit v1.2.3 From c59024357406d9d8e2a4d3d0e75a55f0fe018028 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:10:50 +0100 Subject: Add vterm --- emacs-init.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 8e4a986..0fc8a7c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5125,6 +5125,11 @@ To open and hide a shell quickly I use =shell-pop=. :custom (shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda nil (eshell)))))) #+end_src +Vterm is the emacs terminal emulator, which is closest to standard terminal emulators. +#+begin_src emacs-lisp +(use-package vterm + :straight t) +#+end_src ** Grep #+begin_src emacs-lisp (use-package grep -- cgit v1.2.3 From e47aee7a409431e4b34ab1bf55634f59ee838e9d Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:11:22 +0100 Subject: Update sauron config --- emacs-init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 0fc8a7c..2aa3393 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5839,7 +5839,10 @@ Instead of =$= use =⏎= to indicate newlines (use-package sauron :straight t :custom - (sauron-separate-frame (not (eq (fpi/current-device-info :wm) 'exwm)))) + (sauron-separate-frame (not (eq (fpi/current-device-info :wm) 'exwm))) + (sauron-notifications-urgency-to-priority-plist '(:low 2 :normal 4 :critical 5 :otherwise 2)) + :config + (add-to-list 'sauron-modules 'sauron-dbus)) (use-package alert :straight t) (use-package org-alert -- cgit v1.2.3 From 831cd793e0bca9b2d1008ccb8ecbe1396a2cce0d Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:25:55 +0100 Subject: Add a fallback font (for emojis) --- emacs-init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 2aa3393..e3aff7c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -655,6 +655,17 @@ Meant to be used at some early initialisation stage, such as with ;; The "C-c f" is used elsewhere. :bind ("C-c F" . prot/font-fonts-dwim)) #+end_src +*** Emoji +For undefined characters in the default font, we can set a fallback font using [[info:emacs#Fontsets][fontsets]]. + +Here we set it to use the google icons as fallback. +#+begin_src emacs-lisp +(set-fontset-font "fontset-default" 'unicode "Noto Color Emoji") +#+end_src +Alternatively we could use =OpenMoji= or other icon sets. +#+begin_src emacs-lisp :tangle no +(set-fontset-font "fontset-default" 'unicode "OpenMoji") +#+end_src ** Theme & Faces =hc-zenburn= is the theme I chose for a long time. Lately I started to appreciate light themes more. [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]] is an interesting light -- cgit v1.2.3 From 334933c6db07b834861cd8fc1adfd5dfa5a6058f Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 11 Mar 2021 16:54:28 +0100 Subject: EXWM: No longer try to start dbus --- init-exwm.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init-exwm.org b/init-exwm.org index 73a4500..01e8bc5 100644 --- a/init-exwm.org +++ b/init-exwm.org @@ -25,7 +25,9 @@ export EDITOR="$VISUAL" gpg-agent --daemon export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) -exec dbus-launch --exit-with-session /home/fpi/.local/bin/emacs +# exec dbus-launch --exit-with-session /home/fpi/.local/bin/emacs +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +exec /home/fpi/.local/bin/emacs #+end_src * EXWM config #+begin_src emacs-lisp -- cgit v1.2.3 From 326d6d59953becd4ddd2146b38e309805e9665bd Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 11 Mar 2021 16:56:38 +0100 Subject: EXWM: Set randr outputs based on device & use vterm --- init-exwm.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init-exwm.org b/init-exwm.org index 01e8bc5..8acf733 100644 --- a/init-exwm.org +++ b/init-exwm.org @@ -49,7 +49,8 @@ set keyboard #+BEGIN_SRC emacs-lisp (use-package exwm-randr :config - (setq exwm-randr-workspace-output-plist '(0 "DP1" 1 "DisplayPort-5")) + (setq exwm-randr-workspace-output-plist + (when (equal fpi/current-device "pan") '(0 "DisplayPort-3" 1 "DisplayPort-5"))) ;; (when (equal system-name "pan") ;; (start-process-shell-command "xrandr" nil "xrandr --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --off --output HDMI-A-0 --off --output DisplayPort-3 --mode 2560x1440 --pos 0x612 --rotate normal --output DisplayPort-4 --off --output DisplayPort-5 --mode 2560x1440 --pos 2560x0 --rotate right --output DisplayPort-6 --off") ;; (exwm-workspace-add)) @@ -319,7 +320,6 @@ Global bindings (exwm-input-set-key (kbd "s-r") #'windmove-up) (exwm-input-set-key (kbd "s-t") #'windmove-right) -(exwm-input-set-key (kbd "M-s") #'ace-jump-word-mode) (exwm-input-set-key (kbd "s-B") #'ibuffer-list-buffers) (exwm-input-set-key (kbd "s-X") #'kill-this-buffer) @@ -332,7 +332,8 @@ Global bindings (exwm-input-set-key (kbd "s-T") 'ambrevar/swap-windows-right) (exwm-input-set-key (kbd "s-") #'ambrevar/switch-to-last-buffer) -(exwm-input-set-key (kbd "s-") (lambda () +(exwm-input-set-key (kbd "s-") #'vterm) +(exwm-input-set-key (kbd "S-s-") (lambda () (interactive) (start-process "term" nil "tilix"))) (exwm-input-set-key (kbd "s-h") 'bury-buffer) -- cgit v1.2.3 From 9135f3323604647618f8413309495c54117d25ff Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 22 Mar 2021 19:39:49 +0100 Subject: Add vundo --- emacs-init.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index e3aff7c..ddc9153 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5865,6 +5865,14 @@ Emacs undo mechanic can be confusing. =undo-tree= is a great package but is prone to corruption and also does not allow undo based on the active region. +*** Vundo +=Vundo= is a promising alternative to =undo-tree=, that is compatible with the default emacs undo/redo system. Its function is described in detail in [[https://archive.casouri.cat/note/2021/visual-undo-tree/index.html][this blogpost]]. +#+begin_src emacs-lisp +(use-package vundo + :straight (:host github :repo "casouri/vundo" + :branch "master") + :bind (("M-_" . vundo))) +#+end_src *** Undo-propose :ARCHIVE: =undo-propose= shows undo changes in a temporary buffer. For the keybindings see [[elisp:(which-key-show-full-keymap -- cgit v1.2.3 From 761bceeb742c9146a36f194f07df4ef378f46c25 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 6 May 2021 11:32:41 +0200 Subject: Add openscad support --- emacs-init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index ddc9153..78f7e78 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -35,6 +35,7 @@ - [[#pdfs][PDFs]] - [[#latex][Latex]] - [[#programming-languages][Programming languages]] + - [[#cad][CAD]] - [[#org-mode][Org mode]] - [[#deft][Deft]] - [[#shell][Shell]] @@ -3225,6 +3226,12 @@ area. :straight t :after org) #+end_src +** CAD +[[https://www.openscad.org/][OpenSCAD]] is a programmable CAD Modeller. +#+begin_src emacs-lisp +(use-package scad-mode + :straight t) +#+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org TODO and clocking setup is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt -- cgit v1.2.3 From 2669d58c761575546d05767006eb7b433fd7f168 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 10 Mar 2021 18:11:21 +0100 Subject: Add binding for org-ref --- emacs-init.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 78f7e78..cb67655 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4565,6 +4565,9 @@ A small function to toggle the encryption state of the current entry. (progn (dired (file-name-directory pdf)) (ding)))))))) #+end_src +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(define-key fpi-map "r" #'org-ref-helm-insert-cite-link) +#+end_src ***** Capturing entries I store my bibtex references in an org file together with my notes. In addition to saving the meta information in properties using the same -- cgit v1.2.3 From 5763b128be647f91da16300ae33240b838ca8551 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 29 May 2021 14:07:22 +0200 Subject: Add calc settings for decibel --- emacs-init.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index cb67655..fd97f20 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -36,6 +36,7 @@ - [[#latex][Latex]] - [[#programming-languages][Programming languages]] - [[#cad][CAD]] + - [[#calc][Calc]] - [[#org-mode][Org mode]] - [[#deft][Deft]] - [[#shell][Shell]] @@ -3232,6 +3233,13 @@ area. (use-package scad-mode :straight t) #+end_src +** Calc +#+begin_src emacs-lisp +(use-package calc + :custom + (calc-lu-field-reference "1 V") + (calc-lu-power-reference "1 mW")) +#+end_src ** Org mode Org is the mode you never need to leave, if you do not want to. My org TODO and clocking setup is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt -- cgit v1.2.3 From dcdb0fc297d395cb04687b10275910a0680d2696 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 28 Jun 2021 13:03:02 +0200 Subject: Add org-mime --- emacs-init.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index fd97f20..3708819 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4493,6 +4493,15 @@ CLOSED: %\\1 ;; (buffer-string)))) #+end_src (org-read-date nil nil ".") +*** org-mime +Set ~:preserve-breaks~ to keep line breaks in the html output. =org-mime-export-options= supports the same options as documented in =org-export-options-alist=. +#+begin_src emacs-lisp +(use-package org-mime + :straight t + :custom ((org-mime-export-options + '(:with-latex dvipng + :preserve-breaks t)))) +#+end_src *** Ricing #+begin_src emacs-lisp (setq line-spacing 0.1) -- cgit v1.2.3 From 752cb4b2dd35d44a8fdc456b7a687af7b409cdbe Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 28 Jun 2021 13:03:18 +0200 Subject: Update redtick settings --- emacs-init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 3708819..bdfa91b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5766,6 +5766,13 @@ Saves to a temp file and puts the filename in the kill ring." #+begin_src emacs-lisp (use-package redtick :straight t + :custom + ((redtick-sound-volume "20") + (redtick-play-sound t) + (redtick-work-interval (* 60 20)) + (redtick-rest-interval (* 60 5)) + (redtick--workbar-interval (/ redtick-work-interval 8.0)) + (redtick--restbar-interval (/ redtick-rest-interval 8.0))) :config (redtick-mode 1)) #+end_src * Language settings -- cgit v1.2.3 From f8dabdea0773838c7a91302eefaba16a2cf3c967 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 28 Jun 2021 13:07:14 +0200 Subject: Add ssh-tunnels package --- emacs-init.org | 14 ++++++++++++++ emacs-private.el.gpg | Bin 1184 -> 1247 bytes 2 files changed, 14 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index bdfa91b..5355518 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -52,6 +52,7 @@ - [[#compile][Compile]] - [[#speed-reading][Speed reading]] - [[#context-aware-hydra][Context aware hydra]] + - [[#ssh-tunnels][SSH tunnels]] - [[#minor-utilities][Minor utilities]] - [[#language-settings][Language settings]] - [[#spellcheck][Spellcheck]] @@ -5737,6 +5738,19 @@ _q_ quit _r_ remove result _e_ examplify region ("/" ibuffer-filter-disable "disable") ("b" hydra-ibuffer-main/body "back" :color blue)) #+END_SRC +** SSH tunnels +#+begin_src emacs-lisp +(use-package ssh-tunnels + :straight t + :custom (ssh-tunnels-configurations + (cons `(:name "nntp" + :local-port 4321 + :remote-port 4321 + :login ,private/ssh-host-nntp + :host "localhost") + private/ssh-tunnels)) + :config (auto-ssh-tunnels-mode 1)) +#+end_src ** Minor utilities *** Screenshots / -casts [[https://gitlab.com/ambrevar/emacs-gif-screencast][Here]] is a guide to creating emacs gif screencasts. diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 1deb591..1ed5e4c 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 09c86c6776cbec5e540d29b5eddb460949dbdd1d Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 17:50:17 +0100 Subject: Rename ssh-tunnel logins/hosts --- emacs-init.org | 2 +- emacs-private.el.gpg | Bin 1247 -> 1250 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 5355518..b0ddc85 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5746,7 +5746,7 @@ _q_ quit _r_ remove result _e_ examplify region (cons `(:name "nntp" :local-port 4321 :remote-port 4321 - :login ,private/ssh-host-nntp + :login ,private/ssh-login-nntp :host "localhost") private/ssh-tunnels)) :config (auto-ssh-tunnels-mode 1)) diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 1ed5e4c..23af3d1 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 75974a50c7f0aae39a297808c914cb01da74411b Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 17:50:42 +0100 Subject: Add utf-8-unix encoding header to emacs-init --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index b0ddc85..b8a344a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1,3 +1,4 @@ +# -*- coding: utf-8-unix -*- #+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-init.el :results silent :noweb yes * Contents :QUOTE:TOC_2_gh: #+BEGIN_QUOTE -- cgit v1.2.3 From 91a384abe3d2c45336c633fdb0ae6342c566fbab Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 17:51:10 +0100 Subject: Fix misplaced parentheses in device definition --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index b8a344a..a5a265a 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -383,8 +383,8 @@ To support different settings on different devices storing some device informati ("xcarb" (:type mobile)) ("DESKTOP-PM1PPEC" - (:type mobile) - (:os win10)) + (:type mobile + :os win10)) )) (defun fpi/device-info (device prop) "Return property PROP of DEVICE as stored in `fpi/devices'." -- cgit v1.2.3 From 4ea4a0dca52927810b2f1f9e5c06d80cfc0728cd Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 17:52:14 +0100 Subject: git-annex: Override recipe and fix package loading --- emacs-init.org | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index a5a265a..5f26a68 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -240,6 +240,10 @@ with other package definition and customization. #+BEGIN_SRC emacs-lisp (setq straight-profiles `((nil . ,(expand-file-name "package-versions.el" "~/git/projects/dotfiles")))) +(setq straight-recipe-overrides + '(nil . ( + <> + ))) #+END_SRC **** straight.el documentation excerpts :PROPERTIES: @@ -2441,16 +2445,21 @@ of src_shell{getconf "PATH"}. See [[elisp:(describe-variable ** Git *** Git annex There are some great ressources on [[https://git-annex.branchable.com/][git-annex]] integration in emacs in [[https://github.com/mm--/dot-emacs/blob/master/jmm-emacs.org][Josh's config]]. Most of my configuration is copied from there. +#+begin_src emacs-lisp :noweb-ref straight-recipe-overrides :tangle no :eval never +(git-annex :type git :flavor melpa :host github :repo "jwiegley/git-annex-el") +#+end_src #+begin_src emacs-lisp (use-package git-annex - :straight t + :straight (:host github :repo "fpiper/git-annex-el" :branch "master") :config <> - :after (dired)) -(use-package git-annex + :after (dired) :bind (:map git-annex-dired-map <>) + (:map dired-mode-map + <> + ) ) #+end_src **** Actions to lock/unlock files @@ -2554,7 +2563,7 @@ When you use this in combination with ~dired-do-kill-lines~ (by default bound to "available file")) #+END_SRC **** Mark git-annex files with git-annex-matching-options -#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref dired-bindings +#+BEGIN_SRC emacs-lisp :tangle no :noweb-ref git-annex-dired-map-bindings ("% a" . jmm/dired-mark-files-git-annex-matching) #+END_SRC -- cgit v1.2.3 From 65271be8bebd41f112a623db7ec6b6d3fbbc6526 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:09:49 +0100 Subject: Add auto-insert package for file header templates --- emacs-init.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 5f26a68..f0631b9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -47,6 +47,7 @@ - [[#ledger][Ledger]] - [[#plotting-data][Plotting data]] - [[#html-renderer][HTML renderer]] + - [[#auto-insert][Auto-Insert]] - [[#email][Email]] - [[#footnote-mode][Footnote Mode]] - [[#bbdb][BBDB]] @@ -5314,6 +5315,15 @@ Support for HTML code blocks with proper syntax highlighting. See [[https://gith (advice-add 'eww-display-html :around 'eww-display-html--override-shr-external-rendering-functions)))) #+END_SRC +** Auto-Insert +#+begin_src emacs-lisp +(use-package autoinsert + :config + (define-auto-insert '("\\.sh\\'" . "Shell script skeleton") + '("" + "#!/usr/bin/env bash" \n \n)) + (auto-insert-mode 1)) +#+end_src ** Email For the setup of external mail specific programs see [[file:mail.org]]. *** Sending mail -- cgit v1.2.3 From fcb669cc7bc705bff391fa02ffd6898170b2b26a Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:19:05 +0100 Subject: Redtick make updated intervals work & change recipe --- emacs-init.org | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index f0631b9..9fa2fb9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5799,14 +5799,33 @@ Saves to a temp file and puts the filename in the kill ring." *** Pomodoro / Redtick #+begin_src emacs-lisp (use-package redtick - :straight t + :straight (:host github :repo "fpiper/redtick" + :branch "dev") :custom ((redtick-sound-volume "20") (redtick-play-sound t) (redtick-work-interval (* 60 20)) (redtick-rest-interval (* 60 5)) (redtick--workbar-interval (/ redtick-work-interval 8.0)) - (redtick--restbar-interval (/ redtick-rest-interval 8.0))) + (redtick--restbar-interval (/ redtick-rest-interval 8.0)) + (redtick--bars + `((,redtick--workbar-interval "█" "#ffff66") + (,redtick--workbar-interval "▇" "#ffcc66") + (,redtick--workbar-interval "▆" "#cc9966") + (,redtick--workbar-interval "▅" "#ff9966") + (,redtick--workbar-interval "▄" "#cc6666") + (,redtick--workbar-interval "▃" "#ff6666") + (,redtick--workbar-interval "▂" "#ff3366") + (,redtick--workbar-interval "▁" "#ff0066") + (,redtick--restbar-interval "█" "#00cc66") + (,redtick--restbar-interval "▇" "#33cc66") + (,redtick--restbar-interval "▆" "#66cc66") + (,redtick--restbar-interval "▅" "#00ff66") + (,redtick--restbar-interval "▄" "#33ff66") + (,redtick--restbar-interval "▃" "#66ff66") + (,redtick--restbar-interval "▂" "#99ff66") + (,redtick--restbar-interval "▁" "#ccff66") + (nil "✓" "#cf6a4c")))) :config (redtick-mode 1)) #+end_src * Language settings -- cgit v1.2.3 From 74718e20301e78a5feffbef96e0e4337acc94c44 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:21:26 +0100 Subject: Add auto +x on scripts and move auto-insert --- emacs-init.org | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 9fa2fb9..d388b47 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -47,7 +47,6 @@ - [[#ledger][Ledger]] - [[#plotting-data][Plotting data]] - [[#html-renderer][HTML renderer]] - - [[#auto-insert][Auto-Insert]] - [[#email][Email]] - [[#footnote-mode][Footnote Mode]] - [[#bbdb][BBDB]] @@ -5828,6 +5827,22 @@ Saves to a temp file and puts the filename in the kill ring." (nil "✓" "#cf6a4c")))) :config (redtick-mode 1)) #+end_src +*** Script creation +Automatically make scripts executable upon save if first line is a shebang: +#+begin_src emacs-lisp +(add-hook 'after-save-hook + 'executable-make-buffer-file-executable-if-script-p) +#+end_src + +The =Auto-Insert= package helps inserting header templates upon creating files. +#+begin_src emacs-lisp +(use-package autoinsert + :config + (define-auto-insert '("\\.sh\\'" . "Shell script skeleton") + '("" + "#!/usr/bin/env bash" \n \n)) + (auto-insert-mode 1)) +#+end_src * Language settings End sentences with single spaces. #+begin_src emacs-lisp -- cgit v1.2.3 From eeb68ce022f3b1387d607865a7293dca96c2eb59 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:22:19 +0100 Subject: Add new device --- emacs-init.org | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index d388b47..a445d31 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -381,7 +381,10 @@ To support different settings on different devices storing some device informati #+begin_src emacs-lisp (setq fpi/current-device (system-name)) (setq fpi/devices - '(("pan" + '(("peter" + (:type desktop + :os win10)) + ("pan" (:type desktop :wm exwm)) ("xcarb" @@ -5314,15 +5317,6 @@ Support for HTML code blocks with proper syntax highlighting. See [[https://gith (advice-add 'eww-display-html :around 'eww-display-html--override-shr-external-rendering-functions)))) #+END_SRC -** Auto-Insert -#+begin_src emacs-lisp -(use-package autoinsert - :config - (define-auto-insert '("\\.sh\\'" . "Shell script skeleton") - '("" - "#!/usr/bin/env bash" \n \n)) - (auto-insert-mode 1)) -#+end_src ** Email For the setup of external mail specific programs see [[file:mail.org]]. *** Sending mail -- cgit v1.2.3 From e6c56302241ceef4621502be3d9e52f705e60649 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:27:08 +0100 Subject: Update smime configuration --- emacs-init.org | 31 +++++++++++++++++++++---------- emacs-private.el.gpg | Bin 1250 -> 1271 bytes 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index a445d31..ddfb754 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5363,25 +5363,36 @@ I use =msmtp= to send mail. **** S/MIME Mail signing and encrypting with S/MIME needs a =gpgsm= setup and =smime.el=. -One can either use =EasyPG= or =OpenSSL= as external implementations. -#+begin_src emacs-lisp :tangle no -(mml-smime-use 'epg) -#+end_src - -#+begin_src emacs-lisp :tangle no -(mml-default-encrypt-method "smime") -(mml-default-sign-method "smime") +One can either use =EasyPG= or =OpenSSL= as external implementations. Still need to document these settings and packages better.. +#+begin_src emacs-lisp +(use-package epg + :custom (epg-pinentry-mode nil)) +(use-package mml-sec + :custom + (mml-default-encrypt-method "smime") + (mml-default-sign-method "smime") + (mml-secure-cache-passphrase nil) + (mml-secure-passphrase-cache-expiry 16) + ) +(use-package mml-smime + :custom + (mml-smime-use 'epg) + (mml-secure-smime-sign-with-sender t) +) #+end_src - - #+begin_src emacs-lisp :tangle no (use-package smime :custom (smime-CA-directory "~/certs/trusted") (smime-certificate-directory "~/certs") + (smime-keys private/smime-keys) ) #+end_src + +#+begin_src emacs-lisp :tangle no +(setq mm-sign-option 'guided) +#+end_src *** MUA/Notmuch After using =mu4e= as my mail user agent for a while I switched to diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 23af3d1..a930f89 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ -- cgit v1.2.3 From 725d9ad283f224f28416cbfcaedba5b20debc735 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 16 Jul 2020 08:39:19 +0200 Subject: Update todo keywords for projects, ... Add ACTIVE keyword to use for projects. HOLD for project tasks waiting for other tasks. --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index ddfb754..ab63576 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3550,7 +3550,7 @@ digraph hierarch{ #+begin_src emacs-lisp :noweb-ref org-custom :tangle no (org-todo-keywords '((sequence "HOLD(h)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") ;;todos - (sequence "PLANNING(p)" "TODO(t)" "ACTIVE(a)" "|" "CANCELLED(c)" "DONE(d)") ;;projects + (sequence "PLANNING(p)" "READY(r)" "ACTIVE(a)" "|" "CANCELLED(c)" "DONE(d)") ;;projects (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)" "DONE(d)") (sequence "TODO(t)" "|" "DONE(d)") ;;habits (sequence "IDLE(b)"))) -- cgit v1.2.3 From 280a802ee65020c749a16dfc21bcc08a087ebcfe Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 17 Jul 2020 17:02:48 +0200 Subject: Fix my agenda span definition --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index ab63576..4c978e2 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3630,7 +3630,7 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (org-deadline-warning-days 0) (org-agenda-todo-ignore-timestamp 'all) (org-agenda-start-day "+0d") - (org-agenda-span 1) + (org-agenda-span 'day) (org-agenda-overriding-header "⚡ Schedule:\n⎺⎺⎺⎺⎺⎺⎺⎺⎺") (org-agenda-repeating-timestamp-show-all nil) (org-agenda-remove-tags t) -- cgit v1.2.3 From 8bfe1e0a12543899f9139ce34837579de006627a Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 17 Jul 2020 18:19:55 +0200 Subject: Start work on todo, tag, agenda reorganization --- emacs-init.org | 167 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 100 insertions(+), 67 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 4c978e2..5a77514 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3311,24 +3311,6 @@ I use a org version with some custom patches. Rather than using something like = (org-use-speed-commands (lambda () (and (looking-at org-outline-regexp) (looking-back "^\**")))) (org-pretty-entities t) (org-fast-tag-selection-single-key t) - (org-tag-alist (quote ((:startgroup) - ("@errand" . ?e) - ("@office" . ?o) - ("@home" . ?H) - (:endgroup) - ("IDLE" . ?i) - ("shelf" . ?s) - ("soon" . ?t) - ("project" . ?p) - ;; ("HOLD" . ?h) - ;; ("PERSONAL" . ?P) - ("WORK" . ?W) - ;; ("ORG" . ?O) - ("crypt" . ?E) - ("NOTE" . ?n) - ;; ("CANCELLED" . ?c) - ("FLAGGED" . ??) - ))) (org-link-abbrev-alist '(("google" . "http://www.google.com/search?q=") ("ddg" . "https://duckduckgo.com/?q=") @@ -3338,7 +3320,6 @@ I use a org version with some custom patches. Rather than using something like = (org-outline-path-complete-in-steps nil) (org-log-into-drawer "NOTES") (org-clock-into-drawer "LOGBOOK") - (org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) (org-tags-column 0) (org-tags-exclude-from-inheritance '( <> @@ -3348,18 +3329,8 @@ I use a org version with some custom patches. Rather than using something like = (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) ;; (add-to-list 'org-tags-exclude-from-inheritance "MARKED") - (defun bh/clock-in-to-inprogress (kw) - "Switch a task from NEXT to INPROGRESS when clocking in. -Skips capture tasks, projects, and subprojects. -Switch projects and subprojects from NEXT back to TODO" - (when (not (and (boundp 'org-capture-mode) org-capture-mode)) - (cond - ((and (member (org-get-todo-state) (list "NEXT")) - (bh/is-task-p)) - "INPROGRESS") - ((and (member (org-get-todo-state) (list "NEXT")) - (bh/is-project-p)) - "INPROGRESS"))))) + <> + ) <> <> @@ -3513,7 +3484,10 @@ Use imagemagick and standalone class for latex preview. :delight) #+end_src *** Task organization -**** Todo settings +Much of my current task workflow is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt +Hansen's]] configs. +**** =[WIP]= Task Setup +***** Todos - WAITING tasks are waiting on the completion of other tasks - NEXT tasks can be picked up - INPROGRESS are current tasks with time clocked @@ -3524,35 +3498,36 @@ TODO->DONE cycle is for habits.\\ Idle states cover things to do for time in between, checking the inbox, reading news, … -Phonecalls? - #+BEGIN_SRC dot :file /tmp/todo.png -digraph hierarch{ +digraph hierarch { node [shape=box] - // Tasks, Projects - PLANNING -> NEXT, INPROGRESS, ICEBOX - WAITING -> NEXT -> INPROGRESS -> DONE, WAITING, ICEBOX - NEXT -> WAITING -> INPROGRESS, ICEBOX + // Projects + PLANNING -> READY -> ACTIVE -> DONE, ICEBOX + // Tasks + HOLD -> NEXT -> INPROGRESS -> DONE, ICEBOX NEXT -> ICEBOX, DONE + NEXT -> WAITING -> NEXT + INPROGRESS -> WAITING -> INPROGRESS - // stuff for idle time IDLE -> IDLE - //NEXT -> DONE + TODO -> DONE -> TODO - // Phonecalls, Meetings - PHONE -> DONE, CANCELED - MEETING -> DONE, CANCELED + { rank = source; PLANNING; HOLD } + { rank = same; READY; NEXT; TODO; IDLE } + { rank = same; ACTIVE; INPROGRESS } + { rank = sink; ICEBOX; DONE } } #+END_SRC #+RESULTS: [[file:/tmp/todo.png]] + #+begin_src emacs-lisp :noweb-ref org-custom :tangle no (org-todo-keywords '((sequence "HOLD(h)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") ;;todos - (sequence "PLANNING(p)" "READY(r)" "ACTIVE(a)" "|" "CANCELLED(c)" "DONE(d)") ;;projects - (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELLED(c)" "DONE(d)") - (sequence "TODO(t)" "|" "DONE(d)") ;;habits + (sequence "PLANNING(p)" "READY(r)" "ACTIVE(a!)" "|" "ICEBOX(x@)" "DONE(d)") ;;projects + ;; (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELED(c)" "DONE(d)") + (sequence "TODO(t)" "|" "DONE(d)") (sequence "IDLE(b)"))) (org-use-fast-todo-selection t) (org-todo-keyword-faces @@ -3563,37 +3538,69 @@ digraph hierarch{ ("DONE" :foreground "forest green" :weight bold) ("WAITING" :foreground "orange" :weight bold) ("ICEBOX" :foreground "orange" :weight normal) - ("CANCELLED" :foreground "forest green" :weight bold) - ("MEETING" :foreground "yellow3" :weight bold) - ("PHONE" :foreground "yellow3" :weight bold) + ;; ("CANCELLED" :foreground "forest green" :weight bold) + ;; ("MEETING" :foreground "yellow3" :weight bold) + ;; ("PHONE" :foreground "yellow3" :weight bold) ("IDLE" :foreground "magenta" :weight bold))) #+end_src - +****** Automatically do =NEXT→INPROGRESS= / =READY→ACTIVE= Switch a todo entry from NEXT to INPROGRESS when clocking in. -#+begin_src emacs-lisp :tangle no -(setq org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) +#+begin_src emacs-lisp :tangle no :noweb-ref org-config (defun bh/clock-in-to-inprogress (kw) "Switch a task from NEXT to INPROGRESS when clocking in. -Skips capture tasks, projects, and subprojects. -Switch projects and subprojects from NEXT back to TODO" +Switch projects from READY to ACTIVE." (when (not (and (boundp 'org-capture-mode) org-capture-mode)) (cond - ((and (member (org-get-todo-state) (list "NEXT")) - (bh/is-task-p)) + ((member (org-get-todo-state) (list "NEXT")) "INPROGRESS") - ((and (member (org-get-todo-state) (list "NEXT")) - (bh/is-project-p)) - "INPROGRESS")))) + ((member (org-get-todo-state) (list "READY")) + "ACTIVE")))) #+end_src -***** State changes +#+begin_src emacs-lisp :tangle no :noweb-ref org-custom +(org-clock-in-switch-to-state 'bh/clock-in-to-inprogress) +#+end_src +****** State changes Track state changes to done & changes to schedules and deadlines. #+begin_src emacs-lisp :tangle no :noweb-ref org-custom (org-log-done 'time) (org-log-redeadline 'time) (org-log-reschedule 'time) #+end_src -**** Org agenda custom commands -***** Task-related agendas +***** Tags +Inspired by [[https://bzg.fr/en/some-emacs-org-mode-features-you-may-not-know.html/][Bastien Guerry]], [[https://github.com/jwiegley/dot-emacs][John Wiegley]]. +#+begin_src emacs-lisp :tangle no :noweb-ref org-custom +(org-tag-alist (quote (("HOT" . ?h) + (:startgroup) ;; Location + ("@errand" . ?E) ("@office" . ?O) ("@home" . ?H) + (:endgroup) + (:startgrouptag) ;; context tags + ("net" . ?n) ("call" . ?c) ("reply" . ?R) + (:endgrouptag) + (:startgroup) + ("handson" . ?o) ;; For focused/active tasks + (:grouptags) + ;; ("code" . ?c) ("design" . ?d) ("review" . ?v) + (:endgroup) + (:startgroup) + ("handsoff" . ?f) ;; For listening/passive tasks + (:grouptags) + ("read" . ?r) ("watch" . ?w) + (:endgroup) + ("crypt" . ?E) + ("FLAGGED" . ??) + ))) +#+end_src +***** INPROGRESS Custom Agendas +- John Wiegley: Different background colors for different source files +****** General +- "h": Next action for hot projects +- Project Next actions agenda +- "P": All Projects +- "r": uncategorized items (CATEGORY="Inbox"&LEVEL=2) +- "w": waiting/delegated tasks (W-TODO="DONE"|TODO={WAITING\|DELEGATED}) +- Unscheduled tasks (TODO<>""&TODO<>{DONE\|CANCELED\|NOTE\|PROJECT\|DEFERRED\|SOMEDAY}) +- "c": Appointment calendar +****** Task-related agendas Simple day agenda with =INPROGRESS= tasks #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("d" "Day agenda" @@ -3617,7 +3624,7 @@ Agenda with all open tasks (todo "IDLE") (tags-todo "-habit-shelve-soon-idle"))) #+end_src -****** Fancy agenda to choose todays tasks +******* Fancy agenda to choose todays tasks Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("o" "My Agenda" @@ -3671,7 +3678,7 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (not (= scheduled-day now)))) subtree-end))) #+end_src -***** Week agendas +****** Week agendas #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("w" . "Week agendas") ("ww" "Standard week agenda" @@ -3681,7 +3688,7 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (org-agenda-start-day "mon"))) (tags-todo "+work"))) #+end_src -***** Misc agendas +****** Misc agendas #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("r" "Refile entries" ((tags "+REFILE"))) ("i" "Idle Actions" @@ -3708,6 +3715,31 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. (alltodo "" ((org-agenda-files (fpi/collect-org-directories-recursively default-directory)))))) #+end_src +***** Filtering +****** Auto Exclude +#+begin_src emacs-lisp +;; https://github.com/jwiegley/dot-emacs/blob/master/dot-org.el +(defun org-my-auto-exclude-function (tag) + (and (cond + ((string= tag "call") + (let ((hour (nth 2 (decode-time)))) + (or (< hour 8) (> hour 21)))) + ((string= tag "errand") + (let ((hour (nth 2 (decode-time)))) + (or (< hour 12) (> hour 17)))) + ((or (string= tag "home") (string= tag "nasim")) + (with-temp-buffer + (call-process "ifconfig" nil t nil "en0" "inet") + (call-process "ifconfig" nil t nil "en1" "inet") + (call-process "ifconfig" nil t nil "bond0" "inet") + (goto-char (point-min)) + (not (re-search-forward "inet 192\\.168\\.1\\." nil t)))) + ((string= tag "net") + (not (quickping "imap.fastmail.com"))) + ((string= tag "fun") + org-clock-current-task)) + (concat "-" tag))) +#+end_src **** Refile Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. Also include the current file's headings as a refile targets up to a deep level, all agenda files up to a small level and all open org files up to an even smaller level. @@ -4872,6 +4904,7 @@ Basic flow: 3. Do stuff. Change clocks, capture stuff, take notes, take breaks, … 4. At the end of the day clock out with ~bh/punch-out~. +**** Clocking While punched in org continues to clock your time. Each time you clock out of an entry it clocks you in on the parent entry or the default organizational task. @@ -5004,6 +5037,7 @@ Add a note to the current clock (org-clock-goto) (org-add-note))) #+END_SRC +**** General Go to any heading in an agenda file (or more specifically in any file included in 'org-refile-targets) #+begin_src emacs-lisp @@ -5017,7 +5051,6 @@ included in 'org-refile-targets) (org-show-context) (current-buffer))) #+END_SRC - **** Filter functions Various functions to determine if the current entry is a task, a project or neither. -- cgit v1.2.3 From 74c6784508e1e95378711ac331b6af4fa92663c5 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 22 Jul 2020 10:28:39 +0200 Subject: Add general project functions & agendas by jwiegley --- emacs-init.org | 187 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 185 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 5a77514..5d73324 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3414,6 +3414,9 @@ I use a org version with some custom patches. Rather than using something like = (org-src-fontify-natively t) (org-src-tab-acts-natively t) (org-edit-src-content-indentation 0)) +#+end_src + +#+begin_src emacs-lisp (defun fpi/collect-org-directories-recursively (dir) "Return list of all directories which contain .org files of DIR and its subdirectories" (delete-dups (mapcar 'file-name-directory (directory-files-recursively dir "\.org$")))) @@ -3443,7 +3446,10 @@ I use a org version with some custom patches. Rather than using something like = (org-agenda-custom-commands `( <> - ))) + )) + :config + <> + ) #+end_src #+begin_src emacs-lisp @@ -3522,13 +3528,21 @@ digraph hierarch { #+RESULTS: [[file:/tmp/todo.png]] +#+begin_src emacs-lisp :noweb-ref org-config :tangle no +(defvar org-task-keywords + '("HOLD" "NEXT" "INPROGRESS" "WAITING") + "Org todo keywords to demark tasks") +(defvar org-project-keywords + '("PLANNING" "READY" "ACTIVE") + "Org todo keywords to demark projects") +#+end_src #+begin_src emacs-lisp :noweb-ref org-custom :tangle no (org-todo-keywords '((sequence "HOLD(h)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") ;;todos (sequence "PLANNING(p)" "READY(r)" "ACTIVE(a!)" "|" "ICEBOX(x@)" "DONE(d)") ;;projects ;; (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELED(c)" "DONE(d)") (sequence "TODO(t)" "|" "DONE(d)") - (sequence "IDLE(b)"))) + (sequence "IDLE(b)" "|"))) (org-use-fast-todo-selection t) (org-todo-keyword-faces '(("HOLD" :foreground "light gray" :weight bold) @@ -3590,6 +3604,28 @@ Inspired by [[https://bzg.fr/en/some-emacs-org-mode-features-you-may-not-know.ht ("FLAGGED" . ??) ))) #+end_src +Exclude =HOT= from inheritance +#+begin_src emacs-lisp :tangle no :noweb-ref org-custom-no-inheritance-tags +"HOT" +#+end_src +***** Creating projects +#+begin_src emacs-lisp +(defun fpi/make-parent-project () + (when (or (string-equal org-state "NEXT") + (string-equal org-state "HOLD") + (string-equal org-state "INPROGRESS") + (string-equal org-state "WAITING")) + ;; Activate parent + (org-up-element) + (let ((todo (org-entry-is-todo-p))) + (when todo + (org-todo "ACTIVE") + ;; (end-of-line) + ;; (insert " [0/0]") + (org-update-statistics-cookies nil) + )) + )) +#+end_src ***** INPROGRESS Custom Agendas - John Wiegley: Different background colors for different source files ****** General @@ -3602,6 +3638,153 @@ Inspired by [[https://bzg.fr/en/some-emacs-org-mode-features-you-may-not-know.ht - "c": Appointment calendar ****** Task-related agendas Simple day agenda with =INPROGRESS= tasks +******* Hot Projects +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("h" "Current Hotlist" tags "TODO={NEXT\\|INPROGRESS\\|WAITING}" + ((org-agenda-overriding-header "Current Hotlist") + (org-agenda-skip-function + (function fpi/org-agenda-skip-all-not-hot)))) +#+end_src +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-config +(defun fpi/org-agenda-skip-all-not-hot () + "Skip all not hot entries." + (when (not (member "HOT" (my-org-current-tags 1))) + (or (outline-next-heading) + (goto-char (point-max))))) +(defun fpi/org-agenda-skip-all-not-project () + "Skip all not hot entries." + (when (not (member "HOT" (my-org-current-tags 1))) + (or (outline-next-heading) + (goto-char (point-max))))) +(defun my-org-current-tags (depth) + (save-excursion + (ignore-errors + (let (should-skip) + (while (and (> depth 0) + (not should-skip) + (prog1 + (setq depth (1- depth)) + (not (org-up-element)))) + (if (looking-at "^\*+\\s-+") + (setq should-skip (org-get-local-tags)))) + should-skip)))) +(defun fpi/org-goto-top-project (depth) + "Go to the top project of heading under point" + (save-restriction + (widen) + (let ((top (point))) + (with-demoted-errors + (while (and (> depth 0) + (progn + (setq depth (1- depth)) + (not (org-up-element)))) + (when (fpi/is-not-done-project-p) + (setq top (point))))) + (goto-char top)))) +(defun fpi/parent-is-not-done-project-p () + "Return t if parent heading is a not done project." + (save-excursion + (save-restriction + (widen) + (and (not (org-up-element)) + (fpi/is-not-done-project-p))))) +(defun fpi/is-not-done-project-p () + "Return t if current heading is a not done project." + (save-restriction + (widen) + (let ((todo (org-get-todo-state))) + (member todo org-project-keywords)))) +#+end_src +To narrow the agenda to the currently selected project this function from [[https://github.com/mm--/dot-emacs/blob/master/jmm-org-config.org][Josh's emacs config]] is useful. +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-config +(defun fpi/org-agenda-lock-to-parent-project () + "In the org mode agenda, lock the restriction to the current project." + (interactive) + (save-window-excursion + (org-agenda-goto) + (if (fpi/org-goto-top-project 10) + (org-agenda-set-restriction-lock) + (user-error "No parent project found."))) + (org-agenda-redo-all)) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("H" "Hot Projects" tags "HOT&TODO={PLANNING\\|READY\\|ACTIVE}" + ((org-agenda-overriding-header "Hot Projects"))) +("T" "Non-Hot Projects" tags "-HOT&TODO={ACTIVE}" + ((org-agenda-overriding-header "Non-Hot Projects"))) +("P" "All Projects" + ((tags "HOT&TODO={PLANNING\\|READY\\|ACTIVE}" + ((org-agenda-overriding-header "Hot Projects"))) + (tags "-HOT&TODO={PLANNING\\|READY\\|ACTIVE}" + ((org-agenda-overriding-header "Non-Hot Projects"))) + )) +#+end_src +******* +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("n" "Project Next Actions" alltodo "" + ((org-agenda-overriding-header "Current Hotlist") + (org-agenda-skip-function + (function fpi/org-agenda-skip-all-not-hot)))) +#+end_src +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands-wiegley +("A" "Priority #A tasks" agenda "" + ((org-agenda-ndays 1) + (org-agenda-overriding-header "Today's priority #A tasks: ") + (org-agenda-skip-function + (quote + (org-agenda-skip-entry-if + (quote notregexp) + "\\=.*\\[#A\\]"))))) +("b" "Priority #A and #B tasks" agenda "" + ((org-agenda-ndays 1) + (org-agenda-overriding-header "Today's priority #A and #B tasks: ") + (org-agenda-skip-function + (quote + (org-agenda-skip-entry-if + (quote regexp) + "\\=.*\\[#C\\]"))))) +("r" "Uncategorized items" tags "CATEGORY=\"Inbox\"&LEVEL=2" + ((org-agenda-overriding-header "Uncategorized items"))) +("W" "Waiting/delegated tasks" tags "W-TODO=\"DONE\"|TODO={WAITING\\|DELEGATED}" + ((org-agenda-overriding-header "Waiting/delegated tasks:") + (org-agenda-skip-function + (quote + (org-agenda-skip-entry-if + (quote scheduled)))) + (org-agenda-sorting-strategy + (quote + (todo-state-up priority-down category-up))))) +("D" "Deadlined tasks" tags "TODO<>\"\"&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT}" + ((org-agenda-overriding-header "Deadlined tasks: ") + (org-agenda-skip-function + (quote + (org-agenda-skip-entry-if + (quote notdeadline)))) + (org-agenda-sorting-strategy + (quote + (category-up))))) +("S" "Scheduled tasks" tags "TODO<>\"\"&TODO<>{APPT\\|DONE\\|CANCELED\\|NOTE\\|PROJECT}&STYLE<>\"habit\"" + ((org-agenda-overriding-header "Scheduled tasks: ") + (org-agenda-skip-function + (quote + (org-agenda-skip-entry-if + (quote notscheduled)))) + (org-agenda-sorting-strategy + (quote + (category-up))))) +("d" "Unscheduled open source tasks (by date)" tags "TODO<>\"\"&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT}" + ((org-agenda-overriding-header "Unscheduled Open Source tasks (by date): ") + (org-agenda-skip-function + (quote + (org-agenda-skip-entry-if + (quote scheduled) + (quote deadline) + (quote timestamp) + (quote regexp) + "\\* \\(DEFERRED\\|SOMEDAY\\)"))))) +#+end_src + #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("d" "Day agenda" ((agenda "" ((org-agenda-span 'day))) -- cgit v1.2.3 From e37bd5af68b9fc4ab60dae924c90f74ff81640d1 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 29 Jul 2020 11:34:51 +0200 Subject: Include tasks of subprojects in current hotlist --- emacs-init.org | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 5d73324..ce6b6a6 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3642,13 +3642,14 @@ Simple day agenda with =INPROGRESS= tasks #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("h" "Current Hotlist" tags "TODO={NEXT\\|INPROGRESS\\|WAITING}" ((org-agenda-overriding-header "Current Hotlist") - (org-agenda-skip-function - (function fpi/org-agenda-skip-all-not-hot)))) + (org-agenda-skip-function (function fpi/org-agenda-skip-all-not-hot)) + ;; (org-agenda-prefix-format " %-3i %-12:c%30b %s") + )) #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-config (defun fpi/org-agenda-skip-all-not-hot () "Skip all not hot entries." - (when (not (member "HOT" (my-org-current-tags 1))) + (when (not (member "HOT" (my-org-current-tags (fpi/org-project-depth 10)))) (or (outline-next-heading) (goto-char (point-max))))) (defun fpi/org-agenda-skip-all-not-project () @@ -3668,6 +3669,14 @@ Simple day agenda with =INPROGRESS= tasks (if (looking-at "^\*+\\s-+") (setq should-skip (org-get-local-tags)))) should-skip)))) +(defun fpi/org-project-depth (depth) + "Return number of subheadings before reaching top project." + (let ((current (org-current-level)) + (top (save-excursion + (fpi/org-goto-top-project depth) + (org-current-level)))) + (- current top) + )) (defun fpi/org-goto-top-project (depth) "Go to the top project of heading under point" (save-restriction -- cgit v1.2.3 From 9d6dc81da42a928200f332b11831479677ceeaa8 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 1 Aug 2020 18:14:36 +0200 Subject: Set custom scheduled leaders for the agenda --- emacs-init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs-init.org b/emacs-init.org index ce6b6a6..0206424 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3441,6 +3441,7 @@ I use a org version with some custom patches. Rather than using something like = (org-agenda-skip-scheduled-if-done t) (org-agenda-dim-blocked-tasks t) (org-sort-agenda-notime-is-late t) + (org-agenda-scheduled-leaders '(" ➫" "➫ ")) ;; alternatives if font supports them: 👉🖝🕣🕣 ;; See emacs.christianbaeuerlein.com/my-org-config.html (org-agenda-block-separator 9472) (org-agenda-custom-commands -- cgit v1.2.3 From 7dde44dfe6c35bd1496d7e8faf46fbf64e346ce0 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 3 Aug 2020 18:04:52 +0200 Subject: Customize stuck project definition --- emacs-init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 0206424..4e51fb5 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3448,6 +3448,7 @@ I use a org version with some custom patches. Rather than using something like = `( <> )) + <> :config <> ) @@ -3933,6 +3934,16 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. org-clock-current-task)) (concat "-" tag))) #+end_src +****** Stuck projects +The agenda can also list stuck projects with =C-c a #=. For this to be useful we have define what a stuck project is. + +A stuck project +1. has any todo state of the states listed in ~org-project-keywords~ +2. does /not/ have a subtask with a state of =TODO=, =NEXT= or =INPROGRESS=. + +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom +(org-stuck-projects '("/+{PLANNING\\|READY\\|ACTIVE}" ("TODO" "NEXT" "INPROGRESS") nil "")) +#+end_src **** Refile Use the full outline path so I can distinguish headlines with the same name & disable step-wise completion as I think from the refile target backwards, not from top-level downwards. Also include the current file's headings as a refile targets up to a deep level, all agenda files up to a small level and all open org files up to an even smaller level. -- cgit v1.2.3 From d13d8625e24983bb40f0fa461fc7fb11abbaee50 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 3 Aug 2020 18:05:02 +0200 Subject: Do not show waiting tasks in hotlist --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4e51fb5..bf3a3a0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3642,7 +3642,7 @@ Exclude =HOT= from inheritance Simple day agenda with =INPROGRESS= tasks ******* Hot Projects #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands -("h" "Current Hotlist" tags "TODO={NEXT\\|INPROGRESS\\|WAITING}" +("h" "Current Hotlist" tags "TODO={NEXT\\|INPROGRESS}" ((org-agenda-overriding-header "Current Hotlist") (org-agenda-skip-function (function fpi/org-agenda-skip-all-not-hot)) ;; (org-agenda-prefix-format " %-3i %-12:c%30b %s") -- cgit v1.2.3 From 85ee7d8ec0caf486155bb914c6ec84dbf5f3342f Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 4 Aug 2020 15:15:56 +0200 Subject: Add edna trigger for project subtasks --- emacs-init.org | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index bf3a3a0..3fdf738 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4402,14 +4402,21 @@ the newly set value. Open the PROPERTIES drawer." (interactive) (jmm/org-edna-set-trigger-and-point (format "link-ids(\"%s\")%s" (jmm/org-pop-stored-link) (if rest (concat " " rest) "")))) - (defhydra jmm/org-edna-hydra (:color blue) - "Org Edna" - ("l" jmm/org-edna-link "Link") - ("L" (jmm/org-edna-link "todo!(NEXT)") "Link NEXT") - ("n" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT)") "Next sibling NEXT") - ("N" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\")") "Chain next-sibling NEXT") - ("p" (jmm/org-edna-set-trigger-and-point "parent todo!(DONE)") "Parent DONE") - ("q" nil "cancel"))) + (defhydra fpi/org-edna-hydra (:color blue :hint nil) + " +Org Edna + _l_: Link _P_: N+p + _L_: Link NEXT _p_: Parent DONE + _n_: Sibling NEXT ^ ^ + _N_: Chain sibling NEXT _q_: quit +" + ("l" jmm/org-edna-link) + ("L" (jmm/org-edna-link "todo!(NEXT)")) + ("n" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT)")) + ("N" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\")")) + ("P" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\") if siblings then parent todo!(DONE) endif")) + ("p" (jmm/org-edna-set-trigger-and-point "parent todo!(DONE)")) + ("q" nil))) #+end_src *** org-attach =org-attach= is useful to attach reference material to org files. This can be reference images, data or other files. A special link type is available for attached files: ~[[attachment:file]]~. @@ -5810,7 +5817,7 @@ based on the current mode and context around point. (etype (car elem)) (type (org-element-property :type elem))) (cl-case etype - (headline (jmm/org-edna-hydra/body)) + (headline (fpi/org-edna-hydra/body)) (src-block (hydra-babel-helper/body)) (link (hydra-org-link-helper/body)) ((table-row table-cell) (hydra-org-table-helper/body) ) -- cgit v1.2.3 From 0a7af5151e41e1b44803f1dfef5853e8af00774d Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Sep 2020 15:48:30 +0200 Subject: Add a REVIEW todo state & fix project functions --- emacs-init.org | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 3fdf738..bab1714 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3519,6 +3519,7 @@ digraph hierarch { IDLE -> IDLE TODO -> DONE -> TODO + INPROGRESS -> REVIEW -> DONE { rank = source; PLANNING; HOLD } { rank = same; READY; NEXT; TODO; IDLE } @@ -3532,7 +3533,7 @@ digraph hierarch { #+begin_src emacs-lisp :noweb-ref org-config :tangle no (defvar org-task-keywords - '("HOLD" "NEXT" "INPROGRESS" "WAITING") + '("HOLD" "NEXT" "INPROGRESS" "REVIEW" "WAITING") "Org todo keywords to demark tasks") (defvar org-project-keywords '("PLANNING" "READY" "ACTIVE") @@ -3540,7 +3541,7 @@ digraph hierarch { #+end_src #+begin_src emacs-lisp :noweb-ref org-custom :tangle no -(org-todo-keywords '((sequence "HOLD(h)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "|" "ICEBOX(x@)" "DONE(d)") ;;todos +(org-todo-keywords '((sequence "HOLD(h)" "NEXT(n)" "INPROGRESS(i!)" "WAITING(w@/!)" "REVIEW(r!)" "|" "ICEBOX(x@)" "DONE(d)") ;;todos (sequence "PLANNING(p)" "READY(r)" "ACTIVE(a!)" "|" "ICEBOX(x@)" "DONE(d)") ;;projects ;; (sequence "PHONE(P)" "MEETING(m)" "|" "CANCELED(c)" "DONE(d)") (sequence "TODO(t)" "|" "DONE(d)") @@ -3550,6 +3551,7 @@ digraph hierarch { '(("HOLD" :foreground "light gray" :weight bold) ("NEXT" :foreground "light blue" :weight bold) ("INPROGRESS" :foreground "burlywood" :weight bold) + ("REVIEW" :foreground "light goldenrod" :weight bold) ("ACTIVE" :foreground "chocolate" :weight bold) ("DONE" :foreground "forest green" :weight bold) ("WAITING" :foreground "orange" :weight bold) @@ -3664,12 +3666,11 @@ Simple day agenda with =INPROGRESS= tasks (ignore-errors (let (should-skip) (while (and (> depth 0) - (not should-skip) (prog1 (setq depth (1- depth)) (not (org-up-element)))) (if (looking-at "^\*+\\s-+") - (setq should-skip (org-get-local-tags)))) + (setq should-skip (append should-skip (org-get-local-tags))))) should-skip)))) (defun fpi/org-project-depth (depth) "Return number of subheadings before reaching top project." -- cgit v1.2.3 From 479bf27165a92ee95559e5c83a9c04fb85aef652 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 21 Sep 2020 22:02:43 +0200 Subject: Fix agenda view of all projects --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index bab1714..c209501 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3723,7 +3723,7 @@ To narrow the agenda to the currently selected project this function from [[http #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("H" "Hot Projects" tags "HOT&TODO={PLANNING\\|READY\\|ACTIVE}" ((org-agenda-overriding-header "Hot Projects"))) -("T" "Non-Hot Projects" tags "-HOT&TODO={ACTIVE}" +("T" "Non-Hot Projects" tags "-HOT&TODO={PLANNING\\|READY\\|ACTIVE}" ((org-agenda-overriding-header "Non-Hot Projects"))) ("P" "All Projects" ((tags "HOT&TODO={PLANNING\\|READY\\|ACTIVE}" -- cgit v1.2.3 From aff02836d1cad271c666985db191b5fe5238dd14 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 21 Sep 2020 22:19:00 +0200 Subject: Add agenda view to show all non-project tasks --- emacs-init.org | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index c209501..767ef7e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3656,9 +3656,9 @@ Simple day agenda with =INPROGRESS= tasks (when (not (member "HOT" (my-org-current-tags (fpi/org-project-depth 10)))) (or (outline-next-heading) (goto-char (point-max))))) -(defun fpi/org-agenda-skip-all-not-project () - "Skip all not hot entries." - (when (not (member "HOT" (my-org-current-tags 1))) +(defun fpi/org-agenda-skip-all-project-tasks () + "Skip all entries which belong to a project." + (when (fpi/is-part-of-project-p 10) (or (outline-next-heading) (goto-char (point-max))))) (defun my-org-current-tags (depth) @@ -3693,6 +3693,9 @@ Simple day agenda with =INPROGRESS= tasks (when (fpi/is-not-done-project-p) (setq top (point))))) (goto-char top)))) +(defun fpi/is-part-of-project-p (depth) + "Return t if any parent heading is a project." + (< 0 (fpi/org-project-depth depth))) (defun fpi/parent-is-not-done-project-p () "Return t if parent heading is a not done project." (save-excursion @@ -3732,6 +3735,12 @@ To narrow the agenda to the currently selected project this function from [[http ((org-agenda-overriding-header "Non-Hot Projects"))) )) #+end_src +Some tasks do not go into projects. Let's list only those. +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands +("g" "Non-Project (general) Tasks" tags "TODO={NEXT\\|INPROGRESS\\|REVIEW\\|WAITING}" + ((org-agenda-overriding-header "Non-Project Tasks") + (org-agenda-skip-function (function fpi/org-agenda-skip-all-project-tasks)))) +#+end_src ******* #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("n" "Project Next Actions" alltodo "" -- cgit v1.2.3 From fe089ffb7e260f0a0f19b7f1da3d5277c5a0dafb Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:12:11 +0200 Subject: Collect org clocking settings under one headline --- emacs-init.org | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 767ef7e..d72b954 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3319,7 +3319,6 @@ I use a org version with some custom patches. Rather than using something like = (org-ellipsis " ") (org-outline-path-complete-in-steps nil) (org-log-into-drawer "NOTES") - (org-clock-into-drawer "LOGBOOK") (org-tags-column 0) (org-tags-exclude-from-inheritance '( <> @@ -3400,14 +3399,9 @@ I use a org version with some custom patches. Rather than using something like = (use-package org-id :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) <>) -(use-package org-clock - :custom - (org-clock-out-remove-zero-time-clocks t) - (org-clock-persist 'history) - (org-clock-history-length 30) - :init - (org-clock-persistence-insinuate) - ) +#+end_src + +#+begin_src emacs-lisp (use-package org-src :custom (org-src-window-setup 'other-window) @@ -3491,6 +3485,28 @@ Use imagemagick and standalone class for latex preview. (use-package org-num :delight) #+end_src +*** Timekeeping & Clocking +- Remove clocks with zero time. +- Save a clocking history of the list 50 clocked items. +- Clock into the =LOGBOOK= drawer (as opposed to log entries going into ~org-log-into-drawer~) +#+begin_src emacs-lisp +(use-package org-clock + :custom + (org-clock-out-remove-zero-time-clocks t) + (org-clock-persist 'history) + (org-clock-history-length 50) + (org-clock-into-drawer "LOGBOOK") + :init + (org-clock-persistence-insinuate) + ) +#+end_src +**** Durations +#+begin_src emacs-lisp +(use-package org-duration + :after org + :custom + (org-duration-format '(("h" . t) ("min" . t) (special . h:mm)))) +#+end_src *** Task organization Much of my current task workflow is largely inspired by [[http://doc.rix.si/cce/cce-org.html][Ryan Rix's]] and [[http://doc.norang.ca/org-mode.html][Bernt Hansen's]] configs. @@ -4171,13 +4187,6 @@ This function is handy to use in header arguments to create names based on the c (post (or post ""))) (format "%s%s%s" pre (nth 4 (org-heading-components)) post))) #+end_src -*** Durations -#+begin_src emacs-lisp -(use-package org-duration - :after org - :custom - (org-duration-format '(("h" . t) ("min" . t) (special . h:mm)))) -#+end_src *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal -- cgit v1.2.3 From 12529bb7e4559684495db9816f2a24d7025fd211 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:13:23 +0200 Subject: Remove READLIST, WATCH tags in favor of read, watch --- emacs-init.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index d72b954..e74a26b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3912,16 +3912,16 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom-commands ("r" "Refile entries" ((tags "+REFILE"))) ("i" "Idle Actions" - ((tags-todo "IDLE-READLIST-WATCH" + ((tags-todo "IDLE-read-watch" ((org-agenda-overriding-header "Idle Tasks") (org-agenda-skip-function 'bh/skip-project-tasks) (org-agenda-sorting-strategy '(todo-state-down effort-up)))) - (tags-todo "READLIST" + (tags-todo "read" ((org-agenda-overriding-header "Idle Reading List") (org-agenda-sorting-strategy '(todo-state-down effort-up)))) - (tags-todo "WATCH" + (tags-todo "watch" ((org-agenda-overriding-header "Things to Watch") (org-agenda-skip-function 'bh/skip-project-tasks) (org-agenda-sorting-strategy @@ -4609,7 +4609,7 @@ Instead of project related capture templates, I use the same template for all ta ("Cr" ".. & read" entry (file "~/sync/refile.org") - "* TODO %a :READLIST: + "* TODO %a :read: :PROPERTIES: :CREATED: %U <> -- cgit v1.2.3 From 6c8c25aa4cd015d763ab892be8c0635035b650f6 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 27 Sep 2020 12:12:26 +0200 Subject: Add function to clock in on a refile target --- emacs-init.org | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index e74a26b..1a8fb06 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3500,6 +3500,20 @@ Use imagemagick and standalone class for latex preview. (org-clock-persistence-insinuate) ) #+end_src +Even with the history clocking into the correct item is sometimes difficult. So why not clock in any refile target: +#+begin_src emacs-lisp +(defun fpi/org-clock-in-heading (&optional prompt) + (interactive) + (let* ((location (org-refile-get-location (or prompt "Clock in on"))) + (file (cadr location)) + (marker (car (last location)))) + (save-excursion + (save-restriction + (find-file file) + (goto-char marker) + (org-clock-in) + (current-buffer))))) +#+end_src **** Durations #+begin_src emacs-lisp (use-package org-duration -- cgit v1.2.3 From f2a1b51d43b2861ff2a0096c6866888a2115f759 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 30 Oct 2020 19:30:25 +0100 Subject: Use timestamp based ids --- emacs-init.org | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 1a8fb06..0206230 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3397,10 +3397,17 @@ I use a org version with some custom patches. Rather than using something like = :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) + :custom + (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) <>) #+end_src +I prefer to use timestamp based ID's as they are +#+begin_src emacs-lisp :tangle no :noweb-ref org-id-custom +(org-id-method 'ts) +(org-id-ts-format "%FT%T%z") +#+end_src + #+begin_src emacs-lisp (use-package org-src :custom @@ -4464,10 +4471,18 @@ Org Edna (use-package org-attach :custom (org-attach-use-inheritance nil) + (org-attach-preferred-new-method 'id) + (org-attach-store-link-p t) :config (defun fpi/org-attach-id-folder-format (id) id) - (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-folder-format)) + (defun fpi/org-attach-id-ts-folder-format (id) + "Timestamp id converter to ids generated in the \"%FT%T%z\" format." + (format "%s/%s" + (substring id 0 7) + (substring id 8))) + (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-folder-format) + (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-ts-folder-format)) #+end_src =org-attach-git= auto-commits changes to attachments if the directory is a git repository. I want every attachments to be saved using -- cgit v1.2.3 From b78838697482ce20c282f594647c4c1ba2efc8fb Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 30 Oct 2020 19:32:56 +0100 Subject: Sort some agenda entries by hotness --- emacs-init.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 0206230..def36ee 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3684,10 +3684,31 @@ Simple day agenda with =INPROGRESS= tasks ("h" "Current Hotlist" tags "TODO={NEXT\\|INPROGRESS}" ((org-agenda-overriding-header "Current Hotlist") (org-agenda-skip-function (function fpi/org-agenda-skip-all-not-hot)) + (org-agenda-sorting-strategy + '(priority-down category-keep user-defined-down)) + (org-agenda-cmp-user-defined #'fpi/org-agenda-compare-hotness) + (org-agenda-prefix-format " %i {%(fpi/org-hotness)} %-12:c") ;; (org-agenda-prefix-format " %-3i %-12:c%30b %s") )) #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-config +(defun fpi/org-agenda-compare-hotness (a b) + "Compare level of hot headlines over entries A and B." + (let ((ha (fpi/org-agenda-hotness a)) + (hb (fpi/org-agenda-hotness b))) + (cond + ((> ha hb) +1) + ((< ha hb) -1) + (t nil)))) +(defun fpi/org-agenda-hotness (entry) + "Return level of hot headlines over ENTRY." + (org-agenda-with-point-at-orig-entry entry (fpi/org-hotness))) +(defun fpi/org-hotness () + "Return level of hot headlines over current entry." + (let* ((tags (my-org-current-tags (fpi/org-project-depth 10))) + (l1 (length tags)) + (l2 (length (remove "HOT" tags)))) + (- l1 l2))) (defun fpi/org-agenda-skip-all-not-hot () "Skip all not hot entries." (when (not (member "HOT" (my-org-current-tags (fpi/org-project-depth 10)))) -- cgit v1.2.3 From e900cf26c13478aff3cc942dde20af5ff0944888 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 30 Oct 2020 19:33:26 +0100 Subject: Set clock checking to tolerate no gap at all --- emacs-init.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index def36ee..bd9940b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4062,6 +4062,11 @@ Gives an overview of time spent on defined budgets this week. Great to track if "%50ITEM(Task) %5Effort(Effort){:} %5CLOCKSUM %3PRIORITY %20DEADLINE %20SCHEDULED %20TIMESTAMP %TODO %CATEGORY %TAGS") #+end_src **** Clocking +I try to clock without any gap +#+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-custom +(org-agenda-clock-consistency-checks '(:max-duration "10:00" :min-duration 0 :max-gap "0:00" :gap-ok-around ("4:00") :default-face ((:background "DarkRed") (:foreground "white")) :overlap-face nil :gap-face nil :no-end-time-face nil :long-face nil :short-face nil)) + +#+end_src ***** Combine adjacent clock lines #+begin_src emacs-lisp (defun fpi/org-clock-join-last-clock () -- cgit v1.2.3 From 217867b5efe967704ffdeccfa104a30db82ab39d Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:30:04 +0100 Subject: Add agenda breadcrumbs listing parent projects --- emacs-init.org | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index bd9940b..a012cd8 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3687,11 +3687,42 @@ Simple day agenda with =INPROGRESS= tasks (org-agenda-sorting-strategy '(priority-down category-keep user-defined-down)) (org-agenda-cmp-user-defined #'fpi/org-agenda-compare-hotness) - (org-agenda-prefix-format " %i {%(fpi/org-hotness)} %-12:c") + (org-agenda-prefix-format "%-12:c %-45(fpi/org-breadcrumbs)") ;; (org-agenda-prefix-format " %-3i %-12:c%30b %s") )) #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-config +(defun fpi/org-breadcrumbs () + "Return projects over current entry. + +Similar to %b in `org-agenda-prefix-format'." + (org-with-wide-buffer + (let ((depth (fpi/org-project-depth 10)) + result) + (while (< (length result) depth) + (fpi/org-goto-parent-project 10) + (add-to-list 'result + (org-trim + (org-link-display-format + (replace-regexp-in-string + "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" "" + (nth 4 (org-heading-components)) ;; get entry title + ))))) + (if result + (reduce + (lambda (a b) (format "%s/%s" a b)) + (mapcar (lambda (s) (format "%.12s" s)) result) + ) + "") + ))) +(defun fpi/org-goto-parent-project (depth) + "Goto first project over current entry." + (when (fpi/parent-is-not-done-project-p) + (org-up-heading-safe)) + (while (and (> depth 0) + (not (fpi/is-not-done-project-p)) + (org-up-heading-safe)) + )) (defun fpi/org-agenda-compare-hotness (a b) "Compare level of hot headlines over entries A and B." (let ((ha (fpi/org-agenda-hotness a)) -- cgit v1.2.3 From f8f1ffcfb24317c8571121d95cbe8874d73d7281 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:30:50 +0100 Subject: Make fpi/org-agenda-hotness usable on agenda lines --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index a012cd8..99a8826 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3731,7 +3731,7 @@ Similar to %b in `org-agenda-prefix-format'." ((> ha hb) +1) ((< ha hb) -1) (t nil)))) -(defun fpi/org-agenda-hotness (entry) +(defun fpi/org-agenda-hotness (&optional entry) "Return level of hot headlines over ENTRY." (org-agenda-with-point-at-orig-entry entry (fpi/org-hotness))) (defun fpi/org-hotness () -- cgit v1.2.3 From 68ff830dd049455f32bf3d014b93bf1f2a67cb80 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:31:38 +0100 Subject: Add more project related functions --- emacs-init.org | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 99a8826..24dfa7d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3740,6 +3740,15 @@ Similar to %b in `org-agenda-prefix-format'." (l1 (length tags)) (l2 (length (remove "HOT" tags)))) (- l1 l2))) +(defun fpi/org-agenda-skip-all-not-hot-and-active () + "Skip all not hot entries and not active entries." + (when (not (and + (member "HOT" (my-org-current-tags (fpi/org-project-depth 10))) + (org-with-wide-buffer + (fpi/org-goto-parent-project 10) + (fpi/is-active-project-p)))) + (or (outline-next-heading) + (goto-char (point-max))))) (defun fpi/org-agenda-skip-all-not-hot () "Skip all not hot entries." (when (not (member "HOT" (my-org-current-tags (fpi/org-project-depth 10)))) @@ -3763,25 +3772,21 @@ Similar to %b in `org-agenda-prefix-format'." should-skip)))) (defun fpi/org-project-depth (depth) "Return number of subheadings before reaching top project." - (let ((current (org-current-level)) - (top (save-excursion - (fpi/org-goto-top-project depth) - (org-current-level)))) - (- current top) - )) + (org-with-wide-buffer (fpi/org-goto-top-project depth))) (defun fpi/org-goto-top-project (depth) "Go to the top project of heading under point" (save-restriction (widen) - (let ((top (point))) + (let (top + (count -1)) (with-demoted-errors - (while (and (> depth 0) - (progn - (setq depth (1- depth)) - (not (org-up-element)))) - (when (fpi/is-not-done-project-p) - (setq top (point))))) - (goto-char top)))) + (while (and (> depth 1) + (not (equal top (point)))) + (setq depth (1- depth)) + (setq top (point)) + (fpi/org-goto-parent-project depth) + (setq count (1+ count)))) + count))) (defun fpi/is-part-of-project-p (depth) "Return t if any parent heading is a project." (< 0 (fpi/org-project-depth depth))) @@ -3789,15 +3794,20 @@ Similar to %b in `org-agenda-prefix-format'." "Return t if parent heading is a not done project." (save-excursion (save-restriction - (widen) - (and (not (org-up-element)) - (fpi/is-not-done-project-p))))) + (widen) + (and (not (org-up-element)) + (fpi/is-not-done-project-p))))) (defun fpi/is-not-done-project-p () "Return t if current heading is a not done project." (save-restriction (widen) (let ((todo (org-get-todo-state))) (member todo org-project-keywords)))) +(defun fpi/is-active-project-p () + "Return t if current heading is an active project." + (save-restriction + (widen) + (equal "ACTIVE" (org-get-todo-state)))) #+end_src To narrow the agenda to the currently selected project this function from [[https://github.com/mm--/dot-emacs/blob/master/jmm-org-config.org][Josh's emacs config]] is useful. #+begin_src emacs-lisp :tangle no :noweb-ref org-agenda-config -- cgit v1.2.3 From e39f2094c4568eca1f58cdcd9196401784e6c335 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:32:12 +0100 Subject: Add this weeks agenda --- emacs-init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 24dfa7d..a66879c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3986,6 +3986,10 @@ Based on https://github.com/psamim/dotfiles/blob/master/doom/config.el#L73. ("w" . "Week agendas") ("ww" "Standard week agenda" ((agenda "" ((org-agenda-span 'week))))) +("wt" "This Week's agenda (starting on last Monday)" + ((agenda "" ((org-agenda-span 'week) + (org-agenda-start-day "-mon"))) + (tags-todo "+work"))) ("wn" "Next Week's agenda" ((agenda "" ((org-agenda-span 'week) (org-agenda-start-day "mon"))) -- cgit v1.2.3 From 651db3f3a3f240210e27f49cdb1a625203bb9be0 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Dec 2020 13:32:26 +0100 Subject: Remove "Interrupt: " prefix from interrupt captures --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index a66879c..635f9a9 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4635,7 +4635,7 @@ For interruptions. These are saved in a global refile file and to be sorted to t ("i" "Interrupt" entry (file "~/sync/refile.org") - "** Interrupt: %? + "** %? :PROPERTIES: :CREATED: %U :SOURCE: %a -- cgit v1.2.3 From 8792acbe9e4f5121b24cb4b0aa6221ca14c340dd Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 23 Feb 2021 10:09:41 +0100 Subject: Update org-edna project task trigger .. to consider if the next task really needs to be set to NEXT --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 635f9a9..8b82130 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4525,7 +4525,7 @@ Org Edna ("L" (jmm/org-edna-link "todo!(NEXT)")) ("n" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT)")) ("N" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\")")) - ("P" (jmm/org-edna-set-trigger-and-point "next-sibling todo!(NEXT) chain!(\"TRIGGER\") if siblings then parent todo!(DONE) endif")) + ("P" (jmm/org-edna-set-trigger-and-point "if next-sibling todo-state?(HOLD) then else next-sibling todo!(NEXT) endif next-sibling chain!(\"TRIGGER\") if siblings then parent todo!(DONE) endif")) ("p" (jmm/org-edna-set-trigger-and-point "parent todo!(DONE)")) ("q" nil))) #+end_src -- cgit v1.2.3 From fc9789b7205e4d00d260915ae884cfe6861f8008 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Feb 2022 18:37:23 +0100 Subject: Disable pinentry loopback on win10 devices Breaks in combination with pinentry-wsl --- emacs-init.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 8b82130..0586825 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3077,7 +3077,9 @@ over =windmove=, as it does not interfere with org keybindings. #+begin_src emacs-lisp (use-package epa - :custom (epa-pinentry-mode 'loopback)) + :custom (epa-pinentry-mode (if (equal (fpi/current-device-info :os) 'win10) + nil + 'loopback))) (use-package pinentry :straight t :config (pinentry-start) @@ -3214,6 +3216,11 @@ Various utilities which ease programming in some languages. :straight t) #+end_src *** Emacs lisp +Remap ~eval-last-sexp~ to a pretty print version. Then you can use =C-0 C-x C-e= to insert the values of the last sexp. Use ~pp-macroexpand-last-sexp~ to print a macro expanded version of the last sexp (but not eval it). +#+begin_src emacs-lisp +(global-set-key [remap eval-last-sexp] 'pp-eval-last-sexp) +#+end_src + =Speed of thought= makes writing lisp so easy. No more snippets needed. #+begin_src emacs-lisp -- cgit v1.2.3 From 88124311ceb4a4dfbc8dbd31b2e111a2e8f68168 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 13:28:01 +0100 Subject: Add descriptions to fpi-map bindings --- emacs-init.org | 124 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0586825..8a06392 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1685,8 +1685,8 @@ When switching between monitors with different resolution, scaling the (message "Default height: %s" new))) #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings -(define-key 'fpi-map (kbd "+") 'fpi/scale-default-face) -(define-key 'fpi-map (kbd "-") (lambda () (interactive) (fpi/scale-default-face t))) +(fpi/define-key fpi-map (kbd "+") #'fpi/scale-default-face "Zoom") +(fpi/define-key fpi-map (kbd "-") (lambda () (interactive) (fpi/scale-default-face t)) "Unzoom") #+end_src ** User info Set ~user-full-name~ and ~user-mail-address~. These are set in @@ -1805,40 +1805,48 @@ Some settings could be harmful to emacs and the underlying system. Therefore man Unfortunately =C-c [a-z]= is not always a safe place for user-defined key bindings. I use a special keymap to aggregate common functions. I rebind the =C-z= binding for this. + +Here is a helper macro to define keys including keymap prompts as described [[https://www.olivertaylor.net/emacs/keymap-prompt.html][here]]. This macro has a signature very similar to the regular ~define-key~ function. +#+begin_src emacs-lisp +(defmacro fpi/define-key (map key func &optional desc) + "Define KEY in MAP with FUNC. Optionally provide DESC." + (if desc + `(define-key ,map ,key (cons ,desc ,func)) + `(define-key ,map ,key ,func))) +#+end_src + *** Toggle map to toggle common options This was inspired from [[http://endlessparentheses.com/the-toggle-map-and-wizardry.html][this post]] and I bind it to a key on my personal keymap. #+BEGIN_SRC emacs-lisp :results silent -(define-prefix-command 'fpi/toggle-map) -(define-key fpi/toggle-map "c" #'column-number-mode) +(define-prefix-command 'fpi/toggle-map nil "Toggle") +(fpi/define-key fpi/toggle-map "c" #'column-number-mode "Column") ;;(define-key fpi/toggle-map "d" #'toggle-debug-on-error) -(define-key fpi/toggle-map "f" #'auto-fill-mode) -(define-key fpi/toggle-map "l" #'scroll-lock-mode) -(define-key fpi/toggle-map "s" #'flyspell-mode) -(define-key fpi/toggle-map "t" #'toggle-truncate-lines) -(define-key fpi/toggle-map "q" #'toggle-debug-on-quit) -(define-key fpi/toggle-map "r" #'dired-toggle-read-only) -(autoload 'dired-toggle-read-only "dired" nil t) -(define-key fpi/toggle-map "v" #'visible-mode) -(define-key fpi/toggle-map "w" #'whitespace-mode) -(define-key fpi/toggle-map "W" #'whitespace-toggle-options) +(fpi/define-key fpi/toggle-map "f" #'auto-fill-mode "Fill") +(fpi/define-key fpi/toggle-map "l" #'scroll-lock-mode "Lock scrolling") +(fpi/define-key fpi/toggle-map "s" #'flyspell-mode "Spelling") +(fpi/define-key fpi/toggle-map "t" #'toggle-truncate-lines "Truncate lines") +(fpi/define-key fpi/toggle-map "q" #'toggle-debug-on-quit "Quit trigger debug") +(fpi/define-key fpi/toggle-map "r" #'dired-toggle-read-only "Read only") +(autoload 'dired-toggle-read-only "dired" nil t ) +(fpi/define-key fpi/toggle-map "v" #'visible-mode "Visible") +(fpi/define-key fpi/toggle-map "w" #'whitespace-mode "Whitespace") +(fpi/define-key fpi/toggle-map "W" #'whitespace-toggle-options "Whitespace Options") #+END_SRC *** fpi-map #+BEGIN_SRC emacs-lisp :noweb yes -(define-prefix-command 'fpi-map) +(define-prefix-command 'fpi-map nil "fpi-map") (unbind-key (kbd "C-z")) (global-set-key (kbd "C-z") 'fpi-map) -;;(define-key fpi-map (kbd "1") 'org-global-cycle) -(define-key fpi-map (kbd "a") 'org-agenda-show-agenda-and-todo) -(define-key fpi-map (kbd "b") 'bury-buffer) -(define-key fpi-map (kbd "c") 'compile) +(fpi/define-key fpi-map (kbd "a") #'org-agenda-show-agenda-and-todo "Agenda") +(fpi/define-key fpi-map (kbd "b") #'bury-buffer "Bury") +(fpi/define-key fpi-map (kbd "c") #'compile "Compile") ;;(define-key fpi-map (kbd "u") 'multiple-cursors-hydra/body) -(define-key fpi-map (kbd "e") 'elfeed) -(define-key fpi-map (kbd "h") 'dfeich/context-hydra-launcher) -(define-key fpi-map (kbd "m") 'notmuch) -(define-key fpi-map (kbd "t") fpi/toggle-map) -(define-key fpi-map (kbd "n") 'sauron-toggle-hide-show) -(define-key fpi-map (kbd "j") (lambda () (interactive) (find-file org-journal-file))) +(fpi/define-key fpi-map (kbd "h") #'dfeich/context-hydra-launcher "Hydra") +;; (define-key fpi-map (kbd "m") 'notmuch) +(fpi/define-key fpi-map (kbd "t") #'fpi/toggle-map "Toggle") +(fpi/define-key fpi-map (kbd "n") #'sauron-toggle-hide-show "Notifications") +(fpi/define-key fpi-map (kbd "j") (lambda () (interactive) (find-file org-journal-file)) "Journal") <> #+END_SRC @@ -2861,7 +2869,6 @@ navigate and revert hunks directly from the buffer. Use =g= to open #+begin_src emacs-lisp (use-package diff-hl :straight 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) :hint nil) @@ -2890,6 +2897,10 @@ navigate and revert hunks directly from the buffer. Use =g= to open :color blue)) ) #+end_src + +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(fpi/define-key fpi-map "g" #'hydra-diff-hl/body "Git diff") +#+end_src *** git-auto-commit Mode to automatically commit on file save. Ensure that automatic pushing is always turned off. To enable this with [[info:emacs#File Variables][File Variables]] set @@ -4185,7 +4196,7 @@ This provides functions to get webpage title or content for org mode links. :straight t) #+end_src #+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no -(define-key fpi-map "l" #'org-web-tools-insert-link-for-url) +(fpi/define-key fpi-map "l" #'org-web-tools-insert-link-for-url "Link (org)") #+end_src *** Gnorb @@ -4917,7 +4928,7 @@ A small function to toggle the encryption state of the current entry. (if (looking-at-p "-----BEGIN PGP MESSAGE-----") (org-decrypt-entry) (org-encrypt-entry)))))) - (define-key fpi/toggle-map "e" #'fpi/org-toggle-crypt-entry)) + (fpi/define-key fpi/toggle-map "e" #'fpi/org-toggle-crypt-entry "Encrypt")) #+end_src *** Reference management **** Bibtex @@ -4966,7 +4977,7 @@ A small function to toggle the encryption state of the current entry. (ding)))))))) #+end_src #+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no -(define-key fpi-map "r" #'org-ref-helm-insert-cite-link) +(fpi/define-key fpi-map "r" #'org-ref-helm-insert-cite-link "Ref") #+end_src ***** Capturing entries I store my bibtex references in an org file together with my notes. In @@ -5165,7 +5176,7 @@ pdf if available." (if fpi/org-meta-heading-info-store (mw-org-show-meta-info-lines) (mw-org-hide-meta-heading-info))) -(define-key fpi/toggle-map "m" #'fpi/org-toggle-meta-info-lines) +(fpi/define-key fpi/toggle-map "m" #'fpi/org-toggle-meta-info-lines "Metalines (org)") #+end_src *** Table of contents in org #+begin_src emacs-lisp @@ -5228,8 +5239,10 @@ _g_: Go to active clock _b_: Break _P_: Insert BBDB _c_: Capture ("t" bh/org-todo) ;; neccessary? ("w" bh/widen) ;; neccessary? ("z" cce/note-to-clock)) +#+end_src -(define-key fpi-map (kbd "f") 'hydra-workflow/body) +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(fpi/define-key fpi-map (kbd "f") 'hydra-workflow/body "Flow") #+end_src Basic flow: 1. Start your work by clocking in with ~bh/punch-in~. This sets a @@ -5515,23 +5528,27 @@ custom link format. #+begin_src emacs-lisp (use-package zetteldeft :straight t - :bind (:map fpi-map (("d d" . deft) - ("d D" . zetteldeft-deft-new-search) - ("d R" . deft-refresh) - ("d s" . zetteldeft-search-at-point) - ("d c" . zetteldeft-search-current-id) - ("d f" . zetteldeft-follow-link) - ("d F" . zetteldeft-avy-file-search-ace-window) - ("d l" . zetteldeft-avy-link-search) - ("d t" . zetteldeft-avy-tag-search) - ("d T" . zetteldeft-tag-buffer) - ("d i" . zetteldeft-find-file-id-insert) - ("d I" . zetteldeft-find-file-full-title-insert) - ("d o" . zetteldeft-find-file) - ("d n" . zetteldeft-new-file) - ("d N" . zetteldeft-new-file-and-link) - ("d r" . zetteldeft-file-rename) - ("d x" . zetteldeft-count-words)))) + ;; :bind (:map fpi-map (("d d" . deft) + ;; ("d D" . zetteldeft-deft-new-search) + ;; ("d R" . deft-refresh) + ;; ("d s" . zetteldeft-search-at-point) + ;; ("d c" . zetteldeft-search-current-id) + ;; ("d f" . zetteldeft-follow-link) + ;; ("d F" . zetteldeft-avy-file-search-ace-window) + ;; ("d l" . zetteldeft-avy-link-search) + ;; ("d t" . zetteldeft-avy-tag-search) + ;; ("d T" . zetteldeft-tag-buffer) + ;; ("d i" . zetteldeft-find-file-id-insert) + ;; ("d I" . zetteldeft-find-file-full-title-insert) + ;; ("d o" . zetteldeft-find-file) + ;; ("d n" . zetteldeft-new-file) + ;; ("d N" . zetteldeft-new-file-and-link) + ;; ("d r" . zetteldeft-file-rename) + ;; ("d x" . zetteldeft-count-words))) + ) +#+end_src +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(fpi/define-key fpi-map "dd" #'deft "Deft") #+end_src ** Shell @@ -5597,8 +5614,11 @@ prefix to my custom keymap. (interactive "P") (if arg (call-interactively 'password-store-copy-field) - (call-interactively 'password-store-copy))) - :bind (:map fpi-map ("p" . fpi/password-store-copy-pass-or-field))) + (call-interactively 'password-store-copy)))) +#+end_src + +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(fpi/define-key fpi-map "p" #'fpi/password-store-copy-pass-or-field "Pass") #+end_src **** auth-password-store/auth-source-pass A password-store backend for the Emacs [[info:auth#Top][auth-source]] library which @@ -6414,7 +6434,7 @@ The mode is enabled for all =text-mode= based buffers by default. #+end_src Also set an easy keybinding to toggle it manually. #+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no -(define-key fpi/toggle-map "p" #'prose-mode) +(fpi/define-key fpi/toggle-map "p" #'prose-mode "Prose") #+end_src Olivetti mode is used to center text in the buffer. This somehow helps with writing. @@ -6454,7 +6474,7 @@ If `olivetti-body-width' is a number fit the window width to it instead of the a #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings -(define-key 'fpi-map (kbd "s") 'fpi/fit-window-to-buffer) +(fpi/define-key 'fpi-map (kbd "s") 'fpi/fit-window-to-buffer "Size window to buffer") #+end_src * Wrapping up -- cgit v1.2.3 From dc43dc2cf0c311e9de928cdd4a1c62f247d21c7a Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 13:33:44 +0100 Subject: Replace org headline bullets with org-num-mode --- emacs-init.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8a06392..e08e9e7 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3492,7 +3492,7 @@ Here is a list of nice ones: ◉, ○, ►, •. The default ones are ~'("◉" " #+begin_src emacs-lisp (use-package org-bullets :straight t - :custom (org-bullets-bullet-list '("✧")) + :custom (org-bullets-bullet-list '(" ")) :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) #+end_src Use imagemagick and standalone class for latex preview. @@ -3508,7 +3508,9 @@ Use imagemagick and standalone class for latex preview. #+end_src #+begin_src emacs-lisp (use-package org-num - :delight) + :delight + :after org + :hook (org-mode . org-num-mode)) #+end_src *** Timekeeping & Clocking - Remove clocks with zero time. -- cgit v1.2.3 From f666eac5fddf8932846e71364c5c3e0b6e412f2f Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 13:36:40 +0100 Subject: Fix redtick configuration --- emacs-init.org | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index e08e9e7..7f0825d 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -6201,27 +6201,7 @@ Saves to a temp file and puts the filename in the kill ring." ((redtick-sound-volume "20") (redtick-play-sound t) (redtick-work-interval (* 60 20)) - (redtick-rest-interval (* 60 5)) - (redtick--workbar-interval (/ redtick-work-interval 8.0)) - (redtick--restbar-interval (/ redtick-rest-interval 8.0)) - (redtick--bars - `((,redtick--workbar-interval "█" "#ffff66") - (,redtick--workbar-interval "▇" "#ffcc66") - (,redtick--workbar-interval "▆" "#cc9966") - (,redtick--workbar-interval "▅" "#ff9966") - (,redtick--workbar-interval "▄" "#cc6666") - (,redtick--workbar-interval "▃" "#ff6666") - (,redtick--workbar-interval "▂" "#ff3366") - (,redtick--workbar-interval "▁" "#ff0066") - (,redtick--restbar-interval "█" "#00cc66") - (,redtick--restbar-interval "▇" "#33cc66") - (,redtick--restbar-interval "▆" "#66cc66") - (,redtick--restbar-interval "▅" "#00ff66") - (,redtick--restbar-interval "▄" "#33ff66") - (,redtick--restbar-interval "▃" "#66ff66") - (,redtick--restbar-interval "▂" "#99ff66") - (,redtick--restbar-interval "▁" "#ccff66") - (nil "✓" "#cf6a4c")))) + (redtick-rest-interval (* 60 5))) :config (redtick-mode 1)) #+end_src *** Script creation -- cgit v1.2.3 From ac49090b505bab463eaa207d68eca860fee06a98 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 13:43:39 +0100 Subject: Change org timestamp format to include nanosecond Also add some default latex packages to org export --- emacs-init.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 7f0825d..d21565b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3423,7 +3423,7 @@ I use a org version with some custom patches. Rather than using something like = I prefer to use timestamp based ID's as they are #+begin_src emacs-lisp :tangle no :noweb-ref org-id-custom (org-id-method 'ts) -(org-id-ts-format "%FT%T%z") +(org-id-ts-format "%FT%T%z.%6N") #+end_src #+begin_src emacs-lisp @@ -3506,6 +3506,14 @@ Use imagemagick and standalone class for latex preview. [DEFAULT-PACKAGES] \\pagestyle{empty} % do not remove") #+end_src + +Also let us define some more default latex packages. +#+begin_src emacs-lisp :noweb-ref org-config :tangle no +(add-to-list 'org-latex-packages-alist '("" "uniinput")) +(add-to-list 'org-latex-packages-alist '("" "siunitx")) +(add-to-list 'org-latex-packages-alist '("" "tikz")) +(add-to-list 'org-latex-packages-alist '("" "circuitikz")) +#+end_src #+begin_src emacs-lisp (use-package org-num :delight -- cgit v1.2.3 From 510a44abc93058fb50f26816cc8df6fdb1285c2b Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 13:48:19 +0100 Subject: Replace org-ref with org cite --- emacs-init.org | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index d21565b..304caf1 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4957,37 +4957,18 @@ A small function to toggle the encryption state of the current entry. (setq bibtex-completion-notes-extension ".org") #+end_src -**** org-ref +**** Org Cite +=org-ref= was replaced by =orgcite= which is built into =org=. #+begin_src emacs-lisp -(use-package org-ref - :straight t - :bind (:map org-mode-map (("C-c n p" . fpi/open-bibtex-pdf-or-directory))) +(use-package oc + :after org :custom - (org-ref-bibliography-notes nil) - (org-ref-notes-function 'org-ref-notes-function-many-files) - (org-ref-notes-directory "~/git/projects/zettel/Lit") - (org-ref-default-bibliography '("~/git/projects/personal/bib.bib")) - (org-ref-pdf-directory "~/git/projects/personal/Lit/") - :config - (defun fpi/open-bibtex-pdf-or-directory () - (interactive) - (save-excursion - (bibtex-beginning-of-entry) - (let* ((bibtex-expand-strings t) - (entry (bibtex-parse-entry t)) - (key (reftex-get-bib-field "=key=" entry)) - (pdf (funcall org-ref-get-pdf-filename-function key))) - (message "%s" pdf) - (if (file-exists-p pdf) - (org-open-link-from-string (format "[[file:%s]]" pdf)) - ;; try to get pdf - (or (let ((doi-utils-open-pdf-after-download t)) - (doi-utils-get-bibtex-entry-pdf)) - (progn (dired (file-name-directory pdf)) - (ding)))))))) -#+end_src -#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no -(fpi/define-key fpi-map "r" #'org-ref-helm-insert-cite-link "Ref") + (org-cite-global-bibliography (if (equal fpi/current-device "DESKTOP-PM1PPEC") + '("~/git/projects/personal/bib.bib" + "~/win/Zotero/00_Unsorted.bib" + "~/win/Zotero/01_Annotated.bib" + "~/win/Zotero/99_AllZotero.bib") + '("~/git/projects/personal/bib.bib")))) #+end_src ***** Capturing entries I store my bibtex references in an org file together with my notes. In -- cgit v1.2.3 From 442fc567ffae19ba4d7c12ba2b6e92a1d0dd4f85 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 13:49:16 +0100 Subject: Properly set org-journal-file --- emacs-init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 304caf1..e288c6e 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4599,9 +4599,11 @@ Also exclude =ATTACH= from the inherited tags #+end_src *** Org-Capture #+BEGIN_SRC emacs-lisp +(setq org-journal-file (format "~/sync/journal/%s.org" (nth 2 (calendar-current-date)))) (use-package org-capture + :after org :custom - ((org-journal-file (format "~/sync/journal/%s.org" (nth 2 (calendar-current-date)))) + ( (org-capture-templates `( <>)) -- cgit v1.2.3 From 73038bb3c973992107d90f0f1342d7f8e209b4da Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 14:16:22 +0100 Subject: Update to new org-contrib location --- emacs-init.org | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index e288c6e..0de42de 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3305,11 +3305,11 @@ Hansen's]] configs. - Align tags left :: Fixes problems with line breaking on small window width. -I use a org version with some custom patches. Rather than using something like =el-patch=, I host my version on github for now and update it every so often. This recipe for org is used in all coming =straight.el= calls. +I use a org version with some custom patches. Rather than using something like =el-patch=, I host my version on github for now and update it every so often. #+begin_src emacs-lisp :noweb-ref org-recipe :tangle no -(org-plus-contrib :host github :repo "fpiper/org-mode" :branch "develop" - ;;:local-repo "org" :files (:defaults "contrib/lisp/*.el") - ) +(org :host github :repo "fpiper/org-mode" :branch "develop" + ;;:local-repo "org" :files (:defaults "contrib/lisp/*.el") + ) #+end_src #+begin_src emacs-lisp @@ -4192,8 +4192,7 @@ print the list. #+begin_src emacs-lisp (use-package org-checklist :after org - :straight - <>) + :straight (org-contrib)) #+end_src *** Handling web urls **** org-web-tools @@ -4886,7 +4885,7 @@ CLOSED: %\\1 (use-package org-expiry :after org :straight - <> + (org-contrib) :custom (org-expiry-handler-function 'org-expiry-archive-subtree) (org-expiry-inactive-timestamps t) -- cgit v1.2.3 From b1782e8cfd8a9ef18ba847be5c8a04e7942f72de Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 14:26:58 +0100 Subject: Switch to org-roam v2 --- emacs-init.org | 164 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 111 insertions(+), 53 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0de42de..5e59124 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4360,62 +4360,59 @@ Set some prettify symbols for org mode. #+end_src *** org-roam Org-roam mainly provides a display of backlinks to the current file. This allows the creation of a one-subject-per-file Zettelkasten. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle tangle/emacs-init.el :noweb yes :results silent (use-package org-roam - :straight t - :delight - :hook - (after-init . org-roam-mode) + :straight (:no-byte-compile t) :custom - (org-roam-directory "~/git/projects/zettel/") - (org-roam-tag-sources '(prop last-directory)) - (org-roam-buffer-width 0.2) - (org-roam-graph-exclude-matcher "index.org") - (org-roam-graph-viewer - (lambda (file) - (let ((org-roam-graph-viewer "/mnt/c/Program Files/Mozilla Firefox/firefox.exe")) - (org-roam-graph--open (concat "file://///wsl$/Debian" file))))) + (org-roam-directory "~/git/projects/zettel") + (org-roam-v2-ack t) + (org-roam-mode-section-functions + '(org-roam-backlinks-section + org-roam-reflinks-section + org-roam-unlinked-references-section)) (org-roam-capture-templates - '(("d" "default" plain #'org-roam-capture--get-point "%?" :file-name "%<%Y%m%d%H%M%S>-${slug}" :head "#+title: ${title} -" :unnarrowed t) - ("b" "bib" plain #'org-roam-capture--get-point - "%(fpi/org-roam-get-last-content)" - :file-name "Lit/%(fpi/org-roam-get-key \"${title}\")" - :head "" - :unnarowed t))) - (org-roam-capture-ref-templates - '(("r" "ref" plain #'org-roam-capture--get-point "%?" :file-name "Ref/${slug}" :head "#+title: ${title}\n#+ROAM_KEY: ${ref}\n " :unnarrowed t))) - :bind (:map org-roam-mode-map - (("C-c n l" . org-roam) - ("C-c n u" . org-roam-unlinked-references) - ("C-c n f" . org-roam-find-file) - ("C-c n g" . org-roam-graph) - ("C-c n d" . org-roam-doctor) - ("C-c n G" . fpi/org-roam-graph-with-exclude) - ("C-c n t g" . fpi/org-roam-toggle-graph-executable) - ("C-c n x" . org-roam-jump-to-index) - <> - ) - :map org-mode-map - (("C-c n i" . org-roam-insert))) + (quote + <> + )) :config - (defun org-roam--file-link-face (path) - "Return `org-link'" - 'org-link) - (defun fpi/org-roam-toggle-graph-executable () - (interactive) - (setq org-roam-graph-executable (if (equal org-roam-graph-executable "dot") - "neato" - "dot")) - (message "Set org-roam graphing tool to %s" org-roam-graph-executable)) - (defun fpi/org-roam-graph-with-exclude (&optional arg file node-query) - (interactive "P") - (let ((org-roam-graph-exclude-matcher (completing-read "Exclude matcher to use: " nil))) - (org-roam-graph arg file node-query))) - <> - ) + (org-roam-db-autosync-mode 1) + (add-to-list 'display-buffer-alist + '("\\*org-roam\\*" + (display-buffer-in-direction) + (direction . below) + (window-height . 0.3))) + :bind + (:map org-roam-mode-map + ( + <> + ) + :map org-mode-map + ( + <> + ))) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref org-roam-bindings +("C-c n f" . org-roam-node-find) +("C-c n i" . org-roam-node-insert) +("C-c n t" . org-roam-buffer-toggle) +("C-c n c" . org-roam-capture) +#+end_src +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(fpi/define-key fpi-map "r" #'org-roam-node-find "Roam") +#+end_src + +#+begin_src emacs-lisp +(use-package org-roam-ui + :straight (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out")) + :after org-roam + :custom + (org-roam-ui-browser-function #'browse-url-generic)) +#+end_src + +#+begin_src emacs-lisp :tangle no :noweb-ref org-roam-bindings +("C-c n u" . org-roam-ui-mode) #+end_src -Overwriting ~org-roam--file-link-face~ is a crude fix for hanging emacs. The original function calls file-exist-p which opens a slow tramp connection. The idea of ~fpi/org-roam-todo~ is from a post by [[https://oremacs.com/2020/12/31/happy-new-year/][aboabo]]. It lists all open todos in zettelkasten entries and is a (faster) alternative to running an todo agenda with ~org-agenda-files~ set to ~org-roam-directory~. #+begin_src emacs-lisp :tangle no :noweb-ref org-roam-config @@ -4426,12 +4423,73 @@ The idea of ~fpi/org-roam-todo~ is from a post by [[https://oremacs.com/2020/12/ (counsel-rg "^\\*+ \\(NEXT\\|TODO\\)" org-roam-directory "--sort modified")) #+end_src -As =C-c n t= is already taken as prefix for roam related toggle commands, use =o= (mnemonic: “open”) instead. +As =C-c n t= is already taken, use =o= (mnemonic: “open”) instead. #+begin_src emacs-lisp :tangle no :noweb-ref org-roam-bindings ("C-c n o" . fpi/org-roam-todo) #+end_src +- [ ] ntrdn +**** org-roam capture templates +Here we define some capture templates for roam files. Using variables in the source block header we can define the template contents in quote blocks below. + +#+HEADER: :var default=org-roam-template-default ref=org-roam-template-ref +#+HEADER: :var entities=org-roam-template-entities work=org-roam-template-work +#+HEADER: :var personal=org-roam-template-personal private=org-roam-template-private +#+NAME: org-roam-capture-templates +#+begin_src emacs-lisp :tangle no :noweb yes :results code silent +`( + ("d" "Default (avoid this)" plain "%?" + :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" ,default) + :unnarrowed t) + ("l" "Link/Reference" plain "%?" + :target (file+head "ref/${slug}.org" ,ref) + :unnarrowed t) + ("e" "Entity (Person, Company, …)" plain "%?" + :target (file+head "Entities/${slug}.org" ,entities) + :unnarrowed t) + ("w" "Work related zettel" plain "%?" + :target (file+head "Work/%<%Y%m%d%H%M%S>-${slug}.org" ,work) + :unnarrowed t) + ("p" "Personal/Non-work related zettel" plain "%?" + :target (file+head "Personal/%<%Y%m%d%H%M%S>-${slug}.org" ,personal) + :unnarrowed t) + ("P" "Private zettel" plain "%?" + :target (file+head "Personal/Private/%<%Y%m%d%H%M%S>-${slug}.org" ,private) + :unnarrowed t) + ) +#+end_src +As capture templates get more complex storing the template itself in a separate file – or org-babel source block – can be helpful. Above are my (all very similar) template definitions; below the template contents. + +#+NAME: org-roam-template-default +#+begin_quote +#+title: ${title} +#+end_quote +#+NAME: org-roam-template-ref +#+begin_quote +#+title: ${title} +#+ROAM_KEY: ${ref} +#+end_quote +#+NAME: org-roam-template-entities +#+begin_quote +#+FILETAGS: entity +#+title: ${title} +#+end_quote +#+NAME: org-roam-template-work +#+begin_quote +#+FILETAGS: work +#+title: ${title} +#+end_quote +#+NAME: org-roam-template-personal +#+begin_quote +#+FILETAGS: personal +#+title: ${title} +#+end_quote +#+NAME: org-roam-template-private +#+begin_quote +#+FILETAGS: personal private +#+title: ${title} +#+end_quote **** org-roam-protocol #+begin_src emacs-lisp (use-package org-roam-protocol @@ -5483,7 +5541,7 @@ creation. :custom ((deft-directory "~/git/projects/zettel") (deft-extensions '("org")) (deft-default-extension "org") - (deft-use-filename-as-title nil) + (deft-use-filename-as-title t) (deft-recursive t) (deft-use-filter-string-for-filename t) <>)) -- cgit v1.2.3 From 307103f6f12276581749b1cfa94f7b8cf71c93e5 Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 17 Mar 2022 14:27:16 +0100 Subject: Update packages --- package-versions.el | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/package-versions.el b/package-versions.el index d6a3ef5..f9f6001 100644 --- a/package-versions.el +++ b/package-versions.el @@ -7,6 +7,7 @@ ("biblio.el" . "eb9baf1d2bf6a073d24ccb717025baa693e98f3e") ("cdlatex" . "480387b39f6ddd9cd2a9511ecee064ad8e1dd324") ("closql" . "9371635bc3e259b73a075985ebbfc58b45fa5e9d") + ("company-mode" . "5618f28d62cbbdcccdaee1b455fc6e9d1c8bff31") ("dash.el" . "ea4a4cc7cce7c3b93862a22df8bca8b83052ccbf") ("deft" . "fca9ea05ef4fdac825e2ad3921baa7042f6b82c8") ("delight" . "02e73b69708e23053105866a58fe14f75c272dee") @@ -15,27 +16,31 @@ ("dired-git-info" . "b47f2b0c3a6cb9b7a62a4ee2605a492e512d40a9") ("dired-hacks" . "f49a8bbf95f70671a74a24f7f4de453b2686be46") ("dired-sidebar" . "6e569c851418890c21fd37d03a62f85343aa0900") - ("elfeed" . "a2cae98b4f04616c06455b6104d2ca5ff4b86867") - ("elfeed-org" . "77b6bbf222487809813de260447d31c4c59902c9") ("emacs-async" . "86aef2c38e7d35e8509b7feeee3e989d825eba91") ("emacs-hide-mode-line" . "88888825b5b27b300683e662fa3be88d954b1cea") ("emacs-htmlize" . "86f22f211e9230857197c42a9823d3f05381deed") + ("emacs-libvterm" . "f41849c2c9c1899f22d1c3d4f871ec47c82627ce") + ("emacs-request" . "912525c772984c6af0fd84acd6699ee43d91037a") ("emacs-which-key" . "8b49ae978cceca65967f3544c236f32964ddbed0") ("emacsmirror-mirror" . "006fbf082e52dd33cb842c9d5fb181de12736142") ("emacsql" . "a118b6c95af1306f0288a383d274b5dd93efbbda") ("emacsql-sqlite3" . "1e411fd38a0137553986db209642fe93cae96060") - ("epl" . "78ab7a85c08222cd15582a298a364774e3282ce6") + ("esxml" . "193d199305e7abcb5ed795b9bc5434ded20ae60e") ("f.el" . "1814209e2ff43cf2e6d38c4cd476218915f550fb") ("forge" . "048efbba83b1df591de0487202ff968250ea4fc5") ("ghub" . "3da5d8827f6b697ef71dca0a44eb8134689c1dad") + ("git-annex-el" . "c8f7995a232efe643d7acdafcb6370f2d8af8327") ("git-auto-commit-mode" . "dd0c2441de0f5ff8c69c8260d9450d0b607e3e55") ("git-identity.el" . "eec910b2a5459345321b5b9d166383f1323501f5") + ("gnorb" . "260d41f60a6f5ac864ed0cf48a94b546ce71c24a") ("gntp.el" . "767571135e2c0985944017dc59b0be79af222ef5") ("gnu-elpa-mirror" . "f07e244acca36061cc03c63463246b848748e804") ("gnuplot" . "f0001c30010b2899e36d7d89046322467e923088") ("gnuplot-mode" . "601f6392986f0cba332c87678d31ae0d0a496ce7") + ("header-info" . "1482e2f9fe0558acb36e170b627dc46b1f6f6a38") ("helm" . "3ff35503a920d8629cf5c9c07647923661f24ba2") ("helm-bibtex" . "8a0dd9841316793aacddea744d6b8ca4a7857a35") + ("ht.el" . "fff8c43f0e03d5b98deb9f988522b839ce2ca253") ("hydra" . "8a9124f80b6919ad5288172b3e9f46c5332763ca") ("ibuffer-vc" . "1249c1e30cf11badfe032ac3b1058f24ba510ace") ("icomplete-vertical" . "a5871d39c5850ac4d9aac48350eaa1d31f3aaef7") @@ -44,26 +49,21 @@ ("ledger-mode" . "f8463744191b4feb9fea54190917663f7ba26102") ("let-alist" . "ef3c02fa292b6e32769945bbbfb7f2e5ac574b64") ("log4e" . "7df0c1ff4656f8f993b87064b1567618eadb5546") + ("lsp-mode" . "34de3040f01aeda4eceadc1ccd6a723120ee4598") ("magit" . "8b45756390e43bfc3247dd85bf5f7738516e569a") ("magit-gitflow" . "cc41b561ec6eea947fe9a176349fb4f771ed865b") ("magit-popup" . "b8e886c4f2242d6c58f84d4549af712e86360db1") ("markdown-mode" . "399df42755ccf31cecb61c9f5d8ad72bc30d7e4b") ("matlab-mode" . "e14d97df706049ea2e2d6e5b515fdbd08cd94dd3") ("melpa" . "ee055cc258692a92f727633306adf7df31267479") - ("messages-are-flowing" . "d582a564a63b7b90764ffc5c618bc5300225d0ab") ("notmuch" . "963e363a234f1c8bdf1ae68956f80a2538bee7dc") + ("ob-spice" . "a3581400b253330231573e100c39548e5d891cfd") + ("olivetti" . "0bc5e98b8456493084d1bd3df35e92a12c5da3b2") + ("openscad" . "176ea07abba6f5f8fb5a130143f23b397416c789") ("orderless" . "1f1e0380e2a8cd4fc29b8cc2e00cb01b56d86fbc") - ("org" . "583012b5e129ca79c05109ba68c37f17ffca4930") - ("org-bullets" . "767f55feb58b840a5a04eabfc3fbbf0d257c4792") - ("org-caldav" . "8569941a0a5a9393ba51afc8923fd7b77b73fa7a") - ("org-clock-convenience" . "4e522706a90a504c75d377161005f9543575ea02") - ("org-edna" . "8a14af7baadb3e4021d40e2b4ebdcee66dab4783") - ("org-noter" . "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d") - ("org-pdftools" . "8cc15bb8014ed1f047eecc0abd8bf447f86c0505") - ("org-ref" . "9465abc54a296b4b2f745b4bb3a28ec4dad3a0cb") - ("org-reveal" . "84039bb499290926511b04749882ecb5eda45a0c") - ("org-roam" . "87403b330ce713a892e3e35ff4174a8e2727e24d") - ("org-time-budgets" . "207dda6308cfc73e16dcfd84237a560c27428beb") + ("org-roam" . "f819720c510185af713522c592833ec9f2934251") + ("org-time-budgets" . "439e73b730a9e9434c93b3b1892780e5d128246a") + ("org-web-tools" . "ebc7888f4f4cad26ec1298edd7bf606a5ea2d564") ("parsebib" . "3497b6068d78ae15ba1eaf94e4315d18e9ae6b00") ("pass" . "919d8e3826d556433ab67d4ee21a509d209d1baa") ("password-store" . "07b169ec32ad6961ed8625a0b932a663abcb01d2") @@ -71,24 +71,36 @@ ("pdf-tools" . "c510442ab89c8a9e9881230eeb364f4663f59e76") ("peep-dired" . "1d410a4e48db07a942e54d3b83a85c7a7ec0aab3") ("pinentry" . "cd942f755c38a7ac270ce858bb887ebdd59edd26") - ("pkg-info" . "76ba7415480687d05a4353b27fea2ae02b8d9d61") ("popup-el" . "9d104d4bbbcb37bbc9d9ce762e74d41174683f86") - ("projectile" . "33bc91e7518fb8cecd89580f16e0ac21799de2c2") + ("project" . "e4763443d23710559a92748801db5d6de25e6221") ("rainbow-mode" . "f780ddb18c2a73a666d093f606df92058e5601ea") + ("redtick" . "d30637a536533830693eada29978f275af27aa26") + ("rustic" . "ed68fd3bb410869e1a4ce3943b5913ea88d9b509") ("s.el" . "43ba8b563bee3426cead0e6d4ddc09398e1a349d") + ("sauron" . "5daade4836da5b1b2ab26d84128d6c38328a5d52") ("shell-pop-el" . "4b4394037940a890a313d715d203d9ead2d156a6") ("shr-tag-pre-highlight.el" . "6182f43a36b0f82ba6edcf6e423b5f69a46a814e") ("spacemacs-theme" . "6c26717c0ec64af08ab3fd81e88ef03003543c5d") ("speed-of-thought-lisp" . "ed2356a325c7a4a88ec1bd31381c8666e8997e97") ("spice-mode" . "e5e0644f03f9696f56dd69e2b6979da7f30ed600") + ("spinner" . "2daa167bec1c7566d662d48613a94453536b524a") + ("spray" . "74d9dcfa2e8b38f96a43de9ab0eb13364300cb46") + ("ssh-tunnels" . "d32e2072f50bcbde787196abb5862735837dc8be") ("straight.el" . "a7f94876b2bf96d2595706270be6630ecc94f0d3") ("swiper" . "f8b1ab8c0ec331a4f8f6621f9021811075c71332") ("tablist" . "faab7a035ef2258cc4ea2182f67e3aedab7e2af9") + ("toc-org" . "5deaec41ed0e5c51715737d7f74c5ae1b3c00387") ("transient" . "88d935c7cb9f175871c4cfea7eef2c0514d03b06") ("treepy.el" . "306f7031d26e4ebfc9ff36614acdc6993f3e23c3") ("use-package" . "d2640fec376a8458a669e7526e63e5870d875118") ("use-package-hydra" . "8cd55a1128fbdf6327bb38a199d206225896d146") + ("vundo" . "4b6551748b205dde157bccafcfdd4637071939c7") + ("whole-line-or-region" . "79731cbbf173dbb9dcce3457baa1056e906d98db") ("window-numbering.el" . "10809b3993a97c7b544240bf5d7ce9b1110a1b89") ("with-editor" . "48ca9bb49a1a7a37e85606de9d327a14030d4380") + ("xref" . "83cedce58124a81ff7f323d7fbf553fbeadfa4b5") + ("xterm-color" . "1a4012854c69a5cdaeb5a73d2ad705011892fca3") + ("yasnippet" . "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6") + ("yasnippet-snippets" . "be823d7e1a1a46454d60a9f3dabb16b68b5dd853") ("zetteldeft" . "19943a39e1c5f53dae6fac107ce3a7d2e4c5f2f8")) :alpha -- cgit v1.2.3 From 6c504d10f07a51af0372695d92d144b3440fc4bc Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 18 Mar 2022 14:47:25 +0100 Subject: Update exwm monitor config --- init-exwm.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init-exwm.org b/init-exwm.org index 8acf733..0ce1f07 100644 --- a/init-exwm.org +++ b/init-exwm.org @@ -50,7 +50,7 @@ set keyboard (use-package exwm-randr :config (setq exwm-randr-workspace-output-plist - (when (equal fpi/current-device "pan") '(0 "DisplayPort-3" 1 "DisplayPort-5"))) + (when (equal fpi/current-device "pan") '(0 "DisplayPort-4" 1 "DisplayPort-6"))) ;; (when (equal system-name "pan") ;; (start-process-shell-command "xrandr" nil "xrandr --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --off --output HDMI-A-0 --off --output DisplayPort-3 --mode 2560x1440 --pos 0x612 --rotate normal --output DisplayPort-4 --off --output DisplayPort-5 --mode 2560x1440 --pos 2560x0 --rotate right --output DisplayPort-6 --off") ;; (exwm-workspace-add)) -- cgit v1.2.3 From 1747a88fed064653e52c5da3b83094a53c7bd5d2 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Mar 2022 17:47:39 +0100 Subject: Pull Roam from git & fix templates --- emacs-init.org | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 5e59124..a58f7ad 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4362,7 +4362,11 @@ Set some prettify symbols for org mode. Org-roam mainly provides a display of backlinks to the current file. This allows the creation of a one-subject-per-file Zettelkasten. #+begin_src emacs-lisp :tangle tangle/emacs-init.el :noweb yes :results silent (use-package org-roam - :straight (:no-byte-compile t) + :straight (:host github + :repo "org-roam/org-roam" + :files (:defaults "extensions/*") + :no-byte-compile t) + :after magit :custom (org-roam-directory "~/git/projects/zettel") (org-roam-v2-ack t) @@ -4428,7 +4432,6 @@ As =C-c n t= is already taken, use =o= (mnemonic: “open”) instead. ("C-c n o" . fpi/org-roam-todo) #+end_src -- [ ] ntrdn **** org-roam capture templates Here we define some capture templates for roam files. Using variables in the source block header we can define the template contents in quote blocks below. @@ -4439,22 +4442,22 @@ Here we define some capture templates for roam files. Using variables in the sou #+begin_src emacs-lisp :tangle no :noweb yes :results code silent `( ("d" "Default (avoid this)" plain "%?" - :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" ,default) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" ,default) :unnarrowed t) ("l" "Link/Reference" plain "%?" - :target (file+head "ref/${slug}.org" ,ref) + :if-new (file+head "Ref/${slug}.org" ,ref) :unnarrowed t) ("e" "Entity (Person, Company, …)" plain "%?" - :target (file+head "Entities/${slug}.org" ,entities) + :if-new (file+head "Entities/${slug}.org" ,entities) :unnarrowed t) ("w" "Work related zettel" plain "%?" - :target (file+head "Work/%<%Y%m%d%H%M%S>-${slug}.org" ,work) + :if-new (file+head "Work/%<%Y%m%d%H%M%S>-${slug}.org" ,work) :unnarrowed t) ("p" "Personal/Non-work related zettel" plain "%?" - :target (file+head "Personal/%<%Y%m%d%H%M%S>-${slug}.org" ,personal) + :if-new (file+head "Personal/%<%Y%m%d%H%M%S>-${slug}.org" ,personal) :unnarrowed t) ("P" "Private zettel" plain "%?" - :target (file+head "Personal/Private/%<%Y%m%d%H%M%S>-${slug}.org" ,private) + :if-new (file+head "Personal/Private/%<%Y%m%d%H%M%S>-${slug}.org" ,private) :unnarrowed t) ) #+end_src @@ -4467,8 +4470,10 @@ As capture templates get more complex storing the template itself in a separate #+end_quote #+NAME: org-roam-template-ref #+begin_quote +:PROPERTIES: +:ROAM_REFS: ${ref} +:END: #+title: ${title} -#+ROAM_KEY: ${ref} #+end_quote #+NAME: org-roam-template-entities #+begin_quote @@ -4493,7 +4498,16 @@ As capture templates get more complex storing the template itself in a separate **** org-roam-protocol #+begin_src emacs-lisp (use-package org-roam-protocol - :after org-roam) + :after org-roam + :custom (org-roam-capture-ref-templates + '(("zr" "roam ref" plain "%?" + :if-new (file+head "Ref/${slug}.org" + "#+title: ${title}") + :unnarrowed t) + ("zf" "roam fleeting ref" plain "%?" + :if-new (file+head "Fleeting/${slug}.org" + "#+title: ${title}") + :unnarrowed t)))) #+end_src **** org-roam-bibtex #+begin_src emacs-lisp @@ -4865,8 +4879,10 @@ To be compatible with [[https://github.com/sprig/org-capture-extension][this chr "* %? [[%:link][%:description]] :PROPERTIES: :CREATED: %U +:ID: %(org-id-new) +:ROAM_REFS: %:link :END: -#+ROAM_KEY: %:link") +") #+end_src ***** Old templates Templates I no longer use, but may be interesting. -- cgit v1.2.3 From 0a71f747129eb8d365dfc384803cc7c6d523b575 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Mar 2022 17:48:00 +0100 Subject: Enable org-protocol --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index a58f7ad..3152d50 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4836,7 +4836,7 @@ Instead of project related capture templates, I use the same template for all ta :ID: 28704dfb-7647-43ac-b96f-5967383d1188 :END: Org-protocol is an easy way to capture stuff from outside emacs. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle tangle/emacs-init.el :eval yes :results silent (use-package org-protocol) #+end_src To install the handler for =org-protocol://= URIs under linux you probably need a =.desktop= file similar to the one below. Place it under =~/.local/share/applications= and run src_shell{update-desktop-database}. -- cgit v1.2.3 From 21359a651b5b405b63cd2de802512de7cb18e810 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Mar 2022 17:50:43 +0100 Subject: Add function to create constant, unique filenames --- emacs-init.org | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/emacs-init.org b/emacs-init.org index 3152d50..ea29924 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4306,6 +4306,84 @@ This function is handy to use in header arguments to create names based on the c (post (or post ""))) (format "%s%s%s" pre (nth 4 (org-heading-components)) post))) #+end_src + +We can also create unique names based on the source block content and header information. +#+begin_src emacs-lisp +(defun fpi/org-babel-get-src-block-hash (&optional block) + "Return a hash based on src block content and header. + +This function tries to not take any file positions into account +and always return the same hash given the same source code and +same header arguments. + +`org-babel-sha1-hash' may provide the same feature, but I +discovered that function only after writing this." + (save-mark-and-excursion + (if block (org-babel-goto-named-src-block block)) + (let* ((info (org-babel-get-src-block-info t)) + (body (nth 1 info)) + (header (nth 2 info)) + (hashstring (format "%s%s" body header))) + (md5 hashstring)))) + +(setq fpi/org-babel-outfile-directory "/tmp/babel") +(make-directory fpi/org-babel-outfile-directory t) + +(defun fpi/org-babel-src-block-temp-file (&optional suffix prefix directory block) + "Return a unique filename based on src block content and header. + +This function is intended as an alternative to +`org-babel-temp-file' to provide unique and constant output +filenames. Optionally provide SUFFIX or PREFIX of the filename +and the file DIRECTORY. If SUFFIX or PREFIX is a list its content +will be concatenated. Default directory is +`org-babel-temporary-directory'. Optionally provide a source +block name BLOCK. + " + ;; FIXME Way to create really unique names. In case same code can produce different outputs (e.g. based on time, file context) + (let ((hash (fpi/org-babel-get-src-block-hash block)) + (directory (or + directory + fpi/org-babel-outfile-directory)) + (suffix (if (listp suffix) + (mapconcat (lambda (x) + (cond ;; FIXME possible to handle all cases without cond? + ((symbolp x) (symbol-name x)) + ((numberp x) (number-to-string x)) + (t x) + )) suffix "") + suffix)) + (prefix (if (listp prefix) + (mapconcat (lambda (x) + (cond ;; FIXME possible to handle all cases without cond? + ((symbolp x) (symbol-name x)) + ((numberp x) (number-to-string x)) + (t x) + )) prefix "") + prefix)) + (prefix (or prefix "")) + ) + (expand-file-name (format "%s%s%s" prefix hash suffix) directory) + )) +(defalias 'fpi/ob-name #'fpi/org-babel-src-block-temp-file) +#+end_src + +Now wen can set something like ~:file (fpi/ob-name ".png")~ on all source blocks where we do not care about the output file name. + +Some tests for ~fpi/ob-name~: +#+begin_src emacs-lisp :results value replace :tangle no :exports both +(list + (fpi/ob-name) + (fpi/ob-name "-SUFFIX") + (fpi/ob-name nil "PREFIX-") + (fpi/ob-name "-SUFFIX" "PREFIX-") + (fpi/ob-name '("-SUF" 42 FIX)) + ) +#+end_src + +#+RESULTS: +| /tmp/babel-gwZcjh/291f3f60f3e5d467584a3b5bda4d7b05 | /tmp/babel-gwZcjh/291f3f60f3e5d467584a3b5bda4d7b05-SUFFIX | /tmp/babel-gwZcjh/PREFIX-291f3f60f3e5d467584a3b5bda4d7b05 | /tmp/babel-gwZcjh/PREFIX-291f3f60f3e5d467584a3b5bda4d7b05-SUFFIX | /tmp/babel-gwZcjh/291f3f60f3e5d467584a3b5bda4d7b05-SUF42FIX | + *** ox-reveal #+BEGIN_SRC emacs-lisp (use-package ox-reveal -- cgit v1.2.3 From 8280177fb14b2eb98daf2523b5ccf4b90e89013a Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Mar 2022 17:53:42 +0100 Subject: Use multiple personal imaps --- emacs-private.el.gpg | Bin 1271 -> 1289 bytes gnus.org | 23 ++++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index a930f89..1efdb54 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ diff --git a/gnus.org b/gnus.org index dae6d1a..0bb355e 100644 --- a/gnus.org +++ b/gnus.org @@ -65,11 +65,18 @@ To avoid confusion I enable namespaces for imap groups. #+end_src **** Personal mailbox #+begin_src emacs-lisp :tangle no :noweb-ref secondary-select-methods -(add-to-list 'gnus-secondary-select-methods `(nnimap ,@private/personal-imap-info - (nnimap-stream ssl) - (nnir-search-engine imap) - (nnimap-inbox "INBOX"))) +(mapc + (lambda (info) + (add-to-list + 'gnus-secondary-select-methods + `(nnimap + ,@info + (nnimap-stream ssl) + (nnir-search-engine imap) + (nnimap-inbox "INBOX")))) + private/personal-imap-info) #+end_src + **** RSS/Atom over nntp Setup a secondary imap server and a local nntp server I use to fetch RSS/Atom Feeds asynchronously. @@ -185,12 +192,14 @@ Background fetching for gnus. See the manual and [[https://www.emacswiki.org/ema To define different scoring files for different groups I set [[info:gnus#Home Score File][home score files]] based on the group name. #+begin_src emacs-lisp (setq gnus-home-score-file - '(("^nnimap" "nnimap.SCORE") ;; w/ author scoring + '(("misc@" "nntp_gmane.SCORE") + ("^nnimap" "nnimap.SCORE") ;; w/ author scoring ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring )) (setq gnus-home-adapt-file - '(("^nnimap" "nnimap.ADAPT") + '(("misc@" "nntp_gmane.SCORE") + ("^nnimap" "nnimap.ADAPT") ("gmane" "nntp_gmane.ADAPT") ("^nntp\\+localhost" "nntp_global.ADAPT"))) #+end_src @@ -317,7 +326,7 @@ Commands to interact with the gnus cloud are prefixed with =~= in the group buff #+begin_src emacs-lisp :noweb yes (use-package gnus-cloud :custom - (gnus-cloud-method (concat "nnimap:" (car private/personal-imap-info))) + (gnus-cloud-method (concat "nnimap:" (caar private/personal-imap-info))) (gnus-cloud-synced-files '("~/.authinfo.gpg" ;; "~/.gnus.registry.eieio" ;; (:directory "~/News" :match ".*.\\(SCORE\\|ADAPT\\)") -- cgit v1.2.3 From ca14470d16c2c42bc643206e12836aab75bc9622 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 20 Mar 2022 17:48:24 +0100 Subject: Add functions for derivatives --- gnuplot.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnuplot.org b/gnuplot.org index 2f8a6bf..58e9dce 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -57,6 +57,12 @@ avg10(x)=(back10=back9,(samples($0,9)*avg9(x)+back10)/samples($0,10)) avg11(x)=(back11=back10,(samples($0,10)*avg10(x)+back11)/samples($0,11)) avg12(x)=(back12=back11,(samples($0,11)*avg11(x)+back12)/samples($0,12)) #+end_src + +And some derivatives functions. +#+begin_src gnuplot +d(y) = ($0 == 0) ? (y1 = y, 1/0) : (y2 = y1, y1 = y, y1-y2) +d2(x,y) = ($0 == 0) ? (x1 = x, y1 = y, 1/0) : (x2 = x1, x1 = x, y2 = y1, y1 = y, (y1-y2)/(x1-x2)) +#+end_src * Colors =podo= is a good standard colorblind friendly colorsequence. #+begin_src gnuplot -- cgit v1.2.3 From d2bf2f9e394b443cb27081de9ccd956e9549ff16 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 28 Mar 2022 17:29:56 +0200 Subject: Switch to possibly multiple .el.gpg. secret files --- emacs-init.org | 5 ++--- emacs-private-00.el.gpg | Bin 0 -> 1289 bytes emacs-private.el.gpg | Bin 1289 -> 0 bytes 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 emacs-private-00.el.gpg delete mode 100644 emacs-private.el.gpg diff --git a/emacs-init.org b/emacs-init.org index ea29924..cb35283 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -170,9 +170,8 @@ A similar behaviour can be achieved using [[https://github.com/AGWA/git-crypt][g details regarding my emacs configuration in =emacs-private.el.gpg= and load this file here. #+begin_src emacs-lisp -(setq secret-file (expand-file-name "emacs-private.el.gpg" - user-emacs-directory)) -(load secret-file) +(mapc (lambda (file) (load file)) + (directory-files default-directory t "emacs-.*el.gpg")) #+end_src This is the content of =init.el=. Notice the ~:tangle tangle/init.el~ diff --git a/emacs-private-00.el.gpg b/emacs-private-00.el.gpg new file mode 100644 index 0000000..1efdb54 Binary files /dev/null and b/emacs-private-00.el.gpg differ diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg deleted file mode 100644 index 1efdb54..0000000 Binary files a/emacs-private.el.gpg and /dev/null differ -- cgit v1.2.3 From 0705dd00930cd993cc97a277dfdf043775da6d3a Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 3 Apr 2022 15:27:33 +0200 Subject: Add script to interactively place rotated labels --- gnuplot.org | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/gnuplot.org b/gnuplot.org index 58e9dce..be820a4 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -26,6 +26,8 @@ set datafile missing NaN A macro to easily reset gnuplot and also reload my settings. #+begin_src gnuplot init="load '~/.gnuplot'" +before_refresh="" # Commands to eval before each refresh +r="@before_refresh;refresh" #+end_src Here is a handy function to define colors with individual rgb integers instead of the hex notation. Example usage: ~plot x w l lc rgb rgb(255,80,0)~. Alternatively gnuplot also supports hsv colors with ~hsv2rgb(h,s,v)~. @@ -37,7 +39,7 @@ When setting the column using a variable you can not use the shorthand syntax ~$ #+begin_src gnuplot c(a)=column(a) #+end_src - +* Mathematical functions A collection of functions that can calculate a running average. #+begin_src gnuplot # running averages @@ -63,6 +65,12 @@ And some derivatives functions. d(y) = ($0 == 0) ? (y1 = y, 1/0) : (y2 = y1, y1 = y, y1-y2) d2(x,y) = ($0 == 0) ? (x1 = x, y1 = y, 1/0) : (x2 = x1, x1 = x, y2 = y1, y1 = y, (y1-y2)/(x1-x2)) #+end_src + +Functions to convert between radians and degrees. +#+begin_src gnuplot +rad(deg)=deg/180*pi +deg(rad)=rad/pi*180 +#+end_src * Colors =podo= is a good standard colorblind friendly colorsequence. #+begin_src gnuplot @@ -103,7 +111,6 @@ Also set output to a =.ps= file. After that: ps2ps -sPAGESIZE=a4 yourfilename.ps new_dina4_file.ps #+end_src To finish either use something like =ps2pdf= or view the =.ps= file with =ghostview=. - * Interactive Label Placement [[http://www.gnuplotting.org/interactive-label-placing/][Source]]. I adapted the =label_loop= function to newer gnuplot syntax & added functionality for multiple arguments. The function call to @@ -111,7 +118,7 @@ added functionality for multiple arguments. The function call to macro like this: ~@iLabel "label1" "label2"~ #+begin_src gnuplot -iLabel = "call '~/git/projects/dotfiles/tangle/label_loop.gp " +iLabel = "call '~/git/projects/dotfiles/tangle/label_loop.gp' " #+end_src #+begin_src gnuplot :tangle tangle/label_loop.gp @@ -145,3 +152,59 @@ do for [ELEMENT in ARG1." ".ARG2." ".ARG3." ".ARG4." ".ARG5] { } } #+end_src + +We can also interactively place rotated labels. Getting the label rotation correct is somewhat tricky and heavily relies on macros. Also the use of ~refresh~ limits the usefulness of this for multiplots. +#+begin_src gnuplot :tangle tangle/label.gp +# label +# Script to interactively position a rotated label. +# +# To update after changing graph size rotation angles are scaled with +# the scaling() function. List of useful macros you should define: +# scaling(_)= (1.0*(GPVAL_TERM_YMAX-GPVAL_TERM_YMIN)/(GPVAL_TERM_XMAX-GPVAL_TERM_XMIN))/((GPVAL_Y_MAX-GPVAL_Y_MIN)/(GPVAL_X_MAX-GPVAL_X_MIN)) +# label_reset= "@label_unset;@label_labels;replot;" +# label_init= "undefine label_labels label_unset" + +if (!exists("label_number")) {label_number = 1} +if (!exists("label_labels")) {label_labels = ""} +if (!exists("label_unset")) {label_unset = ""} + +do for [ELEMENT in ARG1." ".ARG2." ".ARG3." ".ARG4." ".ARG5] { + print(ELEMENT) + while (1) { + next=0 + + array pointsX[2]; array pointsY[2] + do for [point=1:2]{ + pause mouse any + if( MOUSE_BUTTON==1 ) { + pointsX[point]=MOUSE_X + pointsY[point]=MOUSE_Y + } else { next=1;break } + } + if(next){break} + if (pointsX[2] == pointsX[1]){ dx = 1e-20 } + else { dx = pointsX[2] - pointsX[1] } + dy = pointsY[2] - pointsY[1] + + cmd=sprintf("set label %i \"%s\" at %f,%f rotate by deg(atan(%f*scaling(NaN)));",\ + label_number, ELEMENT, pointsX[1], pointsY[1],dy/dx) + eval(cmd); refresh + } + print cmd + label_labels = label_labels.cmd + label_unset = label_unset.sprintf("unset label %i;", label_number) + label_number=label_number+1 +} +refresh +#+end_src + +To make using the script easier define a few macros/functions. +#+begin_src gnuplot +scaling(_)= (1.0*(GPVAL_TERM_YMAX-GPVAL_TERM_YMIN)/(GPVAL_TERM_XMAX-GPVAL_TERM_XMIN))/((GPVAL_Y_MAX-GPVAL_Y_MIN)/(GPVAL_X_MAX-GPVAL_X_MIN)) # functions need to have at least one argument +label="call '~/git/projects/dotfiles/tangle/label.gp' " + +label_reset= "@label_unset;@label_labels;refresh;" +before_refresh = before_refresh."set output GPVAL_OUTPUT;@label_unset;@label_labels;" +label_init= "@label_unset;label_labels='';label_unset=''" +@label_init # clear labels each @init +#+end_src -- cgit v1.2.3 From b607f3d82a0b5ca483e47e49e702ff51c93a63ac Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 28 Mar 2022 18:04:32 +0200 Subject: Update org latex packages --- emacs-init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index cb35283..4b8f32c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3508,8 +3508,9 @@ Use imagemagick and standalone class for latex preview. Also let us define some more default latex packages. #+begin_src emacs-lisp :noweb-ref org-config :tangle no -(add-to-list 'org-latex-packages-alist '("" "uniinput")) +(add-to-list 'org-latex-packages-alist '("mathletters" "ucs")) (add-to-list 'org-latex-packages-alist '("" "siunitx")) +(add-to-list 'org-latex-packages-alist '("" "personal")) (add-to-list 'org-latex-packages-alist '("" "tikz")) (add-to-list 'org-latex-packages-alist '("" "circuitikz")) #+end_src -- cgit v1.2.3 From e1a3315de18141c95ada11e09a93a46b77e84cb9 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 29 Mar 2022 12:14:10 +0200 Subject: Allow possibly multiple emacs-.el(.gpg) init files The load order is set by the number in their file name. Also fix some symlinks and exwm trying to tangle to root locations when invoking tangle.sh --- emacs-00-private.el.gpg | Bin 0 -> 1289 bytes emacs-init.org | 19 ++++++++++--------- emacs-private-00.el.gpg | Bin 1289 -> 0 bytes init-exwm.org | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 emacs-00-private.el.gpg delete mode 100644 emacs-private-00.el.gpg diff --git a/emacs-00-private.el.gpg b/emacs-00-private.el.gpg new file mode 100644 index 0000000..1efdb54 Binary files /dev/null and b/emacs-00-private.el.gpg differ diff --git a/emacs-init.org b/emacs-init.org index 4b8f32c..d41797c 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1,5 +1,5 @@ # -*- coding: utf-8-unix -*- -#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-init.el :results silent :noweb yes +#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-10-init.el :results silent :noweb yes * Contents :QUOTE:TOC_2_gh: #+BEGIN_QUOTE - [[#overview][Overview]] @@ -77,10 +77,10 @@ directory. Instead of symlinking the files could also be directly tangled to =~/.emacs.d/=. #+BEGIN_SRC shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" :noweb yes ln -siv $(pwd)/emacs-init.org ~/.emacs.d/ -ln -siv $(pwd)/tangle/emacs-init.el ~/.emacs.d/ -ln -siv $(pwd)/tangle/init-exwm.el ~/.emacs.d/ -ln -siv $(pwd)/emacs-private.el.gpg ~/.emacs.d/ ln -siv $(pwd)/tangle/init.el ~/.emacs.d/ +ln -siv $(pwd)/tangle/emacs-10-init.el ~/.emacs.d/ +ln -siv $(pwd)/tangle/init-exwm.el ~/.emacs.d/ +ls emacs-*.el.gpg | xargs -I FILE ln -siv $(pwd)/FILE ~/.emacs.d <> #+END_SRC @@ -190,7 +190,8 @@ header argument in the source code. (append default-frame-alist '((inhibit-double-buffering . t)))) (setq posframe-inhibit-double-buffering t) -(load (expand-file-name "emacs-init.el" user-emacs-directory)) +(mapc (lambda (file) (load file)) + (directory-files user-emacs-directory t "^emacs-.*el\\(.gpg\\)\\{0,1\\}")) #+end_src I always wanted to reorganize my old init file with >5000 lines, but @@ -1385,7 +1386,7 @@ This call now creates a custom theme based on the settings in the sections #+end_src Now we just have to link the tangled themes to the ~load-path~ -#+BEGIN_SRC shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" +#+BEGIN_SRC shell :results silent :noweb-ref symlinks :tangle no ln -siv $(pwd)/tangle/spacemacs-dark-customizations-theme.el ~/.emacs.d/ ln -siv $(pwd)/tangle/spacemacs-light-customizations-theme.el ~/.emacs.d/ #+END_SRC @@ -4438,7 +4439,7 @@ Set some prettify symbols for org mode. #+end_src *** org-roam Org-roam mainly provides a display of backlinks to the current file. This allows the creation of a one-subject-per-file Zettelkasten. -#+begin_src emacs-lisp :tangle tangle/emacs-init.el :noweb yes :results silent +#+begin_src emacs-lisp :tangle tangle/emacs-10-init.el :noweb yes :results silent (use-package org-roam :straight (:host github :repo "org-roam/org-roam" @@ -4914,7 +4915,7 @@ Instead of project related capture templates, I use the same template for all ta :ID: 28704dfb-7647-43ac-b96f-5967383d1188 :END: Org-protocol is an easy way to capture stuff from outside emacs. -#+begin_src emacs-lisp :tangle tangle/emacs-init.el :eval yes :results silent +#+begin_src emacs-lisp :tangle tangle/emacs-10-init.el :eval yes :results silent (use-package org-protocol) #+end_src To install the handler for =org-protocol://= URIs under linux you probably need a =.desktop= file similar to the one below. Place it under =~/.local/share/applications= and run src_shell{update-desktop-database}. @@ -6068,7 +6069,7 @@ I change the group buffer to something more memorable. This needs to be set befo #+end_src To synchronize the database across devices I symlink it to my central synchronization directory: #+begin_src shell :noweb-ref symlinks :tangle no -ln -siv ~/sync/bbdb/bbdb ~/.emacs.d/1 +ln -siv ~/sync/bbdb/bbdb ~/.emacs.d/bbdb #+end_src ** Compile Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]]. diff --git a/emacs-private-00.el.gpg b/emacs-private-00.el.gpg deleted file mode 100644 index 1efdb54..0000000 Binary files a/emacs-private-00.el.gpg and /dev/null differ diff --git a/init-exwm.org b/init-exwm.org index 0ce1f07..46bf793 100644 --- a/init-exwm.org +++ b/init-exwm.org @@ -3,7 +3,7 @@ * Starting EXWM Either start exwm in =.xinitrc= or if using a display manager setup a desktop file similar to this: -#+HEADER: :tangle /sudo::/usr/share/xsessions/exwm.desktop +##+HEADER: :tangle /sudo::/usr/share/xsessions/exwm.desktop #+begin_src conf [Desktop Entry] Name=EXWM @@ -13,7 +13,7 @@ Exec=exwm-start Type=Application #+end_src With the =exwm-start= script: -#+HEADER: :tangle /sudo::/usr/local/bin/exwm-start +##+HEADER: :tangle /sudo::/usr/local/bin/exwm-start #+begin_src shell :tangle-mode (identity #o755) #!/usr/bin/env sh -- cgit v1.2.3 From e566f221df4e561876db76e28a208a70bcc24626 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 1 May 2022 17:04:25 +0200 Subject: Use org-num by default & reorganize org latex settings --- emacs-init.org | 116 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 29 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index d41797c..c2b1237 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3322,8 +3322,6 @@ I use a org version with some custom patches. Rather than using something like = ("C-c a" . org-agenda) ("C-c l" . org-store-link)) :custom - (org-format-latex-options '(:foreground default :background default :scale 1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers - ("begin" "$1" "$" "$$" "\\(" "\\["))) (org-catch-invisible-edits 'smart) (org-agenda-diary-file "~/sync/diary.org") (org-use-speed-commands (lambda () (and (looking-at org-outline-regexp) (looking-back "^\**")))) @@ -3342,8 +3340,9 @@ I use a org version with some custom patches. Rather than using something like = <> )) <> + :hook + <> :config - (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (add-to-list 'org-structure-template-alist (cons "f" "figure")) ;; (add-to-list 'org-tags-exclude-from-inheritance "MARKED") <> @@ -3407,10 +3406,6 @@ I use a org version with some custom patches. Rather than using something like = #+END_SRC #+begin_src emacs-lisp -(use-package ox - :custom - (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 :straight t :hook (org-load . org-pdftools-setup-link)) @@ -3419,7 +3414,6 @@ I use a org version with some custom patches. Rather than using something like = (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) <>) #+end_src - I prefer to use timestamp based ID's as they are #+begin_src emacs-lisp :tangle no :noweb-ref org-id-custom (org-id-method 'ts) @@ -3495,11 +3489,19 @@ Here is a list of nice ones: ◉, ○, ►, •. The default ones are ~'("◉" " :custom (org-bullets-bullet-list '(" ")) :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) #+end_src -Use imagemagick and standalone class for latex preview. #+begin_src emacs-lisp -(setq org-preview-latex-default-process 'imagemagick) -(setq - org-format-latex-header +(use-package org-num + :delight + :after org + :hook (org-mode . org-num-mode)) +#+end_src +*** Org & Latex +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: + +#+begin_src emacs-lisp :noweb-ref org-custom +(org-format-latex-header "\\documentclass{standalone} \\usepackage[usenames]{color} [PACKAGES] @@ -3507,20 +3509,85 @@ Use imagemagick and standalone class for latex preview. \\pagestyle{empty} % do not remove") #+end_src -Also let us define some more default latex packages. -#+begin_src emacs-lisp :noweb-ref org-config :tangle no -(add-to-list 'org-latex-packages-alist '("mathletters" "ucs")) +#+begin_src emacs-lisp :noweb-ref org-custom +(org-latex-default-packages-alist + '(("mathletters" "ucs") + ("AUTO" "inputenc" t ("pdflatex")) + ("T1" "fontenc" t ("pdflatex")) + ("" "graphicx" t) + ("" "grffile" t) + ("" "longtable" nil) + ("" "wrapfig" nil) + ("" "rotating" nil) + ("normalem" "ulem" t) + ("" "amsmath" t) + ("" "textcomp" t) + ("" "amssymb" t) + ("" "capt-of" nil) + ("" "hyperref" nil))) +#+end_src + +#+begin_src emacs-lisp :noweb-ref org-config (add-to-list 'org-latex-packages-alist '("" "siunitx")) (add-to-list 'org-latex-packages-alist '("" "personal")) +(add-to-list 'org-latex-packages-alist '("" "svg")) (add-to-list 'org-latex-packages-alist '("" "tikz")) (add-to-list 'org-latex-packages-alist '("" "circuitikz")) #+end_src + +#+begin_src emacs-lisp :noweb-ref org-hook +(org-mode . turn-on-org-cdlatex) +#+end_src +*** Org Exporter =ox= #+begin_src emacs-lisp -(use-package org-num - :delight - :after org - :hook (org-mode . org-num-mode)) +(use-package ox + :custom + (org-export-with-broken-links 'match) + (org-export-backends '(ascii beamer html icalendar latex man md odt org groff koma-letter))) +#+end_src +**** Latex & Beamer +#+begin_src emacs-lisp +(use-package ox-latex + :custom + (org-latex-compiler "lualatex") + (org-latex-pdf-process + '("latexmk -f -pdf -%latex -shell-escape -interaction=nonstopmode -output-directory=%o %f"))) +#+end_src +Allow ~\framebreak{}~ by default, set a default theme and we also redefine the beamer latex class to use an aspect ratio of 16:9. The frame size will then be 160 mm by 90 mm. +#+begin_src emacs-lisp +(use-package ox-beamer + :custom + (org-beamer-frame-default-options "allowframebreaks") + (org-beamer-theme "Hannover") + :config + (remove (assoc "beamer" org-latex-classes) org-latex-classes) + (add-to-list 'org-latex-classes + '("beamer" + "\\documentclass[presentation,aspectratio=169]{beamer}" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) + ) +#+end_src +Latex preview +#+begin_src emacs-lisp :tangle no :noweb-rew org-custom +(org-preview-latex-default-process 'imagemagick) +(org-format-latex-options + '(:foreground default :background default :scale 1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))) +(org-preview-latex-process-alist +'( +(dvipng :programs ("latex" "dvipng") :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvipng -D %D -T tight -bg Transparent -o %O %f")) +(dvisvgm :programs ("latex" "dvisvgm") :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" :image-size-adjust (1.7 . 1.5) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) +(imagemagick :programs ("latex" "convert") :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("lualatex -interaction nonstopmode -output-directory %o %f") :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")) +(pdf2svg :programs ("lualatex" "pdf2svg") :description "pdf > svg" :message "" :image-input-type "pdf" :image-output-type "svg" :image-size-adjust (2.0 . 2.0) :latex-compiler ("lualatex -interaction nonstopmode -output-directory %o %f") :image-converter ("pdf2svg %f %O")))) #+end_src +**** ox-reveal +#+BEGIN_SRC emacs-lisp +(use-package ox-reveal + :straight t) +(use-package reveal) +(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/") +#+END_SRC *** Timekeeping & Clocking - Remove clocks with zero time. - Save a clocking history of the list 50 clocked items. @@ -4297,7 +4364,7 @@ Also display remote images by downloading them. #+end_src #+begin_src emacs-lisp :noweb-ref ob-hooks :tangle no -(org-babel-after-execute . org-display-inline-images) +(org-babel-after-execute . org-redisplay-inline-images) #+end_src *** Babel This function is handy to use in header arguments to create names based on the current org heading. E.g. =:var data=(fpi/format-headline "/tmp/prefix_")= @@ -4385,15 +4452,6 @@ Some tests for ~fpi/ob-name~: #+RESULTS: | /tmp/babel-gwZcjh/291f3f60f3e5d467584a3b5bda4d7b05 | /tmp/babel-gwZcjh/291f3f60f3e5d467584a3b5bda4d7b05-SUFFIX | /tmp/babel-gwZcjh/PREFIX-291f3f60f3e5d467584a3b5bda4d7b05 | /tmp/babel-gwZcjh/PREFIX-291f3f60f3e5d467584a3b5bda4d7b05-SUFFIX | /tmp/babel-gwZcjh/291f3f60f3e5d467584a3b5bda4d7b05-SUF42FIX | -*** ox-reveal -#+BEGIN_SRC emacs-lisp -(use-package ox-reveal - :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/") -#+END_SRC - *** ol-bbdb #+begin_src emacs-lisp (use-package ol-bbdb) -- cgit v1.2.3 From 9b01c296300b0c4261c516c6bc7f0f8d87ca3dba Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 1 May 2022 17:17:32 +0200 Subject: Minor fixes --- emacs-init.org | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index c2b1237..af0812f 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -167,11 +167,11 @@ git config --global diff.gpg.textconv "gpg --no-tty --decrypt" echo "*.gpg filter=gpg diff=gpg" > .gitattributes #+end_src A similar behaviour can be achieved using [[https://github.com/AGWA/git-crypt][git-crypt]]. I save private -details regarding my emacs configuration in =emacs-private.el.gpg= and -load this file here. -#+begin_src emacs-lisp +details regarding my emacs configuration in =.el.gpg= files and +load them in =init.el= using some code like this. +#+begin_src emacs-lisp :tangle no (mapc (lambda (file) (load file)) - (directory-files default-directory t "emacs-.*el.gpg")) + (directory-files default-directory t "^emacs-.*el.gpg$")) #+end_src This is the content of =init.el=. Notice the ~:tangle tangle/init.el~ @@ -217,6 +217,7 @@ with other package definition and customization. ;; (package-initialize) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") nil) +(package-refresh-contents t) #+END_SRC *** straight.el :PROPERTIES: @@ -2455,7 +2456,8 @@ of src_shell{getconf "PATH"}. See [[elisp:(describe-variable #+end_src ** Git *** Git annex -There are some great ressources on [[https://git-annex.branchable.com/][git-annex]] integration in emacs in [[https://github.com/mm--/dot-emacs/blob/master/jmm-emacs.org][Josh's config]]. Most of my configuration is copied from there. +There are some great resources on [[https://git-annex.branchable.com/][git-annex]] integration in emacs in [[https://github.com/mm--/dot-emacs/blob/master/jmm-emacs.org][Josh's config]]. Most of my configuration is copied from there. +Or use magit-annex instead? #+begin_src emacs-lisp :noweb-ref straight-recipe-overrides :tangle no :eval never (git-annex :type git :flavor melpa :host github :repo "jwiegley/git-annex-el") #+end_src @@ -2464,7 +2466,7 @@ There are some great ressources on [[https://git-annex.branchable.com/][git-anne :straight (:host github :repo "fpiper/git-annex-el" :branch "master") :config <> - :after (dired) + :after dired :bind (:map git-annex-dired-map <>) -- cgit v1.2.3 From 4cd8da4dc94d5429356893f8a747f72fc9e8b847 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 1 May 2022 17:17:39 +0200 Subject: Make fpi/scale-default-face repeatable --- emacs-init.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index af0812f..4ca3c60 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1683,7 +1683,12 @@ When switching between monitors with different resolution, scaling the (scale (if arg -10 10)) (new (+ height scale))) (set-face-attribute 'default nil :height new) - (message "Default height: %s" new))) + (message "Default height: %s. Use +,- for further adjustment" new) + (set-transient-map + (let ((map (make-sparse-keymap))) + (define-key map (vector '(?-)) (lambda () (interactive) (fpi/scale-default-face t))) + (define-key map (vector '(?+)) (lambda () (interactive) (fpi/scale-default-face nil))) + map)))) #+end_src #+begin_src emacs-lisp :tangle no :noweb-ref fpi-bindings (fpi/define-key fpi-map (kbd "+") #'fpi/scale-default-face "Zoom") -- cgit v1.2.3 From 70b26ae4d8e9933d62451ec6461912a5df4366b9 Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 1 May 2022 17:17:59 +0200 Subject: Adjust gnus loading of secret files --- gnus.org | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gnus.org b/gnus.org index 0bb355e..a293271 100644 --- a/gnus.org +++ b/gnus.org @@ -13,9 +13,8 @@ ln -siv ~/sync/gnus/.gnus.registry.eieio ~/.gnus.registry.eieio Load private settings. #+begin_src emacs-lisp -(setq secret-file (expand-file-name "emacs-private.el.gpg" - user-emacs-directory)) -(load secret-file) +(mapc (lambda (file) (load file)) + (directory-files user-emacs-directory t "^emacs-.*el.gpg$")) #+end_src * Config ** Servers -- cgit v1.2.3 From 79509b41a709e5eea4c21d684a9669fcad0e3915 Mon Sep 17 00:00:00 2001 From: fpi Date: Wed, 4 May 2022 11:17:25 +0200 Subject: Use builtin magit completion --- emacs-init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs-init.org b/emacs-init.org index 4ca3c60..7caf258 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2801,7 +2801,7 @@ For example, ARGS could be \"--in=here\"" #+BEGIN_SRC emacs-lisp (use-package magit :straight t - :custom (magit-completing-read-function 'magit-ido-completing-read) + :custom (magit-completing-read-function 'magit-builtin-completing-read) :init (global-magit-file-mode)) #+END_SRC -- cgit v1.2.3 From d136952015518b54d243b7798451e620a27f2e55 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 28 Mar 2022 16:53:16 +0200 Subject: Add Latex settings --- tex.org | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tex.org diff --git a/tex.org b/tex.org new file mode 100644 index 0000000..c924373 --- /dev/null +++ b/tex.org @@ -0,0 +1,64 @@ +#+PROPERTY: header-args :tangle-mode (identity #o444) +#+PROPERTY: header-args:latex :eval never +Here are some custom latex packages and stuff. + +Let us start by creating the local latex directory. We can also use this source block as a quick way to find the appropriate tangle directory for any latex files. +#+NAME: lob-localtexdir +#+begin_src shell :results silent +texdir=$(kpsewhich -var-value "TEXMFHOME")/tex/latex +mkdir -p $texdir +echo $texdir +#+end_src +* defeq.sty +This first latex package defines a better looking version of =:==. +#+begin_src latex :tangle (expand-file-name "defeq.sty" (org-sbe "lob-localtexdir")) +% Tangled from dotfiles/tex.org +% Defines a better looking version of := +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{defeq} + [2016/03/28 v0.1 defeq] + +\RequirePackage{textcomp} +\RequirePackage{marvosym} +\RequirePackage{amsmath} + +\newcommand*{\defeq}{\mathrel{\vcenter{\baselineskip0.5ex \lineskiplimit0pt \hbox{\scriptsize.}\hbox{\scriptsize.}}} =} + +\endinput +%% +%% End of file `defeq.sty'. +#+end_src +* personal.sty +A package which includes commands, packages and settings I want to be generally available. +Some settings are in external files. We can list these files using basic unix commands and input them in the main file using the noweb syntax. + +#+NAME: personal-files +#+begin_src shell :dir (org-sbe lob-localtexdir) :results raw silent +ls personal-*sty | sed -e 's/\(.*\)/\\input{\1}/' +#+end_src + +#+begin_src latex :tangle (expand-file-name "personal.sty" (org-sbe "lob-localtexdir")) :tangle-mode (identity #o444) :noweb yes +% Tangled from dotfiles/tex.org +\ProvidesPackage{personal} +\RequirePackage{defeq} +\RequirePackage{unicode-math} +\RequirePackage{textcomp} +\RequirePackage{marvosym} +\RequirePackage{amsmath} + +% Command for non-italic subscripts +\newcommand{\V}[1]{\textrm{#1}} +\catcode`\~=\active +\newcommand{~}[1]{_{\textrm{#1}}} + +\def\μ{\si{\micro}} +% \def\Ω{\si{\ohm}} + +\RequirePackage{tikz} +\usetikzlibrary{scopes, intersections, positioning} +\usepackage{gnuplot-lua-tikz} + +% Include other files +<> +#+end_src + -- cgit v1.2.3 From 5969f30c3899148dc461c50b181718d305de1e68 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 13 May 2022 10:07:50 +0200 Subject: Add another scoring category --- gnus.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index a293271..6765440 100644 --- a/gnus.org +++ b/gnus.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:emacs-lisp :tangle tangle/gnus.el :noweb yes +#+PROPERTY: header-args:emacs-lisp :tangle tangle/gnus.el :noweb yes :tangle-mode (identity #o444) #+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" ln -siv $(pwd)/tangle/gnus.el ~/.gnus.el @@ -192,13 +192,17 @@ To define different scoring files for different groups I set [[info:gnus#Home Sc #+begin_src emacs-lisp (setq gnus-home-score-file '(("misc@" "nntp_gmane.SCORE") + ("ieee" "nn_ieee.SCORE") ("^nnimap" "nnimap.SCORE") ;; w/ author scoring + ("^INBOX" "nnimap.SCORE") ;; w/ author scoring ("gmane" "nntp_gmane.SCORE") ;; w/ author scoring ("^nntp\\+localhost" "nntp_global.SCORE") ;; w/o author scoring )) (setq gnus-home-adapt-file - '(("misc@" "nntp_gmane.SCORE") + '(("misc@" "nntp_gmane.ADAPT") + ("ieee" "nn_ieee.ADAPT") ("^nnimap" "nnimap.ADAPT") + ("^INBOX" "nnimap.ADAPT") ("gmane" "nntp_gmane.ADAPT") ("^nntp\\+localhost" "nntp_global.ADAPT"))) #+end_src -- cgit v1.2.3 From 90fb90a51bde5aee02a70dca439d7c69b5e9c382 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 13 May 2022 10:07:08 +0200 Subject: Add support function for x/y tic format --- gnuplot.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnuplot.org b/gnuplot.org index be820a4..a9ec9f4 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -1,5 +1,5 @@ # -*- coding: utf-8-unix -*- -#+PROPERTY: header-args:gnuplot :tangle tangle/.gnuplot :eval query +#+PROPERTY: header-args:gnuplot :tangle tangle/.gnuplot :eval query :tangle-mode (identity #o444) * Symlink First create a symlink to the desired config location. #+begin_src shell :results silent :tangle tangle/symlink.sh :shebang "#!/bin/bash" @@ -100,6 +100,11 @@ gbt(col)=sprintf("set tics nomirror; set border 3 back lc '%s'; set grid back lw gbt="set tics nomirror; set border 3 back lc 'gray50'; set grid back lw 1 lc 'gray50'" @gbt #+end_src + +Support function to set x/y tic formatting with ~set format x formatter(".0","m")~. +#+begin_src gnuplot +formatter(prec,unit)=sprintf("%%%ss %%c%s", prec, unit) +#+end_src * A4 plots See [[https://milianw.de/blog/how-to-generate-proper-din-a4-sized-plots-with-gnuplot.html][How to generate proper DIN A4 sized plots with Gnuplot - Milian Wolff]]. -- cgit v1.2.3 From 555123131a640a183c48469cb8c7cda98e24e495 Mon Sep 17 00:00:00 2001 From: fpi Date: Mon, 9 May 2022 19:22:09 +0200 Subject: Change org image preview, attach-inheritance settings --- emacs-init.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 7caf258..23f5309 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4363,7 +4363,7 @@ Make gnorb consider the same refile targets as org. Resize inline images to 400px but respect width specifications in attribute lines. #+begin_src emacs-lisp :noweb-ref org-custom :tangle no -(org-image-actual-width '(600)) +(org-image-actual-width t) #+end_src Also display remote images by downloading them. #+begin_src emacs-lisp :noweb-ref org-custom :tangle no @@ -4775,7 +4775,7 @@ Org Edna *** org-attach =org-attach= is useful to attach reference material to org files. This can be reference images, data or other files. A special link type is available for attached files: ~[[attachment:file]]~. -- Inheritance :: While inheritance for attachments sounds useful, so subheadings can access their parents attachments, I find that the current implementation (Org 9.3.1) instead of inheriting just sets the attachment dir of all children to that of the parent. So for now I decided not to use it. +- Inheritance :: Note that inheritance here means, that the attachment dir of all children is set to that of the parent. - Attachment Folder :: While I do not like the default double nested folder structure it creates, I also do not want to set an individual =DIR= property for all headings I want to attach something to. @@ -4784,7 +4784,7 @@ Org Edna #+begin_src emacs-lisp (use-package org-attach :custom - (org-attach-use-inheritance nil) + (org-attach-use-inheritance t) (org-attach-preferred-new-method 'id) (org-attach-store-link-p t) :config -- cgit v1.2.3 From 0f81da11b08e3d1014e73c831f2114a2c2415201 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 13 May 2022 10:02:07 +0200 Subject: Add citar for additional citation support --- emacs-init.org | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 23f5309..ae8c501 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -5177,18 +5177,57 @@ A small function to toggle the encryption state of the current entry. #+end_src **** Org Cite -=org-ref= was replaced by =orgcite= which is built into =org=. -#+begin_src emacs-lisp +=org-ref= was replaced by =org-cite= which is built into =org=. + +#+begin_src emacs-lisp :noweb yes (use-package oc :after org :custom - (org-cite-global-bibliography (if (equal fpi/current-device "DESKTOP-PM1PPEC") - '("~/git/projects/personal/bib.bib" - "~/win/Zotero/00_Unsorted.bib" - "~/win/Zotero/01_Annotated.bib" - "~/win/Zotero/99_AllZotero.bib") - '("~/git/projects/personal/bib.bib")))) + (org-cite-global-bibliography + (if (equal fpi/current-device "DESKTOP-PM1PPEC") + '("~/git/projects/personal/bib.bib" + "~/win/Zotero/00_Unsorted.bib" + "~/win/Zotero/01_Annotated.bib" + "~/win/Zotero/99_AllZotero.bib") + '("~/git/projects/personal/bib.bib"))) + <> + ) +#+end_src + +=Citar= is a package that provides extra actions on org cite links. + +#+begin_src emacs-lisp +(use-package citar + :straight t + :after oc + :custom + (citar-bibliography org-cite-global-bibliography) + (citar-library-paths '("~/git/projects/annex_work/Lit")) + (citar-notes-paths '("~/git/projects/zettel/Lit")) + ;; (citar-at-point-function 'embark-act) + (citar-templates + '((main . "${author editor:30} ${date year issued:4} ${title:48}") + (suffix . " ${=key= id:15} ${=type=:12} ${tags keywords keywords:*}") + (preview . "${author editor} (${year issued date}) ${title}, ${journal journaltitle publisher container-title collection-title}. +") + (note . "${=key=}: ${title}") + )) + ;; (citar-symbols + ;; `((file (?📁) . " ") + ;; (note (?📓) . " ") + ;; (link (?🔗) . " "))) + ;; (citar-symbol-separator " ") + ) #+end_src + +Lets customize =org-cite= to use =citar= by default. + +#+begin_src emacs-lisp :noweb-ref org-cite-custom :tangle no +(org-cite-insert-processor 'citar) +(org-cite-follow-processor 'citar) +(org-cite-activate-processor 'citar) +#+end_src + ***** Capturing entries I store my bibtex references in an org file together with my notes. In addition to saving the meta information in properties using the same -- cgit v1.2.3 From e71ce512a2217da08667fd8d9088a9835ca284b3 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 13 May 2022 10:29:43 +0200 Subject: Disable auto-insert-mode Because of frequent wrongly assumed insertions in .el files when loading/building packages --- emacs-init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index ae8c501..af95022 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -6458,14 +6458,14 @@ Automatically make scripts executable upon save if first line is a shebang: 'executable-make-buffer-file-executable-if-script-p) #+end_src -The =Auto-Insert= package helps inserting header templates upon creating files. +The =Auto-Insert= package helps inserting header templates upon creating files. If you do not turn on =auto-insert-mode= you can manually call =M-x auto-insert= to perform the insertion. #+begin_src emacs-lisp (use-package autoinsert :config (define-auto-insert '("\\.sh\\'" . "Shell script skeleton") '("" "#!/usr/bin/env bash" \n \n)) - (auto-insert-mode 1)) + (auto-insert-mode -1)) #+end_src * Language settings End sentences with single spaces. -- cgit v1.2.3 From b647c0c0679ca4f1c759ce0d5fb34e122ae3c364 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 14 May 2022 23:53:07 +0200 Subject: Switch to vertico, consult, embark, marginalia --- emacs-init.org | 510 ++++++++++++++++++++------------------------------------- 1 file changed, 178 insertions(+), 332 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index af95022..82f5a2b 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -1,5 +1,5 @@ # -*- coding: utf-8-unix -*- -#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-10-init.el :results silent :noweb yes +#+PROPERTY: header-args:emacs-lisp :tangle tangle/emacs-10-init.el :results silent :noweb yes :tangle-mode (identity #o444) * Contents :QUOTE:TOC_2_gh: #+BEGIN_QUOTE - [[#overview][Overview]] @@ -28,6 +28,7 @@ - [[#tramp][Tramp]] - [[#git][Git]] - [[#projects][Projects]] + - [[#consult][Consult]] - [[#working-with-buffers][Working with buffers]] - [[#window-configuration][Window configuration]] - [[#file-encryption][File encryption]] @@ -55,6 +56,7 @@ - [[#context-aware-hydra][Context aware hydra]] - [[#ssh-tunnels][SSH tunnels]] - [[#minor-utilities][Minor utilities]] + - [[#embark][Embark]] - [[#language-settings][Language settings]] - [[#spellcheck][Spellcheck]] - [[#interface][Interface]] @@ -1904,343 +1906,79 @@ any recursive editing levels." * Selection and search methods ** Completion frameworks Having used ido, ivy, icicles and helm in the past, I'm trying to -settle for something simple and go back to ido. The settings below -are for now mostly copied from [[https://gitlab.com/protesilaos/dotemacs/][Protesilaos Stavrou]]. -*** Minibuffer settings -#+begin_src emacs-lisp -(use-package minibuffer - :config - - ;; Super-powerful completion style for out-of-order groups of matches - ;; using a comprehensive set of matching styles. - (use-package orderless - :straight t - :config - (setq orderless-regexp-separator "[/\s_-]+") - (setq orderless-matching-styles - '(orderless-flex - orderless-strict-leading-initialism - orderless-regexp - orderless-prefixes - orderless-literal)) - - (defun prot/orderless-literal-dispatcher (pattern _index _total) - (when (string-suffix-p "=" pattern) - `(orderless-literal . ,(substring pattern 0 -1)))) - - (defun prot/orderless-initialism-dispatcher (pattern _index _total) - (when (string-suffix-p "," pattern) - `(orderless-strict-leading-initialism . ,(substring pattern 0 -1)))) - - (setq orderless-style-dispatchers '(prot/orderless-literal-dispatcher - prot/orderless-initialism-dispatcher)) - :bind (:map minibuffer-local-completion-map - ("SPC" . nil) ; space should never complete - ("?" . nil))) ; valid regexp character - - (setq completion-styles - '(orderless partial-completion)) - (setq completion-category-defaults nil) - (setq completion-cycle-threshold 3) - (setq completion-flex-nospace nil) - (setq completion-pcm-complete-word-inserts-delimiters t) - (setq completion-pcm-word-delimiters "-_./:| ") - (setq completion-show-help t) - (setq completion-ignore-case t) - (setq read-buffer-completion-ignore-case t) - (setq read-file-name-completion-ignore-case t) - (setq completions-format 'vertical) ; *Completions* buffer - (setq enable-recursive-minibuffers t) - (setq read-answer-short t) - (setq resize-mini-windows t) - - (file-name-shadow-mode 1) - (minibuffer-depth-indicate-mode 1) - (minibuffer-electric-default-mode 1) - - (defun prot/focus-minibuffer () - "Focus the active minibuffer. - -Bind this to `completion-list-mode-map' to M-v to easily jump -between the list of candidates present in the \\*Completions\\* -buffer and the minibuffer (because by default M-v switches to the -completions if invoked from inside the minibuffer." - (interactive) - (let ((mini (active-minibuffer-window))) - (when mini - (select-window mini)))) - - (defun prot/focus-minibuffer-or-completions () - "Focus the active minibuffer or the \\*Completions\\*. - -If both the minibuffer and the Completions are present, this -command will first move per invocation to the former, then the -latter, and then continue to switch between the two. +settle for something simple. -The continuous switch is essentially the same as running -`prot/focus-minibuffer' and `switch-to-completions' in -succession." - (interactive) - (let* ((mini (active-minibuffer-window)) - ;; This could be hardened a bit, but I am okay with it. - (completions (or (get-buffer-window "*Completions*") - (get-buffer-window "*Embark Live Occur*")))) - (cond ((and mini - (not (minibufferp))) - (select-window mini nil)) - ((and completions - (not (eq (selected-window) - completions))) - (select-window completions nil))))) - - ;; Technically, this is not specific to the minibuffer, but I define - ;; it here so that you can see how it is also used from inside the - ;; "Completions" buffer - (defun prot/describe-symbol-at-point (&optional arg) - "Get help (documentation) for the symbol at point. - -With a prefix argument, switch to the *Help* window. If that is -already focused, switch to the most recently used window -instead." - (interactive "P") - (let ((symbol (symbol-at-point))) - (when symbol - (describe-symbol symbol))) - (when arg - (let ((help (get-buffer-window "*Help*"))) - (when help - (if (not (eq (selected-window) help)) - (select-window help) - (select-window (get-mru-window))))))) - - ;; This will be deprecated in favour of the `embark' package - (defun prot/completions-kill-save-symbol () - "Add symbol-at-point to the kill ring. - -Intended for use in the \\*Completions\\* buffer. Bind this to a -key in `completion-list-mode-map'." - (interactive) - (kill-new (thing-at-point 'symbol))) - - -;;;; DEPRECATED in favour of the `embark' package (see further below), -;;;; which implements the same functionality in a more efficient way. -;; (defun prot/complete-kill-or-insert-candidate (&optional arg) -;; "Place the matching candidate to the top of the `kill-ring'. -;; This will keep the minibuffer session active. -;; -;; With \\[universal-argument] insert the candidate in the most -;; recently used buffer, while keeping focus on the minibuffer. -;; -;; With \\[universal-argument] \\[universal-argument] insert the -;; candidate and immediately exit all recursive editing levels and -;; active minibuffers. -;; -;; Bind this function in `icomplete-minibuffer-map'." -;; (interactive "*P") -;; (let ((candidate (car completion-all-sorted-completions))) -;; (when (and (minibufferp) -;; (or (bound-and-true-p icomplete-mode) -;; (bound-and-true-p live-completions-mode))) ; see next section -;; (cond ((eq arg nil) -;; (kill-new candidate)) -;; ((= (prefix-numeric-value arg) 4) -;; (with-minibuffer-selected-window (insert candidate))) -;; ((= (prefix-numeric-value arg) 16) -;; (with-minibuffer-selected-window (insert candidate)) -;; (top-level)))))) - - ;; Defines, among others, aliases for common actions to Super-KEY. - ;; Normally these should go in individual package declarations, but - ;; their grouping here makes things easier to understand. - :bind (("s-f" . find-file) - ("s-F" . find-file-other-window) - ("s-d" . dired) - ("s-D" . dired-other-window) - ("s-b" . switch-to-buffer) - ("s-B" . switch-to-buffer-other-window) - ("s-h" . prot/describe-symbol-at-point) - ("s-H" . (lambda () - (interactive) - (prot/describe-symbol-at-point '(4)))) - ("s-v" . prot/focus-minibuffer-or-completions) - :map minibuffer-local-completion-map - ("" . minibuffer-force-complete-and-exit) - ("C-j" . exit-minibuffer) - ;;;; DEPRECATED in favour of the `embark' package - ;; ("M-o w" . prot/complete-kill-or-insert-candidate) - ;; ("M-o i" . (lambda () - ;; (interactive) - ;; (prot/complete-kill-or-insert-candidate '(4)))) - ;; ("M-o j" . (lambda () - ;; (interactive) - ;; (prot/complete-kill-or-insert-candidate '(16)))) - :map completion-list-mode-map - ("h" . prot/describe-symbol-at-point) - ("w" . prot/completions-kill-save-symbol) - ("n" . next-line) - ("p" . previous-line) - ("f" . next-completion) - ("b" . previous-completion) - ("M-v" . prot/focus-minibuffer))) -#+end_src -*** Icomplete -#+begin_src emacs-lisp -(use-package icomplete - :demand - :after minibuffer ; Read that section as well - :config - (setq icomplete-delay-completions-threshold 100) - (setq icomplete-max-delay-chars 2) - (setq icomplete-compute-delay 0.2) - (setq icomplete-show-matches-on-no-input t) - (setq icomplete-hide-common-prefix nil) - (setq icomplete-prospects-height 1) - ;; (setq icomplete-separator " · ") - ;; (setq icomplete-separator " │ ") - ;; (setq icomplete-separator " ┆ ") - ;; (setq icomplete-separator " ¦ ") - (setq icomplete-separator (propertize " ┆ " 'face 'shadow)) - (setq icomplete-with-completion-tables t) - (setq icomplete-in-buffer t) - (setq icomplete-tidy-shadowed-file-names nil) - - (fido-mode -1) ; Emacs 27.1 - (icomplete-mode 1) - - (defun prot/icomplete-minibuffer-truncate () - "Truncate minibuffer lines in `icomplete-mode'. - This should only affect the horizontal layout and is meant to - enforce `icomplete-prospects-height' being set to 1. - - Hook it to `icomplete-minibuffer-setup-hook'." - (when (and (minibufferp) - (bound-and-true-p icomplete-mode)) - (setq truncate-lines t))) - - ;; Note that the the syntax for `use-package' hooks is controlled by - ;; the `use-package-hook-name-suffix' variable. The "-hook" suffix is - ;; not an error of mine. - :hook (icomplete-minibuffer-setup-hook . prot/icomplete-minibuffer-truncate) - :bind (:map icomplete-minibuffer-map - ("" . icomplete-force-complete) - ("" . icomplete-force-complete-and-exit) ; exit with completion - ("C-j" . exit-minibuffer) ; force input unconditionally - ("C-n" . icomplete-forward-completions) - ("" . icomplete-forward-completions) - ("" . icomplete-forward-completions) - ("C-p" . icomplete-backward-completions) - ("" . icomplete-backward-completions) - ("" . icomplete-backward-completions) - ;; The following command is from Emacs 27.1 - ("" . icomplete-fido-backward-updir))) -#+end_src -*** Icomplete-vertical -#+begin_src emacs-lisp -(use-package icomplete-vertical +For =vertico= use =M-RET= to end repeated minibuffer reads instead of =RET=. +#+begin_src emacs-lisp +;; Vertico & Marginalia +(use-package vertico + :straight t + :init (vertico-mode 1)) +(use-package vertico-posframe :straight t - :demand - :after (minibuffer icomplete) ; do not forget to check those as well :config - (setq icomplete-vertical-prospects-height (/ (frame-height) 6)) - (icomplete-vertical-mode -1) - - (defun prot/kill-ring-yank-complete () - "Insert the selected `kill-ring' item directly at point. -When region is active, `delete-region'. - -Sorting of the `kill-ring' is disabled. Items appear as they -normally would when calling `yank' followed by `yank-pop'." + (defun fpi/vertico-posframe-toggle () (interactive) - (let ((kills ; do not sort items - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action - action kill-ring string pred))))) - (icomplete-vertical-do - (:separator 'dotted-line :height (/ (frame-height) 4)) - (when (use-region-p) - (delete-region (region-beginning) (region-end))) - (insert - (completing-read "Yank from kill ring: " kills nil t))))) - - :bind (("s-y" . prot/kill-ring-yank-complete) - :map icomplete-minibuffer-map - ("C-v" . icomplete-vertical-toggle))) -#+end_src -*** Ido -:PROPERTIES: -:header-args:emacs-lisp: :tangle no -:END: -#+BEGIN_SRC emacs-lisp -(use-package ido - :init - (setq ido-everywhere t) - (setq ido-enable-flex-matching t) - (setq ido-enable-regexp nil) - (setq ido-enable-prefix nil) - (setq ido-all-frames nil) - (setq ido-buffer-disable-smart-matches t) - (setq ido-completion-buffer "*Ido Completions*") - (setq ido-completion-buffer-all-completions nil) - (setq ido-confirm-unique-completion nil) - (setq ido-create-new-buffer 'prompt) - (setq ido-default-buffer-method 'selected-window) - (setq ido-default-file-method 'selected-window) - (setq ido-enable-last-directory-history t) - (setq ido-use-filename-at-point nil) - (setq ido-use-url-at-point nil) - (setq ido-use-virtual-buffers t) - (setq ido-use-faces t) - (setq ido-max-window-height 1) - (setq ido-decorations - '(" " - " " - " | " - " | …" - "[" - "]" - " [No match]" - " [Matched]" - " [Not readable]" - " [Too big]" - " [Confirm]" - " " - " ")) - (setq ido-auto-merge-work-directories-length -1) - :config - (ido-mode 1) - :hook - (minibuffer-setup . (lambda () - (visual-line-mode 1) - (setq-local truncate-lines nil) - (setq-local resize-mini-windows nil) - (setq-local max-mini-window-height 1)))) -#+END_SRC - -#+BEGIN_SRC emacs-lisp :tangle no -(use-package ido-completing-read+ + (if vertico-posframe-mode + (progn + (vertico-posframe-cleanup) + (vertico-posframe-mode -1)) + (vertico-posframe-mode 1))) + :bind (:map vertico-map + ("C-," . fpi/vertico-posframe-toggle)) + :init (vertico-posframe-mode 1)) +(use-package marginalia :straight t - :after ido - :config - (ido-ubiquitous-mode 1)) -#+END_SRC -*** amx -Ido completion for =M-x=. -#+BEGIN_SRC emacs-lisp :tangle no -(use-package amx + :bind (:map minibuffer-local-map + ("M-A" . marginalia-cycle)) + :init (marginalia-mode 1)) + +;; Orderless & minibuffer settings +(use-package orderless :straight t - :after (ido ido-completing-read+) - :init - (setq amx-backend 'ido) - (setq amx-save-file "~/.emacs.d/amx-items") - (setq amx-history-length 10) - (setq amx-show-key-bindings nil) :config - (amx-mode 1)) -#+END_SRC + (setq orderless-matching-styles + '(orderless-regexp + orderless-initialism)) + (defmacro fpi/orderless-dispatcher (name suffix style) + "Define a orderless dispatcher function NAME using key SUFFIX to +call STYLE." + (backquote + (defun ,name (pattern _index _total) + (when (string-suffix-p ,suffix pattern) + (backquote (,style ,backquote-unquote-symbol(substring pattern 0 -1))))))) + (fpi/orderless-dispatcher + fpi/orderless-literal-dispatcher "=" orderless-literal) + (fpi/orderless-dispatcher + fpi/orderless-initialism-dispatcher "," orderless-initialism) + (fpi/orderless-dispatcher + fpi/orderless-flex-dispatcher "~" orderless-flex) + (setq orderless-style-dispatchers + '(fpi/orderless-literal-dispatcher + fpi/orderless-initialism-dispatcher + fpi/orderless-flex-dispatcher))) +(use-package minibuffer + :after (consult orderless) + :custom + ;; Make tramp host completion work. See vertico documentation. + (completion-styles '(orderless basic)) + (completion-category-overrides '((file (styles basic partial-completion)))) + + ;; Make completion-at-point use vertico + (completion-in-region-function + (lambda (&rest args) + (apply (if vertico-mode + #'consult-completion-in-region + #'completion--in-region) + args)))) + +;; General settings +(setq enable-recursive-minibuffers t) +(setq read-answer-short t) +(file-name-shadow-mode 1) +(minibuffer-depth-indicate-mode 1) +(minibuffer-electric-default-mode 1) +#+end_src ** isearch enhancements Once again this is mostly taken from [[https://gitlab.com/protesilaos/dotemacs/][Protesilaos Stavrou]]. @@ -2957,6 +2695,88 @@ Projectile should be fully replaceable with =project.el=. Though some packages m ;; (projectile-mode 1) :bind (("C-c p" . projectile-command-map))) #+END_SRC +** Consult +A bundle of common functions. Mostly drop in replacements for ~find-file~, ~grep~, ~find~, etc. +#+begin_src emacs-lisp +(define-prefix-command 'fpi/consult-map nil "consult-map") +(use-package consult + :straight t + :bind + ;; C-x bindings (ctl-x-map) + (("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump + ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer + ) + ;; M-g, M-s + ((" a" . consult-apropos) ;; orig. apropos-command + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ;; M-s bindings (search-map) + ("M-s d" . consult-find) + ("M-s D" . consult-locate) + ("M-s g" . consult-grep) + ("M-s G" . consult-git-grep) + ("M-s r" . consult-ripgrep) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + ("M-s m" . consult-multi-occur) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch-history) + :map isearch-mode-map + ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s l" . consult-line) ;; needed by consult-line to detect isearch + ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch + ;; Minibuffer history + :map minibuffer-local-map + ("M-s" . consult-history) ;; orig. next-matching-history-element + ("M-r" . consult-history)) ;; orig. previous-matching-history-element + (:map fpi/consult-map + ;; C-c bindings (mode-specific-map) + ("h" . consult-history) + ("m" . consult-mode-command) + ) + :config + ;; Optionally configure preview. The default value + ;; is 'any, such that any key triggers the preview. + ;; (setq consult-preview-key 'any) + ;; (setq consult-preview-key (kbd "M-.")) + ) +(use-package consult-flyspell + :after consult + :bind (("M-s s" . consult-flyspell))) +(use-package consult-org-roam + :straight t + :after (consult org-roam) + :custom + (consult-org-roam-grep-func #'consult-ripgrep) + :config + ;; Eventually suppress previewing for certain functions + ;; (consult-customize + ;; consult-org-roam-forward-links + ;; :preview-key (kbd "M-.")) + :bind + ("C-c n e" . consult-org-roam-file-find) + ("C-c n b" . consult-org-roam-backlinks) + ("C-c n r" . consult-org-roam-search)) +#+end_src + +Fix pdf-tools =goto-page= command: +#+begin_src emacs-lisp :noweb-ref pdf-tools-config :tangle no +(define-key pdf-view-mode-map [remap consult-goto-line] 'pdf-view-goto-page) +#+end_src + +#+begin_src emacs-lisp :noweb-ref fpi-bindings :tangle no +(fpi/define-key fpi-map (kbd ".") #'fpi/consult-map "Consult") +#+end_src ** Working with buffers This renames buffers with the same name and uniqifies them using angled @@ -3167,7 +2987,9 @@ make sure to compile the tex document with the option ~--synctex=1~. :straight t :config (setq pdf-info-epdfinfo-program (concat user-emacs-directory "epdfinfo")) - (pdf-tools-install)) + (pdf-tools-install) + <> + ) #+END_SRC Add support for pdf annotations. Rebind ~pdf-annot-minor-mode-map~ to @@ -6467,6 +6289,27 @@ The =Auto-Insert= package helps inserting header templates upon creating files. "#!/usr/bin/env bash" \n \n)) (auto-insert-mode -1)) #+end_src +** Embark +Do things in the order =selection → action= instead of =action → selection=. +#+begin_src emacs-lisp +(use-package embark + :straight t + :bind (("C-." . embark-act))) +(use-package embark-consult + :straight t + :after (embark consult)) +#+end_src + +As minor-mode maps would override the global map we have to unset the =C-.= binding in flyspell. We can either do this with an ~eval-after-load~ +#+begin_src emacs-lisp :tangle no :eval never +(eval-after-load "flyspell" + '(define-key flyspell-mode-map (kbd "C-.") nil)) +#+end_src + +or by (un-)setting the binding explicitly in the =use-package= call of flyspell. +#+begin_src emacs-lisp :tangle no :noweb-ref flyspell-bindings +("C-." . nil) +#+end_src * Language settings End sentences with single spaces. #+begin_src emacs-lisp @@ -6487,6 +6330,9 @@ Setup mainly from [[https://github.com/howardabrams/dot-files/blob/master/emacs. #+begin_src emacs-lisp (use-package flyspell :delight + :bind (:map flyspell-mode-map + <> + ) :init (add-hook 'prog-mode-hook 'flyspell-prog-mode) (dolist (hook '(text-mode-hook org-mode-hook)) -- cgit v1.2.3 From d89fc58e6e29ab843b0380e7613c7951df6104cd Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 14 May 2022 23:55:12 +0200 Subject: Remove projectile --- emacs-init.org | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 82f5a2b..8ee24f8 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2663,7 +2663,6 @@ some safe local variable values. (gac-debounce-interval . 600) #+end_src ** Projects -*** project.el #+begin_src emacs-lisp (use-package project :init @@ -2679,22 +2678,6 @@ some safe local variable values. (?v "VC-Dir" project-vc-dir) (?e "Eshell" project-eshell)))) #+end_src -*** Projectile -Projectile should be fully replaceable with =project.el=. Though some packages may still use projectile as dependency.. -#+BEGIN_SRC emacs-lisp :tangle no -(use-package projectile - :straight t - :delight '(:eval (concat " " (projectile-project-name))) - :init - (setq projectile-project-search-path '("~/git/projects/")) - (setq projectile-indexing-method 'alien) - (setq projectile-enable-caching t) - (setq projectile-completion-system 'ido) - (setq projectile-file-exists-local-cache-expire (* 5 60)) - :config - ;; (projectile-mode 1) - :bind (("C-c p" . projectile-command-map))) -#+END_SRC ** Consult A bundle of common functions. Mostly drop in replacements for ~find-file~, ~grep~, ~find~, etc. #+begin_src emacs-lisp -- cgit v1.2.3 From cda3dff04201d109d6c5b43bb3dd394419cded32 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 14 May 2022 23:55:47 +0200 Subject: Fix some magit calls/settings and org-roam load order --- emacs-init.org | 62 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 8ee24f8..0bf53b0 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -2539,8 +2539,7 @@ For example, ARGS could be \"--in=here\"" #+BEGIN_SRC emacs-lisp (use-package magit :straight t - :custom (magit-completing-read-function 'magit-builtin-completing-read) - :init (global-magit-file-mode)) + :custom (magit-completing-read-function 'magit-builtin-completing-read)) #+END_SRC The following package is configured in accordance with the guidelines @@ -2599,12 +2598,11 @@ Found it in this [[https://www.manueluberti.eu/emacs/2020/03/30/lockdown-beam-gi #+begin_src emacs-lisp (use-package git-identity :straight t + :init (git-identity-magit-mode 1) :custom (git-identity-verify t) (git-identity-list private/git-identity-list) :bind (:map magit-status-mode-map ("I" . git-identity-info))) -(use-package git-identity-magit - :config (git-identity-magit-mode 1)) #+end_src *** diff-hl Indicates changed lines in the left fringe. The Hydra can be used to @@ -3184,30 +3182,33 @@ I use a org version with some custom patches. Rather than using something like = #+end_src #+begin_src emacs-lisp (use-package ob - :config (org-babel-do-load-languages - 'org-babel-load-languages - '((ruby . t) - (python . t) - ;;(ipython . t) - (emacs-lisp . t) - (octave . t) - (gnuplot . t) - (dot . t) - (spice . t) - (spectre . t) - (C . t) - (calc . t) - (latex . t) - (matlab . t) - (shell . t) - (lua . t) - (org . t) - (js . t) - (ditaa . t) - (plantuml . t) - ;; (hvm . t) - (ledger . t))) - :hook <>) + :after org-roam + :config + (org-babel-do-load-languages + 'org-babel-load-languages + '((ruby . t) + (python . t) + ;;(ipython . t) + (emacs-lisp . t) + (octave . t) + (gnuplot . t) + (dot . t) + (spice . t) + (spectre . t) + (C . t) + (calc . t) + (latex . t) + (matlab . t) + (shell . t) + (lua . t) + (org . t) + (js . t) + (ditaa . t) + (plantuml . t) + ;; (hvm . t) + (ledger . t))) + :hook + <>) #+end_src #+BEGIN_SRC emacs-lisp (use-package org-noter @@ -4313,9 +4314,8 @@ Org-roam mainly provides a display of backlinks to the current file. This allows (use-package org-roam :straight (:host github :repo "org-roam/org-roam" - :files (:defaults "extensions/*") :no-byte-compile t) - :after magit + :after (magit org) :custom (org-roam-directory "~/git/projects/zettel") (org-roam-v2-ack t) @@ -4466,7 +4466,7 @@ As capture templates get more complex storing the template itself in a separate :hook (org-roam-mode . org-roam-bibtex-mode) :bind (:map org-mode-map (("C-c n a" . orb-note-actions))) - :after bibtex + :after (bibtex org-roam) :custom <> :config -- cgit v1.2.3 From 5081f1a23ad4f98d953077dba7c3741d3a32fbf7 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 14 May 2022 23:56:13 +0200 Subject: Make tangled files rx-only --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 645e312..f336ad0 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:shell :noweb yes +#+PROPERTY: header-args:shell :noweb yes :tangle-mode (identity #o555) * Contents :QUOTE:TOC_2_gh: #+BEGIN_QUOTE - [[#my-dotfiles][My dotfiles]] -- cgit v1.2.3 From b14447cb6221d5ca205623624bf35835c6cf232b Mon Sep 17 00:00:00 2001 From: fpi Date: Sun, 15 May 2022 17:24:32 +0200 Subject: Use biblatex for org-cite latex export processing --- emacs-init.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 0bf53b0..1f3cac2 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -4991,10 +4991,13 @@ A small function to toggle the encryption state of the current entry. (org-cite-global-bibliography (if (equal fpi/current-device "DESKTOP-PM1PPEC") '("~/git/projects/personal/bib.bib" - "~/win/Zotero/00_Unsorted.bib" - "~/win/Zotero/01_Annotated.bib" - "~/win/Zotero/99_AllZotero.bib") + "~/win/Zotero/biblatex/00_Unsorted.bib" + "~/win/Zotero/biblatex/01_Annotated.bib" + "~/win/Zotero/biblatex/99_AllZotero.bib") '("~/git/projects/personal/bib.bib"))) + (org-cite-export-processors + '((latex biblatex "ieee") + (t basic))) <> ) #+end_src -- cgit v1.2.3 From 3d5cb3f3ece3b8f2a3cadbb61c71a0aeab21884a Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 19 May 2022 18:36:08 +0200 Subject: Update bibtex & citekey related settings --- emacs-init.org | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/emacs-init.org b/emacs-init.org index 1f3cac2..5054727 100644 --- a/emacs-init.org +++ b/emacs-init.org @@ -3221,7 +3221,8 @@ I use a org version with some custom patches. Rather than using something like = #+begin_src emacs-lisp (use-package org-pdftools :straight t - :hook (org-load . org-pdftools-setup-link)) + :after (org pdf-tools) + :init (org-pdftools-setup-link)) (use-package org-id :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id) @@ -4470,13 +4471,6 @@ As capture templates get more complex storing the template itself in a separate :custom <> :config - (defun bibtex-autokey-get-year () - "Return year field contents as a string obeying `bibtex-autokey-year-length'." - (let* ((yearfield (bibtex-autokey-get-field "year")) - (yearfield (when (equal yearfield "") - (substring (bibtex-autokey-get-field "date") 0 4)))) - (substring yearfield (max 0 (- (length yearfield) - bibtex-autokey-year-length))))) <>) #+end_src Rewrite of ~bibtex-autokey-get-year~ is a crude way to get bibtex to recognize =date= fields as year. @@ -4969,32 +4963,42 @@ A small function to toggle the encryption state of the current entry. #+begin_src emacs-lisp (use-package bibtex :custom - (bibtex-autokey-titlewords 3) - (bibtex-autokey-titlewords-stretch 1) - (bibtex-autokey-titleword-length 5) (bibtex-completion-library-path "~/git/projects/personal/Lit") + <> :config (bibtex-set-dialect 'BibTeX)) -(setq bibtex-completion-bibliography "~/git/projects/personal/bib.bib") +(setq bibtex-completion-bibliography + (if (equal fpi/current-device "DESKTOP-PM1PPEC") + '("~/git/projects/personal/bib.bib" + "~/win/Zotero/biblatex/00_Unsorted.bib" + "~/win/Zotero/biblatex/01_Annotated.bib" + "~/win/Zotero/biblatex/99_AllZotero.bib") + '("~/git/projects/personal/bib.bib"))) (setq bibtex-completion-notes-path "~/git/projects/zettel/Lit") (setq bibtex-completion-notes-extension ".org") +#+end_src +The bibtex package provides a customizable implementation for key generation with ~bibtex-generate-autokey~. +#+begin_src emacs-lisp :noweb-ref bibtex-custom :tangle no +(bibtex-autokey-year-title-separator "_") +(bibtex-autokey-title-terminators ".$") +(bibtex-autokey-titlewords 3) +(bibtex-autokey-titlewords-stretch 1) +(bibtex-autokey-titleword-length 5) +#+end_src +We can also +#+begin_src emacs-lisp :noweb-ref orb-custom :tangle no +(orb-autokey-format "%e{(bibtex-generate-autokey)}") #+end_src **** Org Cite =org-ref= was replaced by =org-cite= which is built into =org=. #+begin_src emacs-lisp :noweb yes (use-package oc - :after org + :after (org bibtex) :custom - (org-cite-global-bibliography - (if (equal fpi/current-device "DESKTOP-PM1PPEC") - '("~/git/projects/personal/bib.bib" - "~/win/Zotero/biblatex/00_Unsorted.bib" - "~/win/Zotero/biblatex/01_Annotated.bib" - "~/win/Zotero/biblatex/99_AllZotero.bib") - '("~/git/projects/personal/bib.bib"))) + (org-cite-global-bibliography bibtex-completion-bibliography) (org-cite-export-processors '((latex biblatex "ieee") (t basic))) @@ -5036,6 +5040,11 @@ Lets customize =org-cite= to use =citar= by default. (org-cite-activate-processor 'citar) #+end_src +We also make =org-roam-bibtex= compatible with =org-cite= by changing the cite format: +#+begin_src emacs-lisp :noweb-ref orb-custom :tangle no +(orb-pdf-scrapper-citekey-format "[cite:@%s]") +#+end_src + ***** Capturing entries I store my bibtex references in an org file together with my notes. In addition to saving the meta information in properties using the same -- cgit v1.2.3 From ba8a6920bdec93ab2335e8baabeaa6f3a0e93a1e Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 20 May 2022 23:56:54 +0200 Subject: Make ssh_config read-only --- ssh_config.org.gpg | Bin 1000 -> 1003 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ssh_config.org.gpg b/ssh_config.org.gpg index ef3dcf0..c657ed9 100644 Binary files a/ssh_config.org.gpg and b/ssh_config.org.gpg differ -- cgit v1.2.3 From e42a65ade55b7a21a42a9f04d5eff50128e47f9f Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 20 May 2022 23:56:48 +0200 Subject: Make redshift conf read-only --- redshift.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redshift.org b/redshift.org index 5003528..dc2ed38 100644 --- a/redshift.org +++ b/redshift.org @@ -1,5 +1,5 @@ Website: http://jonls.dk/redshift/ -#+PROPERTY: header-args:conf :tangle tangle/redshift.conf +#+PROPERTY: header-args:conf :tangle tangle/redshift.conf :tangle-mode (identity #o444) ** Config #+BEGIN_SRC conf [redshift] -- cgit v1.2.3 From 3247341513661f61797048a1979331a083bd8d82 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 20 May 2022 23:56:39 +0200 Subject: Make ledgerrc read-only --- ledgerrc.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledgerrc.org b/ledgerrc.org index 34bedd6..78b9f31 100644 --- a/ledgerrc.org +++ b/ledgerrc.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent +#+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent :tangle-mode (identity #o444) #+begin_src conf --file ~/git/projects/ledger/main.ledger @@ -9,7 +9,7 @@ ln -siv $(pwd)/tangle/report ~/.local/bin/ #+end_src The =report= script can be used for simple plotting of ledger output using gnuplot. This is taken directly from the ledger git repo. -#+begin_src shell :tangle tangle/report :shebang "#!/usr/bin/env sh" +#+begin_src shell :tangle tangle/report :shebang "#!/usr/bin/env sh" :tangle-mode (identity #o555) # This script facilities plotting of a ledger register report. If you # use OS/X, and have AquaTerm installed, you will probably want to set # LEDGER_TERM to "aqua". -- cgit v1.2.3 From ff6a633dcc6cfa1637ed63ce95a5914368d54544 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 20 May 2022 23:56:19 +0200 Subject: Make mail config files read-only --- mail.org | 1 + 1 file changed, 1 insertion(+) diff --git a/mail.org b/mail.org index dc5853b..e56ce6c 100644 --- a/mail.org +++ b/mail.org @@ -1,4 +1,5 @@ # -*- buffer-auto-save-file-name: nil; -*- +#+PROPERTY: header-args:conf :tangle-mode (identity #o444) * Intro This file describes my mail setup using -- cgit v1.2.3 From cf5262c952b59485391c12417446377d5bd0afe1 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 20 May 2022 23:55:55 +0200 Subject: Make gpg-agent.conf read-only --- gpg-agent.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpg-agent.org b/gpg-agent.org index 51f6cec..1db4895 100644 --- a/gpg-agent.org +++ b/gpg-agent.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:conf :tangle tangle/gpg-agent.conf :comments org +#+PROPERTY: header-args:conf :tangle tangle/gpg-agent.conf :comments org :tangle-mode (identity #o444) #+BEGIN_SRC sh :tangle tangle/symlink.sh :results silent :shebang "#!/bin/bash" ln -siv $(pwd)/tangle/gpg-agent.conf ~/.gnupg/gpg-agent.conf -- cgit v1.2.3 From 9a3831cbacc161fd3038a7e0856d823b656a6ad2 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 20 May 2022 23:56:08 +0200 Subject: Make init-exwm read-only --- init-exwm.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init-exwm.org b/init-exwm.org index 46bf793..13d6523 100644 --- a/init-exwm.org +++ b/init-exwm.org @@ -1,5 +1,5 @@ #+PROPERTY: header-args:emacs-lisp :results silent -#+PROPERTY: header-args:emacs-lisp :tangle tangle/init-exwm.el +#+PROPERTY: header-args:emacs-lisp :tangle tangle/init-exwm.el :tangle-mode (identity #o444) * Starting EXWM Either start exwm in =.xinitrc= or if using a display manager setup a desktop file similar to this: -- cgit v1.2.3 From d8a971ddb0c0dc3f0bc35cce7c9b01cce2a7bcef Mon Sep 17 00:00:00 2001 From: fpi Date: Thu, 2 Jun 2022 19:22:17 +0200 Subject: Fix shell block to ensure use of sh --- tex.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tex.org b/tex.org index c924373..5355514 100644 --- a/tex.org +++ b/tex.org @@ -4,7 +4,7 @@ Here are some custom latex packages and stuff. Let us start by creating the local latex directory. We can also use this source block as a quick way to find the appropriate tangle directory for any latex files. #+NAME: lob-localtexdir -#+begin_src shell :results silent +#+begin_src sh :results silent texdir=$(kpsewhich -var-value "TEXMFHOME")/tex/latex mkdir -p $texdir echo $texdir @@ -33,7 +33,7 @@ A package which includes commands, packages and settings I want to be generally Some settings are in external files. We can list these files using basic unix commands and input them in the main file using the noweb syntax. #+NAME: personal-files -#+begin_src shell :dir (org-sbe lob-localtexdir) :results raw silent +#+begin_src sh :dir (org-sbe lob-localtexdir) :results raw silent ls personal-*sty | sed -e 's/\(.*\)/\\input{\1}/' #+end_src -- cgit v1.2.3