Commit 11a8d41ed8c5

Vincent Demeester <vincent@sbr.pm>
2026-01-28 09:50:46
chore(emacs): remove old config directory
Obsolete config files no longer needed after init.el consolidation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 31e9878
Changed files (256)
dots
.config
emacs
old
config
eshell
etc
eshell
orgmode
transient
yasnippet
host
lisp
transient
dots/.config/emacs/old/config/00-clean.el
@@ -1,79 +0,0 @@
-;;; 00-clean.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; no-littering and recentf configurations
-;;; Note: this file is autogenerated from an org-mode file.
-;;; Code:
-
-(setopt make-backup-files nil)
-(setopt backup-inhibited nil) ; Not sure if needed, given `make-backup-files'
-(setopt create-lockfiles nil)
-
-(use-package recentf
-  :hook (after-init . recentf-mode)
-  :custom
-  (recentf-max-saved-items 500)
-  (recentf-save-file (locate-user-emacs-file "auto-save-list/recent-file-list.el"))
-  (recentf-auto-cleanup "8:00am")
-  (recentf-show-file-shortcuts-flag nil)
-  (recentf-exclude
-   '("\\.?cache" ".cask" "url" "COMMIT_EDITMSG\\'" "bookmarks"
-     "\\.\\(?:gz\\|gif\\|svg\\|elc\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
-     "\\.?ido\\.last$" "\\.revive$" "/G?TAGS$" "/.elfeed/"
-     "^/tmp/" "^/var/folders/.+$" "^/sudo:" "^/su:" "^/ssh:" "^/sshfs:"
-     (lambda (file) (file-in-directory-p file package-user-dir))))
-  :config
-  (push (expand-file-name recentf-save-file) recentf-exclude)
-  ;; Magic advice to rename entries in recentf when moving files in
-  ;; dired.
-  (defun rjs/recentf-rename-notify (oldname newname &rest args)
-    (if (file-directory-p newname)
-        (rjs/recentf-rename-directory oldname newname)
-      (rjs/recentf-rename-file oldname newname)))
-
-  (defun rjs/recentf-rename-file (oldname newname)
-    (setq recentf-list
-          (mapcar (lambda (name)
-                    (if (string-equal name oldname)
-                        newname
-                      oldname))
-                  recentf-list))
-    recentf-cleanup)
-
-  (defun rjs/recentf-rename-directory (oldname newname)
-    ;; oldname, newname and all entries of recentf-list should already
-    ;; be absolute and normalised so I think this can just test whether
-    ;; oldname is a prefix of the element.
-    (setq recentf-list
-          (mapcar (lambda (name)
-                    (if (string-prefix-p oldname name)
-                        (concat newname (substring name (length oldname)))
-                      name))
-                  recentf-list))
-    recentf-cleanup)
-  (add-to-list 'recentf-filename-handlers 'abbreviate-file-name)
-  (advice-add 'dired-rename-file :after #'rjs/recentf-rename-notify))
-
-
-;; 2024-07-08: Do I have to setup this, or should I do like prot, disable *all* backup, lockfile, …
-(use-package no-littering               ; Keep .emacs.d clean
-  :config
-  (require 'recentf)
-  (add-to-list 'recentf-exclude no-littering-var-directory)
-  (add-to-list 'recentf-exclude no-littering-etc-directory)
-
-  ;; Move this in its own thing
-  (setq
-   create-lockfiles nil
-   delete-old-versions t
-   kept-new-versions 6
-   kept-old-versions 2
-   version-control t)
-
-  (setq
-   backup-directory-alist
-   `((".*" . ,(no-littering-expand-var-file-name "backup/")))
-   auto-save-file-name-transforms
-   `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))))
-
-(provide '00-clean)
-;;; 00-clean.el ends here
dots/.config/emacs/old/config/config-appearance.el
@@ -1,164 +0,0 @@
-;;; config-appearance.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Appearance configuration
-;;; Code:
-
-(set-face-attribute 'fill-column-indicator nil
-                    :foreground "#717C7C") ; katana-gray
-(global-display-fill-column-indicator-mode 1)
-
-(setopt echo-keystrokes 0.1
-        line-number-display-limit-width 10000
-        indicate-buffer-boundaries 'left
-        indicate-empty-lines +1)
-
-(line-number-mode 1)
-(column-number-mode 1)
-
-;; let's enable it for all programming major modes
-(add-hook 'prog-mode-hook #'hl-line-mode)
-;; and for all modes derived from text-mode
-(add-hook 'text-mode-hook #'hl-line-mode)
-
-(use-package frame
-  :unless noninteractive
-  :commands vde/cursor-type-mode
-  :config
-  (setq-default cursor-type 'box)
-  (setq-default cursor-in-non-selected-windows '(bar . 2))
-  (setq-default blink-cursor-blinks 50)
-  (setq-default blink-cursor-interval nil) ; 0.75 would be my choice
-  (setq-default blink-cursor-delay 0.2)
-
-  (blink-cursor-mode -1)
-
-  (define-minor-mode vde/cursor-type-mode
-    "Toggle between static block and pulsing bar cursor."
-    :init-value nil
-    :global t
-    (if vde/cursor-type-mode
-        (progn
-          (setq-local blink-cursor-interval 0.75
-                      cursor-type '(bar . 2)
-                      cursor-in-non-selected-windows 'hollow)
-          (blink-cursor-mode 1))
-      (dolist (local '(blink-cursor-interval
-                       cursor-type
-                       cursor-in-non-selected-windows))
-        (kill-local-variable `,local))
-      (blink-cursor-mode -1))))
-
-(use-package emacs
-  :config
-  (setq-default custom-safe-themes t)
-  (setq-default custom--inhibit-theme-enable nil)
-
-  (defun vde/before-load-theme (&rest args)
-    "Clear existing theme settings instead of layering them.
-Ignores `ARGS'."
-    (mapc #'disable-theme custom-enabled-themes))
-
-  (advice-add 'load-theme :before #'vde/before-load-theme))
-
-(use-package emacs
-  :config
-  (setq window-divider-default-right-width 1)
-  (setq window-divider-default-bottom-width 1)
-  (setq window-divider-default-places 'right-only)
-  :hook (after-init . window-divider-mode))
-
-(use-package tab-bar
-  :unless noninteractive
-  :config
-  (setq-default tab-bar-close-button-show nil)
-  (setq-default tab-bar-close-last-tab-choice 'tab-bar-mode-disable)
-  (setq-default tab-bar-close-tab-select 'recent)
-  (setq-default tab-bar-new-tab-choice t)
-  (setq-default tab-bar-new-tab-to 'right)
-  (setq-default tab-bar-position nil)
-  (setq-default tab-bar-show t)
-  (setq-default tab-bar-tab-hints nil)
-  (setq-default tab-bar-tab-name-function 'vde/tab-bar-tab-name)
-
-  (defun vde/tab-bar-tab-name ()
-    "Generate tab name from the buffer of the selected window *or* projectile."
-    (cond
-     ((project-current) (let ((project-path (vde-project--project-current)))
-                          (cond ((string-prefix-p "~/src" project-path)
-                                 (directory-file-name (file-relative-name project-path "~/src")))
-                                ((string-prefix-p "~/desktop" project-path)
-                                 (directory-file-name (file-relative-name project-path "~/desktop")))
-                                ((string-prefix-p "/etc" project-path)
-                                 (directory-file-name (file-relative-name project-path "/etc")))
-                                (t
-                                 (file-relative-name project-path)))))
-     (t (tab-bar-tab-name-current-with-count))))
-
-  (defun vde/complete-tab-bar-tab-dwim ()
-    "Do-What-I-Mean function for getting to a `tab-bar-mode' tab.
-If no other tab exists, create one and switch to it.  If there is
-one other tab (so two in total) switch to it without further
-questions.  Else use completion to select the tab to switch to."
-    (interactive)
-    (let ((tabs (mapcar (lambda (tab)
-                          (alist-get 'name tab))
-                        (tab-bar--tabs-recent))))
-      (cond ((eq tabs nil)
-             (tab-new))
-            ((eq (length tabs) 1)
-             (tab-next))
-            (t
-             (tab-bar-switch-to-tab
-              (completing-read "Select tab: " tabs nil t))))))
-
-  :bind (("C-x t t" . vde/complete-tab-bar-tab-dwim)
-         ("C-x t s" . tab-switcher)
-	 ("C-<next>" . tab-next)
-	 ("C-<prior>" . tab-previous)))
-
-(use-package minions
-  :hook (after-init . minions-mode)
-  :config
-  (add-to-list 'minions-prominent-modes 'flymake-mode))
-
-(use-package time
-  :unless noninteractive
-  :config
-  (setq-default display-time-24hr-format t
-                display-time-day-and-date t
-                display-time-world-list '(("Europe/Paris" "Paris")
-                                          ("Europe/London" "London")
-                                          ("America/New_York" "Boston")
-                                          ("America/Los_Angeles" "San Francisco")
-                                          ("Asia/Calcutta" "Bangalore")
-                                          ("Australia/Brisbane" "Brisbane"))
-                display-time-string-forms
-                '((format "%s %s %s, %s:%s"
-                          dayname
-                          monthname day
-                          24-hours minutes)))
-  (display-time))
-
-(use-package tooltip
-  :unless noninteractive
-  :config
-  (setq tooltip-delay 0.5)
-  (setq tooltip-short-delay 0.5)
-  (setq x-gtk-use-system-tooltips nil)
-  (setq tooltip-frame-parameters
-        '((name . "tooltip")
-          (internal-border-width . 6)
-          (border-width . 0)
-          (no-special-glyphs . t)))
-  :hook (after-init . tooltip-mode))
-
-(use-package alert
-  :init
-  (defun alert-after-finish-in-background (buf str)
-    (when (or (not (get-buffer-window buf 'visible)) (not (frame-focus-state)))
-      (alert str :buffer buf)))
-  :config
-  (setq alert-default-style 'libnotify))
-
-(provide 'config-appearance)
-;;; config-appearance.el ends here
dots/.config/emacs/old/config/config-buffers.el
@@ -1,109 +0,0 @@
-;;; config-buffers.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Buffer related configurations
-;;; Code:
-
-(use-package savehist
-  :unless noninteractive
-  :hook (after-init . savehist-mode)
-  :init
-  (setq savehist-file (no-littering-expand-var-file-name "savehist"))
-  :config
-  (setq-default history-length 10000
-                savehist-save-minibuffer-history t
-		savehist-delete-duplicates t
-                savehist-autosave-interval 180
-                savehist-additional-variables '(extended-command-history
-                                                search-ring
-                                                regexp-search-ring
-                                                comint-input-ring
-                                                compile-history
-                                                last-kbd-macro
-                                                shell-command-history)))
-
-(use-package uniquify
-  :unless noninteractive
-  :config
-  (setq-default uniquify-buffer-name-style 'post-forward
-                uniquify-separator ":"
-                uniquify-ignore-buffers-re "^\\*"
-                uniquify-after-kill-buffer-p t))
-
-(use-package ibuffer
-  :unless noninteractive
-  :commands (ibuffer)
-  :bind (("C-x C-b" . ibuffer)
-         ([remap list-buffers] . ibuffer))
-  :config
-  (setq-default ibuffer-expert t
-                ibuffer-filter-group-name-face 'font-lock-doc-face
-                ibuffer-default-sorting-mode 'filename/process
-                ibuffer-use-header-line t
-                ibuffer-show-empty-filter-groups nil)
-  ;; Use human readable Size column instead of original one
-  (define-ibuffer-column size-h
-    (:name "Size" :inline t)
-    (cond
-     ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
-     ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
-     (t (format "%8d" (buffer-size)))))
-
-  ;; (setq ibuffer-formats
-  ;;       '((mark modified read-only " "
-  ;;               (name 18 18 :left :elide)
-  ;;               " "
-  ;;               (size-h 9 -1 :right)
-  ;;               " "
-  ;;               (mode 16 16 :left :elide)
-  ;;               " "
-  ;;               filename-and-process)
-  ;;         (mark modified read-only " "
-  ;;               (name 18 18 :left :elide)
-  ;;               " "
-  ;;               (size 9 -1 :right)
-  ;;               " "
-  ;;               (mode 16 16 :left :elide)
-  ;;               " "
-  ;;               (vc-status 16 16 :left)
-  ;;               " "
-  ;;               filename-and-process)))
-  )
-
-(use-package ibuffer-vc
-  :unless noninteractive
-  :commands (ibuffer-vc-set-filter-groups-by-vc-root)
-  :hook (ibuffer . (lambda ()
-                     (ibuffer-vc-set-filter-groups-by-vc-root)
-                     (unless (eq ibuffer-sorting-mode 'filename/process)
-                       (ibuffer-do-sort-by-filename/process)))))
-
-;; (unless noninteractive
-;;   (require 'popper)
-;;   (setq popper-reference-buffers
-;;         '("\\*Messages\\*"
-;;           "Output\\*$"
-;;           "\\*Async Shell Command\\*"
-;; 	  "\\*Warnings\\*"
-;; 	  "\\*Compile-Log\\*"
-;;           help-mode
-;; 	  helpful-mode
-;;           compilation-mode
-;; 	  flymake-diagnostics-buffer-mode
-;; 	  flymake-project-diagnostics-mode
-;; 	  Man-mode
-;; 	  woman-mode))
-;;   (global-set-key (kbd "C-`") 'popper-toggle)
-;;   (global-set-key (kbd "M-`") 'popper-cycle)
-;;   (global-set-key (kbd "C-M-`") 'popper-toggle-type)
-;;   (popper-mode +1)
-;; 
-;;   ;; For echo-area hints
-;;   (require 'popper-echo)
-;;   (popper-echo-mode +1))
-
-(use-package goto-addr
-  :hook ((text-mode . goto-address-mode)
-         (prog-mode . goto-address-prog-mode)))
-
-(provide 'config-buffers)
-;;; config-buffers.el ends here
dots/.config/emacs/old/config/config-compile.el
@@ -1,104 +0,0 @@
-;;; config-compile.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Generic compilation configuration
-;;; Code:
-
-(defun my-recompile (args)
-  (interactive "P")
-  (cond
-   ((eq major-mode #'emacs-lisp-mode)
-    (call-interactively 'eros-eval-defun))
-   ((bound-and-true-p my-vterm-command)
-    (my-vterm-execute-region-or-current-line my-vterm-command))
-   ((get-buffer "*compilation*")
-    (with-current-buffer"*compilation*"
-      (recompile)))
-   ((get-buffer "*Go Test*")
-    (with-current-buffer "*Go Test*"
-      (recompile)))
-   ((and (eq major-mode #'go-mode)
-         buffer-file-name
-         (string-match
-          "_test\\'" (file-name-sans-extension buffer-file-name)))
-    (my-gotest-maybe-ts-run))
-   ((and (get-buffer "*cargo-test*")
-         (boundp 'my-rustic-current-test-compile)
-         my-rustic-current-test-compile)
-    (with-current-buffer "*cargo-test*"
-      (rustic-cargo-test-run my-rustic-current-test-compile)))
-   ((get-buffer "*cargo-run*")
-    (with-current-buffer "*cargo-run*"
-      (rustic-cargo-run-rerun)))
-   ((get-buffer "*pytest*")
-    (with-current-buffer "*pytest*"
-      (recompile)))
-   ((eq major-mode #'python-mode)
-    (compile (concat python-shell-interpreter " " (buffer-file-name))))
-   ((call-interactively 'compile))))
-
-;; UseCompile
-(use-package compile
-  :unless noninteractive
-  :commands (compile)
-  :preface
-  (autoload 'ansi-color-apply-on-region "ansi-color")
-
-  (defvar compilation-filter-start)
-
-  (defun vde/colorize-compilation-buffer ()
-    (unless (or (derived-mode-p 'grep-mode)
-                (derived-mode-p 'ag-mode)
-                (derived-mode-p 'rg-mode))
-      (let ((inhibit-read-only t))
-        (ansi-color-apply-on-region compilation-filter-start (point)))))
-  :config
-  (setq-default compilation-scroll-output t
-                ;; I'm not scared of saving everything.
-                compilation-ask-about-save nil
-                ;; Automatically scroll and jump to the first error
-                ;; compilation-scroll-output 'next-error
-                ;; compilation-scroll-output 'first-error
-                ;; compilation-auto-jump-to-first-error t
-                ;; Skip over warnings and info messages in compilation
-                compilation-skip-threshold 2
-                ;; Don't freeze when process reads from stdin
-                compilation-disable-input t
-                ;; Show three lines of context around the current message
-                compilation-context-lines 3
-                )
-  (add-hook 'compilation-finish-functions #'alert-after-finish-in-background)
-  (add-hook 'comint-output-filter-functions
-            'comint-watch-for-password-prompt)
-  (setq-default comint-password-prompt-regexp
-                (concat
-                 "\\("
-                 "^Enter passphrase.*:"
-                 "\\|"
-                 "^Repeat passphrase.*:"
-                 "\\|"
-                 "[Pp]assword for '[a-z0-9_-.]+':"
-                 "\\|"
-                 "\\[sudo\\] [Pp]assword for [a-z0-9_-.]+:"
-                 "\\|"
-                 "[a-zA-Z0-9]'s password:"
-                 "\\|"
-                 "^[Pp]assword:"
-                 "\\|"
-                 "^[Pp]assword (again):"
-                 "\\|"
-                 ".*\\([Ww]ork\\|[Pp]ersonal\\).* password:"
-                 "\\|"
-                 "Password for '([^()]+)' GNOME keyring"
-                 "\\|"
-                 "Password for 'http.*github.*':"
-                 "\\)"))
-  (add-hook 'compilation-filter-hook #'vde/colorize-compilation-buffer))
-
-(use-package emacs
-  :bind
-  (:map prog-mode-map
-        ("C-M-<return>" . compile)
-        ("C-<return>"   . my-recompile)))
-
-(provide 'config-compile)
-;;; config-compile.el ends here
dots/.config/emacs/old/config/config-completion.el
@@ -1,342 +0,0 @@
-;;; config-completion.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Setup completion framework
-;;; Code
-
-(use-package which-key
-  :custom
-  (which-key-separator " → " )
-  :hook
-  (after-init . which-key-mode)
-  :config
-  
-  ;; Define custom, concise descriptions for `tab-bar` commands under "C-x t"
-  (which-key-add-key-based-replacements
-    "C-x t C-f" "Open file in new tab"
-    "C-x t RET" "Switch tabs"
-    "C-x t C-r" "Open file (read-only) in new tab"
-    "C-x t 0"   "Close current tab"
-    "C-x t 1"   "Close other tabs"
-    "C-x t 2"   "New empty tab"
-    "C-x t G"   "Group tabs"
-    "C-x t M"   "Move tab to position"
-    "C-x t N"   "New tab and switch to it"
-    "C-x t O"   "Previous tab"
-    "C-x t b"   "Switch buffer in new tab"
-    "C-x t d"   "Dired in new tab"
-    "C-x t f"   "Open file in new tab"
-    "C-x t m"   "Move tab left/right"
-    "C-x t n"   "Duplicate tab"
-    "C-x t o"   "Next tab"
-    "C-x t p"   "Project in new tab"
-    "C-x t r"   "Rename tab"
-    "C-x t t"   "Switch to other tab"
-    "C-x t u"   "Undo tab close"
-    "C-x t ^ f" "Detach tab window"))
-
-(use-package consult
-  :bind
-  ("M-g M-g" . consult-goto-line)
-  ("M-K" . consult-keep-lines)
-  ("M-s M-b" . consult-buffer)
-  ("M-s M-f" . consult-find)
-  ("M-s M-g" . consult-grep)
-  ("M-s M-r" . consult-ripgrep)
-  ("M-s M-h" . consult-history)
-  ("M-s M-l" . consult-line)
-  ("M-s M-m" . consult-mark)
-  ("M-s M-y" . consult-yank-pop)
-  ("M-s M-s" . consult-outline)
-  :config
-  ;; (general-leader
-  ;;   "y"  #'(consult-yank-pop :which-key "Clipboard history")
-  ;;   "b"  '(:ignore t :which-key "buffer")
-  ;;   "bb" #'(consult-buffer :which-key "switch buffer")
-  ;;   "bd" #'(kill-current-buffer :which-key "kill buffer")
-  ;;   "bD" #'((lambda ()(interactive)(kill-current-buffer)(tab-close)) :wk "Kill buffer and tab")
-  ;;   "bn" #'(next-buffer :which-key "next buffer")
-  ;;   "bp" #'(previous-buffer :which-key "previous buffer")
-  ;;   "s"  '(:ignore t :which-key "search")
-  ;;   "sg" #'(consult-grep :which-key "Consult grep in current directory")
-  ;;   "sR" #'(consult-ripgrep :which-key "Consult ripgrep in current directory")
-  ;;   "sr" '(:ignore t :which-key "rg.el")'
-  ;;   "srp" #'(rg-project :which-key "rg.el in current project")
-  ;;   "srs" #'(rg-dwim :which-key "rg.el Do What I Mean")
-  ;;   "sh"  #'(Info-goto-emacs-command-node :wk "Search help")
-  ;;   "sc"  #'(consult-mode-command :wk "Mode Command")
-  ;;   "s/"  #'(consult-isearch-history :wk "Consult Isearch history")
-  ;;   "g"  '(:ignore t :which-key "go")
-  ;;   "gu" #'(ffap-next-url :which-key "next url")
-  ;;   "gd" #'(xref-find-definitions :which-key "find definition")
-  ;;   "gD" #'(xref-find-definitions-other-window :which-key "find definition (other window)"))
-  )
-
-(use-package consult-imenu
-  :after (consult)
-  :commands (consult-imenu)
-  :bind
-  ("M-s M-i" . consult-imenu))
-
-(use-package consult-xref
-  :after (consult)
-  :commands (consult-xref)
-  :config
-  (setq xref-show-xrefs-function #'consult-xref
-        xref-show-definitions-function #'consult-xref)
-  (defvar consult--xref-history nil
-    "History for the `consult-recent-xref' results.")
-
-  (defun consult-recent-xref (&optional markers)
-    "Jump to a marker in MARKERS list (defaults to `xref--history'.
-
-The command supports preview of the currently selected marker position.
-The symbol at point is added to the future history."
-    (interactive)
-    (consult--read
-     (consult--global-mark-candidates
-      (or markers (flatten-list xref--history)))
-     :prompt "Go to Xref: "
-     :annotate (consult--line-prefix)
-     :category 'consult-location
-     :sort nil
-     :require-match t
-     :lookup #'consult--lookup-location
-     :history '(:input consult--xref-history)
-     :add-history (thing-at-point 'symbol)
-     :state (consult--jump-state))))
-
-;; https://github.com/oantolin/embark/blob/master/embark-consult.el
-(use-package embark
-  :unless noninteractive
-  :commands (emark-act embark-dwim embark-prefix-help-command)
-  :bind
-  ("C-." . embark-act)
-  ("M-." . embark-dwim)
-  ("C-h b" . embark-bindings)
-  ("C-h B" . embark-bindings-at-point)
-  ("C-h M" . embark-bindings-in-keymap)
-  ("C-h E" . embark-on-last-message)
-  (:map completion-list-mode-map
-        ("." . embark-act))
-  (:map embark-collect-mode-map
-        ("a") ; I don't like my own default :)
-        ("." . embark-act)
-        ("F" . consult-focus-lines))
-  (:map embark-package-map
-        ("t" . try))
-  (:map embark-identifier-map
-        ("(" . insert-parentheses)
-        ("[" . insert-pair-map))
-  (:map embark-expression-map
-        ("(" . insert-parentheses)
-        ("[" . insert-pair-map))
-  (:map embark-region-map
-        ("(" . insert-parentheses)
-        ("[" . insert-pair-map)
-        ("D" . dictionary-search))
-  (:map embark-email-map
-        ("+" . add-email-to-ecomplete)
-        ("\\" . remove-email-from-ecomplete))
-  (:map embark-encode-map
-        ("p" . topaz-paste-region))
-  (:map embark-url-map
-        ("x" . browse-url-generic)
-        ("p" . pocket-lib-add-urls))
-  (:map embark-identifier-map
-        ("D" . dictionary-lookup-definition))
-  :custom
-  (embark-quit-after-action t)
-  (prefix-help-command #'embark-prefix-help-command)
-  (embark-indicators '(embark-minimal-indicator
-                       embark-highlight-indicator
-                       embark-isearch-highlight-indicator))
-  (embark-cycle-key ".")
-  (embark-help-key "?")
-  (embark-confirm-act-all nil)
-  :config
-  (setq embark-candidate-collectors
-        (cl-substitute 'embark-sorted-minibuffer-candidates
-                       'embark-minibuffer-candidates
-                       embark-candidate-collectors))
-  (dolist (cmd '(comment-dwim
-                 insert-parentheses
-                 insert-pair
-                 markdown-insert-code
-                 markdown-insert-italic
-                 markdown-insert-bold
-                 org-emphasize
-                 cdlatex-math-modify
-                 TeX-font))
-    (push #'embark--mark-target (alist-get cmd embark-around-action-hooks)))
-  (push #'embark--xref-push-marker
-        (alist-get 'find-file embark-pre-action-hooks))
-  (defun embark-on-last-message (arg)
-    "Act on the last message displayed in the echo area."
-    (interactive "P")
-    (with-current-buffer "*Messages*"
-      (goto-char (1- (point-max)))
-      (embark-act arg)))
-
-  (defmacro ct/embark-display-in-side-window (side)
-    `(defun ,(intern (concat "display-in-side-window--" (symbol-name side))) (&optional buffer)
-       (interactive "b")
-       (when-let* ((buffer (or buffer (current-buffer)))
-                   (display-buffer-overriding-action '((display-buffer-in-side-window)
-                                                       (dedicated . t)
-                                                       (side . ,side)
-                                                       (window-parameters . ((no-delete-other-windows . t))))))
-	 (display-buffer buffer))))
-  (define-key embark-buffer-map (kbd "s b") (ct/embark-display-in-side-window bottom))
-  (define-key embark-buffer-map (kbd "s l") (ct/embark-display-in-side-window left))
-  (define-key embark-buffer-map (kbd "s r") (ct/embark-display-in-side-window right))
-  
-  (defun embark-which-key-indicator ()
-    "An embark indicator that displays keymaps using which-key.
-The which-key help message will show the type and value of the
-current target followed by an ellipsis if there are further
-targets."
-    (lambda (&optional keymap targets prefix)
-      (if (null keymap)
-          (which-key--hide-popup-ignore-command)
-	(which-key--show-keymap
-	 (if (eq (plist-get (car targets) :type) 'embark-become)
-             "Become"
-           (format "Act on %s '%s'%s"
-                   (plist-get (car targets) :type)
-                   (embark--truncate-target (plist-get (car targets) :target))
-                   (if (cdr targets) "…" "")))
-	 (if prefix
-             (pcase (lookup-key keymap prefix 'accept-default)
-               ((and (pred keymapp) km) km)
-               (_ (key-binding prefix 'accept-default)))
-           keymap)
-	 nil nil t (lambda (binding)
-                     (not (string-suffix-p "-argument" (cdr binding))))))))
-
-  (setq embark-indicators
-	'(embark-which-key-indicator
-	  embark-highlight-indicator
-	  embark-isearch-highlight-indicator))
-
-  (defun embark-hide-which-key-indicator (fn &rest args)
-    "Hide the which-key indicator immediately when using the completing-read prompter."
-    (which-key--hide-popup-ignore-command)
-    (let ((embark-indicators
-           (remq #'embark-which-key-indicator embark-indicators)))
-      (apply fn args)))
-
-  (advice-add #'embark-completing-read-prompter
-              :around #'embark-hide-which-key-indicator))
-
-(use-package embark-consult
-  :after (embark consult)
-  :unless noninteractive
-  :hook
-  (embark-collect-mode . consult-preview-at-point-mode))
-
-(setq minibuffer-prompt-properties
-      '(read-only t cursor-intangible t face minibuffer-prompt))
-(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
-
-(use-package emacs
-  :unless noninteractive
-  :custom
-  (completion-cycle-threshold 2)
-  (completion-ignore-case t)
-  (completion-show-inline-help nil)
-  (completions-detailed t)
-  (enable-recursive-minibuffers t)
-  (read-buffer-completion-ignore-case t)
-  (read-file-name-completion-ignore-case t)
-  (resize-mini-windows t)
-  (tab-always-indent 'complete)
-  :config
-  (minibuffer-depth-indicate-mode 1)
-  (minibuffer-electric-default-mode 1))
-
-(use-package vertico
-  :unless noninteractive
-  :hook (after-init . vertico-mode))
-
-(use-package marginalia
-  :unless noninteractive
-  :hook (after-init . marginalia-mode))
-
-(use-package corfu
-  :unless noninteractive
-  :bind (("C-<tab>" . corfu-candidate-overlay-complete-at-point))
-  :hook (after-init . global-corfu-mode)
-  :init
-  (require 'corfu-popupinfo)
-  (require 'corfu-history)
-  (require 'corfu-candidate-overlay)
-  :config
-  (setq corfu-popupinfo-delay '(1.25 . 0.5))
-  (corfu-popupinfo-mode 1)
-  (corfu-candidate-overlay-mode)
-  ;; Sort by input history (no need to modify `corfu-sort-function').
-  (with-eval-after-load 'savehist
-    (corfu-history-mode 1)
-    (add-to-list 'savehist-additional-variables 'corfu-history))
-
-  ;; Adapted from Corfu's manual.
-  (defun contrib/corfu-enable-always-in-minibuffer ()
-    "Enable Corfu in the minibuffer if MCT or Vertico is not active.
-Useful for prompts such as `eval-expression' and `shell-command'."
-    (unless (or (bound-and-true-p vertico--input)
-                (bound-and-true-p mct--active))
-      (corfu-mode 1)))
-
-  (add-hook 'minibuffer-setup-hook #'contrib/corfu-enable-always-in-minibuffer 1))
-
-;; Seems like it is a bit impacting the performance somehow.
-;; (use-package corfu-candidate-overlay
-;;   :after corfu
-;;   :bind (("C-<tab>" . corfu-candidate-overlay-complete-at-point))
-;;   :config
-;;   (corfu-candidate-overlay-mode +1))
-
-(use-package cape
-  :bind (("C-c p f" . cape-file)
-         ("C-c p /" . cape-dabbrev)
-         :map corfu-map
-         ("M-/" . cape-dabbrev)
-         ("C-x C-f" . cape-file))
-  :config
-  (add-to-list 'completion-at-point-functions #'cape-file))
-
-(use-package orderless
-  :unless noninteractive
-  :config
-  (setq completion-styles
-	'(orderless basic substring initials flex partial-completion))
-  (setq completion-category-defaults nil)
-  (setq completion-category-overrides nil)
-  )
-
-(use-package tempel
-  :bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
-         ("M-*" . tempel-insert))
-  :init
-  ;; (defun tempel-setup-capf ()
-  ;;   ;; Add the Tempel Capf to `completion-at-point-functions'.
-  ;;   ;; `tempel-expand' only triggers on exact matches. Alternatively use
-  ;;   ;; `tempel-complete' if you want to see all matches, but then you
-  ;;   ;; should also configure `tempel-trigger-prefix', such that Tempel
-  ;;   ;; does not trigger too often when you don't expect it. NOTE: We add
-  ;;   ;; `tempel-expand' *before* the main programming mode Capf, such
-  ;;   ;; that it will be tried first.
-  ;;   (setq-local completion-at-point-functions
-  ;;               (cons #'tempel-expand
-  ;;                     completion-at-point-functions)))
-  (setq tempel-path (expand-file-name "templates" user-emacs-directory))
-  ;; (add-hook 'conf-mode-hook 'tempel-setup-capf)
-  ;; (add-hook 'prog-mode-hook 'tempel-setup-capf)
-  ;; (add-hook 'text-mode-hook 'tempel-setup-capf)
-  )
-
-(use-package tempel-collection
-  :after tempel)
-
-(provide 'config-completion)
-;;; config-completion.el ends here
dots/.config/emacs/old/config/config-dired.el
@@ -1,244 +0,0 @@
-;;; config-dired.el --  -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Configuration of Dired
-;;; Code:
-
-(defun my-substspaces (str)
-  (subst-char-in-string ?\s ?_ str))
-
-(defmacro vde/dired-fd (name doc prompt &rest flags)
-  "Make commands for selecting 'fd' results with completion.
-NAME is how the function should be named.  DOC is the function's
-documentation string.  PROMPT describes the scope of the query.
-FLAGS are the command-line arguments passed to the 'fd'
-executable, each of which is a string."
-  `(defun ,name (&optional arg)
-     ,doc
-     (interactive "P")
-     (let* ((vc (vc-root-dir))
-            (dir (expand-file-name (if vc vc default-directory)))
-            (regexp (read-regexp
-                     (format "%s matching REGEXP in %s: " ,prompt
-                             (propertize dir 'face 'bold))))
-            (names (process-lines "fd" ,@flags regexp dir))
-            (buf "*FD Dired*"))
-       (if names
-           (if arg
-               (dired (cons (generate-new-buffer-name buf) names))
-	     (find-file
-	      (completing-read (format "Items matching %s (%s): "
-				       (propertize regexp 'face 'success)
-				       (length names))
-			       names nil t))))
-       (user-error (format "No matches for « %s » in %s" regexp dir)))))
-
-(use-package dired
-  :unless noninteractive
-  :commands (dired find-name-dired)
-  :hook ((dired-mode . dired-hide-details-mode)
-	 (dired-mode . toggle-truncate-lines)
-	 (dired-mode . hl-line-mode))
-  :bind (("C-c RET" . vde/open-in-external-app)
-         ("C-c f g" . vde/dired-get-size)
-         ("M-s d" . vde/dired-fd-dirs)
-         ("M-s z" . vde/dired-fd-files-and-dirs)
-         ("C-c f f"    . find-name-dired)
-         (:map dired-mode-map
-               ("M-p"         . vde/dired-up)
-               ("^"           . vde/dired-up)
-               ("<backspace>" . vde/dired-up)
-               ("M-n"         . vde/dired-down)
-               ("!"           . vde/sudired)
-               ("<prior>"     . beginend-dired-mode-goto-beginning)
-               ("<next>"      . beginend-dired-mode-goto-end)
-	       ("b"           . dired-do-open)))
-  :config
-  (setq-default dired-auto-revert-buffer t
-                dired-recursive-copies 'always
-                dired-recursive-deletes 'always
-                dired-isearch-filenames 'dwim
-                delete-by-moving-to-trash t
-                dired-listing-switches "-lFaGh1v --group-directories-first"
-                dired-ls-F-marks-symlinks t
-                dired-dwim-target t)
-
-  (when (string= system-type "darwin")
-    (setq dired-use-ls-dired t
-          insert-directory-program "/usr/local/bin/gls"))
-
-  ;; Enable dired-find-alternate-file
-  (put 'dired-find-alternate-file 'disabled nil)
-
-  (defun vde/dired-substspaces (&optional arg)
-    "Rename all marked (or next ARG) files so that spaces are replaced with underscores."
-    (interactive "P")
-    (dired-rename-non-directory #'my-substspaces "Rename by substituting spaces" arg))
-  (if (keymap-lookup dired-mode-map "% s")
-    (message "Error: %% s already defined in dired-mode-map")
-  (define-key dired-mode-map "%s" 'vde/dired-substspaces))
-
-  (defun vde/dired-up ()
-    "Go to previous directory."
-    (interactive)
-    (find-alternate-file ".."))
-
-  (defun vde/dired-down ()
-    "Enter directory."
-    (interactive)
-    (dired-find-alternate-file))
-
-  (defun vde/open-in-external-app ()
-    "Open the file(s) at point with an external application."
-    (interactive)
-    (let* ((file-list
-            (dired-get-marked-files)))
-      (mapc
-       (lambda (file-path)
-         (let ((process-connection-type nil))
-           (start-process "" nil "xdg-open" file-path))) file-list)))
-
-  (defun find-file-reuse-dir-buffer ()
-    "Like `dired-find-file', but reuse Dired buffers."
-    (interactive)
-    (set-buffer-modified-p nil)
-    (let ((file (dired-get-file-for-visit)))
-      (if (file-directory-p file)
-          (find-alternate-file file)
-        (find-file file))))
-
-  (defun vde/sudired ()
-    "Open directory with sudo in Dired."
-    (interactive)
-    (require 'tramp)
-    (let ((dir (expand-file-name default-directory)))
-      (if (string-match "^/sudo:" dir)
-          (user-error "Already in sudo")
-        (dired (concat "/sudo::" dir)))))
-
-  (defun vde/dired-get-size ()
-    "Quick and easy way to get file size in Dired."
-    (interactive)
-    (let ((files (dired-get-marked-files)))
-      (with-temp-buffer
-        (apply 'call-process "du" nil t nil "-sch" files)
-        (message
-         "Size of all marked files: %s"
-         (progn
-           (re-search-backward "\\(^[0-9.,]+[A-Za-z]+\\).*total$")
-           (match-string 1))))))
-
-  (vde/dired-fd
-   vde/dired-fd-dirs
-   "Search for directories in VC root or PWD.
-With \\[universal-argument] put the results in a `dired' buffer.
-This relies on the external 'fd' executable."
-   "Subdirectories"
-   "-i" "-H" "-a" "-t" "d" "-c" "never")
-
-  (vde/dired-fd
-   vde/dired-fd-files-and-dirs
-   "Search for files and directories in VC root or PWD.
-With \\[universal-argument] put the results in a `dired' buffer.
-This relies on the external 'fd' executable."
-   "Files and dirs"
-   "-i" "-H" "-a" "-t" "d" "-t" "f" "-c" "never")
-  )
-
-(use-package find-dired
-  :after dired
-  :commands (find-name-dired)
-  :config
-  (setq-default find-ls-option ;; applies to `find-name-dired'
-                '("-ls" . "-AFhlv --group-directories-first")
-                find-name-arg "-iname"))
-
-(use-package dired-x
-  :after dired
-  :bind (("C-x C-j" . dired-jump))
-  :commands (dired-jump dired-omit-mode)
-  :config
-  (setq-default dired-omit-files (concat dired-omit-files "\\|^\\.+$\\|^\\..+$")
-                dired-omit-verbose nil
-                dired-clean-confirm-killing-deleted-buffers nil))
-
-(use-package dired-aux
-  :unless noninteractive
-  :after dired
-  :config
-  (setq-default
-   ;; Ask for creation of missing directories when copying/moving
-   dired-create-destination-dirs 'ask
-   dired-create-destination-dirs-on-trailing-dirsep t
-   ;; Search only file names when point is on a file name
-   dired-isearch-filenames'dwim))
-
-(use-package async)
-(use-package dired-async
-  :unless noninteractive
-  :after (dired async)
-  :commands (dired-async-mode)
-  :hook (dired-mode . dired-async-mode))
-
-(use-package dired-narrow
-  :unless noninteractive
-  :after dired
-  :commands (dired-narrow)
-  :bind (:map dired-mode-map
-              ("M-s n" . dired-narrow))
-  :config
-  (setq-default dired-narrow-exit-when-one-left t
-                dired-narrow-enable-blinking t
-                dired-narrow-blink-time 0.3))
-
-(use-package wdired
-  :unless noninteractive
-  :after dired
-  :commands (wdired-mode
-             wdired-change-to-wdired-mode)
-  :bind (:map dired-mode-map
-	      ("E" . wdired-change-to-wdired-mode))
-  :config
-  (setq-default wdired-allow-to-change-permissions t
-                wdired-create-parent-directories t))
-
-(use-package dired-rsync
-  :unless noninteractive
-  :after dired
-  :commands (dired-rsync)
-  :bind (:map dired-mode-map
-              ("r" . dired-rsync)))
-
-(use-package trashed
-  :unless noninteractive
-  :commands (trashed)
-  :config
-  (setq trashed-action-confirmer 'y-or-n-p)
-  (setq trashed-use-header-line t)
-  (setq trashed-sort-key '("Date deleted" . t))
-  (setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
-
-;; (use-package dired-sidebar
-;;   :unless noninteractive
-;;   :commands (dired-sidebar-toggle-sidebar)
-;;   :bind ("C-c C-n" . dired-sidebar-toggle-sidebar)
-;;   :init
-;;   (add-hook 'dired-sidebar-mode-hook
-;;             (lambda ()
-;;               (unless (file-remote-p default-directory)
-;;                 (auto-revert-mode))))
-;;   :config
-;;   (push 'toggle-window-split dired-sidebar-toggle-hidden-commands)
-;;   (push 'rotate-windows dired-sidebar-toggle-hidden-commands)
-;; 
-;;   ;; (setq dired-sidebar-subtree-line-prefix "__")
-;;   ;;(setq dired-sidebar-use-custom-font t)
-;;   (setq dired-sidebar-theme 'arrow)
-;;   (setq dired-sidebar-use-term-integration t))
-
-(use-package casual-dired
-  :after dired
-  :commands (casual-dired-tmenu)
-  :bind (:map dired-mode-map ("C-o" . 'casual-dired-tmenu)))
-
-(provide 'config-dired)
-;; config-dired.el ends here
dots/.config/emacs/old/config/config-editing.el
@@ -1,164 +0,0 @@
-;;; config-editing.el --- -*- lexical-binding: t; -*-
-;; Time-stamp: <Last changed 2025-05-07 22:55:12 by vincent>
-;;; Commentary:
-;;; Editing configuration
-;;; Code:
-
-(setq-default enable-remote-dir-locals t)
-
-;; When finding file in non-existing directory, offer to create the
-;; parent directory.
-(defun with-buffer-name-prompt-and-make-subdirs ()
-  (let ((parent-directory (file-name-directory buffer-file-name)))
-    (when (and (not (file-exists-p parent-directory))
-               (y-or-n-p (format "Directory `%s' does not exist! Create it? " parent-directory)))
-      (make-directory parent-directory t))))
-
-(add-to-list 'find-file-not-found-functions #'with-buffer-name-prompt-and-make-subdirs)
-
-;; Fix long line "problems"
-;; Disable some right-to-left behavior that might not be needed.
-;; Learning arabic might make me change this, but for now..
-(setq-default bidi-paragraph-direction 'left-to-right)
-(if (version<= "27.1" emacs-version)
-    (setq bidi-inhibit-bpa t))
-;; Detect if the line in a buffer are so long they could have a performance impact
-(if (version<= "27.1" emacs-version)
-    (global-so-long-mode 1))
-
-(use-package saveplace
-  :unless noninteractive
-  :config
-  (save-place-mode 1))
-
-(use-package vundo
-  :bind (("M-u"   . undo)
-         ("M-U"   . undo-redo)
-         ("C-x u" . vundo)))
-
-(use-package whitespace
-  :unless noninteractive
-  :commands (whitespace-mode vde/toggle-invisibles)
-  :config
-  (setq-default whitespace-style '(face tabs spaces trailing space-before-tab newline indentation empty space-after-tab space-mark tab-mark newline-mark))
-  (defun vde/toggle-invisibles ()
-    "Toggles the display of indentation and space characters."
-    (interactive)
-    (if (bound-and-true-p whitespace-mode)
-        (whitespace-mode -1)
-      (whitespace-mode)))
-  :bind ("<f6>" . vde/toggle-invisibles))
-
-(use-package easy-kill
-  :unless noninteractive
-  :commands (easy-kill easy-mark)
-  :bind
-  (([remap kill-ring-save] . easy-kill)
-   ([remap mark-sexp] . easy-mark)
-   ("M-r" . easy-mark)))
-
-(use-package display-line-numbers
-  :unless noninteractive
-  :hook (prog-mode . display-line-numbers-mode)
-  :config
-  (setq-default display-line-numbers-type 'relative)
-  (defun vde/toggle-line-numbers ()
-    "Toggles the display of line numbers.  Applies to all buffers."
-    (interactive)
-    (if (bound-and-true-p display-line-numbers-mode)
-        (display-line-numbers-mode -1)
-      (display-line-numbers-mode)))
-  :bind ("<f7>" . vde/toggle-line-numbers))
-
-(add-hook 'prog-mode-hook 'toggle-truncate-lines)
-
-;; (use-package comment-dwim-2
-;;   :bind (([remap comment-dwim] . comment-dwim-2)))
-(use-package newcomment
-  :unless noninteractive
-  :config
-  (setq-default comment-empty-lines t
-                comment-fill-column nil
-                comment-multi-line t
-                comment-style 'multi-line)
-  (defun prot/comment-dwim (&optional arg)
-    "Alternative to `comment-dwim': offers a simple wrapper
-around `comment-line' and `comment-dwim'.
-
-If the region is active, then toggle the comment status of the
-region or, if the major mode defines as much, of all the lines
-implied by the region boundaries.
-
-Else toggle the comment status of the line at point."
-    (interactive "*P")
-    (if (use-region-p)
-        (comment-dwim arg)
-      (save-excursion
-        (comment-line arg))))
-
-  :bind (("C-;" . prot/comment-dwim)
-         ("C-:" . comment-kill)
-         ("M-;" . comment-indent)
-         ("C-x C-;" . comment-box)))
-
-(use-package delsel
-  :unless noninteractive
-  :config
-  (delete-selection-mode 1))
-
-(use-package emacs
-  :unless noninteractive
-  :custom
-  (repeat-on-final-keystroke t)
-  (set-mark-command-repeat-pop t)
-  :bind (("M-z" . zap-up-to-char)
-	 ("M-S-<up>" . duplicate-dwim)))
-
-(use-package visual-regexp
-  :unless noninteractive
-  :commands (vr/replace vr/query-replace)
-  :bind (("C-c r"   . vr/replace)
-         ("C-c %"   . vr/query-replace)))
-
-(use-package emacs
-  :config
-  :bind (("M-SPC" . cycle-spacing)
-         ("M-o" . delete-blank-lines)
-         ("<C-f6>" . tear-off-window)))
-
-(use-package subword
-  :diminish
-  :hook (prog-mode-hook . subword-mode))
-
-(use-package surround
-  :bind-keymap ("M-'" . surround-keymap))
-
-(use-package substitute
-  :bind (("M-<insert> s" . substitute-target-below-point)
-	 ("M-<insert> r" . substitute-target-above-point)
-	 ("M-<insert> d" . substitute-target-in-defun)
-	 ("M-<insert> b" . substitute-target-in-buffer)))
-
-(use-package jinx
-  :hook (emacs-startup . global-jinx-mode)
-  :bind (([remap ispell-word] . jinx-correct) ;; ("M-$" . jinx-correct)
-         ("C-M-$" . jinx-languages)))
-
-(use-package re-builder)
-(use-package casual-re-builder
-  :bind (:map
-	 reb-mode-map ("C-o" . casual-re-builder-tmenu)
-	 :map
-	 reb-lisp-mode-map ("C-o" . casual-re-builder-tmenu))
-  :after (re-builder))
-
-(use-package time-stamp
-  :custom
-  (time-stamp-active t)
-  (time-stamp-line-limit 10)     ; Check first 10 buffer lines for Time-stamp: <>
-  (time-stamp-format "Last changed %Y-%02m-%02d %02H:%02M:%02S by %u")
-  :hook
-  (before-save . time-stamp))
-
-(provide 'config-editing)
-;;; config-editing.el ends here
dots/.config/emacs/old/config/config-emms.el
@@ -1,78 +0,0 @@
-;;; config-emms.el --- EMMS configuration to play music from Emacs -*- lexical-binding: t -*-
-
-;; Author: Vincent Demeester
-
-;; This file is not part of GNU Emacs
-
-;; This program 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 3 of the License, or
-;; (at your option) any later version.
-
-;; This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This configuration is used for controlling playing music from Emacs.
-
-;;; Code:
-
-(use-package emms
-  :custom
-  (emms-player-list '(emms-player-mpv))
-  (emms-source-file-default-directory "~/desktop/music")
-  (emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-audio-display" "--force-window=no" "--vo=null"))
-  :config
-  (require 'emms-source-file)
-  (require 'emms-source-playlist)
-  (require 'emms-player-simple)
-  (require 'emms-player-mpv)
-  (require 'emms-playlist-mode)
-  (require 'emms-info)
-  (require 'emms-info-mp3info)
-  (require 'emms-info-ogginfo)
-  (require 'emms-info-opusinfo)
-  (require 'emms-info-metaflac)
-  (require 'emms-info-tinytag)
-  (require 'emms-info-exiftool)
-  (require 'emms-info-native)
-  (require 'emms-cache)
-  (require 'emms-mode-line)
-  (require 'emms-mark)
-  (require 'emms-show-all)
-  (require 'emms-streams)
-  (require 'emms-playing-time)
-  (require 'emms-browser)
-  (require 'emms-mode-line-icon)
-  (require 'emms-cue)
-  (require 'emms-bookmarks)
-  (require 'emms-last-played)
-  (require 'emms-metaplaylist-mode)
-  (require 'emms-stream-info)
-  (require 'emms-history)
-  (require 'emms-i18n)
-  (require 'emms-volume)
-  (require 'emms-playlist-limit)
-  (require 'emms-mpris)
-  (require 'emms-idapi-musicbrainz)
-  (require 'emms-idapi-browser)
-  
-  (setq emms-playlist-default-major-mode #'emms-playlist-mode)
-  (add-to-list 'emms-track-initialize-functions #'emms-info-initialize-track)
-  (setq emms-info-functions '(emms-info-native emms-info-cueinfo))
-  (setq emms-track-description-function #'emms-info-track-description)
-  (when (fboundp 'emms-cache)		; work around compiler warning
-    (emms-cache 1))
-  (emms-mode-line-mode 1)
-  (emms-mode-line-blank)
-  (emms-playing-time-mode 1)
-  (add-hook 'emms-player-started-hook #'emms-last-played-update-current))
-
-(provide 'config-emms)
-;;; config-emms.el ends here
dots/.config/emacs/old/config/config-files.el
@@ -1,89 +0,0 @@
-;;; config-files.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Files related configurations
-;;; Code:
-(use-package ffap
-  :hook
-  (after-init . ffap-bindings))
-;; (use-package autoinsert
-;;   :init
-;;   (setq-default auto-insert-query nil
-;;                 auto-insert-alist nil)
-;;   :config
-;;   (auto-insert-mode 1))
-
-(require 'hardhat)
-(global-hardhat-mode)
-
-(use-package files
-  :commands (revert-buffer)
-  :bind (("<f5>" . revert-buffer))
-  :config
-  (setq-default view-read-only t))
-
-(use-package envrc
-  :defer 2
-  :if (executable-find "direnv")
-  :bind (:map envrc-mode-map
-              ("C-c e" . envrc-command-map))
-  :config (envrc-global-mode))
-
-(use-package highlight-indentation
-  :unless noninteractive
-  :commands (highlight-indentation-mode highlight-indentation-current-column-mode)
-  :config
-  (set-face-background 'highlight-indentation-face "#e3e3d3")
-  (set-face-background 'highlight-indentation-current-column-face "#c3b3b3"))
-
-(defun vde/delete-this-file ()
-  "Delete the current file, and kill the buffer."
-  (interactive)
-  (or (buffer-file-name) (error "No file is currently being edited"))
-  (when (yes-or-no-p (format "Really delete '%s'?"
-                             (file-name-nondirectory buffer-file-name)))
-    (delete-file (buffer-file-name))
-    (kill-this-buffer)))
-
-(defun vde/rename-this-file-and-buffer (new-name)
-  "Renames both current buffer and file it's visiting to NEW-NAME."
-  (interactive "sNew name: ")
-  (let ((name (buffer-name))
-        (filename (buffer-file-name)))
-    (unless filename
-      (error "Buffer '%s' is not visiting a file!" name))
-    (if (get-buffer new-name)
-        (message "A buffer named '%s' already exists!" new-name)
-      (progn
-        (when (file-exists-p filename)
-          (rename-file filename new-name 1))
-        (rename-buffer new-name)
-        (set-visited-file-name new-name)))))
-
-(bind-key "C-c f D" #'vde/delete-this-file)
-(bind-key "C-c f R" #'vde/rename-this-file-and-buffer)
-
-;; Additional bindings for built-ins
-(bind-key "C-c f v d" #'add-dir-local-variable)
-(bind-key "C-c f v l" #'add-file-local-variable)
-(bind-key "C-c f v p" #'add-file-local-variable-prop-line)
-
-(defun vde/reload-dir-locals-for-current-buffer ()
-  "Reload dir locals for the current buffer."
-  (interactive)
-  (let ((enable-local-variables :all))
-    (hack-dir-local-variables-non-file-buffer)))
-
-(defun vde/reload-dir-locals-for-all-buffers-in-this-directory ()
-  "Reload dir-locals for all buffers in current buffer's `default-directory'."
-  (interactive)
-  (let ((dir default-directory))
-    (dolist (buffer (buffer-list))
-      (with-current-buffer buffer
-        (when (equal default-directory dir))
-        (vde/reload-dir-locals-for-current-buffer)))))
-
-(bind-key "C-c f v r" #'vde/reload-dir-locals-for-current-buffer)
-(bind-key "C-c f v r" #'vde/reload-dir-locals-for-all-buffers-in-this-directory)
-
-(provide 'config-files)
-;;; config-files.el ends here
dots/.config/emacs/old/config/config-keybindings.el
@@ -1,61 +0,0 @@
-;;; config-keybindings.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Key binding specific configuration
-;;; Code:
-
-;; Disable C-x C-n to avoid the disabled command buffer
-(unbind-key "C-x C-n" global-map)
-
-;; Remap dynamic-abbrev to hippie-expand
-;; See https://www.masteringemacs.org/article/text-expansion-hippie-expand
-(global-set-key [remap dabbrev-expand] 'hippie-expand)
-
-(use-package vde-simple
-  :demand t
-  :preface
-  (dolist (key '("C-M-<SPC>" "M-<SPC>"))
-    (global-unset-key (kbd key)))
-  :bind
-  (("M-<SPC> e" . dired-jump)
-   ("M-<SPC> x" . execute-extended-command)
-   ("M-<SPC> :" . eval-expression)
-   ("M-<SPC> <SPC>" . (lambda()(interactive)
-			(let ((consult-buffer-filter))
-			  (add-to-list 'consult-buffer-filter "\\*")
-			  (call-interactively 'consult-buffer))))
-   ("M-<SPC> f f" . project-find-file)
-   ("M-<SPC> f o" . ffap)
-   ("M-<SPC> f q" . read-only-mode)
-   ("M-<SPC> f r" . consult-recent-file)
-   ("M-<SPC> q q" . save-buffers-kill-terminal)))
-
-;; TODO add general configuration here
-;; (use-package general
-;;   :config
-;;   (dolist (key '("C-M-<SPC>" "M-<SPC>"))
-;;     (global-unset-key (kbd key)))
-;;   (general-create-definer general-leader :prefix "M-<SPC>")
-;;   (general-def "C-M-<SPC>" 'cycle-spacing)
-;; 
-;;   (general-leader
-;;     "z"   #'(repeat :which-key "Repeat")
-;;     "u"   #'(universal-argument :which-key "Universal argument")
-;;     "e"   #'(dired-jump :which-key "Dired")
-;;     "x"   #'(execute-extended-command :which-key "M-x")
-;;     "f"   '(:ignore t :which-key "File")
-;;     "SPC" #'((lambda()(interactive)
-;;                (let ((consult-buffer-filter))
-;;                  (add-to-list 'consult-buffer-filter "\\*")
-;;                  (call-interactively 'consult-buffer))) :wk "Switch to Buffer")
-;;     ":"   #'(eval-expression :wk "Eval expression")
-;;     "ff"  #'(project-find-file :which-key "Find in Project")
-;;     "fo"  #'(ffap :which-key "Find with context")
-;;     "fq"  #'(read-only-mode :which-key "Toggle Read Only")
-;;     "fr"  #'(consult-recent-file :which-key "Recent File")
-;;     "q"   #'(:ignore t :wk "Quit")
-;;     "qq"  #'(save-buffers-kill-terminal :wk "Quit Emacs")
-;;    ))
-
-;; 
-(provide 'config-keybindings)
-;;; config-keybindings.el ends here
dots/.config/emacs/old/config/config-llm.el
@@ -1,283 +0,0 @@
-;;; config-llm.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; LLM configuration
-;;; Code:
-
-(use-package copilot
-  ;; :hook
-  ;; (prog-mode . copilot-mode)
-  ;; (markdown-mode . copilot-mode) ;; Enable this on-demand only
-  ;; (text-mode . copilot-mode) ;; I may not want copilot in org-mode for example.
-  ;; (log-edit-mode . copilot-mode)
-  ;; (vc-git-log-edit-mode . copilot-mode)
-  :bind
-  (:map copilot-completion-map
-        ("C-g" . copilot-clear-overlay)
-        ("C-j" . copilot-next-completion)
-        ("C-k" . copilot-previous-completion)
-        ("M-RET" . copilot-accept-completion)
-        ("C-f" . copilot-accept-completion)
-        ("C-l" . copilot-panel-complete))
-  :custom
-  (copilot-idle-delay 1)
-  (copilot-max-char -1)
-  (copile-indent-offset-warning-disable t))
-
-(setq copilot-chat-commit-prompt "Here is the result of running `git diff --cached`. Based on this, suggest a **Conventional Commit message**. Ensure the message includes both a clear title describing the change and a body explaining the change. Do not invent anything new; just comprehend the diff and explain it.
-
-- Do not add extra markdown formatting.
-- Always make sure the commit message is in markdown format.
-- Do not include any additional text outside the commit message.
-- Make sure the title is a max of 50 characters long and not more.
-- The summaries need to be wrapped to 80 characters long and not more (or break the line).
-- Avoid overused words and phrases often associated with AI-generated text. Do not use the following words: *delve, tapestry, vibrant, landscape, realm, embark, excels, vital, comprehensive, intricate, pivotal, moreover, arguably, notably.*
-- Avoid the following phrases: *dive into, it’s important to note, it’s important to remember, certainly, here are, important to consider, based on the information provided, remember that, navigating the [landscape]/[complexities of], delving into the intricacies of, a testament to.*
-- Do not include any generic AI disclaimers or self-references (e.g., \"As an AI language model...\").
-
-# Conventional Commits 1.0.0
-
-## Summary
-
-Conventional Commits is a specification for commit messages that follows these rules to ensure clarity and consistency:
-
-### Format
-
-`<type>[optional scope]: <description>`
-
-`[body]`
-
-### Types
-
-1. **fix:** A bug fix correlating to a PATCH version.
-2. **feat:** A new feature correlating to a MINOR version.
-
-Other types include:
-
-- **build:** Changes to build systems or dependencies.
-- **chore:** Maintenance tasks (e.g., dependency updates).
-- **ci:** Changes to CI configuration.
-- **refactor:** Code changes not adding features or fixing bugs.
-- **test:** Changes to or addition of tests.
-
-Here is the result of `git diff --cached`:")
-
-(use-package copilot-chat
-  :custom
-  (copilot-chat-model "claude-3.7-sonnet")
-  :bind
-  (("C-c a c p" . copilot-chat-prompt-transient-menu)
-   ("C-c a c c" . copilot-chat-insert-commit-message)
-   ("C-c a c o" . copilot-chat-optimize)
-   ("C-c a c m" . copilot-chat-set-model)
-   ("C-c a c w" . my-copilot-chat-copy-source-block)
-   ("C-c a c y" . copilot-chat-yank)
-   ("C-c a c Y" . copilot-chat-yank-pop)
-   ("C-c a c b" . copilot-chat-display)
-   ("C-c a c a" . copilot-chat-switch-to-buffer)
-   ("C-c a c f" . copilot-chat-custom-prompt-function)
-   ("C-c a c s" . copilot-chat-custom-prompt-selection)
-   (:map embark-general-map
-	 ("M a d" . copilot-chat-doc)
-	 ("M a e" . copilot-chat-explain)
-	 ("M a o" . copilot-chat-optimize)
-	 ("M a p" . copilot-chat-custom-prompt-selection)
-	 ("M a r" . copilot-chat-review))
-   (:map copilot-chat-prompt-mode-map
-         ("C-M-w" . my-copilot-chat-copy-source-block)
-         ("C-q" . delete-window)))
-  :config
-  (setq copilot-chat-prompts copilot-chat-markdown-prompt)
-  (defun my-copilot-chat-copy-source-block ()
-    "Copy the source block at point to kill ring."
-    (interactive)
-    (let* ((temp-buffer-name "*copilot-kr-temp*"))
-      (with-current-buffer (get-buffer-create temp-buffer-name)
-        (erase-buffer)
-        (copilot-chat-yank)
-        (kill-ring-save (point-min) (point-max))
-        (kill-buffer))
-      (message "Source block copied to kill ring")))
-
-  (defun copilot-chat-prompt-transient-menu ()
-    "Show a transient menu for Copilot Chat actions."
-    (interactive)
-    (unless (use-region-p)
-      (mark-defun))
-    (transient-define-prefix copilot-chat-prompt-menu ()
-      "Copilot Chat Menu"
-      ["Copilot Chat Actions"
-       ["Target"
-        ("c" "Commit" copilot-chat-insert-commit-message)
-        ("o" "Optimize" copilot-chat-optimize)
-        ("r" "Review" copilot-chat-review)
-        ("f" "Fix" copilot-chat-fix)
-        ("e" "Explain" copilot-chat-explain)
-        ("d" "Doc" copilot-chat-doc)]
-       ["Commands"
-        ("d" "Display chat" copilot-chat-display)
-        ("h" "Hide chat" copilot-chat-hide)
-        ("R" "Reset & reopen" (lambda ()
-                                (interactive)
-                                (copilot-chat-reset)
-                                (copilot-chat-display)))
-        ("x" "Reset" copilot-chat-reset)
-        ("g" "Go to buffer" copilot-chat-switch-to-buffer)
-        ("m" "Set model" copilot-chat-set-model)
-        ("q" "Quit" transient-quit-one)]
-       ["Actions"
-        ("p" "Custom prompt" copilot-chat-custom-prompt-selection)
-        ("i" "Ask and insert" copilot-chat-ask-and-insert)
-        ("m" "Insert commit message" copilot-chat-insert-commit-message)
-        ("b" "Buffers" copilot-chat-transient-buffers)]
-       ["Data"
-        ("y" "Yank last code block" copilot-chat-yank)
-        ("s" "Send code to buffer" copilot-chat-send-to-buffer)]])
-    (copilot-chat-prompt-menu))
-  :after (copilot embark)
-  :commands
-  (copilot-chat-mode))
-
-(use-package aidermacs
-  :bind (("C-c a a m" . aidermacs-transient-menu))
-  :custom
-  (aidermacs-use-architect-mode t)
-  (aidermacs-auto-commits nil)
-  :config
-  (aidermacs-setup-minor-mode))
-
-(use-package gptel
-  :commands (gptel gptel-mode)
-  :bind (("C-c a g" . gptel))
-  :hook
-  (gptel-mode . visual-line-mode)
-  :bind
-  (:map gptel-mode-map
-        ("C-c C-k" . gptel-abort)
-        ("C-c C-m" . gptel-menu)
-        ("C-c C-c" . gptel-send))
-  :custom
-  (gptel-default-mode #'markdown-mode)
-  :config
-  ;; (general-leader
-  ;;   "o"   '(:ignore t :wk "GPTel")
-  ;;   "o o" '(gptel :wk "Start GPTel")
-  ;;   "o m" '(gptel-menu :wk "GPTel menu"))
-  (setq mcp-hub-servers
-	`(("jira" :command "/home/vincent/src/github.com/chmouel/jayrah/.venv/bin/jayrah" :args ("mcp"))
-	  ("github" :command "github-mcp-server" :args ("stdio")
-	   :env (:GITHUB_PERSONAL_ACCESS_TOKEN ,(passage-get "github/vdemeester/github-mcp-server")))))
-  (require 'gptel-curl)
-  (require 'gptel-gemini)
-  (require 'gptel-ollama)
-  (require 'gptel-transient)
-  (require 'gptel-integrations)
-  (require 'gptel-rewrite)
-  (require 'gptel-org)
-  (require 'gptel-openai)
-  (require 'gptel-openai-extras)
-  (require 'gptel-autoloads)
-  (gptel-mcp-connect)
-  (setq gptel-model 'gemini-2.0-flash
-	gptel-backend (gptel-make-gemini "Gemini"
-			:key (passage-get "ai/gemini/api_key"))
-	)
-
-  (gptel-make-deepseek "Deepseek"
-		       :key  (passage-get "ai/deepseek/api_key")
-		       ;; :models '("deepseek-reasoner" "deepseek-chat" )
-		       )
-
-  (gptel-make-openai "MistralLeChat"
-    :host "api.mistral.ai/v1"
-    :endpoint "/chat/completions"
-    :protocol "https"
-    :key (passage-get "ai/mistralai/api_key")
-    :models '("mistral-small"))
-  
-  (gptel-make-openai "OpenRouter"
-    :host "openrouter.ai"
-    :endpoint "/api/v1/chat/completions"
-    :stream t
-    :key (passage-get "ai/openroute/api_key")
-    :models '(cognitivecomputations/dolphin3.0-mistral-24b:free
-	      cognitivecomputations/dolphin3.0-r1-mistral-24b:free
-	      deepseek/deepseek-r1-zero:free
-	      deepseek/deepseek-chat:free
-	      deepseek/deepseek-r1-distill-qwen-32b:free
-	      deepseek/deepseek-r1-distill-llama-70b:free
-	      google/gemini-2.0-flash-lite-preview-02-05:free
-	      google/gemini-2.0-pro-exp-02-05:free
-	      google/gemini-2.5-pro-exp-03-25
-	      google/gemini-2.5-pro-exp-03-25:free
-	      google/gemma-3-12b-it:free
-	      google/gemma-3-27b-it:free
-	      google/gemma-3-4b-it:free
-	      mistralai/mistral-small-3.1-24b-instruct:free
-	      open-r1/olympiccoder-32b:free
-	      qwen/qwen2.5-vl-3b-instruct:free
-	      qwen/qwen-2.5-coder-32b-instruct:free
-	      qwen/qwq-32b:free
-              codellama/codellama-70b-instruct
-              google/gemini-pro
-              google/palm-2-codechat-bison-32k
-              meta-llama/codellama-34b-instruct
-              mistralai/mixtral-8x7b-instruct
-	      openai/gpt-3.5-turbo))
-
-  (gptel-make-openai "Groq"
-    :host "api.groq.com"
-    :endpoint "/openai/v1/chat/completions"
-    :stream t
-    :key (passage-get "ai/groq/wakasu")
-    :models '("llama-3.3-70b-versatile"
-              "llama-3.1-70b-versatile"
-              "llama-3.1-8b-instant"
-              "llama3-70b-8192"
-              "llama3-8b-8192"
-              "deepseek-r1-distill-qwen-32b"
-              "deepseek-r1-distill-llama-70b-specdec"
-              "qwen-2.5-coder-32b"
-              "mixtral-8x7b-32768"
-              "gemma-7b-it"))
-  
-  (gptel-make-ollama "Ollama"
-    :host "localhost:11434"
-    :stream t
-    :models '("smollm:latest"
-              "llama3.1:latest"
-              "deepseek-r1:latest"
-              "mistral-small:latest"
-              "deepseek-r1:7b"
-              "nomic-embed-text:latest")))
-
-(use-package gptel-context
-  :after gptel
-  :config
-  ;; (general-leader
-  ;;   "o c" '(:ignore t :which-key "GPTel Context")
-  ;;   "o c a" 'gptel-context-add
-  ;;   "o c r" 'gptel-context-remove
-  ;;   "o c s" '(lambda ()
-  ;;              (interactive)
-  ;;              (gptel-context-remove-all nil)
-  ;;              (unless (use-region-p)
-  ;;                (mark-defun))
-  ;;              (gptel-context-add)
-  ;;              (my-switch-to-gptel-buffer)))
-  )
-
-(defun my-switch-to-gptel-buffer (&optional arg)
-  "Switch to the most recent buffer with gptel-mode enabled or start it."
-  (interactive "P")
-  (let (target-buffer)
-    (setq target-buffer (cl-find-if 
-                         (lambda (buf)
-                           (with-current-buffer buf
-                             (bound-and-true-p gptel-mode)))
-                         (buffer-list)))
-    (unless target-buffer
-      (call-interactively 'gptel))
-    (pop-to-buffer target-buffer)))
-
-(provide 'config-llm)
-;;; config-llm.el ends here
dots/.config/emacs/old/config/config-misc.el
@@ -1,29 +0,0 @@
-;;; config-misc.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Miscellaneous modes configuration
-;;; Code:
-
-;; (use-package password-store
-;;   :custom
-;;   (password-store-executable "passage"))
-
-(defvar passage-program "passage"
-  "The path to the `passage` executable.")
-
-(defun passage-get (password-name)
-  "Return the password for PASSWORD-NAME from `passage show`."
-  (let ((password (shell-command-to-string (concat passage-program " show " (shell-quote-argument password-name)))))
-    (string-trim password))) ; Trim whitespace here
-
-(use-package helpful
-  :unless noninteractive
-  :bind (("C-h f" . helpful-callable)
-         ("C-h F" . helpful-function)
-         ("C-h M" . helpful-macro)
-         ("C-c h S" . helpful-at-point)
-         ("C-h k" . helpful-key)
-         ("C-h v" . helpful-variable)
-         ("C-h C" . helpful-command)))
-
-(provide 'config-misc)
-;;; config-misc.el ends here
dots/.config/emacs/old/config/config-mouse.el
@@ -1,20 +0,0 @@
-;;; config-mouse.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Mouse configuration
-;;; Code:
-
-(use-package mouse
-  :unless noninteractive
-  :config
-  (setq mouse-wheel-scroll-amount
-        '(1
-          ((shift) . 5)
-          ((meta) . 0.5)
-          ((control) . text-scale)))
-  (setq make-pointer-invisible t
-        mouse-wheel-progressive-speed t
-        mouse-wheel-follow-mouse t)
-  :hook (after-init . mouse-wheel-mode))
-
-(provide 'config-mouse)
-;;; config-mouse.el ends here
dots/.config/emacs/old/config/config-mu4e.el
@@ -1,168 +0,0 @@
-;;; config-mu4e.el -- mu emacs client configuration -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Code:
-
-(use-package mu4e
-  :commands (mu4e)
-  :custom
-  (mu4e-mu-home "/home/vincent/.local/cache/mu")
-  (mu4e-context-policy 'pick-first)
-  (mu4e-change-filenames-when-moving t)
-  (mu4e-attachment-dir "~/desktop/downloads")
-  :config
-  (setq mu4e-get-mail-command (concat (executable-find "mbsync") " --all"))
-  (setq mu4e-update-interval 1800) ; 30m
-  
-  (defun vde-mu4e--mark-get-copy-target ()
-    "Ask for a copy target, and propose to create it if it does not exist."
-    (let* ((target (mu4e-ask-maildir "Copy message to: "))
-           (target (if (string= (substring target 0 1) "/")
-                       target
-                     (concat "/" target)))
-           (fulltarget (mu4e-join-paths (mu4e-root-maildir) target)))
-      (when (mu4e-create-maildir-maybe fulltarget)
-	target)))
-
-  (defun copy-message-to-target(docid msg target)
-    (let (
-          (new_msg_path nil) ;; local variable                                                                
-          (msg_flags (mu4e-message-field msg :flags))                                                                                                       
-          )                                                                                                   
-      ;; 1. target is already determined interactively when executing the mark (:ask-target)                     
-
-      ;; 2. Determine the path for the new file: we use mu4e~draft-message-filename-construct from            
-      ;; mu4e-draft.el to create a new random filename, and append the original's msg_flags                   
-      (setq new_msg_path (format "%s/%s/cur/%s" mu4e-maildir target (mu4e~draft-message-filename-construct    
-								     (mu4e-flags-to-string msg_flags))))                                                                     
-
-      ;; 3. Copy the message using file system call (copy-file) to new_msg_path:                              
-      ;; (See e.g. mu4e-draft.el > mu4e-draft-open > resend)                                             
-      (copy-file (mu4e-message-field msg :path) new_msg_path)                                                 
-
-      ;; 4. Add the information to the database (may need to update current search query with 'g' if duplicating to current box. Try also 'V' to toggle the display of duplicates) 
-      (mu4e~proc-add new_msg_path (mu4e~mark-check-target target))                                              
-      )                                                                                                       
-    )
-
-  (defun vde-mu4e--refile (msg)
-    "Refile function to smartly move `MSG' to a given folder."
-    (cond
-     ;; Delete GitHub CI activity notifications
-     ((string= (plist-get (car-safe (mu4e-message-field msg :cc)) :email) "ci_activity@noreply.github.com")
-      "/icloud/Deleted Messages")
-     ;; Move Red Hat emails to Trash (will be permanently deleted by Gmail after 30 days)
-     ((string-prefix-p "/redhat" (mu4e-message-field msg :maildir))
-      "/redhat/[Gmail]/Trash")
-     ;; Archive iCloud and other emails by year
-     (t
-      (let ((year (format-time-string "%Y" (mu4e-message-field msg :date))))
-	(format "/icloud/Archives/%s" year)))))
-
-  (setq
-   mu4e-headers-draft-mark     '("D" . "💈")
-   mu4e-headers-flagged-mark   '("F" . "📍")
-   mu4e-headers-new-mark       '("N" . "🔥")
-   mu4e-headers-passed-mark    '("P" . "❯")
-   mu4e-headers-replied-mark   '("R" . "❮")
-   mu4e-headers-seen-mark      '("S" . "☑")
-   mu4e-headers-trashed-mark   '("T" . "💀")
-   mu4e-headers-attach-mark    '("a" . "📎")
-   mu4e-headers-encrypted-mark '("x" . "🔒")
-   mu4e-headers-signed-mark    '("s" . "🔑")
-   mu4e-headers-unread-mark    '("u" . "⎕")
-   mu4e-headers-list-mark      '("l" . "🔈")
-   mu4e-headers-personal-mark  '("p" . "👨")
-   mu4e-headers-calendar-mark  '("c" . "📅"))
-
-  (setopt mu4e-completing-read-function completing-read-function)
-  (setq mu4e-refile-folder 'vde-mu4e--refile)
-  (setq mu4e-contexts `( ,(make-mu4e-context
-			   :name "icloud"
-			   :match-func (lambda (msg) (when msg
-						       (string-prefix-p "/icloud" (mu4e-message-field msg :maildir))))
-			   :vars '(
-				   (user-mail-address . "vincent@demeester.fr")
-				   (mu4e-trash-folder . "/icloud/Deleted Messages")
-				   (mu4e-sent-folder . "/icloud/Sent Messages")
-				   (mu4e-draft-folder . "/icloud/Drafts")
-				   ;; (mu4e-get-mail-command . "mbsync icloud")
-				   ))
-			 ,(make-mu4e-context
-			   :name "gmail"
-			   :match-func (lambda (msg) (when msg
-						       (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
-			   :vars '(
-				   (user-mail-address . "vinc.demeester@gmail.com")
-				   (mu4e-drafts-folder  . "/gmail/[Gmail]/Drafts")
-				   (mu4e-sent-folder  . "/gmail/[Gmail]/Sent Mail")
-				   ;; (mu4e-refile-folder  . "/gmail/[Gmail]/All Mail")
-				   (mu4e-trash-folder  . "/gmail/[Gmail]/Trash")
-				   ;; (mu4e-get-mail-command . "mbsync gmail")
-				   ))
-			 ,(make-mu4e-context
-			   :name "redhat"
-			   :match-func (lambda (msg) (when msg
-						       (string-prefix-p "/redhat" (mu4e-message-field msg :maildir))))
-			   :vars '(
-				   (user-mail-address . "vdemeest@redhat.com")
-				   (mu4e-drafts-folder  . "/redhat/[Gmail]/Drafts")
-				   (mu4e-sent-folder  . "/redhat/[Gmail]/Sent Mail")
-				   ;; (mu4e-refile-folder  . "/redhat/[Gmail]/All Mail")
-				   (mu4e-trash-folder  . "/redhat/[Gmail]/Trash")
-				   ;; (mu4e-get-mail-command . "mbsync redhat")
-				   ))
-			 ))
-  (add-to-list 'mu4e-bookmarks
-	       '( :name  "All Inboxes"
-		  :query "maildir:/icloud/INBOX OR maildir:/gmail/INBOX OR maildir:/redhat/INBOX"
-		  :key   ?b))
-  (with-eval-after-load "mm-decode"
-    (add-to-list 'mm-discouraged-alternatives "text/html")
-    (add-to-list 'mm-discouraged-alternatives "text/richtext")))
-
-(setq sendmail-program "msmtp"
-      send-mail-function 'smtpmail-send-it
-      message-sendmail-f-is-evil t
-      message-sendmail-extra-arguments '("--read-envelope-from")
-      message-send-mail-function 'message-send-mail-with-sendmail)
-
-(use-package consult-mu
-  :after mu4e
-  :custom
-  ;;maximum number of results shown in minibuffer
-  (consult-mu-maxnum 200)
-  ;;show preview when pressing any keys
-  (consult-mu-preview-key 'any)
-  ;;do not mark email as read when previewed. If you turn this to t, be aware that the auto-loaded preview if the preview-key above is 'any would also get marked as read!
-  (consult-mu-mark-previewed-as-read nil)
-  ;;mark email as read when selected.
-  (consult-mu-mark-viewed-as-read t)
-  ;;use reply to all when composing reply emails
-  (consult-mu-use-wide-reply t)
-  ;; define a template for headers view in minibuffer. The example below adjusts the width based on the width of the screen.
-  (consult-mu-headers-template (lambda () (concat "%f" (number-to-string (floor (* (frame-width) 0.15))) "%s" (number-to-string (floor (* (frame-width) 0.5))) "%d13" "%g" "%x")))
-
-  :config
-  ;;create a list of saved searches for quick access using `histroy-next-element' with `M-n' in minibuffer. Note the "#" character at the beginning of each query! Change these according to
-  (setq consult-mu-saved-searches-dynamics '("#flag:unread"))
-  (setq consult-mu-saved-searches-async '("#flag:unread"))
-  ;; require embark actions for marking, replying, forwarding, etc. directly from minibuffer
-  (require 'consult-mu-embark)
-  ;; require extra module for composing (e.g. for interactive attachment) as well as embark actions
-  (require 'consult-mu-compose)
-  (require 'consult-mu-compose-embark)
-  ;; require extra module for searching contacts and runing embark actions on contacts
-  (require 'consult-mu-contacts)
-  (require 'consult-mu-contacts-embark)
-  ;; change the prefiew key for compose so you don't open a preview of every file when selecting files to attach
-  (setq consult-mu-compose-preview-key "M-o")
-  ;; pick a key to bind to consult-mu-compose-attach in embark-file-map
-  (setq consult-mu-embark-attach-file-key "C-a")
-  (setq consult-mu-contacts-ignore-list '("^.*no.*reply.*"))
-  (setq consult-mu-contacts-ignore-case-fold-search t)
-  (consult-mu-compose-embark-bind-attach-file-key)
-  ;; choose if you want to use dired for attaching files (choice of 'always, 'in-dired, or nil)
-  (setq consult-mu-compose-use-dired-attachment 'in-dired))
-
-(provide 'config-mu4e)
-;;; config-mu4e.el ends here
dots/.config/emacs/old/config/config-navigating.el
@@ -1,196 +0,0 @@
-;;; config-navigating.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Navigation related configuration
-;;; Code:
-
-(use-package emacs
-  :config
-  (setq-default scroll-preserve-screen-position t)
-  (setq-default scroll-conservatively 1) ; affects `scroll-step'
-  (setq-default scroll-margin 0)
-
-  (define-minor-mode vde/scroll-centre-cursor-mode
-    "Toggle centred cursor scrolling behaviour."
-    :init-value nil
-    :lighter " S="
-    :global nil
-    (if vde/scroll-centre-cursor-mode
-        (setq-local scroll-margin (* (frame-height) 2)
-                    scroll-conservatively 0
-                    maximum-scroll-margin 0.5)
-      (dolist (local '(scroll-preserve-screen-position
-                       scroll-conservatively
-                       maximum-scroll-margin
-                       scroll-margin))
-        (kill-local-variable `,local))))
-
-  ;; C-c l is used for `org-store-link'.  The mnemonic for this is to
-  ;; focus the Line and also works as a variant of C-l.
-  :bind ("C-c L" . vde/scroll-centre-cursor-mode))
-
-(use-package replace
-  :config
-  (setq list-matching-lines-jump-to-current-line t)
-  ;; See my "Modus themes" for these inherited faces
-  (setq list-matching-lines-buffer-name-face
-        '(:inherit modus-theme-intense-neutral :weight bold))
-  (setq list-matching-lines-current-line-face
-        '(:inherit modus-theme-special-mild))
-
-  (defun vde/occur-url ()
-    "Produce list with all URLs in the current buffer."
-    (interactive)
-    (let ((urls browse-url-button-regexp))
-      (occur urls "\\&")))
-
-  :hook ((occur-mode . hl-line-mode)
-         (occur-mode . (lambda ()
-                         (toggle-truncate-lines t))))
-  :bind (("M-s M-o" . multi-occur)
-         :map occur-mode-map
-         ("t" . toggle-truncate-lines)))
-
-(use-package avy
-  :unless noninteractive
-  :commands (avy-goto-char avy-goto-line avy-goto-word-1 avy-pop-mark avy-goto-char-timer)
-  :bind (("C-c j w" . avy-goto-word-1)
-         ("C-c j b" . avy-pop-mark)
-         ("C-c j t" . avy-goto-char-timer)
-         ("C-c j l" . avy-goto-line)
-	 (:map isearch-mode-map ("C-j" . avy-isearch)))
-  :config
-  (defun avy-action-helpful (pt)
-    (save-excursion
-      (goto-char pt)
-      (helpful-at-point))
-    (select-window
-     (cdr (ring-ref avy-ring 0)))
-    t)
-
-  (setf (alist-get ?H avy-dispatch-alist) 'avy-action-helpful))
-
-(use-package casual-avy
-  :unless noninteractive
-  :bind ("C-c j j" . casual-avy-tmenu))
-
-(use-package mwim
-  :unless noninteractive
-  :commands (mwim-beginning-of-code-or-line mwim-end-of-code-or-line)
-  :bind (:map prog-mode-map
-              ("C-a" . mwim-beginning-of-code-or-line)
-              ("C-e" . mwim-end-of-code-or-line)))
-
-(use-package beginend
-  :unless noninteractive
-  :defer 5
-  :config
-  (beginend-global-mode 1))
-
-(use-package imenu
-  :unless noninteractive
-  :config
-  (setq-default imenu-use-markers t
-                imenu-auto-rescan t
-                imenu-auto-rescan-maxout 600000
-                imenu-max-item-length 100
-                imenu-use-popup-menu nil
-                imenu-eager-completion-buffer t
-                imenu-space-replacement " "
-                imenu-level-separator "/")
-
-  :hook ((imenu-after-jump . (lambda ()
-                               (when (and (eq major-mode 'org-mode)
-                                          (org-at-heading-p))
-                                 (org-show-entry)
-                                 (org-reveal t))))))
-
-(use-package flimenu
-  :unless noninteractive
-  :config
-  (flimenu-global-mode 1))
-
-(use-package man
-  :unless noninteractive
-  :commands (man)
-  :bind (:map Man-mode-map
-              ("i" . Man-goto-section)
-              ("g" . Man-update-manpage)))
-
-(use-package bookmark)
-(use-package casual-bookmarks
-  :bind (:map bookmark-bmenu-mode-map
-              ("C-o" . casual-bookmarks-tmenu)
-              ("S" . casual-bookmarks-sortby-tmenu)
-              ("J" . bookmark-jump))
-  :after (bookmark))
-
-(keymap-global-set "S-<down-mouse-2>" 'strokes-do-stroke)
-
-(use-package repeat
-  :config
-  (setq repeat-on-final-keystroke t)
-  (setq set-mark-command-repeat-pop t)
-
-  (repeat-mode 1)
-
-  (defvar isearch-repeat-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "s") #'isearch-repeat-forward)
-    (define-key map (kbd "r") #'isearch-repeat-backward)
-    map))
-
-  (dolist (cmd '(isearch-repeat-forward isearch-repeat-backward))
-    (put cmd 'repeat-map 'isearch-repeat-map))
-
-  (defvar buffer-navigation-map
-    (let ((map (make-sparse-keymap)))
-      (define-key map (kbd "n") #'next-line)
-      (define-key map (kbd "p") #'previous-line)
-      (define-key map (kbd "f") #'forward-word)
-      (define-key map (kbd "b") #'backward-word)
-      (define-key map (kbd "u") #'scroll-up-command)
-      (define-key map (kbd "d") #'scroll-down-command)
-      map))
-
-  (dolist (cmd '(next-line previous-line forward-word backward-word scroll-up-command scroll-down-command))
-    (put cmd 'repeat-map 'buffer-navigation-map)))
-
-(require 'view)
-
-(add-hook
- 'view-mode-hook
- (lambda ()
-   (cond ((derived-mode-p 'org-mode)
-          (define-key view-mode-map (kbd "p") 'org-previous-visible-heading)
-          (define-key view-mode-map (kbd "n") 'org-next-visible-heading))
-         ((derived-mode-p 'markdown-mode)
-          (define-key view-mode-map (kbd "p") 'markdown-outline-previous)
-          (define-key view-mode-map (kbd "n") 'markdown-outline-next))
-         ((derived-mode-p 'html-mode)
-          (define-key view-mode-map (kbd "p") 'sgml-skip-tag-backward)
-          (define-key view-mode-map (kbd "n") 'sgml-skip-tag-forward))
-         ((derived-mode-p 'python-mode)
-          (define-key view-mode-map (kbd "p") 'python-nav-backward-block)
-          (define-key view-mode-map (kbd "n") 'python-nav-forward-block))
-         ((derived-mode-p 'emacs-lisp-mode)
-          (define-key view-mode-map (kbd "p") 'backward-sexp)
-          (define-key view-mode-map (kbd "n") 'forward-sexp))
-         ((derived-mode-p 'makefile-mode)
-          (define-key view-mode-map (kbd "p") 'makefile-previous-dependency)
-          (define-key view-mode-map (kbd "n") 'makefile-next-dependency))
-         ((derived-mode-p 'c-mode)
-          (define-key view-mode-map (kbd "p") 'c-beginning-of-defun)
-          (define-key view-mode-map (kbd "n") 'c-end-of-defun))
-         (t
-          (define-key view-mode-map (kbd "p") 'scroll-down-command)
-          (define-key view-mode-map (kbd "n") 'scroll-up-command)))))
-
-(use-package outline-indent
-  :custom
-  (outline-indent-ellipsis " ▼ ")
-  :config
-  (add-hook 'yaml-mode-hook #'outline-indent-minor-mode)
-  (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode))
-
-(provide 'config-navigating)
-;;; config-navigating.el ends here
dots/.config/emacs/old/config/config-org.el
@@ -1,714 +0,0 @@
-;;; config-org.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Configuration of orgmode.
-;;; Code:
-
-(use-package s)
-(use-package dash)
-
-(defconst org-directory "~/desktop/org/"
-  "org-mode directory, where most of the org-mode file lives")
-(defconst org-notes-directory (expand-file-name "notes" org-directory)
-  "org-mode notes directory, for notes, managed by denote")
-(defconst org-inbox-file (expand-file-name "inbox.org" org-directory)
-  "New stuff collected in this file.")
-(defconst org-todos-file (expand-file-name "todos.org" org-directory)
-  "TODOs collected in this file.")
-;; I am not using this too much
-(defconst org-remember-file (expand-file-name "remember.org" org-directory)
-  "Remember file, very quick and dirty scratch notes, to be refiled later on.")
-
-(defconst org-archive-dir (expand-file-name "archive" org-directory)
-  "Directory of archived files.")
-
-(defconst org-people-dir (expand-file-name "people" org-notes-directory)
-  "People files directory.")
-
-(defconst src-www-dir (expand-file-name "~/src/www" org-directory)
-  "Directory of my www repository, can contain todos there.")
-
-(defconst org-babel-library-file (expand-file-name "org_library_of_babel.org" org-directory)
-  "Org babel library.")
-
-(set-register ?i `(file . ,org-inbox-file))
-(set-register ?t `(file . ,org-todos-file))
-(set-register ?o `(file . ,org-directory))
-(set-register ?P `(file . ,org-people-dir))
-
-(defun vde/agenda-goto-view ()
-  "Jump to the task narrowed but in view mode only to get a glance."
-  (interactive)
-  (org-agenda-goto)
-  (org-narrow-to-subtree)
-  (view-mode t))
-
-(defun vde/org-mode-hook ()
-  "Org-mode hook."
-  (setq show-trailing-whitespace t)
-  (when (not (eq major-mode 'org-agenda-mode))
-    (setq fill-column 90)
-    (auto-revert-mode 1)
-    (auto-fill-mode 1)
-    (org-indent-mode 1)
-    (visual-line-mode 1)
-    (add-hook 'before-save-hook 'org-update-all-dblocks)
-    (add-hook 'auto-save-hook 'org-update-all-dblocks)
-    (add-hook 'before-save-hook #'save-and-update-includes nil 'make-it-local)))
-
-(use-package org
-  :mode (("\\.org$" . org-mode)
-         ("\\.org.draft$" . org-mode))
-  :commands (org-agenda org-capture)
-  :bind (("C-c o l" . org-store-link)
-         ("C-c o r r" . org-refile)
-	 ("C-c o r R" . vde/reload-org-refile-targets)
-         ("C-c o a a" . org-agenda)
-	 ("C-c o a r" . vde/reload-org-agenda-files)
-	 ("C-c C-x i" . vde/org-clock-in-any-heading)
-         ("C-c o s" . org-sort)
-	 ("C-c O" . org-open-at-point-global)
-         ("<f12>" . org-agenda))
-  :hook (org-mode . vde/org-mode-hook)
-  :custom
-  ;; (org-reverse-note-order '((org-inbox-file . t) ;; Insert items on top of inbox
-  ;;                           (".*" . nil)))    ;; On any other file, insert at the bottom
-  (org-archive-location (concat org-archive-dir "/%s::datetree/"))
-  (org-agenda-file-regexp "^[a-zA-Z0-9-_]+.org$")
-  (org-agenda-remove-tags t)
-  (org-use-speed-commands t)
-  (org-special-ctrl-a/e t)
-  (org-special-ctrl-k t)
-  (org-hide-emphasis-markers t)
-  (org-pretty-entities t)
-  (org-ellipsis "…")
-  (org-return-follows-link t)
-  
-  (org-todo-keywords '((sequence "STRT(s)" "NEXT(n)" "TODO(t)" "WAIT(w)" "|" "DONE(d!)" "CANX(c@/!)")))
-  (org-todo-state-tags-triggers '(("CANX" ("CANX" . t))
-                                  ("WAIT" ("WAIT" . t))
-                                  (done ("WAIT"))
-                                  ("TODO" ("WAIT") ("CANX"))
-                                  ("NEXT" ("WAIT") ("CANX"))
-                                  ("DONE" ("WAIT") ("CANX"))))
-  (org-tag-alist
-   '((:startgroup)
-     ("Handson" . ?o)
-     (:grouptags)
-     ("Write" . ?w) ("Code" . ?c)
-     (:endgroup)
-     
-     (:startgroup)
-     ("Handsoff" . ?f)
-     (:grouptags)
-     ("Read" . ?r) ("Watch" . ?W) ("Listen" . ?l)
-     (:endgroup)))
-
-  (org-log-done 'time)
-  (org-log-redeadline 'time)
-  (org-log-reschedule 'time)
-  (org-log-into-drawer t)
-  (org-refile-use-cache t)
-  (org-refile-use-outline-path 'file)
-  (org-refile-allow-creating-parent-nodes 'confirm)
-  (org-list-demote-modify-bullet '(("+" . "-") ("-" . "+")))
-  (org-agenda-span 'day)
-  (org-agenda-start-on-weekday 1)
-  (org-agenda-window-setup 'current-window)
-  (org-agenda-skip-scheduled-if-deadline-is-shown t)
-  (org-agenda-skip-timestamp-if-deadline-is-shown t)
-  (org-agenda-skip-scheduled-if-done nil)
-  (org-agenda-current-time-string "")
-  (org-agenda-time-grid '((daily) () "" ""))
-  ;; ((agenda . " %i %-12:c%?-12t% s")
-  ;;  (todo . " %i %-12:c")
-  ;;  (tags . " %i %-12:c")
-  ;;  (search . " %i %-12:c"))
-  ;; (org-agenda-prefix-format "   %i %?-2 t%s")
-  (org-agenda-prefix-format '((agenda . " %i %?-12t% s")
-			      (todo . " %i")
-			      (tags . " %i")
-			      (search . " %i")))
-  (org-insert-heading-respect-content t)
-  (org-M-RET-may-split-line '((default . nil)))
-  (org-goto-interface 'outline-path-completion)
-  (org-outline-path-complete-in-steps nil)
-  (org-goto-max-level 2)
-
-  (org-agenda-category-icon-alist `(("personal"  ,(list (propertize "🏡")))
-				    ("work"  ,(list (propertize "🏢")))
-				    ("appointments"  ,(list (propertize "📅")))
-				    ("health"  ,(list (propertize "⚕️")))
-				    ("systems"  ,(list (propertize "🖥️")))
-				    ("journal"  ,(list (propertize "📝")))
-				    ("project--" ,(list (propertize "💼" )))
-				    ("tekton", (list (propertize "😼")))
-				    ("openshift-pipelines", (list (propertize "🎩")))
-				    ("redhat", (list (propertize "🎩")))
-				    ("area--"  ,(list (propertize"🏢" )))
-				    ("area--home"  ,(list (propertize "🏡")))
-				    ("home"  ,(list (propertize "🏡")))
-				    ("home-services" ,(list (propertize "☕ ")))
-				    ("email"  ,(list (propertize"📨" )))
-				    ("people"  ,(list (propertize"👤" )))
-				    ("machine" ,(list (propertize "🖥️")))
-				    ("website" ,(list (propertize "🌍")))
-				    ("bike" ,(list (propertize "🚴‍♂️")))
-				    ("security" ,(list (propertize "🛡️")))
-				    ("i*" ,(list (propertize "📒")))))
-  (org-agenda-sticky t)
-  :config
-
-  (defun vde/org-use-speed-commands-for-headings-and-lists ()
-    "Activate speed commands on list items too."
-    (or (and (looking-at org-outline-regexp) (looking-back "^\**" nil))
-	(save-excursion (and (looking-at (org-item-re)) (looking-back "^[ \t]*" nil)))))
-  (setq org-use-speed-commands 'vde/org-use-speed-commands-for-headings-and-lists)
-  ;; TODO: see https://sachachua.com/blog/2025/03/org-mode-cutting-the-current-list-item-including-nested-lists-with-a-speed-command/
-  
-  ;; Refile org-mode cache when emacs has been idled for 5 minutes
-  (run-with-idle-timer 300 t (lambda ()
-                               (org-refile-cache-clear)
-                               (org-refile-get-targets)))
-  
-  ;; Org Babel configurations
-  (when (file-exists-p org-babel-library-file)
-    (org-babel-lob-ingest org-babel-library-file))
-  (defun vde/all-org-agenda-files ()
-    (seq-filter (lambda(x) (and (not (string-match "/archive/" (file-name-directory x)))
-				(not (string-match ".*==readwise=.*" x))))
-		(apply 'append
-		       (mapcar
-			(lambda (directory)
-			  (directory-files-recursively
-			   directory org-agenda-file-regexp))
-			`(,org-directory)))))
-  ;; (defun vde/reload-org-agenda-files ()
-  ;;   "Reload org-agenda-files variables with up-to-date org files"
-  ;;   (interactive)
-  ;;   (setq org-agenda-files (vde/org-agenda-files)))
-  (defun vde/reload-org-refile-targets ()
-    "Reload org-refile-targets variables with up-to-date org files"
-    (interactive)
-    (setq org-refile-targets (vde/org-refile-targets)))
-  (defun vde/org-refile-targets ()
-    (append '((org-inbox-file :level . 0))
-	    (->>
-	     (directory-files org-directory nil ".org$")
-	     (--remove (s-starts-with? "." it))
-	     (--map (format "%s/%s" org-directory it))
-	     (--map `(,it :maxlevel . 3)))
-	    (->>
-	     (directory-files org-notes-directory nil ".org$")
-	     (--remove (s-starts-with? "." it))
-	     (--map (format "%s/%s" org-notes-directory it))
-	     (--map `(,it :maxlevel . 3)))
-	    (->>
-	     (directory-files-recursively org-people-dir ".org$")
-	     (--remove (s-starts-with? (format "%s/legacy" org-people-dir) it))
-	     (--map (format "%s" it))
-	     (--map `(,it :maxlevel . 3)))))
-  (setq org-agenda-files `(,org-inbox-file ,org-todos-file)
-	;; TODO: extract org-refile-targets into a function
-	org-refile-targets (vde/org-refile-targets))
-  (setopt org-agenda-sorting-strategy
-	  '((agenda time-up deadline-up scheduled-up todo-state-up priority-down)
-	    (todo todo-state-up priority-down deadline-up)
-	    (tags todo-state-up priority-down deadline-up)
-	    (search todo-state-up priority-down deadline-up)))
-  (setq org-agenda-custom-commands
-	'(
-	  ;; Archive tasks
-   	  ("#" "To archive" todo "DONE|CANX")
-	  ;; TODO take inspiration from those
-	  ;; ("$" "Appointments" agenda* "Appointments")
-	  ;; ("b" "Week tasks" agenda "Scheduled tasks for this week"
-   	  ;;  ((org-agenda-category-filter-preset '("-RDV")) ; RDV for Rendez-vous
-   	  ;;   (org-agenda-use-time-grid nil)))
-   	  ;; 
-   	  ;; ;; Review started and next tasks
-   	  ;; ("j" "STRT/NEXT" tags-todo "TODO={STRT\\|NEXT}")
-   	  ;; 
-   	  ;; ;; Review other non-scheduled/deadlined to-do tasks
-   	  ;; ("k" "TODO" tags-todo "TODO={TODO}+DEADLINE=\"\"+SCHEDULED=\"\"")
-   	  ;; 
-   	  ;; ;; Review other non-scheduled/deadlined pending tasks
-   	  ;; ("l" "WAIT" tags-todo "TODO={WAIT}+DEADLINE=\"\"+SCHEDULED=\"\"")
-   	  ;; 
-   	  ;; ;; Review upcoming deadlines for the next 60 days
-   	  ;; ("!" "Deadlines all" agenda "Past/upcoming deadlines"
-   	  ;;  ((org-agenda-span 1)
-   	  ;;   (org-deadline-warning-days 60)
-   	  ;;   (org-agenda-entry-types '(:deadline))))
-
-	  ("d" "Daily Agenda"
-	   ((agenda ""
-		    ((org-agenda-span 'day)
-		     (org-deadline-warning-days 5)))
-	    (tags-todo "+PRIORITY=\"A\""
-		       ((org-agenda-overriding-header "High Priority Tasks")))
-	    (todo "NEXT"
-		  ((org-agenda-overriding-header "Next Tasks")))))
-	  ("D" "Daily Agenda (old)"
-	   ((agenda ""
-		    ((org-agenda-files (vde/all-org-agenda-files))
-		     (org-agenda-span 'day)
-		     (org-deadline-warning-days 5)))
-	    (tags-todo "+PRIORITY=\"A\""
-		       ((org-agenda-files (vde/all-org-agenda-files))
-			(org-agenda-overriding-header "High Priority Tasks")))
-	    (todo "NEXT"
-		  ((org-agenda-files (vde/all-org-agenda-files))
-		   (org-agenda-overriding-header "Next Tasks")))))
-	  ("i" "Inbox (triage)"
-	   ((tags-todo ".*"
-		       ((org-agenda-files `(,org-inbox-file)) ;; FIXME use constant here
-			(org-agenda-overriding-header "Unprocessed Inbox Item")))))
-	  ("A" "All (old)"
-	   ((tags-todo ".*"
-		       ((org-agenda-files (vde/all-org-agenda-files))))))
-	  ("u" "Untagged Tasks"
-	   ((tags-todo "-{.*}"
-		       ((org-agenda-overriding-header "Untagged tasks")))))
-	  ("w" "Weekly Review"
-	   ((agenda ""
-		    ((org-agenda-overriding-header "Completed Tasks")
-		     (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo 'done))
-		     (org-agenda-span 'week)))
-	    (agenda ""
-		    ((org-agenda-overriding-header "Unfinished Scheduled Tasks")
-		     (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
-		     (org-agenda-span 'week)))))
-	  ;; FIXME Should only take into account projects and areas ?
-	  ("R" "Review projects" tags-todo "-CANX/"
-           ((org-agenda-overriding-header "Reviews Scheduled")
-            (org-agenda-skip-function 'org-review-agenda-skip)
-            (org-agenda-cmp-user-defined 'org-review-compare)
-	    (org-agenda-sorting-strategy '(user-defined-down)))))))
-
-(use-package org-review
-  :defer t
-  :after (org)
-  :config
-  (setopt org-review-delay "+1w")
-  (add-hook 'org-agenda-mode-hook
-          (lambda ()
-            (local-set-key (kbd "C-c C-r")
-                           'org-review-insert-last-review))))
-
-;; Make sure we load org-protocol
-(use-package org-protocol
-  :after org)
-
-(use-package org-tempo
-  :after (org)
-  :custom
-  (org-structure-template-alist '(("a" . "aside")
-				  ("c" . "center")
-				  ("C" . "comment")
-				  ("e" . "example")
-				  ("E" . "export")
-				  ("Ea" . "export ascii")
-				  ("Eh" . "export html")
-				  ("El" . "export latex")
-				  ("q" . "quote")
-				  ("s" . "src")
-				  ("se" . "src emacs-lisp")
-				  ("sE" . "src emacs-lisp :results value code :lexical t")
-				  ("sg" . "src go")
-				  ("sr" . "src rust")
-				  ("sp" . "src python")
-				  ("v" . "verse"))))
-
-(use-package org-id
-  :after org
-  :commands contrib/org-id-headlines
-  :init
-  (defun contrib/org-id-headlines ()
-    "Add CUSTOM_ID properties to all headlines in the current
-file which do not already have one."
-    (interactive)
-    (org-map-entries
-     (funcall 'contrib/org-get-id (point) 'create)))
-  :config
-  (setq org-id-link-to-org-use-id
-        'create-if-interactive-and-no-custom-id))
-
-(use-package org-capture
-  :after org
-  :commands (org-capture)
-  :config
-
-  ;; TODO: refine this, create a function that reset this
-  (add-to-list 'org-capture-templates
-               `("l" "Link" entry
-                 (file ,org-inbox-file)
-                 "* %a\n%U\n%?\n%i"
-                 :empty-lines 1))
-  (add-to-list 'org-capture-templates
-	       `("d" "daily entry" entry
-		 (function denote-journal-extras-new-or-existing-entry)
-                 "* %a\n%U\n%?\n%i"
-                 :empty-lines 1))
-  (add-to-list 'org-capture-templates
-               `("t" "Tasks"))
-  (add-to-list 'org-capture-templates
-               `("tt" "New task" entry
-                 (file ,org-inbox-file)
-                 "* %?\n:PROPERTIES:\n:CREATED:\t%U\n:END:\n\n%i\n\nFrom: %a"
-                 :empty-lines 1))
-  ;; Refine this
-  (add-to-list 'org-capture-templates
-               `("tr" "PR Review" entry
-                 (file ,org-inbox-file)
-                 "* TODO review gh:%^{issue} :review:\n:PROPERTIES:\n:CREATED:%U\n:END:\n\n%i\n%?\nFrom: %a"
-                 :empty-lines 1))
-  ;; emails
-  (add-to-list 'org-capture-templates
-	       `("m" "Email Workflow"))
-  (add-to-list 'org-capture-templates
-	       `("mf" "Follow Up" entry
-		 (file ,org-inbox-file)
-		 "* TODO Follow up with %:from on %a\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%i"
-		 :immediate-finish t))
-  (add-to-list 'org-capture-templates
-	       `("mr" "Read Later" entry
-		 (file ,org-inbox-file)
-		 "* TODO Read %:subject\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%a\n\n%i" :immediate-finish t))
-  ;; (add-to-list 'org-capture-templates
-  ;;              `("m" "Meeting notes" entry
-  ;;                (file+datetree ,org-meeting-notes-file)
-  ;;                (file ,(concat user-emacs-directory "/etc/orgmode/meeting-notes.org"))))
-
-  (add-to-list 'org-capture-templates
-               `("w" "Writing"))
-  (add-hook 'org-capture-after-finalize-hook #'vde/window-delete-popup-frame)
-  :bind (("C-c o c" . org-capture)))
-
-(defun vde/dired-notes ()
-  "Open a dired buffer with all my notes"
-  (interactive)
-  (find-dired org-directory "-type f -not -path '*/archive/*'"))
-
-;; Using denote as the "source" of my second brain *in* org-mode.
-(use-package denote
-  :commands (denote denote-region denote-type denote-date
-		    denote-signature denote-subdirectory
-		    denote-template denote-link-or-create
-		    denote-add-links denote-find-link
-		    denote-find-backlink denote-rename-file
-		    denote-rename-file-using-front-matter)
-  :bind (("C-c n n" . vde/dired-notes)
-	 ("C-c n N" . denote)
-	 ("C-c n c" . denote-region)
-	 ("C-c n N" . denote-type)
-	 ("C-c n d" . denote-date)
-	 ("C-c n z" . denote-signature)
-	 ("C-c n S" . denote-subdirectory)
-	 ("C-c n t" . denote-template)
-	 ;; Links
-	 ("C-c n i" . denote-link-or-create)
-	 ("C-c n I" . denote-add-links)
-	 ("C-c n b" . denote-backlinks)
-	 ("C-c n F f" . denote-find-link)
-	 ("C-c n F b" . denote-find-backlink)
-	 ;; Renaming
-	 ("C-c n r" . denote-rename-file)
-	 ("C-c n R" . denote-rename-file-using-front-matter)
-	 ;; Dired
-	 (:map dired-mode-map
-	       ("C-c C-d C-i" . denote-link-dired-marked-notes)))
-  :custom
-  (denote-directory org-notes-directory)
-  (denote-rename-buffer-format "📝 %t")
-  (denote-date-prompt-denote-date-prompt-use-org-read-date t)
-  (denote-prompts '(subdirectory title keywords))
-  (denote-backlinks-display-buffer-action
-   '((display-buffer-reuse-window
-      display-buffer-in-side-window)
-     (side . bottom)
-     (slot . 99)
-     (window-width . 0.3)
-     (dedicated . t)
-     (preserve-size . (t . t))))
-  :hook (dired-mode . denote-dired-mode)
-  :config
-  (denote-rename-buffer-mode 1)
-  (defun my-denote-always-rename-on-save-based-on-front-matter ()
-    "Rename the current Denote file, if needed, upon saving the file.
-Rename the file based on its front matter, checking for changes in the
-title or keywords fields.
-
-Add this function to the `after-save-hook'."
-    (let ((denote-rename-confirmations nil)
-          (denote-save-buffers t)) ; to save again post-rename
-      (when (and buffer-file-name (denote-file-is-note-p buffer-file-name))
-	(ignore-errors (denote-rename-file-using-front-matter buffer-file-name))
-	(message "Buffer saved; Denote file renamed"))))
-
-  (add-hook 'after-save-hook #'my-denote-always-rename-on-save-based-on-front-matter)
-  
-  (with-eval-after-load 'org-capture
-    (setq denote-org-capture-specifiers "%l\n%i\n%?")
-    (add-to-list 'org-capture-templates
-		 '("n" "New note (with denote.el)" plain
-                   (file denote-last-path)
-                   #'denote-org-capture
-                   :no-save t
-                   :immediate-finish nil
-                   :kill-buffer t
-                   :jump-to-captured t)))
-  (defun vde/org-category-from-buffer ()
-    "Get the org category (#+category:) value from the buffer"
-    (cond
-     ((string-match "__journal.org$" (buffer-file-name))
-      "journal")
-     (t
-      (denote-sluggify (denote--retrieve-title-or-filename (buffer-file-name) 'org))))))
-
-(use-package denote-journal
-  :commands (denote-journal-new-entry
-             denote-journal-new-or-existing-entry
-             denote-journal-link-or-create-entry)
-  :custom
-  (denote-journal-directory nil) ;; use denote-directory
-  (denote-journal-title-format 'day-date-month-year)
-  :hook (calendar-mode . denote-journal-calendar-mode)
-  :bind (("C-c n j j" . denote-journal-new-or-existing-entry)
-	 ("C-c n j i" . denote-journal-link-or-create-entry)
-	 ("C-c n j n" . denote-journal-new-entry)))
-
-(use-package denote-org
-  :after denote)
-
-(use-package denote-menu
-  :after denote
-  :bind (("C-c n m" . list-denotes)
-	 (:map denote-menu-mode-map
-	       ("c" . denote-menu-clear-filters)
-	       ("/ r" . denote-menu-filter)
-	       ("/ k" . denote-menu-filter-by-keyword)
-	       ("/ o" . denote-menu-filter-out-keyword)
-	       ("e" . denote-menu-export-to-dired))))
-
-(use-package consult-denote
-  :commands (consult-denote-mode
-	     consult-denote-find
-	     consult-denote-grep)
-  :bind (("C-c n f" . consult-denote-find)
-	 ("C-c n s" . consult-denote-grep))
-  :config
-  (consult-denote-mode 1))
-
-(use-package orgit
-  :defer t)
-
-(use-package ob-async
-  :after org
-  :commands (ob-async-org-babel-execute-src-block))
-(use-package ob-emacs-lisp
-  :after org
-  :commands (org-babel-execute:emacs-lisp org-babel-execute:elisp))
-(use-package ob-go
-  :after org
-  :commands (org-babel-execute:go))
-(use-package ob-python
-  :after org
-  :commands (org-babel-execute:python))
-(use-package ob-shell
-  :after org
-  :commands (org-babel-execute:ash
-             org-babel-execute:bash
-             org-babel-execute:csh
-             org-babel-execute:dash
-             org-babel-execute:fish
-             org-babel-execute:ksh
-             org-babel-execute:mksh
-             org-babel-execute:posh
-             org-babel-execute:sh
-             org-babel-execute:shell
-             org-babel-execute:zsh))
-;; my personal
-(use-package ol-github
-  :after (org))
-(use-package ol-gitlab
-  :after (org))
-(use-package ol-rg
-  :disabled
-  :after (org))
-(use-package ol-grep
-  :after (org))
-
-;; built-in org-mode
-(use-package ol-eshell
-  :after (org))
-(use-package ol-git-link
-  :defer 2
-  :after (org))
-(use-package ol-gnus
-  :defer 2
-  :after (org))
-(use-package ol-irc
-  :defer 2
-  :after (org))
-(use-package ol-info
-  :defer 2
-  :after (org))
-(use-package ol-man
-  :defer 2
-  :after (org))
-;; (use-package ol-notmuch
-;;   :defer 2
-;;   :after (org))
-;; (use-package ob-dot
-;;   :after org
-;;   :commands (org-babel-execute:dot))
-;; (use-package ob-ditaa
-;;   :after org
-;;   :commands (org-babel-execute:ditaa)
-;;   :config
-;;   (setq org-ditaa-jar-path "/home/vincent/.nix-profile/lib/ditaa.jar"))
-;; (use-package ob-doc-makefile
-;;   :after org
-;;   :commands (org-babel-execute:makefile))
-
-(use-package org-nix-shell
-  :hook (org-mode . org-nix-shell-mode))
-
-(use-package org-rich-yank
-  :after org
-  :bind (:map org-mode-map
-              ("C-M-y" . org-rich-yank)))
-
-;; from https://sachachua.com/blog/2024/01/using-consult-and-org-ql-to-search-my-org-mode-agenda-files-and-sort-the-results-to-prioritize-heading-matches/
-(defun my-consult-org-ql-agenda-jump ()
-  "Search agenda files with preview."
-  (interactive)
-  (let* ((marker (consult--read
-                  (consult--dynamic-collection
-                   #'my-consult-org-ql-agenda-match)
-                  :state (consult--jump-state)
-                  :category 'consult-org-heading
-                  :prompt "Heading: "
-                  :sort nil
-                  :lookup #'consult--lookup-candidate))
-         (buffer (marker-buffer marker))
-         (pos (marker-position marker)))
-    ;; based on org-agenda-switch-to
-    (unless buffer (user-error "Trying to switch to non-existent buffer"))
-    (pop-to-buffer-same-window buffer)
-    (goto-char pos)
-    (when (derived-mode-p 'org-mode)
-      (org-fold-show-context 'agenda)
-      (run-hooks 'org-agenda-after-show-hook))))
-
-(defun my-consult-org-ql-agenda-format (o)
-  (propertize
-   (org-ql-view--format-element o)
-   'consult--candidate (org-element-property :org-hd-marker o)))
-
-(defun my-consult-org-ql-agenda-match (string)
-  "Return candidates that match STRING.
-Sort heading matches first, followed by other matches.
-Within those groups, sort by date and priority."
-  (let* ((query (org-ql--query-string-to-sexp string))
-         (sort '(date reverse priority))
-         (heading-query (-tree-map (lambda (x) (if (eq x 'rifle) 'heading x)) query))
-         (matched-heading
-          (mapcar #'my-consult-org-ql-agenda-format
-                  (org-ql-select 'org-agenda-files heading-query
-				 :action 'element-with-markers
-				 :sort sort)))
-         (all-matches
-          (mapcar #'my-consult-org-ql-agenda-format
-                  (org-ql-select 'org-agenda-files query
-				 :action 'element-with-markers
-				 :sort sort))))
-    (append
-     matched-heading
-     (seq-difference all-matches matched-heading))))
-
-(use-package org-ql
-  :after org
-  :bind ("M-s a" . my-consult-org-ql-agenda-jump))
-
-(use-package org-ql-view
-  :after org-ql)
-
-(defun my-org-todo-set-keyword-faces ()
-  (setq org-todo-keyword-faces
-        `(("TODO" . (:foreground ,(modus-themes-get-color-value 'red-faint) :weight bold))
-          ("NEXT" . (:foreground ,(modus-themes-get-color-value 'yellow-warmer) :weight bold))
-          ("STARTED" . (:foreground ,(modus-themes-get-color-value 'yellow-intense) :weight bold))
-          ("IN-REVIEW" . (:foreground ,(modus-themes-get-color-value 'blue-faint) :weight bold))
-          ("DONE" . (:foreground ,(modus-themes-get-color-value 'green-warmer) :weight bold))
-          ("CANX" . (:foreground ,(modus-themes-get-color-value 'comment) :weight bold))
-          ("WAIT" . (:foreground ,(modus-themes-get-color-value 'magenta-faint) :weight bold))
-          ("SOMEDAY" . (:foreground ,(modus-themes-get-color-value 'cyan-warmer) :weight bold))
-          ("IDEA" . (:foreground ,(modus-themes-get-color-value 'magenta-cooler) :weight bold))))
-  (when (derived-mode-p 'org-mode)
-    (font-lock-fontify-buffer)))
-(my-org-todo-set-keyword-faces)
-(with-eval-after-load 'modus-themes
-  (add-hook 'modus-themes-after-load-theme-hook #'my-org-todo-set-keyword-faces))
-
-(use-package ox-publish
-  :after org
-  :commands (org-publish org-publish-all org-publish-project org-publish-current-project org-publish-current-file)
-  :config
-  (setq org-html-coding-system 'utf-8-unix
-	org-publish-use-timestamps-flag nil)
-  (defun vde-org-git-exportable-files (directory)
-    "Return a list of files from `DIRECTORY' that can be exported."
-    (directory-files directory nil ".*_www.*\\.org$"))
-  (setq org-publish-project-alist
-	`(("resources"
-	   :base-directory ,org-directory
-	   :base-extension "org"
-	   ;; :include ".*_www*.org"
-	   :include ,(vde-org-git-exportable-files org-directory)
-	   :exclude ".*"
-	   :publishing-directory ,(expand-file-name "resources" src-www-dir)
-	   :publishing-function org-html-publish-to-html
-	   :recursive t
-	   :with-toc nil
-	   :section-numbers nil
-	   :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/2022.css\" />"
-	   :html-head-extra "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/syntax.css\" />"
-	   :html-preamble t
-	   :html-postamble t
-	   :auto-sitemap t
-	   :sitemap-filename "index.org"
-	   :sitemap-title "Resources"
-	   :sitemap-sort-files anti-chronologically
-	   :sitemap-file-entry-format "%d %t"
-	   :sitemap-date-format "%Y-%m-%d"
-	   ;; :sitemap-function org-publish-org-sitemap
-	   ))))
-(use-package org-habit
-  :after (org)
-  :config
-  (setq org-habit-show-habits-only-for-today nil
-        org-habit-graph-column 80))
-(use-package org-download
-  :after (org)
-  :hook ((dired-mode . org-download-enable)
-         (org-mode . org-download-enable))
-  :config
-  (org-download-enable)
-  (setq org-startup-with-inline-images t)
-  (setq org-download-display-inline-images t)
-  (setq org-download-method 'attach))
-
-;; Persistent notes (like persistent-scratch, but built-in)
-(setq remember-data-file org-remember-file
-      remember-handler-functions '(remember-append-to-file)
-      remember-notes-initial-major-mode 'org-mode
-      remember-notes-auto-save-visited-file-name t
-      remember-in-new-frame t)
-
-(use-package consult-org
-  :after (consult org)
-  :commands (consult-org-agenda consult-org-heading))
-
-(provide 'config-org)
-;;; config-org.el ends here
dots/.config/emacs/old/config/config-programming.el
@@ -1,120 +0,0 @@
-;;; config-programming.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Configure general programming
-;;; Code:
-
-(declare-function vde-project--project-root-or-default-directory "proj-func")
-
-(defun my-recompile (args)
-  (interactive "P")
-  (cond
-   ((eq major-mode #'emacs-lisp-mode)
-    (call-interactively 'eros-eval-defun))
-   ((bound-and-true-p my-vterm-command)
-    (my-vterm-execute-region-or-current-line my-vterm-command))
-   ((get-buffer "*compilation*")
-    (with-current-buffer"*compilation*"
-      (recompile)))
-   ((get-buffer "*Go Test*")
-    (with-current-buffer "*Go Test*"
-      (recompile)))
-   ((and (eq major-mode #'go-mode)
-         buffer-file-name
-         (string-match
-          "_test\\'" (file-name-sans-extension buffer-file-name)))
-    (my-gotest-maybe-ts-run))
-   ((and (get-buffer "*cargo-test*")
-         (boundp 'my-rustic-current-test-compile)
-         my-rustic-current-test-compile)
-    (with-current-buffer "*cargo-test*"
-      (rustic-cargo-test-run my-rustic-current-test-compile)))
-   ((get-buffer "*cargo-run*")
-    (with-current-buffer "*cargo-run*"
-      (rustic-cargo-run-rerun)))
-   ((get-buffer "*pytest*")
-    (with-current-buffer "*pytest*"
-      (recompile)))
-   ((eq major-mode #'python-mode)
-    (compile (concat python-shell-interpreter " " (buffer-file-name))))
-   ((call-interactively 'compile))))
-
-(defun run-command-recipes-make--commands (makefile)
-  "Return the list of commands names that was defined in MAKEFILE."
-  (let ((s (f-read makefile))
-        (commands nil)
-        (pos 0))
-    (while (string-match "^\\([^ \n]+\\):" s pos)
-      (push (match-string 1 s) commands)
-      (setq pos (match-end 0)))
-    commands))
-
-;; TODO github run-command: if remote is github.com, add a gh create pr command, and other "goodies"…
-;; TODO tektoncd run-command: if project is tektoncd
-;; TODO redhat run-command: if it's a redhat project
-;; TODO local run-command: figure out how it works
-
-(use-package run-command
-  :bind ("C-c c" . run-command)
-  :config
-  (defun run-command-recipe-make()
-    "Returns a dynamic list of commands based of a Makefile.
-
-This is condition to the following:
-- `make' executable found
-- `Makefile' file present in project root *or* the default directory."
-    (let* ((dir (vde-project--project-root-or-default-directory))
-	   (makefile (expand-file-name "Makefile" dir)))
-    (when (and
-	   (executable-find "make")
-	   (file-exists-p makefile))
-      (message "Makefile present")
-      (let ((targets (run-command-recipes-make--commands makefile)))
-	(mapcar (lambda (target)
-		  (unless (or (string-prefix-p "." target)
-			      (string-prefix-p "$" target)
-			      (string= "FORCE" target))
-		    (list :command-line (concat "make " target)
-			  :command-name target
-			  :working-dir dir
-			  :runner 'run-command-runner-compile)))
-		targets)))))
-  (defun run-command-recipe-hack ()
-    "Returns a dynamic list of commands based of the presence of an `hack' folder
-in the project root *or* the default-directory."
-    (let* ((dir (vde-project--project-root-or-default-directory))
-	   (hack-dir (expand-file-name "hack" dir))
-	   (files (or (ignore-errors (directory-files hack-dir)) [])))
-      (when (file-accessible-directory-p hack-dir)
-	(mapcar (lambda (file)
-		  (let ((hack-file (expand-file-name file hack-dir)))
-		    (when (and (file-regular-p hack-file)
-			       (file-executable-p hack-file))
-		      (list :command-line hack-file
-			    :command-name file
-			    :working-dir dir
-			    :runner 'run-command-runner-compile))))
-		files))))
-  (add-to-list 'run-command-recipes 'run-command-recipe-hack)
-  (add-to-list 'run-command-recipes 'run-command-recipe-make))
-
-(defvar highlight-codetags-keywords
-  '(("\\<\\(TODO\\|FIXME\\|BUG\\|XXX\\)\\>" 1 font-lock-warning-face prepend)
-    ("\\<\\(NOTE\\|HACK\\)\\>" 1 font-lock-doc-face prepend)))
-
-(define-minor-mode highlight-codetags-local-mode
-  "Highlight codetags like TODO, FIXME..."
-  :global nil
-  (if highlight-codetags-local-mode
-      (font-lock-add-keywords nil highlight-codetags-keywords)
-    (font-lock-remove-keywords nil highlight-codetags-keywords))
-
-  ;; Fontify the current buffer
-  (when (bound-and-true-p font-lock-mode)
-    (if (fboundp 'font-lock-flush)
-        (font-lock-flush)
-      (with-no-warnings (font-lock-fontify-buffer)))))
-
-(add-hook 'prog-mode-hook #'highlight-codetags-local-mode)
-
-(provide 'config-programming)
-;;; config-programming.el ends here
dots/.config/emacs/old/config/config-projects.el
@@ -1,91 +0,0 @@
-;;; config-projects.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Project related configuration.
-;;; Code:
-
-(require 'json)
-
-(use-package project
-  :commands (project-find-file project-find-regexp vde/project-vterm vde/project-run-in-vterm)
-  :custom ((project-switch-commands '((?f "File" project-find-file)
-				      (?g "Grep" project-find-regexp)
-				      (?d "Dired" project-dired)
-				      (?b "Buffer" project-switch-to-buffer)
-				      (?q "Query replace" project-query-replace-regexp)
-				      (?m "Magit" vde-project-magit-status)
-				      (?e "Eshell" project-eshell)
-				      (?E "Eat" vde/project-eat)
-				      (?s "Vterm" vde/project-vterm)
-				      (?R "README" vde/open-readme)
-				      (?g "Checkout GitHub PR" checkout-github-pr)))
-	   (project-mode-line t))
-  :bind (("C-x p v" . vde-project-magit-status)
-         ("C-x p s" . vde/project-vterm)
-         ("C-x p X" . vde/project-run-in-vterm)
-	 ("C-x p E" . vde/project-eat)
-	 ("C-x p G" . checkout-github-pr))
-  :init
-  ;; (require project-rootfile)
-  ;; (add-to-list 'project-find-functions #'project-rootfile-try-detect t)
-  ;; (setq project-rootfile-list '(".project"
-  ;;   "default.nix" "flake.nix"                               ; nix
-  ;;   "Makefile" "GNUMakefile" "CMakeLists.txt"               ; Make & CMake
-  ;;   "Cask" "Eldev" "Keg" "Eask"                             ; Emacs
-  ;;   "stack.yaml"                                            ; Haskell
-  ;;   "Cargo.toml"                                            ; Rust
-  ;;   "go.mod"                                                ; Go
-  ;;   ))
-  :config
-  (setq vde/project-local-identifier '(".project")) ;; "go.mod"
-
-  ;; (add-hook 'project-find-functions #'vde/project-try-local)
-
-  (setq-default project-compilation-buffer-name-function 'project-prefixed-buffer-name)
-  (defun vde-project-magit-status ()
-    "Run `magit-status' on project."
-    (interactive)
-    (magit-status (vde-project--project-current)))
-
-  ;; (general-leader
-  ;;   "p"  '(:ignore :which-key "Project")
-  ;;   "pp"  #'(project-switch-project :which-key "Switch to Project")
-  ;;   "ps"  #'(project-search :which-key "Grep in Project")
-  ;;   "pf"  #'(project-find-file :which-key "Find in Project")
-  ;;   "pd"  #'(project-dired :which-key "Dired in Project")
-  ;;   "pc"  #'(project-compile :which-key "Compile in Project")
-  ;;   "pb"  #'(project-switch-to-buffer :which-key "Switch to Project Buffer")
-  ;;   "pk"  #'(project-kill-buffers :which-key "Kill Project Buffers")
-  ;;   "ps"  #'(vde/project-vterm :which-key "Start a vterm in Project")
-  ;;   "pe"  #'(project-eshell :which-key "Start a eshell in Project")
-  ;;   "pE"  #'(vde/project-eat :which-key "Start a eat term in Project")
-  ;;   "px"  #'(vde/project-run-in-vterm :which-key "Execute command in vterm in Project"))
-  )
-
-(use-package conner
-  :bind (("C-x p C" . conner-run-project-command))
-  :commands (conner-run-project-command)
-  :config
-  (require 'vterm))
-
-(use-package project-x
-  :after project
-  :config
-  (add-hook 'project-find-functions 'project-x-try-local 90)
-  (add-hook 'kill-emacs-hook 'project-x--window-state-write)
-  (add-to-list 'project-switch-commands
-               '(?j "Restore windows" project-x-windows) t)
-  :bind (("C-x p w" . project-x-window-state-save)
-         ("C-x p j" . project-x-window-state-load)))
-
-(use-package jira
-  :commands (jira-issues)
-  :config
-  (setq jira-base-url "https://issues.redhat.com"
-	jira-username "vdemeest@redhat.com"
-	jira-token (passage-get "redhat/issues/token/myji")
-	jira-token-is-personal-access-token t
-	jira-api-version 2
-	jira-issues-max-results 500))
-
-(provide 'config-projects)
-;;; config-projects.el ends here
dots/.config/emacs/old/config/config-search.el
@@ -1,183 +0,0 @@
-;;; config-search.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Search related configuration
-;;; Code:
-
-(setq xref-search-program
-      (cond
-       ((or (executable-find "ripgrep")
-            (executable-find "rg"))
-        'ripgrep)
-       ((executable-find "ugrep")
-        'ugrep)
-       (t
-        'grep)))
-
-;; UseISearch
-(use-package isearch
-  :unless noninteractive
-  :config
-  (defun my-project-search-from-isearch ()
-    (interactive)
-    (let ((query (if isearch-regexp
-               isearch-string
-             (regexp-quote isearch-string))))
-      (isearch-update-ring isearch-string isearch-regexp)
-      (let (search-nonincremental-instead)
-        (ignore-errors (isearch-done t t)))
-      (project-find-regexp query)))
-  (defun my-occur-from-isearch ()
-    (interactive)
-    (let ((query (if isearch-regexp
-		     isearch-string
-		   (regexp-quote isearch-string))))
-      (isearch-update-ring isearch-string isearch-regexp)
-      (let (search-nonincremental-instead)
-        (ignore-errors (isearch-done t t)))
-      (occur query)))
-  (setq-default search-whitespace-regexp ".*?"
-                isearch-lax-whitespace t
-                isearch-regexp-lax-whitespace nil
-		isearch-lazy-count t
-		lazy-count-prefix-format nil
-		lazy-count-suffix-format "   (%s/%s)")
-  (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 (("M-s M-o" . multi-occur)
-         :map isearch-mode-map
-	 ("C-o" . my-occur-from-isearch)
-	 ("C-f" . my-project-search-from-isearch)
-	 ("C-d" . isearch-forward-symbol-at-point)
-         ("DEL" . contrib/isearchp-remove-failed-part-or-last-char)
-         ("<C-return>" . contrib/isearch-done-opposite-end)))
-;; -UseISearch
-
-;; UseGrep
-(use-package grep
-  :commands (find-grep grep find-grep-dired find-name-dired)
-  :bind (("M-s n" . find-name-dired)
-         ("M-s F" . find-grep)
-         ("M-s G" . grep)
-         ("M-s d" . find-grep-dired))
-  :hook ((hook-mode . toggle-truncate-lines))
-  :config
-  (setq-default grep-template (string-join '("ugrep"
-                                             "--color=always"
-                                             "--ignore-binary"
-                                             "--ignore-case"
-                                             "--include=<F>"
-                                             "--line-number"
-                                             "--null"
-                                             "--recursive"
-                                             "--regexp=<R>")
-                                           " "))
-  (add-to-list 'grep-find-ignored-directories "auto")
-  (add-to-list 'grep-find-ignored-directories "elpa"))
-;; -UseGrep
-
-;; UseWgrep
-(use-package wgrep
-  :unless noninteractive
-  :commands (wgrep-change-to-wgrep-mode)
-  :defer 2
-  :custom
-  (wgrep-auto-save-buffer t)
-  (wgrep-change-readonly-file t))
-;; -UseWgrep
-
-;; UseRG
-(use-package rg
-  :if (executable-find "rg")
-  :commands (rg rg-project rg-dwim)
-  :bind (("M-s r r" . rg)
-         ("M-s r p" . rg-project)
-         ("M-s r s" . rg-dwim))
-  :config
-  (setq rg-group-result t)
-  (setq rg-hide-command t)
-  (setq rg-show-columns nil)
-  (setq rg-show-header t)
-  (setq rg-default-alias-fallback "all")
-  (cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases)
-  (cl-pushnew '("gotest" . "*_test.go") rg-custom-type-aliases)
-  (defun vde/rg-buffer-name ()
-    "Generate a rg buffer name from project if in one"
-    (let ((p (project-root (project-current))))
-      (if p
-	  (format "rg: %s" (abbreviate-file-name p))
-	"rg")))
-  (setq rg-buffer-name #'vde/rg-buffer-name)
-  ;; (when (f-dir-p "~/src/home/")
-  ;;   (rg-define-search rg-projects-dotemacs
-  ;;     "Search home"
-  ;;     :dir "~/src/home/"
-  ;;     :files "*.*"
-  ;;     :menu ("Projects" "H" "home")))
-  ;; (when (f-dir-p "~/src/github.com/NixOS/nixpkgs/")
-  ;;   (rg-define-search rg-projects-nixpkgs
-  ;;     "Search nixpkgs"
-  ;;     :dir "~/src/github.com/NixOS/nixpkgs/"
-  ;;     :files "*.*"
-  ;;     :menu ("Projects" "N" "nixpkgs")))
-  ;; (when (f-dir-p "~/src/tektoncd/pipeline/")
-  ;;   (rg-define-search rg-projects-tektoncd-pipeline
-  ;;     "Search tektoncd/pipeline"
-  ;;     :dir "~/src/tektoncd/pipeline/"
-  ;;     :files "*.*"
-  ;;     :menu ("tektoncd" "P" "pipeline")))
-  ;; (when (f-dir-p "~/src/tektoncd/operator/")
-  ;;   (rg-define-search rg-projects-tektoncd-operator
-  ;;     "Search tektoncd/operator"
-  ;;     :dir "~/src/tektoncd/operator/"
-  ;;     :files "*.*"
-  ;;     :menu ("tektoncd" "P" "operator")))
-  ;; (when (f-dir-p "~/src/tektoncd/cli/")
-  ;;   (rg-define-search rg-projects-tektoncd-cli
-  ;;     "Search tektoncd/cli"
-  ;;     :dir "~/src/tektoncd/cli/"
-  ;;     :files "*.*"
-  ;;     :menu ("tektoncd" "C" "cli")))
-  ;; (when (f-dir-p "~/src/chmouel/")
-  ;;   (rg-define-search rg-projects-chmouel
-  ;;     "Search chmouel"
-  ;;     :dir "~/src/chmouel/"
-  ;;     :files "*.*"
-  ;;     :menu ("Configs" "ch" "chmouel")))
-  )
-
-;; -UseRG
-
-(provide 'config-search)
-;;; config-search.el ends here
dots/.config/emacs/old/config/config-shells.el
@@ -1,442 +0,0 @@
-;;; config-shells.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Shell scripting
-;;; Code:
-
-(defvar ISATUIN (executable-find "atuin")
-  "Whether atuin is available for shell/eshell history.")
-
-(use-package shell
-  :commands (shell)
-  :bind (("<f1>"      . shell)
-         (:map shell-mode-map
-               ("<tab>" . completion-at-point)))
-  :config
-  (setq-default explicit-shell-file-name "zsh"
-                shell-file-name "zsh")
-  (unbind-key "C-c C-l" shell-mode-map)
-  (bind-key "C-c C-l" #'counsel-shell-history shell-mode-map))
-
-(defun run-in-compile (base-cmd &rest ARGS)
-  "Use `compile' to run the BASE-CMD and ARGS, from eshell."
-  (compile (concat base-cmd " " (apply #'concat ARGS))))
-
-;; TODO: understand and rework eshell completion
-(use-package eshell
-  :commands (eshell eshell-here)
-  :bind* ("C-x m t" . eshell-here)
-  :config
-  (defun eshell/make (&rest ARGS)
-    "Shortcut to more easily run builds in a compile buffer"
-    (cond ((or (file-exists-p "Makefile")
-	       (file-exists-p "makefile"))
-	   (run-in-compile "make" ARGS))
-	  ((file-exists-p "build.zig")
-	   (run-in-compile "zig build"))
-	  (t "No supported build system found.")))
-  (defun eshell-here ()
-    "Open EShell in the directory associated with the current buffer's file.
-The EShell is renamed to match that directory to make multiple windows easier."
-    (interactive)
-    (let* ((parent (if (buffer-file-name)
-                       (file-name-directory (buffer-file-name))
-                     default-directory))
-           (name   (car (last (split-string parent "/" t)))))
-      (eshell "new")
-      (rename-buffer (concat "*eshell: " name "*"))))
-
-  ;; Handy aliases
-  (defalias 'ff 'find-file)
-  (defalias 'emacs 'find-file)
-  (defalias 'e 'find-file)
-  (defalias 'ec 'find-file)
-  (defalias 'd 'dired)
-
-  (defun eshell/gs (&rest args)
-    (magit-status (pop args) nil)
-    (eshell/echo))                      ; The echo command suppresses output
-
-  (defun eshell/cdg ()
-    "Change directory to the project's root."
-    (eshell/cd (locate-dominating-file default-directory ".git")))
-
-  (defun eshell/extract (file)
-    "One universal command to extract FILE (for bz2, gz, rar, etc.)"
-    (eshell-command-result (format "%s %s" (cond ((string-match-p ".*\.tar.bz2" file)
-                                                  "tar xzf")
-                                                 ((string-match-p ".*\.tar.gz" file)
-                                                  "tar xzf")
-                                                 ((string-match-p ".*\.bz2" file)
-                                                  "bunzip2")
-                                                 ((string-match-p ".*\.rar" file)
-                                                  "unrar x")
-                                                 ((string-match-p ".*\.gz" file)
-                                                  "gunzip")
-                                                 ((string-match-p ".*\.tar" file)
-                                                  "tar xf")
-                                                 ((string-match-p ".*\.tbz2" file)
-                                                  "tar xjf")
-                                                 ((string-match-p ".*\.tgz" file)
-                                                  "tar xzf")
-                                                 ((string-match-p ".*\.zip" file)
-                                                  "unzip")
-                                                 ((string-match-p ".*\.jar" file)
-                                                  "unzip")
-                                                 ((string-match-p ".*\.Z" file)
-                                                  "uncompress")
-                                                 (t
-                                                  (error "Don't know how to extract %s" file)))
-                                   file)))
-
-  ;; From https://karthinks.com/software/jumping-directories-in-eshell/
-  (defun eshell/j (&optional regexp)
-    "Navigate to a previously visited directory in eshell, or to
-any directory proferred by `consult-dir'."
-    (let ((eshell-dirs (delete-dups
-                        (mapcar 'abbreviate-file-name
-                                (ring-elements eshell-last-dir-ring)))))
-      (cond
-       ((and (not regexp) (featurep 'consult-dir))
-        (let* ((consult-dir--source-eshell `(:name "Eshell"
-                                                   :narrow ?e
-                                                   :category file
-                                                   :face consult-file
-                                                   :items ,eshell-dirs))
-               (consult-dir-sources (cons consult-dir--source-eshell
-                                          consult-dir-sources)))
-          (eshell/cd (substring-no-properties
-                      (consult-dir--pick "Switch directory: ")))))
-       (t (eshell/cd (if regexp (eshell-find-previous-directory regexp)
-                       (completing-read "cd: " eshell-dirs)))))))
-
-  (add-hook
-   'eshell-mode-hook
-   (lambda ()
-     (let ((ls (if (executable-find "exa") "exa" "ls")))
-       (eshell/alias "ls" (concat ls " $*"))
-       (eshell/alias "ll" (concat ls " -l $*"))
-       (eshell/alias "l" (concat ls " -lah $*")))
-     (eshell-smart-initialize)
-     (eshell-dirs-initialize)
-     (bind-keys :map eshell-mode-map
-                ("C-c C-l"                . counsel-esh-history)
-                ([remap eshell-pcomplete] . completion-at-point)
-                )))
-
-  ;; Use system su/sudo
-  (with-eval-after-load "em-unix"
-    '(progn
-       (unintern 'eshell/su nil)
-       (unintern 'eshell/sudo nil)))
-
-  (add-hook 'eshell-mode-hook #'with-editor-export-editor))
-
-(use-package eshell-atuin
-  :when ISATUIN
-  :after eshell
-  ;; :bind* ( :map eshell-mode-map
-  ;;          ([remap eshell-previous-matching-input] . eshell-atuin-history))
-  :bind (("C-r" . eshell-atuin-history)
-	 ([remap eshell-list-history] . eshell-atuin-history))
-  :config
-  (eshell-atuin-mode)
-  (setopt eshell-atuin-filter-mode 'global
-          eshell-atuin-search-fields '(time duration command directory host)
-	  eshell-atuin-search-options '() ;; default --exit 0 ignores all the one imported… which is a shame
-          eshell-atuin-history-format "%-80c %-40i %>10t %h"))
-
-(use-package em-prompt
-  :after eshell
-  :config
-  (defun vde/eshell-quit-or-delete-char (arg)
-    "Use C-d to either delete forward char or exit EShell."
-    (interactive "p")
-    (if (and (eolp) (looking-back eshell-prompt-regexp nil nil))
-        (progn
-          (eshell-life-is-too-much))
-      (delete-char arg)))
-
-  (add-hook 'eshell-mode-hook
-            (lambda ()
-              (bind-key "C-d"
-                        #'vde/eshell-quit-or-delete-char eshell-mode-map))))
-
-(use-package esh-mode
-  :disabled
-  :after eshell
-  :bind (:map eshell-mode-map
-              ("<tab>" . vde/esh-mode-completion-at-point))
-  :config
-  (setq-default eshell-scroll-to-bottom-on-input 'all)
-  (defun vde/esh-mode-completion-at-point ()
-    "Same as `completion-at-point' except for some commands."
-    (interactive)
-    ;; unbinding pcomplete/make gives a chance to `bash-completion'
-    ;; to complete make rules. Bash-completion is indeed more
-    ;; powerfull than `pcomplete-make'.
-    (cl-letf (((symbol-function 'pcomplete/make) nil))
-      (completion-at-point))))
-
-(use-package em-smart
-  :after eshell)
-(use-package em-dirs
-  :after eshell)
-
-(use-package em-cmpl
-  :after eshell
-  :hook (eshell-mode . eshell-cmpl-initialize)
-  :config
-  (defun my/eshell-bash-completion ()
-    (let ((bash-completion-nospace t))
-      (while (pcomplete-here
-              (nth 2 (bash-completion-dynamic-complete-nocomint
-                      (save-excursion (eshell-bol) (point))
-                      (point)))))))
-  (when (require 'bash-completion nil t)
-    (setq eshell-default-completion-function #'my/eshell-bash-completion))
-
-  (add-to-list 'eshell-command-completions-alist
-               '("gunzip" "gz\\'"))
-  (add-to-list 'eshell-command-completions-alist
-               '("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'")))
-
-(use-package em-hist
-  :after eshell
-  :config (setq eshell-hist-ignoredups t))
-
-(use-package em-tramp
-  :after eshell)
-
-(use-package em-term
-  :after eshell
-  :config
-  (add-to-list 'eshell-visual-commands "ssh")
-  (add-to-list 'eshell-visual-commands "htop")
-  (add-to-list 'eshell-visual-commands "top")
-  (add-to-list 'eshell-visual-commands "tail")
-  (add-to-list 'eshell-visual-commands "npm")
-  (add-to-list 'eshell-visual-commands "ncdu"))
-
-(use-package em-banner
-  :after eshell
-  :config
-  (setq eshell-banner-message "
-  Welcome to the Emacs
-
-                         _/                  _/  _/
-      _/_/      _/_/_/  _/_/_/      _/_/    _/  _/
-   _/_/_/_/  _/_/      _/    _/  _/_/_/_/  _/  _/
-  _/            _/_/  _/    _/  _/        _/  _/
-   _/_/_/  _/_/_/    _/    _/    _/_/_/  _/  _/
-
-"))
-
-(use-package eshell-prompt-extras
-  :after eshell
-  :custom
-  (eshell-highlight-prompt nil)
-  (eshell-prompt-function 'vde-theme-lambda)
-  :config
-  (setq epe-path-style 'fish
-	epe-fish-path-max-len 20)
-  (defun vde-kubernetes-current-context ()
-    "Return the current context"
-    (if (not (string-empty-p (getenv "KUBECONFIG")))
-        (epe-trim-newline (shell-command-to-string (concat
-                                                    "env KUBECONFIG="
-                                                    (getenv "KUBECONFIG")
-                                                    " kubectl config current-context")))
-      (epe-trim-newline (shell-command-to-string "kubectl config current-context"))))
-  (defun vde-kubernetes-p ()
-    "If you have kubectl install and a config set,
-using either KUBECONFIG or ~/.kube/config"
-    (and (eshell-search-path "kubectl")
-         (not (string-empty-p (vde-kubernetes-current-context)))
-         (not (string-match-p "error: current-context is not set" (vde-kubernetes-current-context)))))
-  ;; From epe-theme-lambda
-  (defun vde-theme-lambda ()
-    "A eshell-prompt lambda theme."
-    (setq eshell-prompt-regexp "^[^#\nλ]*[#λ] ")
-    (concat
-     (when (epe-remote-p)
-       (epe-colorize-with-face
-        (concat (epe-remote-user) "@" (epe-remote-host) " ")
-        'epe-remote-face))
-     (when (and epe-show-python-info (bound-and-true-p venv-current-name))
-       (epe-colorize-with-face (concat "(" venv-current-name ") ") 'epe-venv-face))
-     (let ((f (cond ((eq epe-path-style 'fish) 'epe-fish-path)
-                    ((eq epe-path-style 'single) 'epe-abbrev-dir-name)
-                    ((eq epe-path-style 'full) 'abbreviate-file-name))))
-       (epe-colorize-with-face (funcall f (eshell/pwd)) 'epe-dir-face))
-     (when (epe-git-p)
-       (concat
-        (epe-colorize-with-face ":" 'epe-dir-face)
-        (epe-colorize-with-face
-         (concat (epe-git-branch)
-                 (epe-git-dirty)
-                 (epe-git-untracked)
-                 (let ((unpushed (epe-git-unpushed-number)))
-                   (unless (= unpushed 0)
-                     (concat ":" (number-to-string unpushed)))))
-         'epe-git-face)))
-     (when (vde-kubernetes-p)
-       (concat (epe-colorize-with-face " (" 'epe-dir-face)
-               (epe-colorize-with-face (vde-kubernetes-current-context) 'epe-dir-face)
-               (epe-colorize-with-face ")" 'epe-dir-face)))
-     (epe-colorize-with-face " λ" 'epe-symbol-face)
-     (epe-colorize-with-face (if (= (user-uid) 0) "#" "") 'epe-sudo-symbol-face)
-     " ")))
-
-(use-package eat
-  :commands (eat)
-  :init (setq eat-kill-buffer-on-exit t
-	      eat-enable-yank-to-terminal t)
-  :hook ((eshell-mode . eat-eshell-mode)
-	 (eshell-mode . eat-eshell-visual-command-mode)))
-
-(use-package xterm-color
-  :after eshell
-  :init
-  ;; (setq comint-output-filter-functions
-  ;;       (remove 'ansi-color-process-output comint-output-filter-functions))
-  (add-hook 'shell-mode-hook
-            (lambda ()
-              ;; Disable font-locking in this buffer to improve performance
-              (font-lock-mode -1)
-              ;; Prevent font-locking from being re-enabled in this buffer
-              (make-local-variable 'font-lock-function)
-              (setq font-lock-function (lambda (_) nil))
-              (add-hook 'comint-preoutput-filter-functions 'xterm-color-filter nil t)))
-  (add-hook 'eshell-before-prompt-hook
-            (lambda ()
-              (setenv "TERM" "xterm-256color")
-              (setq xterm-color-preserve-properties t)))
-  (add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter)
-  (setq eshell-output-filter-functions (remove 'eshell-handle-ansi-color eshell-output-filter-functions))
-  (setq compilation-environment '("TERM=xterm-256color")))
-
-(use-package vterm
-  :commands (vterm vde/vterm-toggle)
-  :bind (("C-c t v" . vde/vterm-toggle)
-         ("C-c t r" . vde/run-in-vterm))
-  :custom
-  (vterm-kill-buffer-on-exit t)
-  (vterm-max-scrollback 100000)
-  (vterm-tramp-shells '(("scp" "/usr/bin/env zsh")
-			("ssh" "/usr/bin/env zsh")
-			("sshx" "/usr/bin/env zsh")
-			("sshfs" "/usr/bin/env zsh")
-			("docker" "/bin/sh")))
-  :config
-  (defun vde/vterm-tramp-get-method-parameter (method param)
-    "Return the method parameter PARAM.
-If the `tramp-methods' entry does not exist, return NIL."
-    (let ((entry (assoc param (assoc method tramp-methods))))
-      (when entry (cadr entry))))
-  (add-hook 'vterm-set-title-functions 'vterm--rename-buffer-as-title)
-  ;; TODO: hook into projectile-run-vterm instead
-  ;; Also, look into vterm-toggle way of doing things.. I thing it is trying to be too smart about it..
-  ;; I prefer an easy projectile integration (or projects integration)
-  (defun vde/vterm ()
-    ""
-    (interactive)
-    (let* ((dir (expand-file-name default-directory))
-           cd-cmd cur-host vterm-dir vterm-host cur-user cur-port remote-p cur-method login-cmd)
-      (if (ignore-errors (file-remote-p dir))
-          (with-parsed-tramp-file-name dir nil
-            (setq remote-p t)
-            (setq cur-host host)
-            (setq cur-method (tramp-find-method method user cur-host))
-            (setq cur-user (or (tramp-find-user cur-method user cur-host) ""))
-            (setq cur-port (or port ""))
-            (setq dir localname))
-        (setq cur-host (system-name)))
-      (setq login-cmd (vde/vterm-tramp-get-method-parameter cur-method 'tramp-login-program))
-      (setq cd-cmd (concat " cd " (shell-quote-argument dir)))
-      (setq shell-buffer (format "vterm %s %s" cur-host dir))
-      (if (buffer-live-p shell-buffer)
-          (switch-to-buffer shell-buffer)
-        (progn
-          (message (format "buffer '%s' doesn't exists" shell-buffer))
-          (vterm shell-buffer)
-          (with-current-buffer shell-buffer
-            (message (format "%s" remote-p))
-            (when remote-p
-              (let* ((method (if (string-equal login-cmd "ssh") "ssh" cur-method))
-                     (login-opts (vde/vterm-tramp-get-method-parameter method 'tramp-login-args))
-                     (login-shell (vde/vterm-tramp-get-method-parameter method 'tramp-remote-shell))
-                     (login-shell-args (tramp-get-sh-extra-args login-shell))
-                     ;; (vterm-toggle-tramp-get-method-parameter cur-method 'tramp-remote-shell)
-                     (spec (format-spec-make
-			                ?h cur-host ?u cur-user ?p cur-port ?c ""
-			                ?l (concat login-shell " " login-shell-args)))
-                     (cmd
-                      (concat login-cmd " "
-                              (mapconcat
-		                       (lambda (x)
-			                     (setq x (mapcar (lambda (y) (format-spec y spec)) x))
-			                     (unless (member "" x) (string-join x " ")))
-		                       login-opts " "))))
-                (vterm-send-string cmd)
-                (vterm-send-return)))
-            (vterm-send-string cd-cmd)
-            (vterm-send-return))))))
-  (defun vde/vterm-toggle ()
-    "Toggle between the main vterm buffer and the current buffer.
-If you are in a vterm buffer, switch the window configuration
-back to your code buffers. Otherwise, create at least one vterm
-buffer if it doesn't exist already, and switch to it. On every
-toggle, the current window configuration is saved in a register."
-    (interactive)
-    (if (eq major-mode 'vterm-mode)
-        (jump-to-register ?W)
-      ;; Save current window config and jump to shell
-      (window-configuration-to-register ?W)
-      (condition-case nil
-          (jump-to-register ?Z)
-        (error
-         (vterm)
-         (when (= (length (window-list)) 2)
-           (other-window 1)
-           (vterm 1)
-           (other-window 1))))
-      (window-configuration-to-register ?Z)))
-  (buffer-name)
-  (defun vde/run-in-vterm ()
-    (interactive)
-    (with-current-buffer "vterm"
-      (vterm-send-string (read-string "Command: "))
-      (vterm-send-C-j))))
-
-(use-package multi-vterm
-  :commands (multi-vterm multi-vterm-projectile multi-vterm-dedicated-toggle)
-  :bind (("C-c t t" . multi-vterm-dedicated-toggle)
-         ("C-c t p" . multi-vterm-prev)
-         ("C-c t n" . multi-vterm-next)
-         ("C-c t s" . multi-vterm)))
-;; for fish in ansi-term
-(add-hook 'term-mode-hook 'toggle-truncate-lines)
-
-(use-package tramp
-  :defer t
-  :config
-  (setq-default tramp-use-ssh-controlmaster-options nil ; Don't override SSH config.
-                tramp-default-method "ssh") ; ssh is faster than scp and supports ports.
-  (add-to-list 'tramp-remote-path "/run/current-system/sw/bin")
-  (add-to-list 'tramp-remote-path "/etc/profiles/per-user/root/bin/")
-  (add-to-list 'tramp-remote-path "/etc/profiles/per-user/vincent/bin/")
-  (add-to-list 'tramp-remote-path "~/.nix-profile/bin")
-  (add-to-list 'tramp-remote-path "~/bin")
-  (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
-
-(defun generic-term-init ()
-  (visual-line-mode -1)
-  (setq-local global-hl-line-mode nil)
-  (setq-local scroll-margin 0))
-
-(add-hook 'term-mode-hook #'generic-term-init)
-(add-hook 'shell-mode-hook #'generic-term-init)
-(add-hook 'eshell-mode-hook #'generic-term-init)
-
-(provide 'config-shells)
-;;; config-shells.el ends here
dots/.config/emacs/old/config/config-vcs.el
@@ -1,395 +0,0 @@
-;;; config-vcs.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Version control configuration
-;;; Code:
-
-
-(defun vde/vc-browse-remote (&optional current-line)
-  "Open the repository's remote URL in the browser.
-If CURRENT-LINE is non-nil, point to the current branch, file, and line.
-Otherwise, open the repository's main page."
-  (interactive "P")
-  (let* ((remote-url (string-trim (vc-git--run-command-string nil "config" "--get" "remote.origin.url")))
-		 (branch (string-trim (vc-git--run-command-string nil "rev-parse" "--abbrev-ref" "HEAD")))
-		 (file (string-trim (file-relative-name (buffer-file-name) (vc-root-dir))))
-		 (line (line-number-at-pos)))
-	(message "Opening remote on browser: %s" remote-url)
-	(if (and remote-url (string-match "\\(?:git@\\|https://\\)\\([^:/]+\\)[:/]\\(.+?\\)\\(?:\\.git\\)?$" remote-url))
-		(let ((host (match-string 1 remote-url))
-			  (path (match-string 2 remote-url)))
-		  ;; Convert SSH URLs to HTTPS (e.g., git@github.com:user/repo.git -> https://github.com/user/repo)
-		  (when (string-prefix-p "git@" host)
-			(setq host (replace-regexp-in-string "^git@" "" host)))
-		  ;; Construct the appropriate URL based on CURRENT-LINE
-		  (browse-url
-		   (if current-line
-			   (format "https://%s/%s/blob/%s/%s#L%d" host path branch file line)
-			 (format "https://%s/%s" host path))))
-	  (message "Could not determine repository URL"))))
-
-(global-set-key (kbd "C-x v B") 'vde/vc-browse-remote)
-
-(use-package vc
-  :config
-  (setq-default vc-find-revision-no-save t
-                vc-follow-symlinks t)
-  :bind (("C-x v f" . vc-log-incoming)  ;  git fetch
-         ("C-x v F" . vc-update)
-         ("C-x v d" . vc-diff)))
-
-(use-package vc-dir
-  :config
-  (defun vde/vc-dir-project ()
-    "Unconditionally display `vc-diff' for the current project."
-    (interactive)
-    (vc-dir (vc-root-dir)))
-
-  (defun vde/vc-dir-jump ()
-    "Jump to present directory in a `vc-dir' buffer."
-    (interactive)
-    (vc-dir default-directory))
-  :bind (("C-x v p" . vde/vc-dir-project)
-         ("C-x v j" . vde/vc-dir-jump) ; similar to `dired-jump'
-         :map vc-dir-mode-map
-         ("f" . vc-log-incoming) ; replaces `vc-dir-find-file' (use RET)
-         ("F" . vc-update)       ; symmetric with P: `vc-push'
-         ("d" . vc-diff)         ; align with D: `vc-root-diff'
-         ("k" . vc-dir-clean-files)))
-
-(use-package vc-git
-  :config
-  (setq vc-git-diff-switches "--patch-with-stat")
-  (setq vc-git-print-log-follow t))
-
-(use-package vc-annotate
-  :config
-  (setq vc-annotate-display-mode 'scale)
-  :bind (("C-x v a" . vc-annotate)
-         :map vc-annotate-mode-map
-         ("t" . vc-annotate-toggle-annotation-visibility)))
-
-(use-package ediff
-  :commands (ediff ediff-files ediff-merge ediff3 ediff-files3 ediff-merge3)
-  :config
-  (setq ediff-window-setup-function 'ediff-setup-windows-plain)
-  (setq ediff-split-window-function 'split-window-horizontally)
-  (setq ediff-diff-options "-w")
-  (add-hook 'ediff-after-quit-hook-internal 'winner-undo))
-
-(use-package diff
-  :config
-  (setq diff-default-read-only nil)
-  (setq diff-advance-after-apply-hunk t)
-  (setq diff-update-on-the-fly t)
-  (setq diff-refine 'font-lock)
-  (setq diff-font-lock-prettify nil)
-  (setq diff-font-lock-syntax nil))
-
-(use-package magit-popup)
-
-(defun th/magit--with-difftastic (buffer command)
-  "Run COMMAND with GIT_EXTERNAL_DIFF=difft then show result in BUFFER."
-  (let ((process-environment
-         (cons (concat "GIT_EXTERNAL_DIFF=difft --width="
-                       (number-to-string (frame-width)))
-               process-environment)))
-    ;; Clear the result buffer (we might regenerate a diff, e.g., for
-    ;; the current changes in our working directory).
-    (with-current-buffer buffer
-      (setq buffer-read-only nil)
-      (erase-buffer))
-    ;; Now spawn a process calling the git COMMAND.
-    (make-process
-     :name (buffer-name buffer)
-     :buffer buffer
-     :command command
-     ;; Don't query for running processes when emacs is quit.
-     :noquery t
-     ;; Show the result buffer once the process has finished.
-     :sentinel (lambda (proc event)
-                 (when (eq (process-status proc) 'exit)
-                   (with-current-buffer (process-buffer proc)
-                     (goto-char (point-min))
-                     (ansi-color-apply-on-region (point-min) (point-max))
-                     (setq buffer-read-only t)
-                     (view-mode)
-                     (end-of-line)
-                     ;; difftastic diffs are usually 2-column side-by-side,
-                     ;; so ensure our window is wide enough.
-                     (let ((width (current-column)))
-                       (while (zerop (forward-line 1))
-                         (end-of-line)
-                         (setq width (max (current-column) width)))
-                       ;; Add column size of fringes
-                       (setq width (+ width
-                                      (fringe-columns 'left)
-                                      (fringe-columns 'right)))
-                       (goto-char (point-min))
-                       (pop-to-buffer
-                        (current-buffer)
-                        `(;; If the buffer is that wide that splitting the frame in
-                          ;; two side-by-side windows would result in less than
-                          ;; 80 columns left, ensure it's shown at the bottom.
-                          ,(when (> 80 (- (frame-width) width))
-                             #'display-buffer-at-bottom)
-                          (window-width
-                           . ,(min width (frame-width))))))))))))
-(defun th/magit-show-with-difftastic (rev)
-  "Show the result of \"git show REV\" with GIT_EXTERNAL_DIFF=difft."
-  (interactive
-   (list (or
-          ;; If REV is given, just use it.
-          (when (boundp 'rev) rev)
-          ;; If not invoked with prefix arg, try to guess the REV from
-          ;; point's position.
-          (and (not current-prefix-arg)
-               (or (magit-thing-at-point 'git-revision t)
-                   (magit-branch-or-commit-at-point)))
-          ;; Otherwise, query the user.
-          (magit-read-branch-or-commit "Revision"))))
-  (if (not rev)
-      (error "No revision specified")
-    (th/magit--with-difftastic
-     (get-buffer-create (concat "*git show difftastic " rev "*"))
-     (list "git" "--no-pager" "show" "--ext-diff" rev))))
-(defun th/magit-diff-with-difftastic (arg)
-  "Show the result of \"git diff ARG\" with GIT_EXTERNAL_DIFF=difft."
-  (interactive
-   (list (or
-          ;; If RANGE is given, just use it.
-          (when (boundp 'range) range)
-          ;; If prefix arg is given, query the user.
-          (and current-prefix-arg
-               (magit-diff-read-range-or-commit "Range"))
-          ;; Otherwise, auto-guess based on position of point, e.g., based on
-          ;; if we are in the Staged or Unstaged section.
-          (pcase (magit-diff--dwim)
-            ('unmerged (error "unmerged is not yet implemented"))
-            ('unstaged nil)
-            ('staged "--cached")
-            (`(stash . ,value) (error "stash is not yet implemented"))
-            (`(commit . ,value) (format "%s^..%s" value value))
-            ((and range (pred stringp)) range)
-            (_ (magit-diff-read-range-or-commit "Range/Commit"))))))
-  (let ((name (concat "*git diff difftastic"
-                      (if arg (concat " " arg) "")
-                      "*")))
-    (th/magit--with-difftastic
-     (get-buffer-create name)
-     `("git" "--no-pager" "diff" "--ext-diff" ,@(when arg (list arg))))))
-
-(use-package magit
-  :unless noninteractive
-  :commands (magit-status magit-clone magit-pull magit-blame magit-log-buffer-file magit-log)
-  :bind (("C-c v c" . magit-commit)
-         ("C-c v C" . magit-checkout)
-         ("C-c v b" . magit-branch)
-         ("C-c v d" . magit-dispatch)
-         ("C-c v f" . magit-fetch)
-         ("C-c v g" . magit-blame)
-         ("C-c v l" . magit-log-buffer-file)
-         ("C-c v L" . magit-log)
-         ("C-c v p" . magit-pull)
-         ("C-c v P" . magit-push)
-         ("C-c v r" . magit-rebase)
-	 ("C-c v s" . magit-stage)
-         ("C-c v v" . magit-status))
-  :config
-  (transient-define-prefix th/magit-aux-commands ()
-    "My personal auxiliary magit commands."
-    ["Auxiliary commands"
-     ("d" "Difftastic Diff (dwim)" th/magit-diff-with-difftastic)
-     ("s" "Difftastic Show" th/magit-show-with-difftastic)])
-  (transient-append-suffix 'magit-dispatch "!"
-    '("#" "My Magit Cmds" th/magit-aux-commands))
-  (setq-default magit-save-repository-buffers 'dontask
-                magit-refs-show-commit-count 'all
-                magit-branch-prefer-remote-upstream '("main")
-		magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1
-		magit-bury-buffer-function #'magit-restore-window-configuration
-		magit-refresh-status-buffer nil)
-
-  (setq-default git-commit-summary-max-length 50
-                git-commit-style-convention-checks
-                '(non-empty-second-line
-                  overlong-summary-line))
-
-;; TODO: complete with list of issues (async ?)
-;;   (transient-append-suffix 'git-commit-insert-trailer "t"
-;;   '("i" "Issue numero" hello))
-;; 
-;; (defun hello (foo)
-;;   (interactive (list (completing-read "Foo number"
-;; 				'("foo" "bar" "baz"))))
-;;   (message foo)
-;;   (git-commit--insert-trailer "Hello" foo))
-
-  ;; (magit-define-popup-option 'magit-rebase-popup
-  ;;                            ?S "Sign using gpg" "--gpg-sign=" #'magit-read-gpg-secret-key)
-  (magit-define-popup-switch 'magit-log-popup
-                             ?m "Omit merge commits" "--no-merges")
-  ;; cargo-culted from https://github.com/magit/magit/issues/3717#issuecomment-734798341
-  ;; valid gitlab options are defined in https://docs.gitlab.com/ee/user/project/push_options.html
-  ;;
-  ;; the second argument to transient-append-suffix is where to append
-  ;; to, not sure what -u is, but this works
-  (transient-append-suffix 'magit-push "-u"
-    '(1 "=s" "Skip gitlab pipeline" "--push-option=ci.skip"))
-  (transient-append-suffix 'magit-push "=s"
-    '(1 "=m" "Create gitlab merge-request" "--push-option=merge_request.create"))
-  (transient-append-suffix 'magit-push "=m"
-    '(1 "=o" "Set push option" "--push-option="))  ;; Will prompt, can only set one extra
-
-  (defun vde/fetch-and-rebase-from-upstream ()
-    ""
-    (interactive)
-    (magit-fetch-all "--quiet")
-    (magit-git-rebase (concat "upstream/" (vc-git--symbolic-ref (buffer-file-name))) "-sS"))
-  
-  ;; Hide "Recent Commits"
-  (magit-add-section-hook 'magit-status-sections-hook
-                          'magit-insert-modules
-                          'magit-insert-unpushed-to-upstream
-                          'magit-insert-unpulled-from-upstream)
-  ;; No need for tag in the status header
-  (remove-hook 'magit-status-sections-hook 'magit-insert-tags-header)
-  (setq-default magit-module-sections-nested nil)
-
-  ;; Show refined hunks during diffs
-  (set-default 'magit-diff-refine-hunk t))
-
-(use-package gitconfig-mode
-  :commands (gitconfig-mode)
-  :mode (("/\\.gitconfig\\'"  . gitconfig-mode)
-         ("/\\.git/config\\'" . gitconfig-mode)
-         ("/git/config\\'"    . gitconfig-mode)
-         ("/\\.gitmodules\\'" . gitconfig-mode)))
-
-(use-package gitignore-mode
-  :commands (gitignore-mode)
-  :mode (("/\\.gitignore\\'"        . gitignore-mode)
-         ("/\\.git/info/exclude\\'" . gitignore-mode)
-         ("/git/ignore\\'"          . gitignore-mode)))
-
-(use-package gitattributes-mode
-  :commands (gitattributes-mode)
-  :mode (("/\\.gitattributes" . gitattributes-mode)))
-
-(use-package dired-git-info
-  :disabled
-  :bind (:map dired-mode-map
-              (")" . dired-git-info-mode))
-  :defer 2)
-
-(defun git-blame-line ()
-  "Runs `git blame` on the current line and
-   adds the commit id to the kill ring"
-  (interactive)
-  (let* ((line-number (save-excursion
-                        (goto-char (point-at-bol))
-                        (+ 1 (count-lines 1 (point)))))
-         (line-arg (format "%d,%d" line-number line-number))
-         (commit-buf (generate-new-buffer "*git-blame-line-commit*")))
-    (call-process "git" nil commit-buf nil
-                  "blame" (buffer-file-name) "-L" line-arg)
-    (let* ((commit-id (with-current-buffer commit-buf
-                        (buffer-substring 1 9)))
-           (log-buf (generate-new-buffer "*git-blame-line-log*")))
-      (kill-new commit-id)
-      (call-process "git" nil log-buf nil
-                    "log" "-1" "--pretty=%h   %an   %s" commit-id)
-      (with-current-buffer log-buf
-        (message "Line %d: %s" line-number (buffer-string)))
-      (kill-buffer log-buf))
-    (kill-buffer commit-buf)))
-
-(use-package diff-hl
-  :hook (find-file . diff-hl-mode)
-  :hook (prog-mode . diff-hl-mode)
-  :hook (magit-post-refresh . diff-hl-magit-post-refresh)
-  :bind
-  (:map diff-hl-command-map
-	("n" . diff-hl-next-hunk)
-	("p" . diff-hl-previous-hunk)
-	("[" . nil)
-	("]" . nil)
-	("DEL"   . diff-hl-revert-hunk)
-	("<delete>" . diff-hl-revert-hunk)
-	("SPC" . diff-hl-mark-hunk)
-	:map vc-prefix-map
-	("n" . diff-hl-next-hunk)
-	("p" . diff-hl-previous-hunk)
-	("s" . diff-hl-stage-dwim)
-	("DEL"   . diff-hl-revert-hunk)
-	("<delete>" . diff-hl-revert-hunk)
-	("SPC" . diff-hl-mark-hunk))
-  :config
-  (put 'diff-hl-inline-popup-hide
-       'repeat-map 'diff-hl-command-map))
-
-(use-package diff-hl-inline-popup
-  :after (diff-hl))
-(use-package diff-hl-show-hunk
-  :after (diff-hl))
-
-(use-package diff-hl-dired
-  :after (diff-hl)
-  :hook (dired-mode . diff-hl-dired-mode))
-
-(use-package consult-vc-modified-files
-  :after consult
-  :bind
-  ("C-x v /" . consult-vc-modified-files))
-
-;; FIXME bind pr-review-submit-review
-(use-package pr-review
-  :commands (pr-review pr-review-open pr-review-submit-review)
-;;  :bind
-;;  (("M-<SPC> p r" . pr-review-submit-review))
-  :custom
-  (pr-review-ghub-host "api.github.com")
-  (pr-review-notification-include-read nil)
-  (pr-review-notification-include-unsubscribed nil))
-
-(use-package pr-review-search
-  :commands (pr-review-search pr-review-search-open pr-review-current-repository pr-review-current-repository-search)
-;;  :bind
-;;  (("M-<SPC> p a" . pr-review-current-repository)
-;;   ;; FIXME understand why this one doesn't work
-  ;;  ("M-<SPC> p s" . pr-review-current-repository-search)))
-  )
-
-(use-package pr-review-notification
-  :commands (pr-review-notification)
-;;  :bind
-  ;;  (("M-<SPC> p n" . pr-review-notification)))
-  )
-
-(defun pr-review-current-repository-search (query)
-  "Run pr-review-search on the current repository."
-  (interactive "sSearch query: ")
-  (pr-review-search (format "is:pr archived:false is:open repo:%s %s" (vde/gh-get-current-repo) query)))
-
-(defun pr-review-current-repository ()
-  "Run pr-review-search on the current repository."
-  (interactive)
-  (pr-review-search (format "is:pr archived:false is:open repo:%s" (vde/gh-get-current-repo))))
-
-;; (pr-review-search "build is:pr archive:false is:open repo:tektoncd/pipeline")
-;; (pr-review-search "build")
-
-;; TODO this is relatively slow. Cache result or ?
-(defun vde/gh-get-current-repo ()
-  "Get the current repository name using the `gh' command line."
-  (unless (executable-find "gh")
-    (error "GitHub CLI (gh) command not found"))
-
-  (with-temp-buffer
-    (let ((exit-code (call-process "gh" nil t nil "repo" "view" "--json" "owner,name" "--template" "{{.owner.login}}/{{.name}}")))
-      (unless (= exit-code 0)
-	(error "Failed to get repository info: gh command exited with code %d" exit-code))
-      (string-trim (buffer-string)))))
-
-
-(provide 'config-vcs)
-;;; config-vcs.el ends here
dots/.config/emacs/old/config/config-web.el
@@ -1,97 +0,0 @@
-;;; config-web.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Web related configuration, notably the built-in web browser.
-;;; Code:
-
-;; (use-package shr
-;;   :config
-;;   (setq shr-use-fonts nil)
-;;   (setq shr-use-colors nil)
-;;   (setq shr-bullet "• ")
-;;   (setq shr-folding-mode t)
-;; 
-;;   (setq shr-max-image-proportion 0.7)
-;;   (setq shr-image-animate nil)
-;;   (setq shr-width (current-fill-column)))
-;; 
-;; (use-package shr-tag-pre-highlight
-;;   :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))))
-;; 
-;; (use-package eww
-;;   :commands (eww
-;;              eww-browse-url
-;;              eww-search-words
-;;              eww-open-in-new-buffer
-;;              eww-open-file
-;;              vde/eww-visit-history)
-;;   :config
-;;   (setq eww-restore-desktop nil)
-;;   (setq eww-desktop-remove-duplicates t)
-;;   (setq eww-header-line-format "%u")
-;;   (setq eww-search-prefix "https://duckduckgo.com/html/?q=")
-;;   (setq url-privacy-level '(email agent cookies lastloc))
-;;   (setq eww-download-directory "~/desktop/downloads/")
-;;   (setq eww-suggest-uris
-;;         '(eww-links-at-point
-;;           thing-at-point-url-at-point))
-;;   (setq eww-bookmarks-directory "~/.emacs.d/eww-bookmarks/")
-;;   (setq eww-history-limit 150)
-;;   (setq eww-use-external-browser-for-content-type
-;;         "\\`\\(video/\\|audio/\\|application/pdf\\)")
-;;   (setq eww-browse-url-new-window-is-tab nil)
-;;   (setq eww-form-checkbox-selected-symbol "[X]")
-;;   (setq eww-form-checkbox-symbol "[ ]")
-;; 
-;;   ;; eww-view-source
-;; 
-;;   (defvar vde/eww-mode-global-map
-;;     (let ((map (make-sparse-keymap)))
-;;       (define-key map "s" 'eww-search-words)
-;;       (define-key map "o" 'eww-open-in-new-buffer)
-;;       (define-key map "f" 'eww-open-file)
-;;       map)
-;;     "Key map to scope `eww' bindings for global usage.
-;; The idea is to bind this to a prefix sequence, so that its
-;; defined keys follow the pattern of <PREFIX> <KEY>.")
-;;   :bind-keymap ("C-x w" . vde/eww-mode-global-map)
-;;   :bind (:map eww-mode-map
-;;               ("n" . next-line)
-;;               ("p" . previous-line)
-;;               ("f" . forward-char)
-;;               ("b" . backward-char)
-;;               ("B" . eww-back-url)
-;;               ("N" . eww-next-url)
-;;               ("P" . eww-previous-url)))
-
-(use-package browse-url
-  :after eww
-  :config
-
-  ;; (defun browse-url-xdg-desktop-portal (url &rest args)
-  ;;   "Open URL via a portal backend."
-  ;;   (dbus-call-method :session
-  ;;                     "org.freedesktop.portal.Desktop"
-  ;;                     "/org/freedesktop/portal/desktop"
-  ;;                     "org.freedesktop.portal.OpenURI"
-  ;;                     "OpenURI"
-  ;;                     "" url '(:array :signature "{sv}")))
-  ;; (setopt browse-url-browser-function #'browse-url-xdg-desktop-portal)
-  ;; (setq browse-url-browser-function #'eww-browse-url)
-
-  ;; (setq browse-url-generic-program "google-chrome-stable")
-  (setq browse-url-handlers '(("^https://gitlab.com.*" . browse-url-default-browser)
-                              ("^https://github.com.*" . browse-url-default-browser)
-                              ("^https://issues.redhat.com.*" . browse-url-default-browser)
-                              ("^https://.*redhat.com.*" . browse-url-default-browser)
-                              ("^https://docs.jboss.org.*" . browse-url-default-browser)
-                              (".*" . eww-browse-url))))
-
-(provide 'config-web)
-;;; config-web.el ends here
dots/.config/emacs/old/config/config-windows.el
@@ -1,304 +0,0 @@
-;;; config-windows.el ---  -*- lexical-binding: t; -*-
-;; Commentary:
-;;; Windows configuration
-;; Code:
-
-(setq switch-to-buffer-obey-display-actions t)
-
-(defun vde/window-delete-popup-frame (&rest _)
-  "Kill selected selected frame if it has parameter `prot-window-popup-frame'.
-Use this function via a hook."
-  (when (frame-parameter nil 'vde/window-popup-frame)
-    (delete-frame)))
-
-(defun vde/save-desktop-no-ask ()
-  "Save the desktop without asking questions by modifying the modtime."
-  (interactive)
-  (require 'desktop)
-  (desktop--get-file-modtime)
-  (desktop-save (concat desktop-dirname)))
-(defun vde/desktop-load ()
-  "Load saved desktop"
-  (interactive)
-  (require 'desktop)
-  (desktop-read desktop-dirname))
-
-(bind-key "C-c d s" #'vde/save-desktop-no-ask)
-(bind-key "C-c d l" #'vde/desktop-load)
-
-;; Winner
-(use-package winner
-  :unless noninteractive
-  :defer 5
-  :config
-  (winner-mode 1))
-;; -UseWinner
-
-(defun toggle-maximize-buffer ()
-  "Maximize buffer"
-  (interactive)
-  (if (one-window-p)
-      (winner-undo)
-    (delete-other-windows)))
-
-;; UseAceWindow
-(use-package ace-window
-  :unless noninteractive
-  :commands (ace-window ace-swap-window)
-  :bind (("C-x o"   . ace-window)
-         ("C-c w w" . ace-window)
-         ("C-c w s" . ace-swap-window))
-  :config
-  (setq-default aw-keys '(?a ?u ?i ?e ?, ?c ?t ?r ?m)
-                aw-scope 'frame
-                aw-dispatch-always t
-                aw-dispatch-alist
-                '((?s aw-swap-window "Swap Windows")
-                  (?2 aw-split-window-vert "Split Window Vertically")
-                  (?3 aw-split-window-horz "Split Window Horizontally")
-                  (?? aw-show-dispatch-help))
-                aw-minibuffer-flag t
-                aw-ignore-current nil
-                aw-display-mode-overlay t
-                aw-background t))
-;; -UseAceWindow
-
-;; UseWindmove
-(use-package windmove
-  :unless noninteractive
-  :commands (windmove-left windmove-right windmove-down windmove-up)
-  :custom
-  (windmove-allow-all-windows t)
-  :bind (("C-M-<up>" . windmove-up)
-         ("C-M-<right>" . windmove-right)
-         ("C-M-<down>" . windmove-down)
-         ("C-M-<left>" . windmove-left)))
-;; -UseWindmove
-
-;; UseWindow
-(use-package window
-  :unless noninteractive
-  :commands (shrink-window-horizontally shrink-window enlarge-window-horizontally enlarge-window)
-  :bind (("S-C-<left>" . shrink-window-horizontally)
-         ("S-C-<right>" . enlarge-window-horizontally)
-         ("S-C-<down>" . shrink-window)
-         ("S-C-<up>" . enlarge-window)))
-;; -UseWindow
-
-;;;###autoload
-(defun prot-common-window-small-p ()
-  "Return non-nil if window is small.
-Check if the `window-width' or `window-height' is less than
-`split-width-threshold' and `split-height-threshold',
-respectively."
-  (or (and (numberp split-width-threshold)
-           (< (window-total-width) split-width-threshold))
-      (and (numberp split-height-threshold)
-           (> (window-total-height) split-height-threshold))))
-
-(defun prot-common-three-or-more-windows-p (&optional frame)
-  "Return non-nil if three or more windows occupy FRAME.
-If FRAME is non-nil, inspect the current frame."
-  (>= (length (window-list frame :no-minibuffer)) 3))
-
-(defun prot-window--get-display-buffer-below-or-pop ()
-  "Return list of functions for `prot-window-display-buffer-below-or-pop'."
-  (list
-   #'display-buffer-reuse-mode-window
-   (if (or (prot-common-window-small-p)
-           (prot-common-three-or-more-windows-p))
-       #'display-buffer-below-selected
-     #'display-buffer-pop-up-window)))
-
-(defun prot-window-display-buffer-below-or-pop (&rest args)
-  "Display buffer below current window or pop a new window.
-The criterion for choosing to display the buffer below the
-current one is a non-nil return value for
-`prot-common-window-small-p'.
-
-Apply ARGS expected by the underlying `display-buffer' functions.
-
-This as the action function in a `display-buffer-alist' entry."
-  (let ((functions (prot-window--get-display-buffer-below-or-pop)))
-    (catch 'success
-      (dolist (fn functions)
-        (when (apply fn args)
-          (throw 'success fn))))))
-
-(defvar prot-window-window-sizes
-  '( :max-height (lambda () (floor (frame-height) 3))
-     :min-height 10
-     :max-width (lambda () (floor (frame-width) 4))
-     :min-width 20)
-  "Property list of maximum and minimum window sizes.
-The property keys are `:max-height', `:min-height', `:max-width',
-and `:min-width'.  They all accept a value of either a
-number (integer or floating point) or a function.")
-
-(defun prot-window--get-window-size (key)
-  "Extract the value of KEY from `prot-window-window-sizes'."
-  (when-let ((value (plist-get prot-window-window-sizes key)))
-    (cond
-     ((functionp value)
-      (funcall value))
-     ((numberp value)
-      value)
-     (t
-      (error "The value of `%s' is neither a number nor a function" key)))))
-
-(defun prot-window-select-fit-size (window &rest _)
-  "Select WINDOW and resize it.
-The resize pertains to the maximum and minimum values for height
-and width, per `prot-window-window-sizes'.
-
-Use this as the `body-function' in a `display-buffer-alist' entry."
-  (select-window window)
-  (fit-window-to-buffer
-   window
-   (prot-window--get-window-size :max-height)
-   (prot-window--get-window-size :min-height)
-   (prot-window--get-window-size :max-width)
-   (prot-window--get-window-size :min-width)))
-
-(defun prot-window-shell-or-term-p (buffer &rest _)
-  "Check if BUFFER is a shell or terminal.
-This is a predicate function for `buffer-match-p', intended for
-use in `display-buffer-alist'."
-  (when (string-match-p "\\*.*\\(e?shell\\|v?term\\).*" (buffer-name (get-buffer buffer)))
-    (with-current-buffer buffer
-      ;; REVIEW 2022-07-14: Is this robust?
-      (and (not (derived-mode-p 'message-mode 'text-mode))
-           (derived-mode-p 'eshell-mode 'shell-mode 'comint-mode 'fundamental-mode)))))
-
-;; (setq display-buffer-alist
-;;       `(;; Default to no window
-;; 	("\\`\\*Async Shell Command\\*\\'"
-;; 	 (display-buffer-no-window))
-;; 	("\\`\\*Warnings\\*\\'"
-;;          (display-buffer-no-window)
-;; 	 (allow-no-window . t))
-;; 	("\\`\\*\\(Compile-Log\\|Org Links\\)\\*\\'"
-;;          (display-buffer-no-window))
-;; 	;; bottom side window
-;;         ("\\*Org \\(Select\\|Note\\)\\*" ; the `org-capture' key selection and `org-add-log-note'
-;;          (display-buffer-in-side-window)
-;;          (dedicated . t)
-;;          (side . bottom)
-;;          (slot . 0)
-;;          (window-parameters . ((mode-line-format . none))))
-;; 	;; bottom buffer (NOT side window)
-;;         ((or . ((derived-mode . flymake-diagnostics-buffer-mode)
-;;                 (derived-mode . flymake-project-diagnostics-mode)
-;;                 (derived-mode . messages-buffer-mode)
-;;                 (derived-mode . backtrace-mode)))
-;;          (display-buffer-reuse-mode-window display-buffer-at-bottom)
-;;          (window-height . 0.3)
-;;          (dedicated . t)
-;;          (preserve-size . (t . t)))
-;; 	;; ((or . ((derived-mode . Man-mode)
-;; 	;; 	(derived-mode . woman-mode)
-;; 	;; 	"\\*\\(Man\\|woman\\).*"))
-;; 	;;  (display-buffer-reuse-mode-window display-buffer-below-selected)
-;;         ;;  (window-height . 0.3) ; note this is literal lines, not relative
-;;         ;;  (dedicated . t)
-;;         ;;  (preserve-size . (t . t)))
-;; 	;; below current window
-;; 	("\\(\\*Capture\\*\\|CAPTURE-.*\\)"
-;;          (display-buffer-reuse-mode-window display-buffer-below-selected))
-;; 	((derived-mode . reb-mode) ; M-x re-builder
-;;          (display-buffer-reuse-mode-window display-buffer-below-selected)
-;;          (window-height . 4) ; note this is literal lines, not relative
-;;          (dedicated . t)
-;;          (preserve-size . (t . t)))
-;; 	((or . ((derived-mode . occur-mode)
-;;                 (derived-mode . grep-mode)
-;;                 (derived-mode . Buffer-menu-mode)
-;;                 (derived-mode . log-view-mode)
-;; 		(derived-mode . helpful-mode)
-;;                 (derived-mode . help-mode) ; See the hooks for `visual-line-mode'
-;;                 "\\*\\(|Buffer List\\|Occur\\|vc-change-log\\).*"
-;;                 prot-window-shell-or-term-p
-;;                 ,world-clock-buffer-name))
-;;          (prot-window-display-buffer-below-or-pop)
-;;          (dedicated . t)
-;;          (body-function . prot-window-select-fit-size))
-;; 	))
-
-(use-package auto-side-windows
-  :custom
-  ;; Top side window configurations
-  (auto-side-windows-top-buffer-names
-   '("^\\*Backtrace\\*$" "^\\*Compile-Log\\*$" "^COMMIT_EDITMSG$"
-     "^\\*Org Src.*\\*" "^\\*Agenda Commands\\*$" "^\\*Org Agenda\\*$"
-     "^\\*Quick Help\\*$" "^\\*Multiple Choice Help\\*$" "^\\*TeX Help\\*$"
-     "^\\*TeX errors\\*$" "^\\*Warnings\\*$" "^\\*diff-hl\\*$"
-     "^\\*Process List\\*$"))
-  (auto-side-windows-top-buffer-modes
-   '(flymake-diagnostics-buffer-mode locate-mode occur-mode grep-mode
-                                     xref--xref-buffer-mode))
-
-  ;; Bottom side window configurations
-  (auto-side-windows-bottom-buffer-names
-   '("^\\*.*eshell.*\\*$" "^\\*.*shell.*\\*$" "^\\*.*term.*\\*$"
-     "^\\*.*vterm.*\\*$" "^\\*.*eat.*\\*$"))
-  (auto-side-windows-bottom-buffer-modes
-   '(eshell-mode shell-mode term-mode vterm-mode comint-mode compilation-mode debugger-mode))
-
-  ;; Right side window configurations
-  (auto-side-windows-right-buffer-names
-   '("^\\*eldoc.*\\*$" "^\\*info\\*$" "^\\*Metahelp\\*$"))
-  (auto-side-windows-right-buffer-modes
-   '(Info-mode TeX-output-mode pdf-view-mode eldoc-mode help-mode
-               helpful-mode shortdoc-mode))
-
-  ;; Example: Custom parameters for top windows (e.g., fit height to buffer)
-  ;; (auto-side-windows-top-alist '((window-height . fit-window-to-buffer)))
-  ;; (auto-side-windows-top-window-parameters '((mode-line-format . ...))) ;; Adjust mode-line
-
-  ;; Maximum number of side windows on the left, top, right and bottom
-  (window-sides-slots '(1 1 1 1)) ; Example: Allow one window per side
-
-  ;; Force left and right side windows to occupy full frame height
-  (window-sides-vertical t)
-  (window-combination-resize t)
-
-  ;; Make changes to tab-/header- and mode-line-format persistent when toggleling windows visibility
-  (window-persistent-parameters
-   (append window-persistent-parameters
-           '((tab-line-format . t)
-             (header-line-format . t)
-             (mode-line-format . t))))
-  :bind ;; Example keybindings (adjust prefix as needed)
-  (:map global-map ; Or your preferred keymap prefix
-        ("C-c w t" . auto-side-windows-display-buffer-top)
-        ("C-c w b" . auto-side-windows-display-buffer-bottom)
-        ("C-c w l" . auto-side-windows-display-buffer-left)
-        ("C-c w r" . auto-side-windows-display-buffer-right)
-        ("C-c w T" . auto-side-windows-toggle-side-window)) ; Toggle current buffer in/out of side window
-  :hook
-  (after-init . auto-side-windows-mode)) ; Activate the mode
-
-(use-package popper
-  :after auto-side-windows ; Ensure auto-side-windows variables are defined
-  :hook (auto-side-windows-mode . popper-mode) ; Activate popper alongside
-  :custom
-  ;; Tell Popper to consider buffers matching auto-side-windows rules as popups
-  (popper-reference-buffers
-   (append auto-side-windows-top-buffer-names auto-side-windows-top-buffer-modes
-           auto-side-windows-left-buffer-names auto-side-windows-left-buffer-modes
-           auto-side-windows-right-buffer-names auto-side-windows-right-buffer-modes
-           auto-side-windows-bottom-buffer-names auto-side-windows-bottom-buffer-modes))
-  ;; Optional: Don't let Popper decide where to display, auto-side-windows handles that
-  (popper-display-control nil) ; Or 'user if you prefer popper commands for display
-  :config
-  (require 'popper-echo)
-  (popper-mode +1) ; Enable popper-mode
-  (popper-echo-mode +1) ; Optional: echo area notifications
-  :bind
-  (("C-`" . popper-toggle)
-   ("C-M-`" . popper-toggle-type)
-   ("M-`" . popper-cycle)))
-;; TODO: Move display-buffer-alist here
-
-(provide 'config-windows)
-;;; config-windows ends here
dots/.config/emacs/old/config/programming-config.el
@@ -1,227 +0,0 @@
-;;; programming-config.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Configuration files mode configuration
-;;; Code:
-
-(defconst src-dir "~/src/"
-  "Where all my sources are.")
-(set-register ?s `(file . ,src-dir))
-
-(use-package symbol-overlay
-  :custom
-  (symbol-overlay-idle-time 0.2)
-  :bind
-  ("M-s s i" . symbol-overlay-put)
-  ("M-N" . symbol-overlay-jump-next)
-  ("M-P" . symbol-overlay-jump-prev)
-  ("M-s s r" . symbol-overlay-rename)
-  ("M-s s c" . symbol-overlay-remove-all)
-  :hook
-  (prog-mode . symbol-overlay-mode))
-
-(use-package devdocs
-  :commands (devdocs-lookup devdocs-install vde/install-devdocs)
-  :bind (("C-h D" . devdocs-lookup))
-  :config
-  (defun vde/install-devdocs ()
-    "Install the devdocs I am using the most."
-    (interactive)
-    (dolist (docset '("bash"
-		      "c"
-		      "click"
-		      "cpp"
-		      "css"
-		      "elisp"
-		      "flask"
-		      "git"
-		      "gnu_make"
-		      "go"
-		      "html"
-		      "htmx"
-		      "http"
-		      "javascript"
-		      "jq"
-		      "jquery"
-		      "kubectl"
-		      "kubernetes"
-		      "lua~5.4"
-		      "nix"
-		      "python~3.13"
-		      "python~3.12"
-		      "requests"
-		      "sqlite"
-		      "terraform"
-		      "werkzeug"
-		      "zig"))
-    (devdocs-install docset))))
-
-(use-package yaml-ts-mode
-  :mode "\\.ya?ml\\'"
-  :hook ((yaml-ts-mode . display-line-numbers-mode)
-	 (yaml-ts-mode . outline-minor-mode)
-	 (yaml-ts-mode . electric-pair-local-mode))
-  :config
-  (setq-local outline-regexp "^ *\\([A-Za-z0-9_-]*: *[>|]?$\\|-\\b\\)")
-  (font-lock-add-keywords
-   'yaml-ts-mode
-   '(("\\($(\\(workspaces\\|context\\|params\\)\.[^)]+)\\)" 1 'font-lock-constant-face prepend)
-     ("kind:\s*\\(.*\\)\n" 1 'font-lock-keyword-face prepend))))
-
-;; TODO https://github.com/zkry/yaml-pro?tab=readme-ov-file#easy-movement-with-repeat-map
-;; FIXME it currently gets in the way…
-;; (use-package yaml-pro
-;;   :after yaml-ts-mode
-;;   :hook (yaml-ts-mode . yaml-pro-ts-mode))
-
-(use-package consult-flymake
-  :after (consult)
-  :bind
-  ("M-s M-d" . consult-flymake)
-  :config
-  ;; (general-leader
-  ;;   "sd" #'(consult-flymake :which-key "Flymake diagnostics"))
-  )
-
-(use-package flymake-yamllint
-  :after yaml-ts-mode
-  :hook
-  (yaml-ts-mode . flymake-yamllint-setup))
-
-(use-package conf-mode
-  :mode ("\\.to?ml\\'" . conf-toml-mode))
-
-(use-package adoc-mode
-  :mode ("\\.adoc\\'" . conf-toml-mode))
-
-(defun repeatize (keymap)
-  "Add `repeat-mode' support to a KEYMAP."
-  (map-keymap
-   (lambda (_key cmd)
-     (when (symbolp cmd)
-       (put cmd 'repeat-map keymap)))
-   (symbol-value keymap)))
-
-(defvar flymake-repeat-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "n") 'flymake-goto-next-error)
-    (define-key map (kbd "p") 'flymake-goto-prev-error)
-    (define-key map (kbd "f") 'attrap-flymake)
-    (define-key map (kbd "M-n") 'flymake-goto-next-error)
-    (define-key map (kbd "M-p") 'flymake-goto-prev-error)
-    map))
-
-(use-package flymake
-  :defer t
-  :bind
-  (("C-c f e" . flymake-show-project-diagnostics))
-  (:map flymake-mode-map
-        ("M-n" . flymake-goto-next-error)
-        ("M-p" . flymake-goto-prev-error))
-  (
-   :map flymake-diagnostics-buffer-mode-map
-   ("p" .
-    (lambda()(interactive)
-      (previous-line)
-      (save-excursion
-        (flymake-show-diagnostic(point)))))
-   ("n" .
-    (lambda()(interactive)
-      (next-line)
-      (save-excursion
-        (flymake-show-diagnostic(point)))))
-   (
-    :map flymake-project-diagnostics-mode-map
-    ("p" .
-     (lambda()(interactive)
-       (previous-line)
-       (save-excursion
-         (flymake-show-diagnostic(point)))))
-    ("n" .
-     (lambda()(interactive)
-       (next-line)
-       (save-excursion
-         (flymake-show-diagnostic(point)))))))
-  :config
-  (repeatize 'flymake-repeat-map)
-  :hook
-  ;; (prog-mode . flyspell-prog-mode) rebind flyspell-auto-correct-previous-word
-  (prog-mode . flymake-mode))
-
-(defun my-gotest-get-current-test()
-  "Get the current test name, if we have a subtest (starting with name) then use it."
-  (interactive)
-  (require 'which-func)
-  (let ((subtest (when-let* ((subtest
-                              (progn
-                                (save-excursion
-                                  (goto-char (line-beginning-position))
-                                  (re-search-forward "name:[[:blank:]]*\"\\([^\"]*\\)\"" (line-end-position) t)))))
-                   (if subtest
-                       (shell-quote-argument (replace-regexp-in-string " " "_" (match-string-no-properties 1))))))
-        (gotest (when-let* ((test-name (which-function)))
-                  (if test-name test-name
-                    (error "No test selected")))))
-    (concat (format "^%s%s$" gotest (if subtest (concat "/" subtest) "")))))
-
-(use-package dape
-  :commands (my-dape-go-test-at-point)
-  :after go-ts-mode
-  :bind
-  (:map go-ts-mode-map
-        ("<f5>" . (lambda()(interactive)
-                    (if (dape--live-connections)
-                        (call-interactively 'dape-continue)
-                      (call-interactively 'dape))))
-        ("S-<f5>"   . dape-stop)
-        ("C-S-<f5>" . dape-restart)
-        ("<f9>"     . dape-breakpoint-toggle)
-        ("<f10>"    . dape-next)
-        ("<f11>"    . dape-step-in)
-        ("S-<f11>"    . dape-step-out))
-  :hook
-  (go-ts-mode . (lambda()
-                  (interactive)
-                  (if (string-suffix-p "_test.go"  (buffer-name))
-                      (setq-local dape-command '(delve-unit-test)))))
-  :config
-  (defun my-dape-go-test-at-point ()
-    (interactive)
-    (dape (dape--config-eval-1
-           `(modes (go-mode go-ts-mode)
-                   ensure dape-ensure-command
-                   fn dape-config-autoport
-                   command "dlv"
-                   command-args ("dap" "--listen" "127.0.0.1::autoport")
-                   command-cwd dape-cwd-fn
-                   port :autoport
-                   :type "debug"
-                   :request "launch"
-                   :mode "test"
-                   :cwd dape-cwd-fn
-                   :program (lambda () (concat "./" (file-relative-name default-directory (funcall dape-cwd-fn))))
-                   :args (lambda ()
-                           (when-let* ((test-name (my-gotest-get-current-test)))
-                             (if test-name `["-test.run" ,test-name]
-                               (error "No test selected")))))))))
-
-(defconst markdown-regex-italic
-    "\\(?:^\\|[^\\]\\)\\(?1:\\(?2:[_]\\)\\(?3:[^ \n\t\\]\\|[^ \n\t]\\(?:.\\|\n[^\n]\\)[^\\ ]\\)\\(?4:\\2\\)\\)")
-;; and/or
-(defconst markdown-regex-gfm-italic
-    "\\(?:^\\|[^\\]\\)\\(?1:\\(?2:[_]\\)\\(?3:[^ \\]\\2\\|[^ ]\\(?:.\\|\n[^\n]\\)\\)\\(?4:\\2\\)\\)")
-
-(use-package markdown-mode
-  :commands (markdown-mode gfm-mode)
-  :mode (("README\\.md\\'" . gfm-mode)
-         ("\\.md\\'" . markdown-mode)
-         ("\\.markdown\\'" . markdown-mode))
-  :hook ((markdown-mode . visual-line-mode)
-	 (gfm-mode . visual-line-mode)))
-
-(use-package orgalist
-  :commands (orgalist-mode)
-  :hook ((markdown-mode . orgalist-mode)
-	 (gfm-mode . orgalist-mode)))
-
-(provide 'programming-config)
-;;; programming-config.el ends here
dots/.config/emacs/old/config/programming-containers.el
@@ -1,31 +0,0 @@
-;;; programming-containers.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Containers configuration
-;;; Code:
-(use-package dockerfile-mode
-  :mode ("Dockerfile\\'" . dockerfile-mode))
-
-;; I have a bunch of different 'profiles' for kubernetes by different cluster so
-;; i don't mess between things
-;; This allow me to set the KUBECONFIG variable between those easily
-;; TODO: add the current profile in modeline
-(defun my-switch-kubeconfig-env (&optional kubeconfig)
-  "Set KUBECONFIG environment variable for the current session"
-  (interactive
-   (list
-    (completing-read
-     "Kubeconfig: "
-     (mapcar
-      (lambda (x)
-        (replace-regexp-in-string
-         "^config\." ""
-         (file-name-nondirectory(directory-file-name x))))
-      (directory-files-recursively
-       (expand-file-name "~/.kube") "^config\.")) nil t )))
-  (setq kubeconfig (expand-file-name (format "~/.kube/config.%s" kubeconfig)))
-  (if (file-exists-p kubeconfig)
-      (setenv "KUBECONFIG" kubeconfig)
-    (error "Cannot find kubeconfig: %s" kubeconfig)))
-
-(provide 'programming-containers)
-;;; programming-containers.el ends here
dots/.config/emacs/old/config/programming-cue.el
@@ -1,9 +0,0 @@
-;;; programming-cue.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Cue "data" language configuration
-;;; Code:
-(use-package cue-mode
-  :commands (cue-mode)
-  :mode "\\.cue$")
-
-(provide 'programming-cue)
dots/.config/emacs/old/config/programming-eglot.el
@@ -1,49 +0,0 @@
-;;; programming-eglot.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Eglot configuration
-;;; Code:
-(use-package eglot
-  :bind
-  (:map eglot-mode-map
-        ("C-c e a" . eglot-code-actions)
-        ("C-c e r" . eglot-reconnect)
-        ("<f2>" . eglot-rename)
-        ("C-c e ?" . eldoc-print-current-symbol-info))
-  :config
-  (add-to-list 'eglot-ignored-server-capabilities :documentHighlightProvider)
-  (add-to-list 'eglot-server-programs `(json-mode  "vscode-json-language-server" "--stdio"))
-  (add-to-list 'eglot-server-programs '(nix-mode . ("nil")))
-  (setq-default eglot-workspace-configuration
-		'(:gopls (:usePlaceholders t)))
-  (setq-default
-   eglot-workspace-configuration
-   '((:gopls . ((gofumpt . t)))))
-  :hook
-  (before-save . gofmt-before-save)
-  (before-save . eglot-format-buffer)
-  (nix-mode . eglot-ensure)
-  (nix-ts-mode . eglot-ensure)
-  (rust-mode . eglot-ensure)
-  (rust-ts-mode . eglot-ensure)
-  (sh-script-mode . eglot-ensure)
-  (python-mode . eglot-ensure)
-  (json-mode . eglot-ensure)
-  (yaml-mode . eglot-ensure)
-  (c-mode . eglot-ensure)
-  (cc-mode . eglot-ensure)
-  (go-mode . eglot-ensure)
-  (go-ts-mode . eglot-ensure)
-  (js-mode . eglot-ensure)
-  (js2-mode . eglot-ensure)
-  (typescript-mode . eglot-ensure)
-  (typescript-ts-mode . eglot-ensure))
-
-(use-package eldoc-box
-  :hook
-  (eglot-managed-mode . eldoc-box-hover-mode)
-  :custom
-  (eldoc-box-max-pixel-width 1024))
-
-
-(provide 'programming-eglot)
-;;; programming-eglot.el ends here
dots/.config/emacs/old/config/programming-elisp.el
@@ -1,9 +0,0 @@
-;;; programming-elisp.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Emacs lisp programming language configuration
-;;; Code:
-(use-package smartparens
-  :hook ((emacs-lisp-mode . smartparens-mode)))
-
-(provide 'programming-elisp)
-;;; programming-elisp.el ends here
dots/.config/emacs/old/config/programming-go.el
@@ -1,107 +0,0 @@
-;;; programming-go.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Go programming language configuration
-;;; Code:
-
-(declare-function project-root "project")
-(declare-function project-current "project")
-(declare-function vde-project--project-root-or-default-directory "proj-func")
-(declare-function go-test--get-current-file-tests "gotest")
-
-(use-package gotest
-  :commands (my-gotest-maybe-ts-run go-test--get-current-test-info go-test--get-current-file-tests)
-  :after go-ts-mode
-  :custom
-  (go-test-verbose t)
-  :hook
-  (go-test-mode . (lambda () (pop-to-buffer (get-buffer "*Go Test*"))))
-  (go-mode . (lambda ()(interactive) (setq go-run-args "-v")))
-  (go-ts-mode . (lambda ()(interactive) (setq go-run-args "-v")))
-  :config
-  (defun my-go-test-current-project()
-    (interactive)
-    (let ((default-directory (project-root (project-current t))))
-      (go-test-current-project)))
-  (defun my-gotest-maybe-ts-run()
-    (interactive)
-    (let ((testrunname)
-          (gotest (cadr (go-test--get-current-test-info))))
-      (save-excursion
-        (goto-char (line-beginning-position))
-        (re-search-forward "name:[[:blank:]]*\"\\([^\"]*\\)\"" (line-end-position) t))
-      (setq testrunname (match-string-no-properties 1))
-      (if testrunname
-          (setq gotest (format "%s/%s" gotest (shell-quote-argument
-                                               (replace-regexp-in-string " " "_" testrunname)))))
-      (go-test--go-test (concat "-run " gotest "\\$ .")))))
-
-(use-package gotest-ts
-  :bind (("C-c C-t t" . gotest-ts-run-dwim)))
-
-(defun go-mode-p ()
-  "Return non-nil value when the major mode is `go-mode' or `go-ts-mode'."
-  (memq major-mode '(go-ts-mode go-mode)))
-
-;; TODO (defun run-command-recipe-ko ())
-
-(defun run-command-recipe-go ()
-  "Go `run-command' recipes."
-  (when (buffer-file-name) ;; no buffer-file-name means virtual buffer (dired, …)
-    
-    (let* ((dir (vde-project--project-root-or-default-directory))
-	   (package (file-name-directory (concat "./" (file-relative-name (buffer-file-name) dir)))))
-      (when (or (go-mode-p) (file-exists-p (expand-file-name "go.mod" dir)))
-	(append
-	 (and (buffer-file-name) (go-mode-p)
-	      (list
-	       (list :command-name "gofumpt"
-		     :command-line (concat "gofumpt -extra -w " (buffer-file-name))
-		     :working-dir dir
-		     :display "gofumpt (reformat) file")
-	       (list :command-name "go-fmt"
-		     :command-line (concat "go fmt " (buffer-file-name))
-		     :working-dir dir
-		     :display "gofmt (reformat) file")
-	       (list :command-name "go-run"
-		     :command-line (concat "go run " (buffer-file-name))
-		     :working-dir dir
-		     :display "Compile, execute file")))
-	 (and (string-suffix-p "_test.go" buffer-file-name) (go-mode-p)
-	      (list
-	       (let ((runArgs (go-test--get-current-file-tests)))
-		 ;; go test current test
-		 ;; go test current file
-		 (list :command-name "go-test-file"
-		       :command-line (concat "go test -v " package " -run " (shell-quote-argument runArgs))
-		       :working-dir dir
-		       :display (concat "Test file " (concat "./"(file-relative-name (buffer-file-name) dir)))
-		       :runner 'run-command-runner-compile)
-		 )))
-	 ;; TODO: handle test file as well
-	 (list
-	  (list :command-name "go-build-project"
-		:command-line "go build -v ./..."
-		:working-dir dir
-		:display "compile package and dependencies"
-		:runner 'run-command-runner-compile)
-	  (list :command-name "go-test-project"
-		:command-line "go test ./..."
-		:working-dir dir
-		:display "test all"
-		:runner 'run-command-runner-compile)
-	  (list :command-name "go-test-package"
-		:command-line (concat "go test -v " package)
-		:working-dir dir
-		:display (concat "Test package " package)
-		:runner 'run-command-runner-compile)))))))
-
-(with-eval-after-load 'run-command
-  (add-to-list 'run-command-recipes 'run-command-recipe-go))
-
-(use-package go-ts-mode
-  :mode (("\\.go$" . go-ts-mode)
-         ("\\.go" . go-ts-mode)
-         ("\\.go\\'" . go-ts-mode)))
-
-(provide 'programming-go)
-;;; programming-go.el ends here
dots/.config/emacs/old/config/programming-js.el
@@ -1,24 +0,0 @@
-;;; programming-js.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Javascript and Typescript programming language configuration
-;;; Code:
-
-(use-package js2-mode
-  :hook
-  (js2-mode . js-ts-mode-hook))
-
-(use-package typescript-mode
-  :hook
-  (typescript-mode . typescript-ts-mode-hook))
-
-(use-package typescript-ts-mode
-  :mode (("\\.ts\\'" . typescript-ts-mode)
-         ("\\.tsx\\'" . tsx-ts-mode)))
-
-(use-package json-mode
-  :mode (("\\.json\\'" . json-ts-mode))
-  :hook
-  (json-mode . json-ts-mode-hook))
-  
-(provide 'programming-js)
-;;; programming-js.el ends here
dots/.config/emacs/old/config/programming-nix.el
@@ -1,28 +0,0 @@
-;;; programming-nix.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Nix configuration
-;;; Code:
-(use-package nix-ts-mode
-  :if (executable-find "nix")
-  :mode ("\\.nix\\'" "\\.nix.in\\'"))
-
-(use-package nix-drv-mode
-  :if (executable-find "nix")
-  :after nix-mode
-  :mode "\\.drv\\'")
-
-(use-package nix-shell
-  :if (executable-find "nix")
-  :after nix-mode
-  :commands (nix-shell-unpack nix-shell-configure nix-shell-build))
-
-(use-package nixpkgs-fmt
-  :if (executable-find "nix")
-  :after nix-ts-mode
-  ;; :custom
-  ;; (nixpkgs-fmt-command "nixfmt")
-  :config
-  (add-hook 'nix-ts-mode-hook 'nixpkgs-fmt-on-save-mode))
-
-(provide 'programming-nix)
-;;; programming-nix.el ends here
dots/.config/emacs/old/config/programming-treesitter.el
@@ -1,22 +0,0 @@
-;;; programming-treesitter.el --- -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Treesitter configuration
-;;; Code:
-
-
-(use-package indent-bars
-  :if (eq system-type 'gnu/linux)
-  :hook
-  (python-mode . indent-bars-mode)
-  (yaml-ts-mode . indent-bars-mode)
-  :config
-  (require 'indent-bars-ts)
-  :custom
-  (indent-bars-no-descend-lists t)
-  (indent-bars-treesit-support t)
-  (indent-bars-treesit-ignore-blank-lines-types '("module"))
-  (indent-bars-treesit-scope '((python function_definition class_definition for_statement
-	                               if_statement with_statement while_statement))))
-
-(provide 'programming-treesitter)
-;;; programming-treesitter.el ends here
dots/.config/emacs/old/config/programming-web.el
@@ -1,41 +0,0 @@
-;;; programming-web.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Programming the Web related configuration
-;;; Code:
-
-(use-package web-mode
-  :commands (web-mode)
-  :mode
-  ("\\.html\\'" . web-mode)
-  ("\\.phtml\\'" . web-mode)
-  ("\\.[agj]sp\\'" . web-mode)
-  ("\\.as[cp]x\\'" . web-mode)
-  ("\\.erb\\'" . web-mode)
-  ("\\.mustache\\'" . web-mode)
-  ("\\.djhtml\\'" . web-mode)
-  ("\\.jsp\\'" . web-mode)
-  ("\\.eex\\'" . web-mode)
-  ("\\.tsx\\'" . web-mode)
-  :config
-  (setq web-mode-attr-indent-offset 2)
-  (setq web-mode-code-indent-offset 2)
-  (setq web-mode-css-indent-offset 2)
-  (setq web-mode-indent-style 2)
-  (setq web-mode-markup-indent-offset 2)
-  (setq web-mode-sql-indent-offset 2)
-  (eval-after-load 'smartparens
-    (lambda ()
-      (setq web-mode-enable-auto-pairing nil)
-      (sp-with-modes '(web-mode)
-        (sp-local-pair "%" "%"
-                       :unless '(sp-in-string-p)
-                       :post-handlers '(((lambda (&rest _ignored)
-                                           (just-one-space)
-                                           (save-excursion (insert " ")))
-                                         "SPC" "=" "#")))
-        (sp-local-tag "%" "<% "  " %>")
-        (sp-local-tag "=" "<%= " " %>")
-        (sp-local-tag "#" "<%# " " %>")))))
-
-(provide 'programming-web)
-;;; programming-web.el ends here
dots/.config/emacs/old/eshell/lastdir
@@ -1,8 +0,0 @@
-~
-/ssh:aomi.home:/home/vincent
-/ssh:aomi.home:/home/vincent/src
-/ssh:aomi.home:/home/vincent/src/osp
-/ssh:aomi.home:/home/vincent/src/osp/p12n
-/ssh:aomi.home:/home/vincent/src/osp/p12n/p12n
-/ssh:aomi.home:/home/vincent/src/osp/p12n/p12n/versions/1.9
-/ssh:aomi.home:/home/vincent/src/osp/p12n/p12n
dots/.config/emacs/old/etc/eshell/aliases
@@ -1,3 +0,0 @@
-alias l exa -lah $*
-alias ll exa -l $*
-alias ls exa $*
dots/.config/emacs/old/etc/orgmode/meeting-notes.org
@@ -1,20 +0,0 @@
-* %^{meeting}
-
-- Actions ::
-  #+BEGIN: columnview :id local :match "/TODO|DONE" :format "%ITEM(What) %TAGS(Who) %DEADLINE(When) %TODO(State)"
-  | What                                | Who        | When | State |
-  |-------------------------------------+------------+------+-------|
-  #+END:
-- Decisions ::
-  #+BEGIN: columnview :id local :match "Decision" :format "%ITEM(Decisions)"
-  | Decisions |
-  |-----------|
-  #+END:
-
-** Present at meeting
-  - [ ]
-** Agenda
-- %?
-** Notes
-- Use =:Decision:= tag for decision
-- Use entry with =TODO= (or =DONE=) for actions
dots/.config/emacs/old/etc/orgmode/weekly.org
@@ -1,20 +0,0 @@
-** %(format-time-string org-journal-time-format) weekly review :weekly:review:
-%U
-
-- [ ] review [[file:../projects/inbox.org][~inbox.org~]]
-  Clean the file by either
-  - refiling it to ~incubate.org~
-  - removing it / archiving it
-- [ ] review [[file:../projects/incubate.org][~incubate.org~]]
-  - Is something worth becoming a project
-  - Is something not worth thinking about anymore ?
-- [ ] empty mail inbox (and create task if needed)
-  - [ ] work
-  - [ ] perso
-- [ ] Review next week ~F12 n w f~
-- [ ] review ~org-mode~ workflow
-  - *what works, what doesn't ?*
-  - *is there task / stuck projects ?*
-  - *enhancement possible ?*
-- Additional /notes/:
-  + …
dots/.config/emacs/old/etc/transient/levels.el
@@ -1,4 +0,0 @@
-((magit-commit
-  (magit:--gpg-sign . 3))
- (magit-rebase
-  (magit:--gpg-sign . 3)))
dots/.config/emacs/old/etc/transient/values.el
@@ -1,4 +0,0 @@
-((magit-commit "--signoff")
- (magit-fetch "--prune")
- (magit-submodule "--recursive" "--rebase" "--remote")
- (magit-tag "--sign"))
dots/.config/emacs/old/etc/yasnippet/snippets/c++-mode/.yas-parents
@@ -1,1 +0,0 @@
-cc-mode
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/c-mode/.yas-parents
@@ -1,1 +0,0 @@
-cc-mode
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/add
@@ -1,4 +0,0 @@
-#name : /*** START TI ADD ***/ ... /*** END TI ADD ***/
-# --
-/*** START TI ADD ***/
-$0/*** END TI ADD ***/
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/addif
@@ -1,7 +0,0 @@
-#name : START TI ADD + #if OPENCL
-# --
-/*** START TI ADD ***/
-#if OPENCL_EXTENSIONS_SUPPORTED
-$0
-#endif /* OPENCL_EXTENSIONS_SUPPORTED */
-/*** END TI ADD ***/
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/class
@@ -1,71 +0,0 @@
-#name : class ... { ... }
-# --
-/**
- * @brief Summary
- *
- * Description.
- */
-class $1
-{
-  $0
-
-public:
-  /** @name Construction and Destruction
-      @{ */
-
-  $1() noexcept? {
-    TRACE_CTOR($1, "");
-  }
-
-#if defined(DEBUG_MODE)
-  virtual? ~$1() {
-    try {
-      TRACE_DTOR($1);
-    }
-    catch (...) {
-      std::terminate();
-    }
-  }
-#else
-  ~$1() = default|delete;
-#endif
-
-  /*@}*/
-
-  /** @name Assignment, Copy and Move
-      @{*/
-
-#if defined(DEBUG_MODE)
-  $1(const $1& rhs) noexcept? {
-    TRACE_CTOR($1, "copy");
-    *this = rhs;
-  }
-#else
-  $1(const $1&) = default|delete;
-#endif
-
-  $1& operator=(const $1&) = default|delete;
-  $1& operator=(const $1& rhs) noexcept? {
-    //if (this != &rhs) {
-    //}
-    return *this;
-  }
-
-#if defined(DEBUG_MODE)
-  $1($1&&r rhs) noexcept? {
-    TRACE_CTOR($1, "move");
-    *this = rhs;
-  }
-#else
-  $1($1&&r) = default|delete;
-#endif
-
-  $1& operator=($1&&r) = default|delete;
-  $1& operator=($1&&r rhs) noexcept? {
-    //if (this != &rhs) {
-    //}
-    return *this;
-  }
-
-  /*@}*/
-}; // class $1
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/com
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: TI comment
-# --
-/*------------------------------------------------------------*/
-/* $0 */
-/*------------------------------------------------------------*/
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/fopen
@@ -1,3 +0,0 @@
-#name : FILE *fp = fopen(..., ...);
-# --
-FILE *${fp} = fopen(${"file"}, "${r}");
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/inc
@@ -1,3 +0,0 @@
-#name : #include "..."
-# --
-#include "$1"
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/inc.1
@@ -1,3 +0,0 @@
-#name : #include <...>
-# --
-#include <$1>
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/main
@@ -1,7 +0,0 @@
-#name: int main(argc, argv) { ... }
-# --
-int main(int argc, char *argv[])
-{
-    $0
-    return 0;
-}
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/misra
@@ -1,14 +0,0 @@
-#name : MISRA-C:2004 rule implementation
-# --
-/*** START TI ADD ***/
-#if MISRA_C_2004_VALIDATION
-         if (check_misra_c_2004)
-         {
-            /*----------------------------------------------------------------*/
-            /* MISRA-C:2004 - Rule ${1:Rule} (${2:required})                            */
-            /* ${3:Description} $0*/
-            /*----------------------------------------------------------------*/
-            diagnostic(misra_${2:required}_severity, ec_misra_c_2004_$1);
-         }              /* if */
-#endif /* MISRA_C_2004_VALIDATION */
-/*** END TI ADD ***/
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/ns
@@ -1,5 +0,0 @@
-#name : namespace ...
-# --
-namespace $1 {
-    $0
-}
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/once
@@ -1,8 +0,0 @@
-#name : #ifndef XXX; #define XXX; #endif
-# --
-#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}
-#define $1
-
-$0
-
-#endif /* $1 */
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/tfunc
@@ -1,11 +0,0 @@
-#name : Texas Instruments function
-# --
-/******************************************************************************/
-/* jww (`(format-time-string "%Y-%m-%d")`): NYI                                                      */
-/******************************************************************************/
-a_boolean $1($2)
-{
-   a_boolean result = FALSE;
-   $0
-   return result;
-}				/* $1 */
dots/.config/emacs/old/etc/yasnippet/snippets/cc-mode/using
@@ -1,4 +0,0 @@
-#name : using namespace ... 
-# --
-using namespace ${std};
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/emacs-lisp-mode/hdr
@@ -1,36 +0,0 @@
-;;; `(file-name-sans-extension (file-name-nondirectory buffer-file-name))` --- $1
-
-;; Copyright (C) `(format-time-string "%Y")` `user-full-name`
-
-;; Author: `user-full-name` <`user-mail-address`>
-;; Created: `(format-time-string "%d %b %Y")`
-;; Version: 1.0
-;; Keywords: $2
-;; X-URL: https://github.com/jwiegley/${3:`(file-name-sans-extension (file-name-nondirectory buffer-file-name))`}
-
-;; This program 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 program 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:
-
-;; $0
-
-(defgroup `(file-name-sans-extension (file-name-nondirectory buffer-file-name))` nil
-  "$1"
-  :group '$4)
-
-(provide '`(file-name-sans-extension (file-name-nondirectory buffer-file-name))`)
-
-;;; `(file-name-nondirectory buffer-file-name)` ends here
dots/.config/emacs/old/etc/yasnippet/snippets/emacs-lisp-mode/test
@@ -1,2 +0,0 @@
-(ert-deftest $1 ()
-  (should (equal $0)))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/fundamental-mode/date
@@ -1,3 +0,0 @@
-#name : (current date)
-# --
-`(format-time-string "%Y-%m-%d")`
dots/.config/emacs/old/etc/yasnippet/snippets/fundamental-mode/mail
@@ -1,3 +0,0 @@
-#name : (user's email)
-# --
-`user-mail-address`
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/fundamental-mode/time
@@ -1,3 +0,0 @@
-#name : (current time)
-# --
-`(current-time-string)`
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/coloneq
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: ... := ...
-# key: :=
-# --
-${1:x} := ${2:`%`}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/f
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func
-# --
-func ${1:fun}($2) {
-	$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/fm
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func (target) name(args) (results) { ... }
-# --
-func (${1:target}) ${2:name}(${3:args}) (${4:results}) {
-	$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/for
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: for ... { ... }
-# --
-for $1 {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/fore
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: for key, value := range ... { ... }
-# --
-for ${1:key}, ${2:value} := range ${3:target} {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/foreach
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: for key, value := range ... { ... }
-# --
-for ${1:key}, ${2:value} := range ${3:target} {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/fori
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: for i := 0; i < n; i++ { ... }
-# --
-for ${1:i} := ${2:0}; $1 < ${3:10}; $1++ {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/forw
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name : for ... { ... }
-# --
-for $1 {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/func
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func
-# --
-func ${1:fun}($2) {
-	$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/iferr
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: if err != nil { ... }
-# --
-if err != nil {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/ifunc
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func (...) ... { ... }
-# --
-func ($1) $2 {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/imp
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: import
-# --
-import ${1:package}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/import
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: import
-# --
-import ${1:package}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/main
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func main() { ... }
-# --
-func main() {
-   $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/map
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: map
-# --
-map[${1:KeyType}]${2:ValueType}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/method
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func (target) name(args) (results) { ... }
-# --
-func (${1:target}) ${2:name}(${3:args}) (${4:results}) {
-	$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/package
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: package
-# --
-package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/pkg
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: package
-# --
-package ${1:`(car (last (split-string (file-name-directory buffer-file-name) "/") 2))`}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/pr
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: printf
-# --
-fmt.Printf("$1\n"${2:, ${3:str}})
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/printf
@@ -1,4 +0,0 @@
-# -*- mode: snippet -*-
-# name: printf
-# --
-fmt.Printf("$1\n"${2:, ${3:str}})
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/struct
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: type ... struct { ... }
-# --
-type $1 struct {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/switch
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# name: switch
-# key: switch
-# --
-switch {
-    case ${1:cond}:
-         $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/test
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: func Test...() { ... }
-# --
-func Test${1:Name}(${2:t *testing.T}) {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/go-mode/while
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name : for ... { ... }
-# --
-for $1 {
-	`%`$0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/break
@@ -1,1 +0,0 @@
-break _ZL12diag_message13an_error_codeP17a_source_position17an_error_severity30a_diagnostic_category_kind_tag
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/cd
@@ -1,1 +0,0 @@
-cd ~/Contracts/TI/bugslayer/cl_
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/const
@@ -1,1 +0,0 @@
-(void)_Z11db_constantP10a_constant($0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/cree
@@ -1,1 +0,0 @@
-run --gcc -DUSE_ASCII -I/usr/local/opt/libffi/lib/libffi-3.0.11/include --llvm_file_name - ~/src/cree/test/wc.c
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/expr
@@ -1,1 +0,0 @@
-(void)_Z13db_expressionP12an_expr_node($0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/iar
@@ -1,1 +0,0 @@
-run --advice:power=all --diag_suppress=163 --ulp_standalone_mode=iar -D__IAR_SYSTEMS_ICC__ -D__TID__=11008 -D__intrinsic= -D__no_init= -D__persistent= --c iar.c
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/icd
@@ -1,1 +0,0 @@
-cd ~/Contracts/TI/tmp/iar
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/line
@@ -1,1 +0,0 @@
-(a_line_number)_Z15db_line_for_seqm (pos_curr_token.seq)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/mrun
@@ -1,1 +0,0 @@
-run -I../../exec/arm -Imc2_headers --check_misra=all,-5.3 --c mc2_$0.c
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/opencl
@@ -1,1 +0,0 @@
-run --abi=eabi --opencl --c -I.. cl_$0.c
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/oper
@@ -1,1 +0,0 @@
-(void)_Z10db_operandP10an_operand($0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/operkind
@@ -1,1 +0,0 @@
-(an_expr_operator_kind_tag)$0->variant.operation.kind
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/run
@@ -1,1 +0,0 @@
-run --abi=eabi --opencl --c -I.. cl_$0.c
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/type
@@ -1,1 +0,0 @@
-(void)_Z7db_typeP6a_type($0->type)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/ulpcd
@@ -1,1 +0,0 @@
-cd ~/Contracts/TI/bugslayer/ulp_
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/gud-mode/ulprun
@@ -1,1 +0,0 @@
-run --abi=eabi --advice:power=all --remarks --c -I.. ulp_$0.c
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/.yas-ignore-filenames-as-triggers
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/.yas-make-groups
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/case
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# key: case
-# name: case
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-case ${1:x} of
-    ${2:Data} -> ${4:expression}
-    ${3:Data} -> ${5:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/comment.block
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: {-
-# name: block comment
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-{- $0 -}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/constraint
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: =>
-# name: Type constraint
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-(${1:Class} ${2:m}) => $0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/data.inline
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# key: data
-# name: inline data
-# condition: (= (length "data") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-data ${1:Type} = ${2:Data}$0 ${3:deriving (${4:Show, Eq})}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/data.record
@@ -1,10 +0,0 @@
-# -*- mode: snippet -*-
-# key: data
-# name: record data
-# condition: (= (length "data") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-data ${1:Type} = $1
-    { ${2:field} :: ${3:Type}
-    , ${4:field} :: ${5:Type}$0
-    } ${6:deriving (${7:Show, Eq})}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/fn
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# key: fn
-# name: simple function
-# condition: (= (length "fn") (current-column))
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-${1:f} :: ${2:a} ${3:-> ${4:b}}
-$1 ${5:x} = ${6:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/fn.clause
@@ -1,10 +0,0 @@
-# -*- mode: snippet -*-
-# key: fn
-# name: clause function
-# condition: (= (length "fn") (current-column))
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-${1:f} :: ${2:a} ${3:-> ${4:b}}
-$1 ${5:pattern} = ${7:expression}
-$1 ${6:pattern} = ${8:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/fn.guarded
@@ -1,11 +0,0 @@
-# -*- mode: snippet -*-
-# key: fn
-# name: guarded function
-# condition: (= (length "fn") (current-column))
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-${1:f} :: ${2:a} ${3:-> ${4:b}}
-$1 ${5:x}
-    | ${6:conditional} = ${8:expression}
-    | ${7:conditional} = ${9:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/get
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: <-
-# name: monadic get
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-${1:x} <- ${2:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/if.block
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# key: if
-# name: block if
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-if ${1:condition}
-    then ${2:expression}
-    else ${3:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/if.inline
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: if
-# name: inline if
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-if ${1:condition} then ${2:expression} else ${3:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/import
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# key: imp
-# name: simple import
-# condition: (= (length "imp") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-import           ${1:Module} ${2:(${3:f})}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/import.qualified
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# key: imp
-# name: qualified import
-# condition: (= (length "imp") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-import qualified ${1:Module} as ${2:${1:$(let ((name (car (last (split-string yas-text "\\\.")))))
-                                              (if (not (nil-blank-string name)) ""
-                                                  (subseq name 0 1)))}}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/instance
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# key: inst
-# name: instance
-# condition: (= (length "inst") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-instance ${1:Class} ${2:Data} where
-    ${3:f} = ${4:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/lambda
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: \
-# name: lambda
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-\\${1:x} -> ${2:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/lang-pragma
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# key: lang
-# name: language pragma
-# condition: (= (length "lang") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>, John Wiegley
-# --
-{-# LANGUAGE `(progn (require 'haskell-yas) (haskell-yas-complete "Extension: " haskell-yas-ghc-language-pragmas))` #-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/let
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: let
-# name: let
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-let ${1:x} = ${2:expression}$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/main
@@ -1,13 +0,0 @@
-# -*- mode: snippet -*-
-# key: main
-# name: main module
-# condition: (= (length "main") (current-column))
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-module Main where
-
-main :: IO ()
-main = do
-  ${1:expression}$0
-  return ()
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/module
@@ -1,14 +0,0 @@
-# -*- mode: snippet -*-
-# key: mod
-# name: simple module
-# condition: (= (length "mod") (current-column))
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-module ${1:`(if (not buffer-file-name) "Module"
-                (let ((name (file-name-sans-extension (buffer-file-name))))
-                     (if (search "src/" name)
-                         (replace-regexp-in-string "/" "." (car (last (split-string name "src/"))))
-                         (file-name-nondirectory name))))`} where
-
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/module.exports
@@ -1,17 +0,0 @@
-# -*- mode: snippet -*-
-# key: mod
-# name: exports module
-# condition: (= (length "mod") (current-column))
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-module ${1:`(if (not buffer-file-name) "Module"
-                (let ((name (file-name-sans-extension (buffer-file-name))))
-                     (if (search "src/" name)
-                         (replace-regexp-in-string "/" "." (car (last (split-string name "src/"))))
-                         (file-name-nondirectory name))))`}
-    ( ${3:export}
-    ${4:, ${5:export}}
-    ) where
-
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/haskell-mode/newtype
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# key: new
-# name: newtype
-# condition: (= (length "new") (current-column))
-# contributor: Luke Hoersten <luke@hoersten.org>
-# --
-newtype ${1:Type} = $1 { un$1 :: ${2:a} } ${3:deriving (${4:Show, Eq})}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/.hgignore
@@ -1,7 +0,0 @@
-syntax: regexp
-~$
-\#.*$
-\.DS_Store
-\.yas-compiled-snippets\.el$
-
-
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/hdr.yasnippet
@@ -1,23 +0,0 @@
-# -*- mode: snippet -*-
-# key: hdr
-# name: haskell header
-# expand-env: ((yas-indent-line 'fixed))
-# contributor: John Wiegley <johnw@newartisans.com>
-# --
-{-# LANGUAGE OverloadedStrings #-}
-
-module `(file-name-sans-extension (buffer-name))` where
-
-import Control.Applicative
-import Control.Monad
-import Control.Monad.IO.Class
-import Control.Monad.Trans.Class
-import Control.Monad.Trans.Control
-import Data.Maybe
-import Data.Monoid
-
-$1 :: $0
-$1 = undefined
-
-main :: IO ()
-main = undefined
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/README.md
@@ -1,89 +0,0 @@
-# Shnippet
-
-
-**Shnippet** is a collection of
-[YASnippet][yas]
-[Haskell][haskell] snippets for Emacs.
-
-
-## Installation
-
-Clone repository:
-
-    $ cd ~/.emacs.d/snippets
-    $ git clone https://github.com/LukeHoersten/shnippet
-    OR
-    $ hg clone https://bitbucket.org/LukeHoersten/shnippet
-
-Add the cloned repository to YASnippet's `yas-snippet-dirs`:
-
-    (setq yas-snippet-dirs
-          '("~/.emacs.d/snippets/shnippet"
-            "/other/paths/"
-            ))
-
-Snippets may have to be recompiled and reloaded in Emacs if YASnippet
-is already in use:
-
-    M-x yas-recompile-all
-    M-x yas-reload-all
-
-
-Haskell snippts should now be available to use! In a `haskell-mode`
-buffer, type `fn<TAB>`. A prompt should appear asking which `fn`
-snippet to expand.
-
-I **highly** recommend using YASnippet with [ido-mode]. Configure
-Emacs:
-
-    (setq-default yas-prompt-functions '(yas-ido-prompt yas-dropdown-prompt))
-
-This is important so that alternatives (like `import` vs. `import
-qualified`) can quickly be selected with a single key stroke.
-
-
-## Available Expansion Keys
-
-* `new` - newtype
-* `mod` - module [simple, exports]
-* `main ` - main module and function
-* `let` - let bindings
-* `lang` - language extension pragmas
-* `\` - lambda function
-* `inst` - instance declairation
-* `imp` - import modules [simple, qualified]
-* `if` - if conditional [inline, block]
-* `<-` - monadic get
-* `fn` - top level function [simple, guarded, clauses]
-* `data` - data type definition [inline, record]
-* `=>` - type constraint
-* `{-` - block comment
-* `case` - case statement
-
-
-## Design Ideals
-
-* Keep snippet keys (the prefix used to auto-complete) to four
-  characters or less while still being as easy to guess as possible.
-
-* Have as few keys as possible. The more keys there are to remember,
-  the harder snippets are to use and learn.
-
-* Leverage [ido-mode][] when reasonable. For instance, to keep the
-  number of snippet keys to a minimum as well as auto complete things
-  like [Haskell Langauge Extension Pragmas][lang-pragma]. When
-  multiple snippets share a key (ex: `fn`), the `ido-mode` prompts are
-  unique to one character (ex: `guarded function` and `simple
-  function` are `g` and `s` respectively).
-
-
-## Authors
-
-This code is written and maintained by Luke Hoersten,
-<luke@hoersten.org>.
-
-
-[yas]: https://github.com/capitaomorte/yasnippet
-[ido-mode]: http://www.emacswiki.org/emacs/InteractivelyDoThings
-[lang-pragma]: http://hackage.haskell.org/packages/archive/Cabal/1.16.0.3/doc/html/Language-Haskell-Extension.html#t:KnownExtension
-[haskell]: http://haskell.org/
dots/.config/emacs/old/etc/yasnippet/snippets/haskell-mode/tr.yasnippet
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# key: tr
-# name: trace
-# contributor: John Wiegley <johnw@newartisans.com>
-# --
-trace ("$1: " ++ show ($1)) $ 
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/commonjs.require
@@ -1,5 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: commonjs.require
-# key: req
-# --
-var ${3:${1:$(s-lower-camel-case (file-name-nondirectory yas/text))}} = require("${1:module}")$2;$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/es6.import
@@ -1,6 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: es6.import
-# key: imp
-# binding: direct-keybinding
-# --
-import ${3:${1:$(s-lower-camel-case (file-name-nondirectory yas/text))}} from "${1:module}";$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/js.es5exportedfunction
@@ -1,6 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: js.exportedfunction
-# key: 5xf
-# --
-function $1($2) {$0};
-module.exports.$1 = $1;
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/js.exportedconst
@@ -1,5 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: js.exportedconst
-# key: xc
-# --
-export const $1 = $0;
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/js.exportedfunction
@@ -1,7 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: js.exportedfunction
-# key: xf
-# --
-export function ${1:f}($2) {
-  $0
-}
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/js.exportedvar
@@ -1,5 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: js.exportedvar
-# key: xv
-# --
-var $1 = module.exports.$1 = $0;
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/js.function
@@ -1,5 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: js.function
-# key: fn
-# --
-function($1) {$0}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/js.generator
@@ -1,5 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: js.generator
-# key: gen
-# --
-function*() {$0}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/js-mode/jsdoc
@@ -1,7 +0,0 @@
-# -*- mode: snippet; require-final-newline: nil -*-
-# name: jsdoc
-# key: jd
-# --
-/**
- * $0
- */
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/latex-mode/acro
@@ -1,1 +0,0 @@
-\newacronym{$1}{${1:$(upcase yas-text)}}{$0}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/latex-mode/code
@@ -1,10 +0,0 @@
-# -*- mode: snippet -*-
-# key: code
-# expand-env: ((yas-indent-line 'fixed))
-# --
-\begin{listing}[!ht]
-  \begin{minted}[frame=single,gobble=4]{coq}
-    $0
-  \end{minted}
-  \caption{$1}
-\end{listing}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/latex-mode/gloss
@@ -1,4 +0,0 @@
-\newglossaryentry{$1}{
-  name={$1},
-  description={$0}
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/latex-mode/hafez
@@ -1,3 +0,0 @@
-\begin{hafez}{$1}{${2:pp.~1--2}}
-  $0
-\end{hafez}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/case
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: case
-# key: case
-# --
-(case ${1:key-form}
-  (${2:match} ${3:result})${4:
-  (t ${5:otherwise})})
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/ccase
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: ccase
-# key: ccase
-# --
-(ccase ${1:key-form}
-  (${2:match} ${3:result}))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/cond
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: cond
-# key: cond
-# --
-(cond (${1:test} ${2:then})
-      (t ${3:else}))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/ctypecase
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: ctypecase
-# key: ctypecase
-# --
-(ctypecase ${1:key-form}
-  (${2:match} ${3:result}))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defclass
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defclass
-# key: defclass
-# --
-(defclass ${1:name} (${2:parents})
-  ($0)${3:
-  (:documentation "${4:doc}")})
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defconstant
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defconstant
-# key: defconstant
-# --
-(defconstant +${1:name}+ ${2:nil}${3:
- "${4:doc}"})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defgeneric
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defgeneric
-# key: defgeneric
-# --
-(defgeneric ${1:name} (${2:args})${3:
-  (:documentation "${4:doc}")})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/define-compiler-macro
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: define-compiler-macro
-# key: define-compiler-macro
-# --
-(define-compiler-macro ${1:name} (${2:args})
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/define-condition
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: define-condition
-# key: define-condition
-# --
-(define-condition ${1:name} (${2:parents})
-  ($0)${3:
-  (:documentation "${4:doc}")})
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/define-symbol-macro
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: define-symbol-macro
-# key: define-symbol-macro
-# --
-(define-symbol-macro ${1:name} ${2:expansion})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defmacro
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defmacro
-# key: defmacro
-# --
-(defmacro ${1:name} (${2:args }${3:&body body})${4:
-  "${5:doc}"}
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defmethod
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defmethod
-# key: defmethod
-# --
-(defmethod ${1:name} (${2:args})
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defpackage
@@ -1,12 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defpackage
-# key: defpackage
-# --
-(defpackage   :${1:package}${2:
-  (:nicknames ${3:nicks})}${4:
-  (:use       ${5:packages})}${6:
-  (:shadow    ${7:packages})}${8:
-  (:export    ${9:packages})}${10:
-  (:documentation "${11:doc}")})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defparameter
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defparameter
-# key: defparameter
-# --
-(defparameter *${1:name}* ${2:nil}${3:
- "${4:doc}"})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defstruct
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defstruct
-# key: defstruct
-# --
-(defstruct ${1:name}${2:
-  "${3:doc}"}
-  ($0))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defsystem
@@ -1,14 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defsystem
-# key: defsystem
-# --
-(asdf:defsystem :${1:system}${2:
-  :version      "${3:0.1.0}"}${4:
-  :description  "${5:description}"}${6:
-  :author       "${7:`user-full-name` <`user-mail-address`>}"}${8:
-  :serial       t}${10:
-  :license      "${11:GNU GPL, version 3}"}${12:
-  :components   (${13:(:file "file.lisp")})}${14:
-  :depends-on   (${15:#:alexandria})})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/deftype
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: deftype
-# key: deftype
-# --
-(deftype ${1:name} (${2:args})${3:
-  "${4:doc}"}
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defun
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defun
-# key: defun
-# --
-(defun ${1:name} (${2:args})${3:
-  "${4:doc}"}
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/defvar
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: defvar
-# key: defvar
-# --
-(defvar *${1:name}*${2: nil}${3:
- "${4:doc}"})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/destructuring-bind
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: destructuring-bind
-# key: dbind
-# --
-(destructuring-bind (${1:vars}) ${2:value}
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/do
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: do
-# key: do
-# --
-(do (${1:vars})
-    (${2:end-test-form}${3: result})
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/do_
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: do*
-# key: do*
-# --
-(do* (${1:vars})
-     (${2:end-test-form}${3: result})
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/dolist
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: dolist
-# key: dolist
-# --
-(dolist (${1:var} ${2:list}${3: result})
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/dotimes
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: dotimes
-# key: dotimes
-# --
-(dotimes (${1:var} ${2:count}${3: result})
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/ecase
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: ecase
-# key: ecase
-# --
-(ecase ${1:key-form}
-  (${2:match} ${3:result}))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/etypecase
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: etypecase
-# key: etypecase
-# --
-(etypecase ${1:key-form}
-  (${2:match} ${3:result}))
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/flet
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Toni Querol
-# name: flet
-# key: flet
-# --
-(flet ((${1:name} (${2:args})${3:
-  "${4:doc}"}
-  ${5:body}))
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/format
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: format
-# key: format
-# --
-(format ${1:nil} ${2:str} $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/gnugpl
@@ -1,25 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: GNU GPL 3 Header
-# key: gnugpl
-# --
-;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; -*-
-;;;
-;;; ${1:description}
-;;;
-;;; Copyright © ${2:`(format-time-string "%Y")`} `user-full-name` <`user-mail-address`>
-;;;
-;;; ${3:This program$(prog1 yas-text (fill-paragraph))} 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 3 of the License, or (at your option) any later version.
-;;;
-;;; ${3:$(prog1 yas-text (fill-paragraph))} 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 this program. If not, see <http://www.gnu.org/licenses/>.
-
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/if
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: if
-# key: if
-# --
-(if ${1:test} ${2:then}${3: else})
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/in-package
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: in-package
-# key: in-package
-# --
-(in-package #:${1:package})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/labels
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Toni Querol
-# name: labels
-# key: labels
-# --
-(labels ((${1:name} (${2:args})${3:
-  "${4:doc}"}
-  ${5:body}))
-  $0)
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/let
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: let
-# key: let
-# --
-(let ((${1:var} ${2:val}))
-  $0)
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/mapc
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: mapc
-# key: mapc
-# --
-(mapc ${1:fnc} ${2:list})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/mapcar
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: mapcar
-# key: mapcar
-# --
-(mapcar ${1:fnc} ${2:list})
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/mitlic
@@ -1,31 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: MIT License Header
-# key: mitlic
-# --
-;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; -*-
-;;;
-;;; ${1:description}
-;;;
-;;; Copyright © ${2:`(format-time-string "%Y")`} `user-full-name` <`user-mail-address`>
-;;;
-;;; Permission is hereby granted, free of charge, to any person obtaining a
-;;; copy of this software and associated documentation files (the
-;;; "Software"), to deal in the Software without restriction, including
-;;; without limitation the rights to use, copy, modify, merge, publish,
-;;; distribute, sublicense, and/or sell copies of the Software, and to
-;;; permit persons to whom the Software is furnished to do so, subject to
-;;; the following conditions:
-;;;
-;;; The above copyright notice and this permission notice shall be included
-;;; in all copies or substantial portions of the Software.
-;;;
-;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-;;; OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-;;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-;;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-;;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-$0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/lisp-mode/typecase
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# contributor: Mark Karpov
-# name: typecase
-# key: typecase
-# --
-(typecase ${1:key-form}
-  (${2:match} ${3:result})${4:
-  (t ${5:otherwise})})
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/message-mode/check
@@ -1,4 +0,0 @@
-Hi $1,
-
-On $2 you mentioned you were going to check part $3. How's it going?
-
dots/.config/emacs/old/etc/yasnippet/snippets/message-mode/granted
@@ -1,38 +0,0 @@
-# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
-# --
-
-Your wish has been granted. You can commit to Emacs and GNU ELPA. Feel free to
-use this power, but please try to be extra careful and prove yourself worthy
-of this privilege:
-
-- Send your patches for review before installing them.
-
-- Only install changes whose code follows the usual coding conventions. Some
-  of those conventions are documented in http://www.gnu.org/prep/standards;
-  you'll discover others during code review.
-
-- Always provide a good commit message (copied into or from the ChangeLog for
-  emacs.git), following the GNU coding standards (e.g. using the
-  present/imperative tense, and syntax described at
-  http://www.gnu.org/prep/standards/html_node/Change-Logs.html), and properly
-  labelling the author of the code.
-
-- If the change is a new feature or a change in behavior, don't forget to
-  mention it in the etc/NEWS file and to update the Texinfo doc accordingly.
-
-- Be sure your change is accepted as being for the better by the package's
-  maintainer. As a general rule send your patch for review before installing
-  it, unless you're absolutely positively 200% sure that everyone will be
-  pleased with the content and the form of the patch.
-
-Last but not least:
-
-- And make extra sure that all the code you install has the proper copyright:
-  if it is not your own code, make sure the author has signed the relevant
-  copyright papers (for non-trivial contributions), and indicate the author
-  correctly in the commit (and the ChangeLog if applicable).
-
-If you have the slightest doubt about any of those points, send your question
-or your patch to emacs-devel@gnu.org (or bug-gnu-emacs@gnu.org).
-
-Thank you very much for your contribution to Emacs,
dots/.config/emacs/old/etc/yasnippet/snippets/message-mode/proof
@@ -1,22 +0,0 @@
-The list of sections still needing to be proofread is here:
-
-  http://ftp.newartisans.com/pub/emacs-manual.html
-
-If you'd like a suggestion, how about:
-
-| Chapter | Part | Title                          | Page | Length |
-|---------+------+--------------------------------+------+--------|
-|      24 |   17 | Compiling and Testing Programs |  277 |     20 |
-
-Otherwise, please pick any section(s) without a "Checked By" name, and e-mail
-emacs-manual-bugs@gnu.org with the Ch/Pt numbers. I'll then add you to the
-volunteered list. Once you have some edits, send them to the same list, and
-I'll add you to the Checked By column for that section.
-
-It's OK to proofread something that's already been done, if you were hoping to
-brush up on that part of the manual. It's our goal to make sure everything is
-seen at least three times.
-
-Richard has sent instructions to many of you, but in case you haven't received
-them yet, they can be found here:
-https://lists.gnu.org/archive/html/help-gnu-emacs/2018-01/msg00295.html
dots/.config/emacs/old/etc/yasnippet/snippets/message-mode/suggest
@@ -1,21 +0,0 @@
-Hi $1,
-
-I was wondering if you'd be willing to check any of these parts for us:
-
-| Ch |  Pt | Title                                       | Page | Len |
-|----+-----+---------------------------------------------+------+-----|
-| 11 |  7a | Chapter Beginning - Font Lock mode          |   72 |   9 |
-| 13 |   9 | Commands for Fixing Typos                   |  119 |   6 |
-| 14 |     | Keyboard Macros                             |  125 |   8 |
-|    | 10b | Reverting a Buffer - Chapter End            |      |  13 |
-| 17 |     | Multiple Windows                            |  167 |   7 |
-| 24 |  17 | Compiling and Testing Programs              |  277 |  20 |
-|    | 18b | Change Logs - Chapter End                   |      |  13 |
-| 28 |  21 | The Calendar and the Diary                  |  351 |  19 |
-| 30 |  23 | Reading Mail with Rmail                     |  379 |  20 |
-|    | 26b | Customizing Key Bindings - Chapter End      |      |  14 |
-|  C |  29 | Command Line Arguments for Emacs Invocation |  507 |  15 |
-|  E |     | Emacs 25 Antinews                           |  529 |   3 |
-|  F |  31 | Emacs and Mac OS / GNUstep                  |  532 |   3 |
-|  G |     | Emacs and Microsoft Windows/MS-DOS          |  535 |  10 |
-| GL |  33 | Glossary                                    |  553 |  23 |
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/appt
@@ -1,7 +0,0 @@
-#name : APPT
-# --
-APPT $0
-SCHEDULED: `(with-temp-buffer (org-insert-time-stamp (current-time)))`
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:END:
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/assem
@@ -1,31 +0,0 @@
-* NOTE Assembly meeting agenda for `(with-temp-buffer (org-insert-time-stamp (current-time) nil t))`
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:OVERLAY: (face (:background "#e8f9e8"))
-:END:
-** Opening Prayers
-** Attendance [0/9]
-- [$0 ] Caroline Delaney
-- [ ] Todd Zeigler
-- [ ] Becky Thomas
-- [ ] Pamela Fox
-- [ ] Nasim Wiegley
-- [ ] Beth Youker-Schwab
-- [ ] Gail Hill
-- [ ] Christina Stone
-- [ ] John Wiegley
-** Review prior minutes of [2013-01-01 Tue]
-** New Business
-** Outstanding business
-** Upcoming events
-** Secretary's report
-** Feast suggestions
-** Treasurer's Report
-** Consultation
-** Affairs of the Local Spiritual Assembly
-*** P.I. Rep: Caroline
-*** Center Manager: Caroline
-*** Children's Education: Mary Anne, Sisi, Keith
-*** Teaching Committee: Mary Anne, Christina, JohnW and Katy
-*** Center Improvement Committee: Beth, Pamela
-** Next Assembly meeting is [2013-01-01 Tue 00:00]
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/bbdb
@@ -1,3 +0,0 @@
-#name : bbdb
-# --
-[[bbdb:$1][$1]] $0
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/hask
@@ -1,2 +0,0 @@
-#+begin_src haskell
-$0#+end_src
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/list
@@ -1,7 +0,0 @@
-#name : List NOTE
-# --
-*** NOTE $1 [/]
-- [ ] $0
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:END:
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/note
@@ -1,6 +0,0 @@
-#name : NOTE
-# --
-NOTE $0
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:END:
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/out
@@ -1,4 +0,0 @@
-#name : :OUTPUT: ... :END:
-# --
-:OUTPUT:
-$0:END:
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/proj
@@ -1,6 +0,0 @@
-#name : PROJECT
-# --
-PROJECT $0
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:END:
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/sh
@@ -1,2 +0,0 @@
-#+begin_src sh
-$0#+end_src
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/skip
@@ -1,3 +0,0 @@
-:PROPERTIES:
-:BEAMER_act: <2->
-:END:
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/src
@@ -1,4 +0,0 @@
-# --
-#+begin_src $1
-$0
-#+end_src
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/status
@@ -1,23 +0,0 @@
-**** NOTE Status Report for `(with-temp-buffer (org-insert-time-stamp (current-time) nil t))`
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:END:
-***** Planned and implemented
-
-- 
-
-***** Not planned but implemented
-
-- 
-
-***** Planned but not implemented
-
-- 
-
-***** Planned for next week
-
-- 
-
-***** Questions and concerns
-
-- None this week.
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/teach
@@ -1,21 +0,0 @@
-* NOTE Assembly meeting agenda for `(with-temp-buffer (org-insert-time-stamp (current-time) nil t))`
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:OVERLAY: (face (:background "#e8f9e8"))
-:END:
-** Opening Prayers
-** Attendance [0/9]
-- [$0 ] Caroline Delaney
-- [ ] Sisi Mereness
-- [ ] John Tempey
-- [ ] Pamela Fox
-- [ ] Nami Peymani
-- [ ] Beth Youker-Schwab
-- [ ] Gail Hill
-- [ ] Christina Stone
-- [ ] John Wiegley
-** Not reviewing prior minutes at this meeting
-** Teaching
-** Consultation
-** New Business
-** Next Assembly meeting is [2013-01-01 Tue 00:00]
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/org-mode/todo
@@ -1,7 +0,0 @@
-#name : TODO
-# --
-TODO $0
-SCHEDULED: `(with-temp-buffer (org-insert-time-stamp (current-time)))`
-:PROPERTIES:
-:ID:       `(shell-command-to-string "uuidgen")`:CREATED: `(with-temp-buffer (org-insert-time-stamp (current-time) t t))`
-:END:
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/python-mode/def
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# name: de
-# contributor: Orestis Markou
-# contributor: Yasser González Fernández <yglez@uh.cu>
-# contributor: Tibor Simko <tibor.simko@cern.ch>
-# --
-def ${1:name}($2):
-    """
-    $3
-    ${2:$
-    (let* ((indent
-            (concat "\n" (make-string (current-column) 32)))
-           (args
-            (mapconcat
-             '(lambda (x)
-                (if (not (string= (nth 0 x) ""))
-                    (concat "@param " (nth 0 x) ": " indent
-                            "@type " (nth 0 x) ": ")))
-             (mapcar
-              '(lambda (x)
-                 (mapcar
-                  '(lambda (x)
-                     (replace-regexp-in-string "[[:blank:]]*$" ""
-                      (replace-regexp-in-string "^[[:blank:]]*" "" x)))
-                  x))
-              (mapcar '(lambda (x) (split-string x "="))
-                      (split-string yas-text ",")))
-             indent)))
-      (if (string= args "")
-          (concat indent "@return: " indent "@rtype: " indent (make-string 3 34))
-        (mapconcat
-         'identity
-         (list "" args "@return: " "@rtype: " (make-string 3 34))
-         indent)))
-    }
-    $0
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/clone
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: clone
-# key: clone
-# --
-clone(&self) -> Self {
-    $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/default
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: default
-# key: default
-# --
-default() -> Self {
-    ${0:Self::new()}
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/fmt
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: fmt
-# key: fmt
-# --
-fmt(&self, f: &mut Formatter) -> Result<(), Error> {
-    $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/impl
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: impl
-# key: impl
-# --
-impl$3 ${1:Trait} for ${2:Type}$3 {
-    $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/implClone
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# name: implClone
-# key: Clone
-# --
-impl$2 Clone for ${1:Type}$2 {
-    fn clone(&self) -> Self {
-        $0
-    }
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/implDefault
@@ -1,9 +0,0 @@
-# -*- mode: snippet -*-
-# name: implDefault
-# key: Default
-# --
-impl$2 Default for ${1:Type}$2 {
-    fn default() -> Self {
-        ${0:Self::new()}
-    }
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/is_empty
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: is_empty
-# key: is_empty
-# --
-is_empty(&self) -> bool {
-    ${0:self.len() == 0}
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/len
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: len
-# key: len
-# --
-len(&self) -> usize {
-    $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/rust-mode/new
@@ -1,7 +0,0 @@
-# -*- mode: snippet -*-
-# name: new
-# key: new
-# --
-new() -> Self {
-    $0
-}
\ No newline at end of file
dots/.config/emacs/old/etc/yasnippet/snippets/text-mode/ggit
@@ -1,1 +0,0 @@
-https://github.com/vdemeester/$0
dots/.config/emacs/old/etc/pandoc.css
@@ -1,245 +0,0 @@
-/***************************************************************************/
-/* My Stylesheet for Pandoc generated files                                */
-/* Copyright (c) 2015 Sebastian Wiesner <swiesner@lunaryorn.com>           */
-/*                                                                         */
-/* Permission is hereby granted, free of charge, to any person obtaining a */
-/* copy of this software and associated documentation files (the           */
-/* "Software"), to deal in the Software without restriction, including     */
-/* without limitation the rights to use, copy, modify, merge, publish,     */
-/* distribute, sublicense, and/or sell copies of the Software, and to      */
-/* permit persons to whom the Software is furnished to do so, subject to   */
-/* the following conditions:                                               */
-/*                                                                         */
-/* The above copyright notice and this permission notice shall be included */
-/* in all copies or substantial portions of the Software.                  */
-/*                                                                         */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS */
-/* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF              */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND                   */
-/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE  */
-/* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION  */
-/* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION   */
-/* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.         */
-/***************************************************************************/
-
-body {
-  font-family: "Source Sans Pro", sans-serif;
-  font-size: 16px;
-  line-height: 1.35;
-  color: #444;
-  font-feature-settings: "onum", "kern", "liga", "clig", "dlig", "calt";
-  -webkit-font-feature-settings: "onum", "kern", "liga", "clig", "dlig", "calt";
-  margin: 0 auto;
-  padding: 15px;
-  margin-bottom: 1.35em;
-  word-wrap: break-word;
-}
-
-p {
-  margin: 0 0;
-  text-indent: 1.5em;
-  text-align: left;
-}
-
-p:only-child {
-  text-indent: 0;
-}
-
-strong {
-  font-weight: 600;
-}
-
-ul, ol {
-  margin: 1em 4em;
-  padding: 0;
-}
-
-ol {
-  list-style-type: decimal;
-}
-
-ul {
-  list-style-type: disc;
-}
-
-small, sup {
-  font-size: 0.86em;
-}
-
-h1 small, h2 small, h3 small, h4 small {
-  font-weight: normal;
-  font-size: 0.65em;
-  line-height: 1;
-  color: #777;
-}
-
-blockquote {
-  margin: 1.2em 0;
-  padding: 0 2em;
-  line-height: 1.25;
-  font-size: 0.9em;
-  border-left: 5px solid #EEE;
-}
-
-a {
-  color: #333;
-  text-decoration: underline;
-}
-
-a:hover {
-  background-color: #fbf3f3;
-  border-radius: 4px;
-  transition-property: background;
-  transition-duration: 0.2s;
-}
-
-.footnoteRef {                  /* Use body font for footnotes */
-  font-size: 1rem;
-  text-decoration: none;
-}
-
-h1, h2, h3, h4 {                /* Text headings*/
-  font-family: "Source Sans Pro", sans-serif;
-  font-weight: 600;
-  line-height: 1;
-  color: #222;
-  margin-top: 2em;
-  margin-bottom: 0.8em;
-  hyphens: none;
-  font-feature-settings: "salt", "lnum";
-  -webkit-font-feature-settings: "salt", "lnum";
-}
-
-h1 {
-  font-size: 1.2em;
-}
-
-h2 {
-  font-size: 1.1em;
-}
-
-h3 {
-  font-size: 1em;
-}
-
-.header-section-number {
-  margin-right: 0.5em;
-}
-
-.header-section-number:after {
-  content: "."
-}
-
-hr {
-  border-width: 1px;
-  border-color: #CCC;
-  border-style: none none solid;
-  margin: 1.35em 0;
-}
-
-/* Images and figures */
-img {
-  max-width: 100%;
-  max-height: 100%;
-}
-
-figure {
-  margin: 2em;
-}
-
-figcaption {
-  margin-top: 0.8em;
-  text-align: center;
-  font-size: 0.9em;
-}
-
-figcaption:before {
-  content: "Figure.";
-  font-weight: 700;
-  margin-right: 0.5em;
-}
-
-/* Code and pre-formatted text */
-kbd, code {
-  font-family: "Source Code Pro", monospace;
-  font-size: 0.83em;
-}
-
-kbd {
-  border: 1px solid #CCC;
-  border-radius: 4px;
-  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px #FFF inset;
-  padding: 0 4px;
-}
-
-code {
-  padding: 0.11em 0.22em;
-}
-
-pre {
-  overflow: auto;
-  padding: 10px;
-  border: 1px solid #CCC;
-  border-radius: 4px;
-}
-
-pre:hover {                     /* Auto-expand pre on hover */
-  position: relative;
-  width: 900px;
-  z-index: 99;
-}
-
-pre code {
-  padding: 0;
-}
-
-.title {               /* Page title */
-  font-size: 1.5rem;
-  font-weight: 700;
-  margin-bottom: 0.2em;
-  margin-top: 0;
-}
-
-nav {
-  margin: 1em;
-  font-feature-settings: "salt", "lnum";
-  -webkit-font-feature-settings: "salt", "lnum";
-}
-
-nav a {
-  text-decoration: none;
-}
-
-nav ul {
-  list-style: none inside disc;
-  margin: 0;
-  padding: 0 0.5em;
-}
-
-header {
-  border-width: 1px;
-  border-color: #CCC;
-  border-style: none none solid;
-  margin: 1.35em 0;
-}
-
-
-@media print {
-  body {
-    width: auto;
-    height: auto;
-    font-size: 10pt;
-  }
-}
-
-@media screen and (min-width: 650px) {     /* Larger devices */
-  body {
-    width: 600px;
-  }
-}
-
-@page
-{
-  size: A4;
-  margin: 24.75mm 17.50mm;
-}
dots/.config/emacs/old/host/naruhodo.el
@@ -1,1 +0,0 @@
-../../sync/emacs/naruhodo.el
\ No newline at end of file
dots/.config/emacs/old/host/README.org
@@ -1,1 +0,0 @@
-Put stuff here that are local to a specific machine, those are private, aka not shared via this git repository.
dots/.config/emacs/old/host/wakasu.el
@@ -1,1 +0,0 @@
-../../sync/emacs/wakasu.el
\ No newline at end of file
dots/.config/emacs/old/lisp/auto-side-windows/.gitignore
@@ -1,127 +0,0 @@
-# Created by https://www.toptal.com/developers/gitignore/api/linux,windows,macos,emacs
-# Edit at https://www.toptal.com/developers/gitignore?templates=linux,windows,macos,emacs
-
-### Emacs ###
-# -*- mode: gitignore; -*-
-*~
-\#*\#
-/.emacs.desktop
-/.emacs.desktop.lock
-*.elc
-auto-save-list
-tramp
-.\#*
-
-# Org-mode
-.org-id-locations
-*_archive
-
-# flymake-mode
-*_flymake.*
-
-# eshell files
-/eshell/history
-/eshell/lastdir
-
-# elpa packages
-/elpa/
-
-# reftex files
-*.rel
-
-# AUCTeX auto folder
-/auto/
-
-# cask packages
-.cask/
-dist/
-
-# Flycheck
-flycheck_*.el
-
-# server auth directory
-/server/
-
-# projectiles files
-.projectile
-
-# directory configuration
-.dir-locals.el
-
-# network security
-/network-security.data
-
-
-### Linux ###
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-
-# .nfs files are created when an open file is removed but is still being accessed
-.nfs*
-
-### macOS ###
-# General
-.DS_Store
-.AppleDouble
-.LSOverride
-
-# Icon must end with two \r
-Icon

-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
-### macOS Patch ###
-# iCloud generated files
-*.icloud
-
-### Windows ###
-# Windows thumbnail cache files
-Thumbs.db
-Thumbs.db:encryptable
-ehthumbs.db
-ehthumbs_vista.db
-
-# Dump file
-*.stackdump
-
-# Folder config file
-[Dd]esktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msix
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-
-# End of https://www.toptal.com/developers/gitignore/api/linux,windows,macos,emacs
dots/.config/emacs/old/lisp/auto-side-windows/auto-side-windows.el
@@ -1,423 +0,0 @@
-;;; auto-side-windows.el --- Simplified buffer management for side windows -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2025 Marcel Arpogaus
-
-;; Author: Marcel Arpogaus <znepry.necbtnhf@tznvy.pbz>
-;; Version: 0.1
-;; Package-Requires: ((emacs "30.1"))
-;; Keywords: convenience, windows, buffers
-
-;;; Commentary:
-
-;; `auto-side-windows-mode' allows users to automatically display buffers
-;; in side windows based on user-defined name or mode rules. This package
-;; enhances workflow and buffer organization by providing a more predictable
-;; and organized buffer management.
-
-;; The user can define buffers to be displayed in the left, right, top, or
-;; bottom side windows through a set of buffer name regular expressions and
-;; major modes. Extra conditions can also be specified to refine these rules
-;; further.
-
-;; Additionally, the package provides commands to toggle side windows or display
-;; buffers explicitly in one of the four sides manually.
-
-;;; Code:
-(defgroup auto-side-windows nil
-  "Automatically manage buffer display in side windows."
-  :group 'windows
-  :prefix "auto-side-windows-")
-
-;;;; Customization Variables
-(defcustom auto-side-windows-top-buffer-names nil
-  "List of buffer name regexps to be displayed in top side windows.
-Each regexp is used to match buffer names. When a buffer's name
-matches any regex in this list, the buffer will be shown in the
-top side window."
-  :type '(repeat string)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-bottom-buffer-names nil
-  "List of buffer name regexps to be displayed in bottom side windows.
-Each regexp is used to match buffer names. When a buffer's name
-matches any regex in this list, the buffer will be shown in the
-bottom side window."
-  :type '(repeat string)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-left-buffer-names nil
-  "List of buffer name regexps to be displayed in left side windows.
-Each regexp is used to match buffer names. When a buffer's name
-matches any regex in this list, the buffer will be shown in the
-left side window."
-  :type '(repeat string)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-right-buffer-names nil
-  "List of buffer name regexps to be displayed in right side windows.
-Each regexp is used to match buffer names. When a buffer's name
-matches any regex in this list, the buffer will be shown in the
-right side window."
-  :type '(repeat string)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-top-buffer-modes nil
-  "List of major modes for buffers to be displayed in top side windows.
-When a buffer's major mode matches any symbol in this list,
-it will be shown in the top side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-bottom-buffer-modes nil
-  "List of major modes for buffers to be displayed in bottom side windows.
-When a buffer's major mode matches any symbol in this list,
-it will be shown in the bottom side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-left-buffer-modes nil
-  "List of major modes for buffers to be displayed in left side windows.
-When a buffer's major mode matches any symbol in this list,
-it will be shown in the left side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-right-buffer-modes nil
-  "List of major modes for buffers to be displayed in right side windows.
-When a buffer's major mode matches any symbol in this list,
-it will be shown in the right side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-top-extra-conditions '((category . force-side-top))
-  "Lists of extra conditions to match top buffers.
-These extra conditions are checked along with buffer name and major mode
-rules to determine if a buffer should be displayed in a top side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-bottom-extra-conditions '((category . force-side-bottom))
-  "Lists of extra conditions to match bottom buffers.
-These extra conditions are checked along with buffer name and major mode
-rules to determine if a buffer should be displayed in a bottom side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-left-extra-conditions '((category . force-side-left))
-  "Lists of extra conditions to match left buffers.
-These extra conditions are checked along with buffer name and major mode
-rules to determine if a buffer should be displayed in a left side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-right-extra-conditions '((category . force-side-right))
-  "Lists of extra conditions to match right buffers.
-These extra conditions are checked along with buffer name and major mode
-rules to determine if a buffer should be displayed in a right side window."
-  :type '(repeat symbol)
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-top-window-parameters nil
-  "Custom window parameters for top side windows.
-This alist can be used to specify parameters like the height
-or width of the top side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-bottom-window-parameters nil
-  "Custom window parameters for bottom side windows.
-This alist can be used to specify parameters like the height
-or width of the bottom side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-left-window-parameters nil
-  "Custom window parameters for left side windows.
-This alist can be used to specify parameters like the height
-or width of the left side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-right-window-parameters nil
-  "Custom window parameters for right side windows.
-This alist can be used to specify parameters like the height
-or width of the right side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-top-alist '((window-height . (lambda (win) (fit-window-to-buffer win 20 5))))
-  "Custom alist for top side windows.
-This alist contains display properties which will be applied
-when displaying buffers in the top side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-bottom-alist nil
-  "Custom alist for bottom side windows.
-This alist contains display properties which will be applied
-when displaying buffers in the bottom side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-left-alist nil
-  "Custom alist for left side windows.
-This alist contains display properties which will be applied
-when displaying buffers in the left side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-right-alist '((window-width . 80))
-  "Custom alist for right side windows.
-This alist contains display properties which will be applied
-when displaying buffers in the right side window."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-common-window-parameters '((no-other-window . t)
-                                                        (tab-line-format . none)
-                                                        (mode-line-format . none))
-  "Custom window parameters for all side windows.
-These parameters will be applied to all side windows created by
-`auto-side-windows-mode'."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-common-alist '((dedicated . t))
-  "Custom alist for all side windows.
-These parameters will be applied to all side windows created by
-`auto-side-windows-mode`."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-reuse-mode-window '((right . t))
-  "Allow reuse of side windows for same mode on given sides.
-If set, side windows may be reused for buffers of the same major mode."
-  :type 'alist
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-before-display-hook nil
-  "Hook run before displaying a buffer in a side window.
-This hook allows users to execute custom code or functions
-before a buffer is placed in a side window."
-  :type 'hook
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-after-display-hook nil
-  "Hook run after displaying a buffer in a side window.
-This hook allows users to execute custom code or functions
-after a buffer has been placed in a side window."
-  :type 'hook
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-before-toggle-hook nil
-  "Hook run before toggling the display of a buffer.
-This hook allows users to execute custom code or functions
-before the toggle action of a buffer in a side window."
-  :type 'hook
-  :group 'auto-side-windows)
-
-(defcustom auto-side-windows-after-toggle-hook nil
-  "Hook run after toggling the display of a buffer.
-This hook allows users to execute custom code or functions
-after the toggle action of a buffer in a side window."
-  :type 'hook
-  :group 'auto-side-windows)
-
-;;;; Internal Variables
-(defvar auto-side-windows--side-window-functions nil
-  "List of functions added to `display-buffer-alist' by `auto-side-windows-mode'.
-These functions determine how buffers are displayed in side windows.")
-
-;;;; Helper Functions
-(defun auto-side-windows--buffer-match-condition (majormodes &optional buffernames extra-conds)
-  "Get condition to match buffers with given MAJORMODES or BUFFERNAMES.
-MAJORMODES are the major modes to match, while BUFFERNAMES
-are optional regex patterns for buffer names. EXTRA-CONDS are
-additional conditions to refine the matching process."
-  (let ((modes-cond `(or ,@(mapcar (lambda (mode) `(derived-mode . ,mode)) majormodes))))
-    (when buffernames (setq modes-cond `(or (or ,@buffernames) ,modes-cond)))
-    (setq modes-cond (append modes-cond extra-conds))
-    modes-cond))
-
-(defun auto-side-windows--get-buffer-side (buffer &optional args)
-  "Determine which side BUFFER should be displayed in.
-This function checks the buffer against user-defined conditions relative to the
-side windows. It returns `'top', `'bottom', `'left', or `'right',or nil if no
-conditions are met.
-Optional ARGS may contain a category (New in Emacs>30.1)."
-  (cond
-   ((buffer-match-p `(and (not ,@(append auto-side-windows-left-extra-conditions
-                                         auto-side-windows-right-extra-conditions
-                                         auto-side-windows-bottom-extra-conditions)
-                               (category . detached-side-window))
-                          ,(auto-side-windows--buffer-match-condition
-                            auto-side-windows-top-buffer-modes
-                            auto-side-windows-top-buffer-names
-                            auto-side-windows-top-extra-conditions))
-                    buffer args)
-    'top)
-   ((buffer-match-p `(and (not ,@(append auto-side-windows-left-extra-conditions
-                                         auto-side-windows-right-extra-conditions
-                                         auto-side-windows-top-extra-conditions)
-                               (category . detached-side-window))
-                          ,(auto-side-windows--buffer-match-condition
-                            auto-side-windows-bottom-buffer-modes
-                            auto-side-windows-bottom-buffer-names
-                            auto-side-windows-bottom-extra-conditions))
-                    buffer args)
-    'bottom)
-   ((buffer-match-p `(and (not ,@(append auto-side-windows-top-extra-conditions
-                                         auto-side-windows-right-extra-conditions
-                                         auto-side-windows-bottom-extra-conditions)
-                               (category . detached-side-window))
-                          ,(auto-side-windows--buffer-match-condition
-                            auto-side-windows-left-buffer-modes
-                            auto-side-windows-left-buffer-names
-                            auto-side-windows-left-extra-conditions))
-                    buffer args)
-    'left)
-   ((buffer-match-p `(and (not ,@(append auto-side-windows-left-extra-conditions
-                                         auto-side-windows-top-extra-conditions
-                                         auto-side-windows-bottom-extra-conditions)
-                               (category . detached-side-window))
-                          ,(auto-side-windows--buffer-match-condition
-                            auto-side-windows-right-buffer-modes
-                            auto-side-windows-right-buffer-names
-                            auto-side-windows-right-extra-conditions))
-                    buffer args)
-    'right)
-   (t nil)))
-
-(defun auto-side-windows--get-next-free-slot (side)
-  "Return the next free slot number for SIDE.
-Each side window can have multiple slots numbered from 0 to
-MAX-SLOTS-1. This function finds and returns the next available
-slot number for use.
-If no free slot is found return MAX-SLOTS-1."
-  (let* ((max-slots (nth (cond ((eq side 'left) 0)
-                               ((eq side 'top) 1)
-                               ((eq side 'right) 2)
-                               ((eq side 'bottom) 3))
-                         window-sides-slots))
-         used-slots)
-    ;; Collect used slots
-    (dolist (win (window-list))
-      (when (equal (window-parameter win 'window-side) side)
-        (when-let ((slot (window-parameter win 'window-slot)))
-          (setq used-slots (cons slot used-slots)))))
-
-    ;; Find the next free slot
-    (if-let ((next-slot (catch 'next-slot
-                          (dotimes (i max-slots)
-                            (unless (member i used-slots)
-                              (throw 'next-slot i))))))
-        next-slot (1- max-slots))))
-
-(defun auto-side-windows--display-buffer (buffer alist)
-  "Custom display buffer function for `auto-side-windows-mode'.
-BUFFER is the buffer to display and ALIST contains display parameters.
-This function determines the appropriate side for the buffer and
-displays it in the selected side window if conditions are met.
-
-Before displaying the buffer, it runs `auto-side-windows-before-display-hook'.
-After displaying the buffer, it runs `auto-side-windows-after-display-hook'."
-  (when-let* ((side (auto-side-windows--get-buffer-side buffer `(nil . ,alist)))
-              (slot (auto-side-windows--get-next-free-slot side))
-              (window-params (append auto-side-windows-common-window-parameters
-                                     (symbol-value (intern (format "auto-side-windows-%s-window-parameters" (symbol-name side))))))
-              (side-alist (append auto-side-windows-common-alist
-                                  (symbol-value (intern (format "auto-side-windows-%s-alist" (symbol-name side))))))
-              (alist (append alist
-                             side-alist
-                             `((side . ,side)
-                               (slot . ,slot)
-                               (window-parameters . ,window-params)))))
-    (run-hook-with-args 'auto-side-windows-before-display-hook buffer)
-    (let ((window (unless (when (alist-get side auto-side-windows-reuse-mode-window)
-                            (display-buffer-reuse-mode-window buffer alist))
-                    (display-buffer-in-side-window buffer alist))))
-      (run-hook-with-args 'auto-side-windows-after-display-hook buffer window)
-      window)))
-
-;;;; Commands
-(defun auto-side-windows-toggle-side-window nil
-  "Toggle the current buffer as a side window.
-If the current window is already a side window, it will delete
-the window. If not, the buffer will be displayed in a side window.
-
-Before toggling the buffer, it runs `auto-side-windows-before-toggle-hook'.
-After toggling the buffer, it runs `auto-side-windows-after-toggle-hook'."
-  (interactive)
-  (let ((window (selected-window))
-        (buf (current-buffer)))
-    (with-selected-window window
-      (run-hook-with-args 'auto-side-windows-before-toggle-hook buf)
-      (cond
-       ((window-parameter window 'window-side)
-        (progn
-          (setq-local was-side-window t)
-          (display-buffer
-           buf '(display-buffer-use-some-window . ((some-window . mru)
-                                                   (category . detached-side-window))))
-          (delete-window window)))
-       ((local-variable-if-set-p 'was-side-window buf)
-        (progn
-          (kill-local-variable 'was-side-window)
-          (switch-to-prev-buffer window 'bury)
-          (display-buffer buf)))
-       (t
-        (error "Not a side window")))
-      (run-hook-with-args 'auto-side-windows-after-toggle-hook buf))))
-
-(defun auto-side-windows-display-buffer-on-side (side)
-  "Display the current buffer in a window on SIDE.
-This command explicitly places the buffer in the specified side window.
-It runs `auto-side-windows-before-display-hook` before displaying the buffer
-and `auto-side-windows-after-display-hook` after."
-  (interactive (list (intern (completing-read "Select side: " '("left" "right" "top" "bottom")))))
-  (let ((buf (current-buffer))
-        (alist `(nil . ((category . ,(intern (concat "force-side-" (symbol-name side))))))))
-    (if-let* ((window (selected-window))
-              (window-side (window-parameter window 'window-side)))
-        (delete-window window)
-      (switch-to-prev-buffer window 'bury))
-    (display-buffer buf alist)))
-
-(defun auto-side-windows-display-buffer-top ()
-  "Display the current buffer in a top side window."
-  (interactive)
-  (auto-side-windows-display-buffer-on-side 'top))
-
-(defun auto-side-windows-display-buffer-bottom ()
-  "Display the current buffer in a bottom side window."
-  (interactive)
-  (auto-side-windows-display-buffer-on-side 'bottom))
-
-(defun auto-side-windows-display-buffer-left ()
-  "Display the current buffer in a left side window."
-  (interactive)
-  (auto-side-windows-display-buffer-on-side 'left))
-
-(defun auto-side-windows-display-buffer-right ()
-  "Display the current buffer in a right side window."
-  (interactive)
-  (auto-side-windows-display-buffer-on-side 'right))
-
-;;;; Minor Mode
-;;;###autoload
-(define-minor-mode auto-side-windows-mode
-  "Toggle automatic side window management based on buffer rules.
-When enabled, this minor mode allows customized display of buffers
-in defined side windows based on their names or modes. It adds
-provided functions to `display-buffer-alist` to enable this feature."
-  :global t
-  :group 'auto-side-windows
-  (if auto-side-windows-mode
-      (add-to-list 'display-buffer-alist
-                   '(t auto-side-windows--display-buffer))
-    (setq display-buffer-alist
-          (delete '(t auto-side-windows--display-buffer)
-                  display-buffer-alist))))
-
-(provide 'auto-side-windows)
-;;; auto-side-windows.el ends here
dots/.config/emacs/old/lisp/auto-side-windows/COPYING
@@ -1,676 +0,0 @@
-
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
- 
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-  
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program 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 3 of the License, or
-    (at your option) any later version.
-
-    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
dots/.config/emacs/old/lisp/auto-side-windows/README.org
@@ -1,378 +0,0 @@
-# Inspired by: https://github.com/othneildrew/Best-README-Template
-#+OPTIONS: toc:nil
-
-[[https://github.com/MArpogaus/auto-side-windows/graphs/contributors][https://img.shields.io/github/contributors/MArpogaus/auto-side-windows.svg?style=flat-square]]
-[[https://github.com/MArpogaus/auto-side-windows/network/members][https://img.shields.io/github/forks/MArpogaus/auto-side-windows.svg?style=flat-square]]
-[[https://github.com/MArpogaus/auto-side-windows/stargazers][https://img.shields.io/github/stars/MArpogaus/auto-side-windows.svg?style=flat-square]]
-[[https://github.com/MArpogaus/auto-side-windows/issues][https://img.shields.io/github/issues/MArpogaus/auto-side-windows.svg?style=flat-square]]
-[[https://github.com/MArpogaus/auto-side-windows/blob/main/LICENSE][https://img.shields.io/github/license/MArpogaus/auto-side-windows.svg?style=flat-square]]
-[[https://linkedin.com/in/MArpogaus][https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555]]
-
-* auto-side-windows :TOC_3_gh:noexport:
-  - [[#about-the-project][About The Project]]
-    - [[#motivation][Motivation]]
-    - [[#layout-concept][Layout Concept]]
-    - [[#inspirations][Inspirations]]
-  - [[#getting-started][Getting Started]]
-    - [[#prerequisites][Prerequisites]]
-    - [[#example-configuration][Example Configuration]]
-  - [[#usage][Usage]]
-  - [[#customization][Customization]]
-  - [[#commands][Commands]]
-  - [[#integration-with-other-packages][Integration with Other Packages]]
-    - [[#popper-integration][Popper Integration]]
-    - [[#ace-window-integration][Ace Window Integration]]
-    - [[#enhancing-magit-and-org-mode-compatibility][Enhancing =magit= and =org-mode= compatibility]]
-  - [[#comparison-with-other-packages][Comparison with Other Packages]]
-    - [[#shackle][Shackle]]
-    - [[#popper][Popper]]
-    - [[#core-emacs-display-buffer-alist][Core Emacs (=display-buffer-alist=)]]
-  - [[#bonus-boxes-around-top-windows][Bonus: Boxes around top windows]]
-  - [[#contributions][Contributions]]
-  - [[#license][License]]
-  - [[#contact][Contact]]
-
-** About The Project
-
-[[file:screenshot.png]]
-
-*** Motivation
-
-I found the default behavior of =display-buffer= often unpredictable, leading to new buffers appearing in unexpected windows.
-Digging into Emacs' window management led me to realize the power of =display-buffer-alist=, but configuring it directly can be complicated and confusing especially for new users.
-
-=auto-side-windows= simplifies this process.
-It provides a straightforward way to define rules based on buffer names or major modes, ensuring that specific buffers consistently open in designated side windows (top, bottom, left, or right).
-The goal is to achieve a predictable, organized workspace, similar to layouts often found in IDEs, keeping the main editing area clear while providing easy access to complementary information.
-
-*** Layout Concept
-
-The package helps achieve layouts where side windows display non-primary information, keeping the central area focused on editing. A conceptual layout might look like this:
-
-#+begin_src
-     _________________________________________________
-    |         top: compilation, grep, occur           |
-    |_________________________________________________|
-    | left:      |                       | right:     |
-    | - dired    |                       | - Help     |
-    | - treemacs |                       | - Info     |
-    | - outline  |    Main Window Area   | - Magit    |
-    |            |       (Editing)       |            |
-    |            |                       |            |
-    |            |                       |            |
-    |____________|_______________________|____________|
-    |              bottom: REPLs, shells              |
-    |_________________________________________________|
-    |                   Echo Area                     |
-    |_________________________________________________|
-#+end_src
-
-This allows buffers like help, compilation logs, shells, or project trees to be accessible without disrupting the primary editing flow.
-
-*** Inspirations
-
-This package builds upon the excellent work and explanations of others in the Emacs community:
-- [[https://karthinks.com/software/emacs-window-management-almanac/][Emacs Window Management Almanac]] by [[https://www.reddit.com/user/karthinks/][u/karthinks]]
-- [[https://www.masteringemacs.org/article/demystifying-emacs-window-manager][Demystifying Emacs's Window Manager]] by [[https://www.reddit.com/user/mickeyp/][u/mickeyp]]
-- [[https://github.com/karthink/.emacs.d/blob/25a0aec771c38e340789d7c304f3e39ff23aee3e/lisp/setup-windows.el#L164][Karthink's setup-windows.el]] for a practical examples.
-Thank you all!
-
-** Getting Started
-
-*** Prerequisites
-
-- Emacs 30.1 or later.
-
-*** Example Configuration
-
-Here’s an example configuration using =use-package=:
-
-#+begin_src emacs-lisp
-  (use-package auto-side-windows
-    :load-path "/path/to/auto-side-windows/"
-    :custom
-    ;; Top side window configurations
-    (auto-side-windows-top-buffer-names
-     '("^\\*Backtrace\\*$" "^\\*Compile-Log\\*$" "^COMMIT_EDITMSG$"
-       "^\\*Org Src.*\\*" "^\\*Agenda Commands\\*$" "^\\*Org Agenda\\*$"
-       "^\\*Quick Help\\*$" "^\\*Multiple Choice Help\\*$" "^\\*TeX Help\\*$"
-       "^\\*TeX errors\\*$" "^\\*Warnings\\*$" "^\\*diff-hl\\*$"
-       "^\\*Process List\\*$"))
-    (auto-side-windows-top-buffer-modes
-     '(flymake-diagnostics-buffer-mode locate-mode occur-mode grep-mode
-                                       xref--xref-buffer-mode))
-
-    ;; Bottom side window configurations
-    (auto-side-windows-bottom-buffer-names
-     '("^\\*.*eshell.*\\*$" "^\\*.*shell.*\\*$" "^\\*.*term.*\\*$"
-       "^\\*.*vterm.*\\*$"))
-    (auto-side-windows-bottom-buffer-modes
-     '(eshell-mode shell-mode term-mode vterm-mode comint-mode debugger-mode))
-
-    ;; Right side window configurations
-    (auto-side-windows-right-buffer-names
-     '("^\\*eldoc.*\\*$" "^\\*info\\*$" "^\\*Metahelp\\*$"))
-    (auto-side-windows-right-buffer-modes
-     '(Info-mode TeX-output-mode pdf-view-mode eldoc-mode help-mode
-                 helpful-mode shortdoc-mode))
-
-    ;; Example: Custom parameters for top windows (e.g., fit height to buffer)
-    ;; (auto-side-windows-top-alist '((window-height . fit-window-to-buffer)))
-    ;; (auto-side-windows-top-window-parameters '((mode-line-format . ...))) ;; Adjust mode-line
-
-    ;; Maximum number of side windows on the left, top, right and bottom
-    (window-sides-slots '(1 1 1 1)) ; Example: Allow one window per side
-
-    ;; Force left and right side windows to occupy full frame height
-    (window-sides-vertical t)
-
-    ;; Make changes to tab-/header- and mode-line-format persistent when toggleling windows visibility
-    (window-persistent-parameters
-     (append window-persistent-parameters
-             '((tab-line-format . t)
-               (header-line-format . t)
-               (mode-line-format . t))))
-    :bind ;; Example keybindings (adjust prefix as needed)
-    (:map global-map ; Or your preferred keymap prefix
-          ("C-c w t" . auto-side-windows-display-buffer-top)
-          ("C-c w b" . auto-side-windows-display-buffer-bottom)
-          ("C-c w l" . auto-side-windows-display-buffer-left)
-          ("C-c w r" . auto-side-windows-display-buffer-right)
-          ("C-c w T" . auto-side-windows-toggle-side-window)) ; Toggle current buffer in/out of side window
-    :hook
-    (after-init . auto-side-windows-mode)) ; Activate the mode
-#+end_src
-
-** Usage
-
-Once =auto-side-windows-mode= is enabled and configured, buffers matching your defined rules (by name regexp or major mode) will automatically be displayed in the specified side window.
-
-** Customization
-
-You can customize the behavior through the following variables (accessible via `M-x customize-group RET auto-side-windows RET`):
-
-| Option                                                      | Type          | Description                                                                            |
-|-------------------------------------------------------------+---------------+----------------------------------------------------------------------------------------|
-| =auto-side-windows-{top,bottom,left,right}-buffer-names=      | list (string) | Regexps matching buffer names for each side.                                           |
-| =auto-side-windows-{top,bottom,left,right}-buffer-modes=      | list (symbol) | Major modes for buffers for each side.                                                 |
-| =auto-side-windows-{top,bottom,left,right}-extra-conditions=  | list (sexp)   | Additional conditions (e.g., `(category . ...)` for =display-buffer=) for matching.      |
-| =auto-side-windows-{top,bottom,left,right}-window-parameters= | alist         | Window parameters (see =window-parameters=) applied to windows on this side.             |
-| =auto-side-windows-{top,bottom,left,right}-alist=             | alist         | Action alist properties (e.g., =window-height=) applied for this side.                   |
-| =auto-side-windows-common-window-parameters=                  | alist         | Window parameters applied to *all* side windows created by this package.                 |
-| =auto-side-windows-common-alist=                              | alist         | Action alist properties (e.g., `(dedicated . t)`) applied for *all* side windows.        |
-| =auto-side-windows-reuse-mode-window=                         | alist         | Specify sides (e.g., `((right . t))`) where windows can be reused for same major mode. |
-| =auto-side-windows-{before,after}-display-hook=               | hook          | Hooks run before/after displaying a buffer in a side window.                           |
-| =auto-side-windows-{before,after}-toggle-hook=                | hook          | Hooks run before/after toggling a buffer as a side window.                             |
-
-** Commands
-
-The package provides the following commands:
-
-- =auto-side-windows-mode=: Global minor mode. Enable this to activate the automatic side window management based on your rules.
-- =auto-side-windows-toggle-side-window=: If the current buffer is in a side window created by this package, move it to a normal window. If it was just moved out, move it back to its side window configuration. Useful for temporarily maximizing a side window buffer.
-- =auto-side-windows-display-buffer-{top,bottom,left,right}=: Manually force the current buffer to be displayed in a side window on the specified side, overriding normal rules.
-- =auto-side-windows-display-buffer-on-side=: Manually force the current buffer to be displayed in a side window on the specified side, overriding normal rules. Compared to the command above the user is prompted side in the minibuffer.
-
-** Integration with Other Packages
-
-=auto-side-windows= plays well with other common window and buffer management packages.
-
-*** Popper Integration
-
-You can configure [[https://github.com/karthink/popper][Popper]] to manage the side windows created by =auto-side-windows=. Define Popper's reference buffers using the same lists you use for =auto-side-windows=:
-
-#+begin_src emacs-lisp
-  (use-package popper
-    :after auto-side-windows ; Ensure auto-side-windows variables are defined
-    :hook (auto-side-windows-mode . popper-mode) ; Activate popper alongside
-    :custom
-    ;; Tell Popper to consider buffers matching auto-side-windows rules as popups
-    (popper-reference-buffers
-     (append auto-side-windows-top-buffer-names auto-side-windows-top-buffer-modes
-             auto-side-windows-left-buffer-names auto-side-windows-left-buffer-modes
-             auto-side-windows-right-buffer-names auto-side-windows-right-buffer-modes
-             auto-side-windows-bottom-buffer-names auto-side-windows-bottom-buffer-modes))
-    ;; Optional: Don't let Popper decide where to display, auto-side-windows handles that
-    (popper-display-control nil) ; Or 'user if you prefer popper commands for display
-    :config
-    (popper-mode +1) ; Enable popper-mode
-    (popper-echo-mode +1) ; Optional: echo area notifications
-    :bind ;; Example bindings
-    (:map your-prefix-map ;; e.g. my/toggle-map
-          ("p" . popper-toggle)      ; Toggle last popup
-          ("P" . popper-toggle-type) ; Toggle popups of specific type
-          ("C-p" . popper-cycle)))   ; Cycle through visible popups
-#+end_src
-
-With this setup, you can use Popper commands (like =popper-toggle= or =popper-cycle=) to quickly hide/show/cycle through the side windows managed by =auto-side-windows=.
-
-Additionally, the following custom command allows you to switch to arbitrary buried popup buffers:
-
-#+begin_src emacs-lisp
-  (defun my/popper-switch-to-buried-buffer (buffer)
-    "Switch to buried popup BUFFER."
-    (interactive
-     (list
-      (when-let ((buried-popups (progn (popper--find-buried-popups)
-                                       (mapcar #'cdr
-                                               (alist-get (funcall popper-group-function)
-                                                          popper-buried-popup-alist nil nil 'equal))))
-                 (pred (lambda (b)
-                         (if (consp b) (setq b (car b)))
-                         (setq b (get-buffer b))
-                         (member b buried-popups))))
-        (read-buffer "Switch to popup: " nil t pred))))
-    (if buffer (display-buffer buffer)
-      (message "No buried popups.")))
-    #+end_src
-
-Just add it to the =:preface= section of the above =use-package= declaration and optionally bind it to a key.
-
-*** Ace Window Integration
-
-[[https://github.com/abo-abo/ace-window][Ace Window]] can serve as a fallback mechanism for selecting a window when =display-buffer= doesn't find a suitable existing window or rule (including those from =auto-side-windows=).
-
-Modify =display-buffer-base-action= to include =ace-display-buffer=. This tells Emacs to use Ace Window to ask you where to put a buffer if other methods fail.
-
-    #+begin_src emacs-lisp
-      (use-package ace-window
-        :custom
-        (display-buffer-base-action '(display-buffer-reuse-window
-                                      display-buffer-in-previous-window
-                                      ace-display-buffer))) ; Ask user via ace-window
-    #+end_src
-
-Now, if a command tries to display a buffer and no =auto-side-windows= rule applies and standard reuse fails, =ace-display-buffer= will trigger, letting you pick the window.
-
-*** Enhancing =magit= and =org-mode= compatibility
-
-To further enhance the Emacs experience with =auto-side-windows=, consider adding these configurations:
-
-#+begin_src emacs-lisp
-  ;; Org mode: Ensure agenda buffers open in the top side window for easy access
-  (setopt org-src-window-setup 'plain)
-  (setopt auto-side-windows-top-buffer-names '("^\\*Org Agenda\\*$"
-                                               "^\\*Org Src.*\\*"
-                                               "^\\*Org-Babel Error Output\\*"
-                                               ...)))
-
-  ;; Magit: Display Magit diff/status in the right side window, edit commit msg on top
-  (setopt magit-display-buffer-function #'display-buffer
-          magit-commit-diff-inhibit-same-window t)
-  (setopt auto-side-windows-right-buffer-names '("^magit-diff:.*$"
-                                                 "^magit-process:.*$"
-                                                 ...))
-  (setopt auto-side-windows-right-buffer-modes '(magit-status-mode
-                                                 magit-log-mode
-                                                 magit-diff-mode
-                                                 magit-process-mode
-                                                 ...))
-  (setopt auto-side-windows-top-buffer-names
-          '("^COMMIT_EDITMSG$"
-            ...))
-#+end_src
-
-These configurations integrate well with =auto-side-windows= and enhance buffer management for specific use cases in Emacs.
-
-** Comparison with Other Packages
-
-While several packages address window management, =auto-side-windows= has a specific focus:
-
-*** Shackle
-[[https://depp.brause.cc/shackle/][Shackle]] is a powerful package for finely controlling how and where popup windows appear, including options for creating new frames or specifying precise window parameters. It's very flexible and can involve more complex rule definitions.
-
-*Difference:* =auto-side-windows= focuses *specifically* on simplifying the common use case of assigning buffers to *side windows* within the *current frame* based on simple name/mode matching, acting as a high-level interface to =display-buffer-alist= for this purpose.
-
-*** Popper
-[[https://github.com/karthink/popper][Popper]] excels at *managing* buffers that are already considered "popups". It allows you to quickly toggle, cycle through, and manage the visibility of these popup windows.
-
-*Difference:* =auto-side-windows= *defines which buffers should become* side windows in the first place. Popper can then be configured to *manage* these side windows created by =auto-side-windows= rules (see [[#popper-integration][Popper Integration]]). They work well together.
-
-*** Core Emacs (=display-buffer-alist=)
-Emacs' built-in =display-buffer-alist= is the underlying mechanism for controlling buffer display. It's extremely powerful but requires writing potentially complex alist structures.
-
-*Difference:* =auto-side-windows= acts as a configuration layer *on top of* =display-buffer-alist=. It generates the necessary alist entries for side window rules based on user-friendly customization variables, reducing the need to write the raw alist entries manually for this common pattern.
-
-** Bonus: Boxes around top windows
-
-Inspired by [[https://www.reddit.com/r/emacs/comments/1hoehaa/boxes_everywhere/][u/Nicolas-Rougier's post]], you can add customized header lines to side windows for better visual distinction.
-To resemble the example shown in the screenshot add this to your configuration:
-
-#+begin_src emacs-lisp
-  (use-package auto-side-windows
-    :ensure (:host github :repo "MArpogaus/auto-side-windows")
-    :preface
-    (defun my/get-header-line-icon-for-buffer (buffer)
-      (with-current-buffer buffer
-        (unless (boundp 'header-line-icon)
-          (setq-local header-line-icon
-                      (cond
-                       ((buffer-match-p "Warning" buffer) '("  !  " . warning))
-                       ((buffer-match-p '(or "^\\*Backtrace\\*$" ".*[Ee]rror.*") buffer) '("  !  " . error))
-                       ((buffer-match-p '(or "^COMMIT_EDITMSG$" "^\\*diff-hl\\*$") buffer) '("    " . success))
-                       ((buffer-match-p "^\\*Org Src.*\\*" buffer) '("     " . mode-line-emphasis))
-                       ((buffer-match-p "^\\*Org Agenda\\*$" buffer) '("    " . mode-line-emphasis))
-                       (t '("  ?  " . mode-line-emphasis)))))
-        header-line-icon))
-    (defun my/install-top-side-window-face-remaps (buffer foreground background)
-      (with-current-buffer buffer
-        (unless (bound-and-true-p top-side-window-face-remaps-cookies)
-          (setq-local top-side-window-face-remaps-cookies
-                      (list
-                       (face-remap-add-relative 'header-line
-                                                `(:box nil :underline nil :overline ,background))
-                       (face-remap-add-relative 'fringe
-                                                `(:background ,background))
-                       (face-remap-add-relative 'mode-line-active
-                                                `(:overline ,background :underline nil :height 0))
-                       (face-remap-add-relative 'mode-line-inactive
-                                                `(:overline ,background :underline nil :height 0))
-                       )))))
-    (defvar my/header-line-format-top
-      '(:eval
-        (let*
-            ((buffer (current-buffer))
-             (prefix-and-face (my/get-header-line-icon-for-buffer buffer))
-             (prefix (car prefix-and-face))
-             (background (face-foreground (cdr prefix-and-face)))
-             (foreground (face-background (cdr prefix-and-face) nil 'default))
-             (prefix-face `((t :inherit bold :background ,background :foreground ,foreground)))
-             (buffer-face `((t :inherit bold :foreground ,background))))
-          (set-window-fringes nil 1 1 t)
-          ;; (set-window-margins nil 1 1)
-          (my/install-top-side-window-face-remaps buffer foreground background)
-          (list
-           (propertize prefix 'face prefix-face 'display '(space-width 0.7))
-           (propertize (format-mode-line " %b ") 'face buffer-face)
-           (propertize " " 'display `(space :align-to right))
-           (propertize " " 'face prefix-face 'display '(space-width 1))))))
-    :custom
-    ;; Draw boxes around top side windows
-    (auto-side-windows-top-window-parameters `((mode-line-format . t)
-                                               (header-line-format . ,my/header-line-format-top)))
-    (auto-side-windows-before-display-hook '((lambda (buffer)
-                                               (with-current-buffer buffer
-                                                 (when (bound-and-true-p top-side-window-face-remaps-cookies)
-                                                   (dolist (cookie top-side-window-face-remaps-cookies)
-                                                     (face-remap-remove-relative cookie))
-                                                   (kill-local-variable 'top-side-window-face-remaps-cookies))))))
-    (auto-side-windows-before-toggle-hook auto-side-windows-before-display-hook))
-#+end_src
-
-*Note:* Complex face remapping in header lines might have side effects (e.g., affecting Corfu popup fringes).
-
-** Contributions
-
-Contributions to the =auto-side-windows= package are greatly appreciated!
-Feel free to check the [[https://github.com/MArpogaus/auto-side-windows/issues][issues page]] or submit a [[https://github.com/MArpogaus/auto-side-windows/pulls][pull request]].
-
-** License
-
-Distributed under the [[file:COPYING][GPLv3]] License.
-
-** Contact
-
-[[https://github.com/MArpogaus/][Marcel Arpogaus]] - [[mailto:znepry.necbtnhf@tznvy.pbz][znepry.necbtnhf@tznvy.pbz]] (encrypted with [ROT13](https://rot13.com/))
-
-Project Link:
-[[https://github.com/MArpogaus/auto-side-windows]]
dots/.config/emacs/old/lisp/consult-mu/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,36 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**To Reproduce**
-Steps to reproduce the behavior:
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Screenshots**
-If applicable, add screenshots to help explain your problem.
-
-**Important Information:**
- - OS: [e.g. macOS]
- - Version of Emacs [e.g. 29] (or other Emacsen you use)
- - Version of `mu` (run `mu --version` in a shell)
- - Version of `consult` (see [pkg-info](https://github.com/emacsorphanage/pkg-info))
- - The installation method and the configuration you are using with your consult-mu.
- - If there is an error message, turn debug-on-error on (by `M-x toggle-debug-on-error`) and include the backtrace content in your report.
- - If the error only exists when you have some other packages installed, list those packages (e.g. problem happens when evil is installed)
-
-**Additional context**
-Add any other context about the problem here.
dots/.config/emacs/old/lisp/consult-mu/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,20 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
dots/.config/emacs/old/lisp/consult-mu/.github/FUNDING.yml
@@ -1,13 +0,0 @@
-# These are supported funding model platforms
-
-github: [armindarvish] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
-custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
dots/.config/emacs/old/lisp/consult-mu/extras/consult-mu-compose-embark.el
@@ -1,72 +0,0 @@
-;;; consult-mu-compose-embark.el --- Emabrk Actions for consult-mu-compose -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021-2023
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-
-;;; Code:
-
-;;; Requirements
-(require 'embark)
-(require 'consult-mu)
-(require 'consult-mu-embark)
-
-(defun consult-mu-compose-embark-attach-file (cand)
-  "Run `consult-mu-attach-files' on CAND."
-  (funcall (apply-partially #'consult-mu-compose-attach cand)))
-
-;;; add consult-mu-attach to embark-file-map
-(defun consult-mu-compose-embark-bind-attach-file-key (&optional key)
-  "Binds `consult-mu-embark-attach-file-key'.
-
-Bind `consult-mu-embark-attach-file-key' to
-`consult-mu-compose-embark-attach-file' in `embark-file-map'.  If KEY is
-non-nil binds KEY instead of `consult-mu-embark-attach-file-key'."
-  (if-let ((keyb (or key (kbd consult-mu-embark-attach-file-key))))
-      (define-key embark-file-map keyb #'consult-mu-compose-embark-attach-file)))
-
-(consult-mu-compose-embark-bind-attach-file-key)
-
-;; change the default action on `consult-mu-contacts category.
-(add-to-list 'embark-default-action-overrides '((file . consult-mu-compose--read-file-attach)  . consult-mu-compose-attach))
-(add-to-list 'embark-default-action-overrides '((file . consult-mu-compose-attach)  . consult-mu-compose-attach))
-
-;;; Provide `consult-mu-compose-embark' module
-
-(provide 'consult-mu-compose-embark)
-
-;;; consult-mu-compose-embark.el ends here
dots/.config/emacs/old/lisp/consult-mu/extras/consult-mu-compose.el
@@ -1,398 +0,0 @@
-;;; consult-mu-compose.el --- Consult Mu4e asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2023 Armin Darvish
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-;;; Code:
-
-(require 'consult-mu)
-
-;;; Customization Variables
-(defcustom consult-mu-compose-use-dired-attachment 'in-dired
-  "Use a Dired buffer for multiple file attachment?
-
-If set to \='in-dired uses `dired' buffer and `dired' marks only when inside
-a `dired' buffer.  If \='t, a `dired' buffer will be used for selecting attachment files similar to what Doom Emacs does:
-URL `https://github.com/doomemacs/doomemacs/blob/bea81278fd2ecb65db6a63dbcd6db2f52921ee41/modules/email/mu4e/autoload/email.el#L272'.
-
-If \='nil, consult-mu uses minibuffer completion for selection files to
-attach, even if inside a `dired' buffer.
-
-By default this is set to \='in-dired."
-  :group 'consult-mu
-  :type '(choice (const :tag "Only use Dired if inside Dired Buffer" 'in-dired)
-                 (const :tag "Always use Dired" t)
-                 (const :tag "Never use Dired" nil)))
-
-(defcustom consult-mu-large-file-warning-threshold large-file-warning-threshold
-  "Threshold for size of file to require confirmation for preview.
-
-This is used when selecting files to attach to emails.  Files larger than this value in size will require user confirmation before previewing the file.  Default value is set by `large-file-warning-threshold'.  If nil, no cofnirmation is required."
-  :group 'consult-mu
-  :type '(choice integer (const :tag "Never request confirmation" nil)))
-
-
-(defcustom consult-mu-compose-preview-key consult-mu-preview-key
-  "Preview key for `consult-mu-compose'.
-
-This is similar to `consult-mu-preview-key' but explicitly for
-consult-mu-compose.  It is recommended to set this to something other than
-\='any to avoid loading preview buffers for each file."
-  :group 'consult-mu
-  :type '(choice (const :tag "Any key" any)
-                 (list :tag "Debounced"
-                       (const :debounce)
-                       (float :tag "Seconds" 0.1)
-                       (const any))
-                 (const :tag "No preview" nil)
-                 (key :tag "Key")
-                 (repeat :tag "List of keys" key)))
-
-(defcustom consult-mu-embark-attach-file-key nil
-  "Embark key binding for interactive file attachement."
-  :group 'consult-mu
-  :type '(choice (key :tag "Key")
-                 (const :tag "no key binding" nil)))
-
-(defvar consult-mu-compose-attach-history nil
-  "History variable for file attachment.
-
-It is used in `consult-mu-compose--read-file-attach'.")
-
-(defvar consult-mu-compose-current-draft-buffer nil
-  "Store the buffer that is being edited.")
-
-(defun consult-mu-compose--read-file-attach (&optional initial)
-  "Read files in the minibuffer to attach to an email.
-
-INITIAL is the initial input in the minibuffer."
-  (consult--read (completion-table-in-turn #'completion--embedded-envvar-table
-                                           #'completion--file-name-table)
-                 :prompt "Attach File: "
-                 :require-match t
-                 :category 'file
-                 :initial (or initial default-directory)
-                 :lookup (lambda (sel cands &rest args)
-                           (file-truename sel))
-                 :state (lambda (action cand)
-                          (let ((preview (consult--buffer-preview)))
-                            (pcase action
-                              ('preview
-                               (if cand
-                                   (when (not (file-directory-p cand))
-                                     (let* ((filename (file-truename cand))
-                                            (filesize (float
-                                                       (file-attribute-size
-                                                        (file-attributes filename))))
-                                            (confirm (if (and filename
-                                                              (>= filesize consult-mu-large-file-warning-threshold))
-                                                         (yes-or-no-p (format "File is %s Bytes.  Do you really want to preview it?" filesize))
-                                                       t)))
-                                       (if confirm
-                                           (funcall preview action
-                                                    (find-file-noselect (file-truename cand))))))))
-                              ('return
-                               cand))))
-                 :preview-key consult-mu-compose-preview-key
-                 :add-history (list mu4e-attachment-dir)
-                 :history 'consult-mu-compose-attach-history))
-
-(defun consult-mu-compose--read-file-remove (&optional initial)
-  "Select attached files to remove from email.
-
-INITIAL is the initial input in the minibuffer."
-
-  (if-let ((current-files (pcase major-mode
-                            ('org-msg-edit-mode
-                             (org-msg-get-prop "attachment"))
-                            ((or 'mu4e-compose-mode 'message-mode)
-                             (goto-char (point-max))
-                             (cl-loop while (re-search-backward "<#part.*filename=\"\\(?1:.*\\)\"[[:ascii:][:nonascii:]]*?/part>" nil t)
-                                      collect (match-string-no-properties 1)))
-                            (_
-                             (error "Not in a compose message buffer")
-                             nil))))
-
-      (consult--read current-files
-                     :prompt "Remove File:"
-                     :category 'file
-                     :state (lambda (action cand)
-                              (let ((preview (consult--buffer-preview)))
-                                (pcase action
-                                  ('preview
-                                   (if cand
-                                       (when (not (file-directory-p cand))
-                                         (let* ((filename (file-truename cand))
-                                                (filesize (float
-                                                           (file-attribute-size
-                                                            (file-attributes filename))))
-                                                (confirm (if (and filename
-                                                                  (>= filesize consult-mu-large-file-warning-threshold))
-                                                             (yes-or-no-p (format "File is %s Bytes.  Do you really want to preview it?" filesize))
-                                                           t)))
-                                           (if confirm
-                                               (funcall preview action
-                                                        (find-file-noselect (file-truename cand))))))))
-                                  ('return
-                                   cand))))
-                     :preview-key consult-mu-compose-preview-key
-                     :initial initial)
-    (progn
-      (message "No files currently attached!")
-      nil)))
-
-(defun consult-mu-compose-get-draft-buffer ()
-  "Query user to select a mu4e compose draft buffer."
-  (save-excursion
-  (if (and (consult-mu-compose-get-current-buffers)
-           (y-or-n-p "Attach the files to an existing compose buffer? "))
-      (consult--read (consult-mu-compose-get-current-buffers)
-                     :prompt "Select Message Buffer: "
-                     :require-match nil
-                     :category 'consult-mu-messages
-                     :preview-key consult-mu-preview-key
-                     :lookup (lambda (sel cands &rest args)
-                               (or (get-buffer sel) sel))
-                     :state (lambda (action cand)
-                              (let ((preview (consult--buffer-preview)))
-                                (pcase action
-                                  ('preview
-                                   (if (and cand (buffer-live-p cand))
-                                       (funcall preview action
-                                                cand)))
-                                  ('return
-                                   cand))))))))
-
-(defun consult-mu-compose-get-current-buffers ()
-  "Return a list of active compose message buffers."
-  (let (buffers)
-    (save-current-buffer
-      (dolist (buffer (buffer-list t))
-        (set-buffer buffer)
-        (when (or (and (derived-mode-p 'message-mode)
-                       (null message-sent-message-via))
-                  (derived-mode-p 'org-msg-edit-mode)
-                  (derived-mode-p 'mu4e-compose-mode))
-          (push (buffer-name buffer) buffers))))
-    (nreverse buffers)))
-
-(defun consult-mu-compose--attach-files (files &optional mail-buffer &rest _args)
-  "Attach FILES to email in MAIL-BUFFER compose buffer."
-  (let ((files (if (stringp files) (list files) files))
-        (mail-buffer (or mail-buffer (if (version<= mu4e-mu-version "1.12")
-                                 (mu4e-compose 'new) (mu4e-compose-new)))))
-    (with-current-buffer mail-buffer
-      (pcase major-mode
-        ('org-msg-edit-mode
-         (save-excursion
-           (let* ((new-files (delete-dups (append (org-msg-get-prop "attachment") files))))
-             (org-msg-set-prop "attachment" new-files))
-           (goto-last-change 0)
-           (org-reveal)
-           (consult-mu--pulse-line)))
-        ((or 'mu4e-compose-mode 'message-mode)
-         (save-excursion
-           (dolist (file files)
-             (goto-char (point-max))
-             (unless (eq (current-column) 0)
-               (insert "\n\n")
-               (forward-line 2))
-             (mail-add-attachment (file-truename file))
-             (goto-last-change 0)
-             (forward-line -2)
-             (consult-mu--pulse-line))))
-        (_
-         (error "%s is not a compose buffer" (current-buffer)))))))
-
-(defun consult-mu-compose--remove-files (files &optional mail-buffer &rest _args)
-  "Remove FILES from current attachments in MAIL-BUFFER."
-  (let ((files (if (stringp files) (list files) files))
-        (mail-buffer (or mail-buffer (current-buffer))))
-    (with-current-buffer mail-buffer
-      (save-excursion
-        (pcase major-mode
-          ('org-msg-edit-mode
-           (let ((current-files (org-msg-get-prop "attachment"))
-                 (removed-files (list)))
-             (mapcar (lambda (file)
-                       (when (member file current-files)
-                         (org-msg-set-prop "attachment" (delete-dups (remove file current-files)))
-                         (add-to-list 'removed-files file)
-                         (setq current-files (org-msg-get-prop "attachment"))
-                         (goto-last-change 0)
-                         (org-reveal)
-                         (consult-mu--pulse-line)))
-                     files)
-             (message "file(s) %s detached" (mapconcat 'identity removed-files ","))))
-          ('mu4e-compose-mode
-           (let ((removed-files (list)))
-             (mapcar (lambda (file)
-                       (goto-char (point-min))
-                       (while (re-search-forward (format "<#part.*filename=\"%s\"[[:ascii:][:nonascii:]]*?/part>" file) nil t)
-                         (replace-match "" nil nil)
-                         (setq removed-files (append removed-files (list file)))
-                         (goto-last-change 0)
-                         (consult-mu--pulse-line)
-                         (whitespace-cleanup)))
-                     files)
-             (message "file(s) %s detached" (mapconcat 'identity removed-files ", ")))))))))
-
-(defun consult-mu-compose-attach (&optional files mail-buffer)
-  "Attach FILES to email in MAIL-BUFFER interactively.
-
-MAIL-BUFFER defaults to `consult-mu-compose-current-draft-buffer'."
-  (interactive)
-  (let* ((consult-mu-compose-current-draft-buffer (cond
-                                                   ((or (derived-mode-p 'mu4e-compose-mode) (derived-mode-p 'org-msg-edit-mode) (derived-mode-p 'message-mode)) (current-buffer))
-                                                   ((derived-mode-p 'dired-mode)
-                                                    (and (bound-and-true-p dired-mail-buffer) (buffer-live-p dired-mail-buffer) dired-mail-buffer))
-                                                   (t
-                                                    consult-mu-compose-current-draft-buffer)))
-         (mail-buffer (or mail-buffer
-                          (and (buffer-live-p consult-mu-compose-current-draft-buffer) consult-mu-compose-current-draft-buffer)
-                          nil))
-         (files (or files
-                    (if (and (derived-mode-p 'dired-mode) consult-mu-compose-use-dired-attachment)
-                        (delq nil
-                              (mapcar
-                               ;; don't attach directories
-                               (lambda (f) (if (file-directory-p f)
-                                               nil
-                                             f))
-                               (nreverse (dired-map-over-marks (dired-get-filename) nil))))
-                      (consult-mu-compose--read-file-attach files)))))
-    (pcase major-mode
-      ((or 'mu4e-compose-mode 'org-msg-edit-mode 'message-mode)
-       (setq mail-buffer (current-buffer))
-       (setq consult-mu-compose-current-draft-buffer mail-buffer)
-       (cond
-        ((stringp files)
-         (cond
-          ((and (not (file-directory-p files)) (file-truename files))
-           (consult-mu-compose--attach-files (file-truename files) mail-buffer))
-          ((and (file-directory-p files) (eq consult-mu-compose-use-dired-attachment 'always))
-           (progn
-             (split-window-sensibly)
-             (with-current-buffer (dired files)
-               (setq-local dired-mail-buffer mail-buffer))))
-          ((and (file-directory-p files) (not (eq consult-mu-compose-use-dired-attachment 'always)))
-           (progn
-             (while (file-directory-p files)
-               (setq files (consult-mu-compose--read-file-attach files)))
-             (consult-mu-compose--attach-files (file-truename files) mail-buffer)))))
-        ((listp files)
-         (consult-mu-compose--attach-files files mail-buffer))))
-      ('dired-mode
-       (setq mail-buffer (or (and (bound-and-true-p dired-mail-buffer) (buffer-live-p dired-mail-buffer) dired-mail-buffer)
-                             (consult-mu-compose-get-draft-buffer)
-                             (if (version<= mu4e-mu-version "1.12")
-                                 (mu4e-compose 'new) (mu4e-compose-new))))
-
-       (cond
-        ((and mail-buffer (buffer-live-p mail-buffer)))
-        ((stringp mail-buffer) (with-current-buffer (if (version<= mu4e-mu-version "1.12")
-                                                        (mu4e-compose 'new) (mu4e-compose-new))
-                                 (save-excursion (message-goto-subject)
-                                                 (insert mail-buffer)
-                                                 (rename-buffer mail-buffer t)))
-         (setq mail-buffer (get-buffer mail-buffer))))
-
-       (if (and mail-buffer (buffer-live-p mail-buffer))
-           (progn
-             (setq-local dired-mail-buffer mail-buffer)
-             (switch-to-buffer mail-buffer)
-             (cond
-              ((not files)
-               (message "no files were selected!"))
-              ((stringp files)
-               (cond
-                ((and (file-truename files) (not (file-directory-p files)))
-                 (consult-mu-compose--attach-files (file-truename files) mail-buffer))
-                ((and (not consult-mu-compose-use-dired-attachment) (file-directory-p files))
-                 (progn
-                   (while (file-directory-p files)
-                     (setq files (consult-mu-compose--read-file-attach files)))
-                   (consult-mu-compose--attach-files (file-truename files) mail-buffer)))))
-              ((listp files)
-               (consult-mu-compose--attach-files files mail-buffer))))))
-      (_
-       (setq mail-buffer (or
-                          consult-mu-compose-current-draft-buffer
-                          (consult-mu-compose-get-draft-buffer)
-                          (if (version<= mu4e-mu-version "1.12")
-                              (mu4e-compose 'new) (mu4e-compose-new))))
-       (cond
-        ((and mail-buffer (buffer-live-p mail-buffer)))
-        ((stringp mail-buffer) (with-current-buffer (if (version<= mu4e-mu-version "1.12")
-                                                        (mu4e-compose 'new) (mu4e-compose-new))
-                                 (save-excursion (message-goto-subject)
-                                                 (insert mail-buffer)
-                                                 (rename-buffer mail-buffer t)))
-         (setq mail-buffer (get-buffer mail-buffer))))
-       (if (and mail-buffer (buffer-live-p mail-buffer))
-           (progn
-             (switch-to-buffer mail-buffer)
-             (setq consult-mu-compose-current-draft-buffer mail-buffer)
-             (cond
-              ((and (not (file-directory-p files)) (file-truename files))
-               (consult-mu-compose--attach-files (file-truename files) mail-buffer))
-              ((and (file-directory-p files) (eq consult-mu-compose-use-dired-attachment 'always))
-               (progn
-                 (split-window-sensibly)
-                 (with-current-buffer (dired files)
-                   (setq-local dired-mail-buffer mail-buffer)
-                   )))
-              ((and (file-directory-p files) (not (eq consult-mu-compose-use-dired-attachment 'always)))
-               (progn
-                 (while (file-directory-p files)
-                   (setq files (consult-mu-compose--read-file-attach files)))
-                 (consult-mu-compose--attach-files (file-truename files) mail-buffer)))
-              ((listp files)
-               (consult-mu-compose--attach-files files mail-buffer))))))))
-  mail-buffer)
-
-(defun consult-mu-compose-detach (&optional file)
-  "Remove FILE from email attachments interactively."
-  (interactive)
-  (save-mark-and-excursion
-    (when-let (file (consult-mu-compose--read-file-remove))
-      (consult-mu-compose--remove-files file))))
-
-;;; provide `consult-mu-compose' module
-(provide 'consult-mu-compose)
-
-;;; consult-mu-compose.el ends here
dots/.config/emacs/old/lisp/consult-mu/extras/consult-mu-contacts-embark.el
@@ -1,112 +0,0 @@
-;;; consult-mu-contacts-embark.el --- Emabrk Actions for consult-mu-contacts -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021-2023
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-
-;;; Code:
-
-;;; Requirements
-
-(require 'embark)
-(require 'consult-mu)
-(require 'consult-mu-embark)
-
-(defun consult-mu-contacts-embark-insert-email (cand)
-  "Embark function for inserting CAND's email."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (email (plist-get contact :email)))
-    (insert (concat email "; "))))
-
-(defun consult-mu-contacts-embark-kill-email (cand)
-  "Embark function for copying CAND's email."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (email (plist-get contact :email)))
-    (kill-new email)))
-
-(defun consult-mu-contacts-embark-get-alternative (cand)
-  "Embark function for copying CAND's email."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (name (string-trim (plist-get contact :name)))
-         (email (plist-get contact :email))
-         (user (string-trim (replace-regexp-in-string "@.*" "" email))))
-    (consult-mu-contacts (cond
-                          ((not (string-empty-p name))
-                           name)
-                          ((not (string-empty-p user))
-                           user)
-                          ((t ""))))))
-
-(defun consult-mu-contacts-embark-compose (cand)
-  "Embark function for composing an email to CAND."
-  (let* ((contact (get-text-property 0 :contact cand)))
-    (consult-mu-contacts--compose-to contact)))
-
-(defun consult-mu-contacts-embark-search-messages (cand)
-  "Embark function for searching messages from CAND using `consult-mu'."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (email (plist-get contact :email)))
-    (consult-mu (concat "from:" email))))
-
-(defun consult-mu-contacts-embark-default-action (cand)
-  "Run `consult-mu-contacts-action' on CAND."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (query (get-text-property 0 :query cand))
-         (newcand (cons cand `(:contact ,contact :query ,query))))
-    (funcall #'consult-mu-contacts--insert-email-action newcand)))
-
-;;; Define Embark Keymaps
-(defvar-keymap consult-mu-embark-contacts-actions-map
-  :doc "Keymap for consult-mu-embark-contacts"
-  :parent consult-mu-embark-general-actions-map
-  "c" #'consult-mu-contacts-embark-compose
-  "s" #'consult-mu-contacts-embark-search-messages
-  "i" #'consult-mu-contacts-embark-insert-email
-  "w" #'consult-mu-contacts-embark-kill-email
-  "a" #'consult-mu-contacts-embark-get-alternative)
-
-
-(add-to-list 'embark-keymap-alist '(consult-mu-contacts . consult-mu-embark-contacts-actions-map))
-
-;; change the default action on `consult-mu-contacts category.
-(add-to-list 'embark-default-action-overrides '(consult-mu-contacts . consult-mu-contacts-embark-default-action))
-
-;;; Provide `consult-mu-contacts-embark' module
-
-(provide 'consult-mu-contacts-embark)
-
-;;; consult-mu-contacts-embark.el ends here
dots/.config/emacs/old/lisp/consult-mu/extras/consult-mu-contacts.el
@@ -1,451 +0,0 @@
-;;; consult-mu-contacts.el --- Consult Mu4e asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2023 Armin Darvish
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-
-;;; Code:
-
-(require 'consult-mu)
-
-;;; Customization Variables
-
-(defcustom consult-mu-contacts-group-by :name
-  "What field to use to group the results in the minibuffer?
-
-By default it is set to :name, but can be any of:
-
-  :name    group by contact name
-  :email   group by email of the contact
-  :domain  group by the domain of the contact's email
-           \(e.g. domain.com in user@domain.com\)
-  :user    group by the ncontact's user name
-           \(e.g. user in user@domain.com\)"
-  :group 'consult-mu
-  :type '(radio (const :name)
-                (const :email)
-                (const :domain)
-                (const :user)))
-
-(defcustom consult-mu-contacts-action #'consult-mu-contacts--list-messages-action
-  "Which function to use when selecting a contact?
-
-By default it is bound to
-`consult-mu-contacts--list-messages-action'."
-  :group 'consult-mu
-  :type '(choice (function :tag "(Default) Show Messages from Contact" #'consult-mu-contacts--list-messages-action)
-                 (function :tag "Insert Email" #'consult-mu-contacts--insert-email-action)
-                 (function :tag "Copy Email to Kill Ring" #'consult-mu-contacts--copy-email-action)
-                 (function :tag "Custom Function")))
-
-(defcustom consult-mu-contacts-ignore-list (list)
-  "List of Regexps to ignore when searching contacts.
-
-This is useful to filter certain addreses from contacts.  For example, you
-can remove no-reply adresses by setting this variable to
-\='((“no-reply@example.com”))."
-  :group 'consult-mu
-  :type '(repeat :tag "Regexp List" regexp))
-
-(defcustom consult-mu-contacts-ignore-case-fold-search case-fold-search
-  "Whether to ignore case when matching against ignore-list?
-
-When non-nil, `consult-mu-contacts' performs case *insensitive* match with
-`consult-mu-contacts-ignore-list' and removes matches from candidates.
-
-By default it is inherited from `case-fold-search'."
-  :group 'consult-mu
-  :type 'boolean)
-
-;;; Other Variables
-
-(defvar consult-mu-contacts-category 'consult-mu-contacts
-  "Category symbol for contacts in `consult-mu' package.")
-
-(defvar consult-mu-contacts--override-group nil
-  "Override grouping in `consult-mu-contacs' based on user input.")
-
-(defvar consult-mu-contacts--history nil
-  "History variable for `consult-mu-contacts'.")
-
-(defun consult-mu-contacts--list-messages (contact)
-  "List messages from CONTACT using `consult-mu'."
-  (let* ((consult-mu-maxnum nil)
-         (email (plist-get contact :email)))
-    (consult-mu (format "contact:%s" email))))
-
-(defun consult-mu-contacts--list-messages-action (cand)
-  "Search the messages from contact candidate, CAND.
-
-This is a wrapper function around `consult-mu-contacts--list-messages'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--list-messages'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to
-\=#'consult-mu-contacts--list-messages-action."
-
-
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--list-messages contact)))
-
-(defun consult-mu-contacts--insert-email (contact)
-  "Insert email of CONTACT at point.
-
-This is useful for inserting email when composing an email to contact."
-  (let* ((email (plist-get contact :email)))
-    (insert (concat email "; "))))
-
-(defun consult-mu-contacts--insert-email-action (cand)
-  "Insert the email from contact candidate, CAND.
-
-This is a wrapper function around `consult-mu-contacts--insert-email'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--insert-email'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to
-\=#'consult-mu-contacts--insert-email-action."
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--insert-email contact)))
-
-(defun consult-mu-contacts--copy-email (contact)
-  "Copy email of CONTACT to kill ring."
-  (let* ((email (plist-get contact :email)))
-      (kill-new email)))
-
-(defun consult-mu-contacts--copy-email-action (cand)
-  "Copy the email from contact candidate, CAND, to kill ring.
-
-This is a wrapper function around `consult-mu-contacts--copy-email'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--copy-email'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to
-\=#'consult-mu-contacts--copy-email-action."
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--copy-email contact)))
-
-(defun consult-mu-contacts--compose-to (contact)
-  "Compose an email to CONTACT using `mu4e-compose-new'."
-  (let* ((email (plist-get contact :email)))
-         (mu4e-compose-new email)))
-
-(defun consult-mu-contacts--compose-to-action (cand)
-  "Open a new buffer to compose a message to contact candidate, CAND.
-
-This is a wrapper function around `consult-mu-contacts--compose-to'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--compose-to'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to \=#'consult-mu-contacts--compose-to-action."
-
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--compose-to contact)))
-
-(defun consult-mu-contacts--format-candidate (string input highlight)
-  "Format minibuffer candidates for `consult-mu-contacts'.
-
-STRING is the output retrieved from “mu cfind INPUT ...” in the command
-line.
-
-INPUT is the query from the user.
-
-If HIGHLIGHT is non-nil, input is highlighted with
-`consult-mu-highlight-match-face' in the minibuffer."
-  (let* ((query input)
-         (email (consult-mu--message-extract-email-from-string string))
-         (name (string-trim (replace-regexp-in-string email "" string nil t nil nil)))
-         (contact (list :name name :email email))
-         (match-str (if (stringp input) (consult--split-escaped (car (consult--command-split query))) nil))
-         (str (format "%s\s\s%s"
-                      (propertize (consult-mu--set-string-width email (floor (* (frame-width) 0.55))) 'face 'consult-mu-sender-face)
-                      (propertize name 'face 'consult-mu-subject-face)))
-         (str (propertize str :contact contact :query query)))
-    (if (and consult-mu-highlight-matches highlight)
-        (cond
-         ((listp match-str)
-          (mapc (lambda (match) (setq str (consult-mu--highlight-match match str t))) match-str))
-         ((stringp match-str)
-          (setq str (consult-mu--highlight-match match-str str t))))
-      str)
-    (cons str (list :contact contact :query query))))
-
-(defun consult-mu-contacts--add-history ()
-  "Get list of emails in the current buffer.
-
-This is used to add the emails in the current buffer to history."
-  (let ((add (list)))
-    (pcase major-mode
-      ((or mu4e-view-mode mu4e-compose-mode org-msg-edit-mode message-mode)
-       (mapcar (lambda (item)
-                 (concat "#" (consult-mu--message-extract-email-from-string item)))
-               (append add
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "from"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "to"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "cc"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "bcc"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "reply-to")))))
-      (_ (list)))))
-
-(defun consult-mu-contacts--group-name (cand)
-  "Get the group name of CAND using `consult-mu-contacts-group-by'.
-
-See `consult-mu-contacts-group-by' for details of grouping options."
-(let* ((contact (get-text-property 0 :contact cand))
-       (email (plist-get contact :email))
-       (name (plist-get contact :name))
-       (_ (string-match "\\(?1:[a-zA-Z0-9\_\.\+\-]+\\)@\\(?2:[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+\\)" email))
-       (user (match-string 1 email))
-       (domain (match-string 2 email))
-       (group (or consult-mu-contacts--override-group consult-mu-contacts-group-by))
-      (field (if (not (keywordp group)) (intern (concat ":" (format "%s" group))) group)))
-      (pcase field
-        (:email email)
-        (:name (if (string-empty-p name) "n/a" name))
-        (:domain domain)
-        (:user user)
-        (_ nil))))
-
-(defun consult-mu-contacts--group (cand transform)
-"Group function for `consult-mu-contacts' candidates.
-
-CAND `consult-mu-contacts--group-name' to get the group name for contact.
-When TRANSFORM is non-nil, the name of the candiate is used as group title."
-  (when-let ((name (consult-mu-contacts--group-name cand)))
-    (if transform (substring cand) name)))
-
-(defun consult-mu-contacs--lookup ()
-  "Lookup function for `consult-mu-contacs' minibuffer candidates.
-
-This is passed as LOOKUP to `consult--read' on candidates and is used to
-format the output when a candidate is selected."
-  (lambda (sel cands &rest args)
-    (let* ((info (cdr (assoc sel cands)))
-           (contact  (plist-get info :contact))
-           (name (plist-get contact :name))
-           (email (plist-get contact :email)))
-      (cons (or name email) info))))
-
-(defun consult-mu-contatcs--predicate (cand)
-  "Predicate function for `consult-mu-contacs' candidate, CAND.
-
-This is passed as Predicate to `consult--read' on candidates and is used to
-remove contacts matching `consult-mu-contacts-ignore-list' from the list of
-candidtaes.
-
-Note that `consult-mu-contacts-ignore-case-fold-search' is used to define
-case (in)sensitivity as well."
-
-  (let* ((contact (plist-get (cdr cand) :contact))
-         (email (plist-get contact :email))
-         (name (plist-get contact :name))
-         (case-fold-search consult-mu-contacts-ignore-case-fold-search))
-    (if (seq-empty-p (seq-filter (lambda (reg) (or (string-match-p reg email)
-                                                   (string-match-p reg name)))
-                                 consult-mu-contacts-ignore-list))
-        t
-      nil)))
-
-(defun consult-mu-contacts--state ()
-  "State function for `consult-mu-contacts' candidates.
-
-This is passed as STATE to `consult--read' and is used to preview or do
-other actions on the candidate."
-  (lambda (action cand)
-    (let ((preview (consult--buffer-preview)))
-      (pcase action
-        ('preview)
-        ('return
-         (save-mark-and-excursion
-           (consult-mu--execute-all-marks))
-         (setq consult-mu-contacts--override-group nil)
-         cand)))))
-
-(defun consult-mu-contacts--transform (input)
-  "Add annotation to minibuffer candiates for `consult-mu-contacts'.
-
-Format each candidates with `consult-gh--repo-format' and INPUT."
-  (lambda (cands)
-    (cl-loop for cand in cands
-             collect
-             (consult-mu-contacts--format-candidate cand input t))))
-
-(defun consult-mu-contacts--builder (input)
-  "Build mu command line for searching contacts by INPUT."
-  (pcase-let* ((consult-mu-args (append consult-mu-args '("cfind")))
-               (cmd (consult--build-args consult-mu-args))
-               (`(,arg . ,opts) (consult--command-split input))
-               (flags (append cmd opts)))
-    (unless (or (member "-n" flags) (member "--maxnum" flags))
-      (if (and consult-mu-maxnum (> consult-mu-maxnum 0))
-          (setq opts (append opts (list "--maxnum" (format "%s" consult-mu-maxnum))))))
-    (if (or (member "-g" opts)  (member "--group" opts))
-        (cond
-         ((member "-g" opts)
-          (setq consult-mu-contacts--override-group (ignore-errors (intern (nth (+ (cl-position "-g" opts :test 'equal) 1) opts))))
-          (setq opts (remove "-g" (remove (ignore-errors (nth (+ (cl-position "-g" opts :test 'equal) 1) opts)) opts))))
-         ((member "--group" opts)
-          (setq consult-mu-contacts--override-group (ignore-errors (intern (nth (+ (cl-position "--group" opts :test 'equal) 1) opts))))
-          (setq opts (remove "--group" (remove (ignore-errors (nth (+ (cl-position "--group" opts :test 'equal) 1) opts)) opts)))))
-      (setq consult-mu-contacts--override-group nil))
-    (pcase-let* ((`(,re . ,hl) (funcall consult--regexp-compiler arg 'pcre t)))
-      (when re
-        (cons (append cmd
-                      (list (string-join re " "))
-                      opts)
-              hl)))))
-
-(defun consult-mu-contacts--async (prompt builder &optional initial)
-  "Query mu4e contacts asynchronously.
-
-This is a non-interactive internal function.  For the interactive version
-see `consult-mu-contacts'.
-
-It runs the command line from `consult-mu-contacts--builder' in an async
-process and returns the results \(list of contacts\) as a completion table
-in minibuffer that will be passed to `consult--read'.  The completion table
-gets dynamically updated as the user types in the minibuffer.  Each
-candidate in the minibuffer is formatted by
-`consult-mu-contacts--transform' to add annotation and other info to the
-candidate.
-
-Description of Arguments:
-  PROMPT  the prompt in the minibuffer.
-          \(passed as PROMPT to `consult--red'\)
-  BUILDER an async builder function passed to `consult--async-command'.
-  INITIAL an optional arg for the initial input in the minibuffer.
-          \(passed as INITITAL to `consult--read'\)
-
-commandline arguments/options \(run “mu cfind --help” in the command line
-for details\) can be passed to the minibuffer input similar to
-`consult-grep'.  For example the user can enter:
-
-“#john -- --maxnum 10”
-
-This will search for contacts with the query “john”, and retrives a maximum
-of 10 contacts.
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#john -- --maxnum 10#@gmail”
-
-Will retrieve the message as the example above, then narrows down the
-completion table to candidates that match “@gmail”."
-  (consult--read
-   (consult--process-collection builder
-     :transform (consult--async-transform-by-input #'consult-mu-contacts--transform))
-   :prompt prompt
-   :lookup (consult-mu-contacs--lookup)
-   :state (funcall #'consult-mu-contacts--state)
-   :initial initial
-   :group #'consult-mu-contacts--group
-   :add-history (consult-mu-contacts--add-history)
-   :history '(:input consult-mu-contacts--history)
-   :category 'consult-mu-contacts
-   :preview-key consult-mu-preview-key
-   :predicate #'consult-mu-contatcs--predicate
-   :sort t))
-
-(defun consult-mu-contacts (&optional initial noaction)
-    "List results of “mu cfind” asynchronously.
-
-This is an interactive wrapper function around
-`consult-mu-contacts--async'.  It queries the user for a search term in the
-minibuffer, then fetches a list of contacts for the entered search term as
-a minibuffer completion table for selection.  The list of candidates in the
-completion table are dynamically updated as the user changes the entry.
-
-INITIAL is an optional arg for the initial input in the minibuffer \(passed
-as INITITAL to `consult-mu-contacts--async'\).
-
-Upon selection of a candidate either
- - the candidate is returned if NOACTION is non-nil
- or
- - the candidate is passed to `consult-mu-contacts-action' if NOACTION is
-   nil.
-
-Additional commandline arguments can be passed in the minibuffer entry by
-typing “--” followed by command line arguments.
-
-For example the user can enter:
-
-“#john doe -- -n 10”
-
-This will run a contact search with the query “john doe” and changes the
-search limit to 10.
-
-Also, the results can further be narrowed by `consult-async-split-style'
-\(e.g. by entering “#” when `consult-async-split-style' is set to \='perl\).
-
-
-For example:
-
-“#john doe -- -n 10#@gmail”
-
-will retrieve the message as the example above, then narrows down to the
-candidates that match “@gmail”.
-
-For more details on consult--async functionalities, see `consult-grep' and
-the official manual of consult, here: https://github.com/minad/consult."
-  (interactive)
-  (save-mark-and-excursion
-  (consult-mu--execute-all-marks))
-  (let* ((sel
-        (consult-mu-contacts--async (concat "[" (propertize "consult-mu-contacts" 'face 'consult-mu-sender-face) "]" " Search Contacts:  ") #'consult-mu-contacts--builder initial)))
-    (save-mark-and-excursion
-      (consult-mu--execute-all-marks))
-    (if noaction
-        sel
-      (progn
-        (funcall consult-mu-contacts-action sel)
-        sel))))
-
-;;; provide `consult-mu-contacts' module
-(provide 'consult-mu-contacts)
-
-;;; consult-mu-contacts.el ends here
dots/.config/emacs/old/lisp/consult-mu/.gitignore
@@ -1,15 +0,0 @@
-# Compiled
-*.elc
-
-# Packaging
-.cask
-
-# Backup files
-*~
-
-# Undo-tree save-files
-*.~undo-tree
-
-# test files
-tests.org
-/tests
dots/.config/emacs/old/lisp/consult-mu/consult-mu-embark.el
@@ -1,249 +0,0 @@
-;;; consult-mu-embark.el --- Emabrk Actions for consult-mu -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021-2023
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-;;; Code:
-
-;;; Requirements
-(require 'embark)
-(require 'consult-mu)
-
-;;; Customization Variables
-(defcustom consult-mu-embark-noconfirm-before-execute nil
-  "Should consult-mu-embark skip confirmation when executing marks?"
-  :group 'consult-mu
-  :type 'boolean)
-
-;;; Define Embark Action Functions
-(defun consult-mu-embark-default-action (cand)
-  "Run `consult-mu-action' on the candidate, CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand))
-         (newcand (cons cand `(:msg ,msg :query ,query :type ,type))))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (funcall consult-mu-action newcand)))
-
-
-
-(defun consult-mu-embark-reply (cand)
-  "Reply to message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (consult-mu--reply msg nil)))
-
-(defun consult-mu-embark-wide-reply (cand)
-  "Reply all for message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (consult-mu--reply msg )))
-
-(defun consult-mu-embark-forward (cand)
-  "Forward the message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (consult-mu--forward msg)))
-
-(defun consult-mu-embark-kill-message-field (cand)
-  "Get a header field of message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand))
-         (msg-id (plist-get msg :message-id)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (with-current-buffer consult-mu-headers-buffer-name
-      (unless (equal (mu4e-message-field-at-point :message-id) msg-id)
-        (mu4e-headers-goto-message-id msg-id))
-      (if (equal (mu4e-message-field-at-point :message-id) msg-id)
-          (progn
-            (mu4e~headers-update-handler msg nil nil))))
-
-    (with-current-buffer consult-mu-view-buffer-name
-      (kill-new (consult-mu--message-get-header-field))
-      (consult-mu--pulse-region (point) (line-end-position)))))
-
-(defun consult-mu-embark-save-attachmnts (cand)
-  "Save attachments of CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand))
-         (msg-id (plist-get msg :message-id)))
-
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (unless (equal (mu4e-message-field-at-point :message-id) msg-id)
-        (mu4e-headers-goto-message-id msg-id))
-      (if (equal (mu4e-message-field-at-point :message-id) msg-id)
-          (progn
-            (mu4e~headers-update-handler msg nil nil))))
-
-    (with-current-buffer consult-mu-view-buffer-name
-      (goto-char (point-min))
-      (re-search-forward "^\\(Attachment\\|Attachments\\): " nil t)
-      (consult-mu--pulse-region (point) (line-end-position))
-      (mu4e-view-save-attachments t))))
-
-(defun consult-mu-embark-search-messages-from-contact (cand)
-  "Search messages from the same sender as the message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (from (car (plist-get msg :from)))
-         (email (plist-get from :email)))
-    (consult-mu (concat "from:" email))))
-
-(defun consult-mu-embark-search-messages-with-subject (cand)
-  "Search all messages for the same subject as the message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         ;;(subject (replace-regexp-in-string ":\\|#\\|\\.\\|\\+" "" (plist-get msg :subject)))
-         (subject (replace-regexp-in-string ":\\|#\\|\\.\\|\\+\\|\\(\\[.*\\]\\)" "" (format "%s" (plist-get msg :subject)))))
-    (consult-mu (concat "subject:" subject))))
-
-;; macro for defining functions for marks
-(defmacro consult-mu-embark--defun-mark-for (mark)
-  "Define a function mu4e-view-mark-for- MARK."
-  (let ((funcname (intern (format "consult-mu-embark-mark-for-%s" mark)))
-        (docstring (format "Mark the current message for %s." mark)))
-    `(progn
-       (defun ,funcname (cand) ,docstring
-              (let* ((msg (get-text-property 0 :msg cand))
-                     (msgid (plist-get msg  :message-id))
-                     (query (get-text-property 0 :query cand))
-                     (buf (get-buffer consult-mu-headers-buffer-name)))
-                (if buf
-                    (progn
-                      (with-current-buffer buf
-                        (if (eq major-mode 'mu4e-headers-mode)
-                            (progn
-                              (goto-char (point-min))
-                              (mu4e-headers-goto-message-id msgid)
-                              (if (equal (mu4e-message-field-at-point :message-id) msgid)
-                                  (mu4e-headers-mark-and-next ',mark)
-                                (progn
-                                  (consult-mu--update-headers query t msg :async)
-                                  (with-current-buffer buf
-                                    (goto-char (point-min))
-                                    (mu4e-headers-goto-message-id msgid)
-                                    (if (equal (mu4e-message-field-at-point :message-id) msgid)
-                                        (mu4e-headers-mark-and-next ',mark))))))
-                          (progn
-                            (consult-mu--update-headers query t msg :async)
-                            (with-current-buffer buf
-                              (goto-char (point-min))
-                              (mu4e-headers-goto-message-id msgid)
-                              (if (equal (mu4e-message-field-at-point :message-id) msgid)
-                                  (mu4e-headers-mark-and-next ',mark)))))))))))))
-
-;; add embark functions for marks
-(defun consult-mu-embark--defun-func-for-marks (marks)
-  "Run the macro `consult-mu-embark--defun-mark-for' on MARKS.
-
-MARKS is a list of marks.
-
-This is useful for creating embark functions for all the `mu4e-marks'
-elements."
-  (mapcar (lambda (mark) (eval `(consult-mu-embark--defun-mark-for ,mark))) marks))
-
-;; use consult-mu-embark--defun-func-for-marks to make a function for each `mu4e-marks' element.
-(consult-mu-embark--defun-func-for-marks (mapcar 'car mu4e-marks))
-
-;;; Define Embark Keymaps
-(defvar-keymap consult-mu-embark-general-actions-map
-  :doc "Keymap for consult-mu-embark"
-  :parent embark-general-map)
-
-(add-to-list 'embark-keymap-alist '(consult-mu . consult-mu-embark-general-actions-map))
-
-
-(defvar-keymap consult-mu-embark-messages-actions-map
-  :doc "Keymap for consult-mu-embark-messages"
-  :parent consult-mu-embark-general-actions-map
-  "r" #'consult-mu-embark-reply
-  "w" #'consult-mu-embark-wide-reply
-  "f" #'consult-mu-embark-forward
-  "?" #'consult-mu-embark-kill-message-field
-  "c" #'consult-mu-embark-search-messages-from-contact
-  "s" #'consult-mu-embark-search-messages-with-subject
-  "S" #'consult-mu-embark-save-attachmnts)
-
-(add-to-list 'embark-keymap-alist '(consult-mu-messages . consult-mu-embark-messages-actions-map))
-
-
-;; add mark keys to `consult-mu-embark-messages-actions-map' keymap
-(defun consult-mu-embark--add-keys-for-marks (marks)
-  "Add a key for each mark in MARKS to embark map.
-
-Adds the keys in `consult-mu-embark-messages-actions-map', and binds the
-combination “m key”, where key is the :char in mark plist in the
-`consult-mu-embark-messages-actions-map' to the function defined by the
-prefix “consult-mu-embark-mark-for-” and mark.
-
-This is useful for adding all `mu4e-marks' to embark key bindings under a
-submenu (called by “m”), for example, the default mark-for-archive mark
-that is bound to r in mu4e buffers can be called in embark by “m r”."
-  (mapcar (lambda (mark)
-            (let* ((key (plist-get (cdr mark) :char))
-                   (key (cond ((consp key) (car key)) ((stringp key) key)))
-                   (func (intern (concat "consult-mu-embark-mark-for-" (format "%s" (car mark)))))
-                   (key (concat "m" key)))
-              (define-key consult-mu-embark-messages-actions-map key func)))
-          marks))
-
-;; add all `mu4e-marks to embark keybindings. See `consult-mu-embark--add-keys-for-marks' above for more details
-(consult-mu-embark--add-keys-for-marks mu4e-marks)
-
-;; change the default action on `consult-mu-messages' category.
-(add-to-list 'embark-default-action-overrides '(consult-mu-messages . consult-mu-embark-default-action))
-
-
-;;; Provide `consult-mu-embark' module
-
-(provide 'consult-mu-embark)
-
-;;; consult-mu-embark.el ends here
dots/.config/emacs/old/lisp/consult-mu/consult-mu.el
@@ -1,1673 +0,0 @@
-;;; consult-mu.el --- Consult Mu4e asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2023 Armin Darvish
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-;;; Code:
-
-;;; Requirements
-(require 'consult)
-(require 'mu4e)
-
-;;; Group
-
-(defgroup consult-mu nil
-  "Options for `consult-mu'."
-  :group 'convenience
-  :group 'minibuffer
-  :group 'consult
-  :group 'mu4e
-  :prefix "consult-mu-")
-
-;;; Customization Variables
-
-(defcustom consult-mu-args '("mu")
-  "Command line arguments to call `mu` asynchronously.
-
-The dynamically computed arguments are appended.
-Can be either a string, or a list of strings or expressions."
-  :group 'consult-mu
-  :type '(choice string (repeat (choice string sexp))))
-
-(defcustom consult-mu-maxnum mu4e-search-results-limit
-  "Maximum number of results.
-
-This is normally passed to “--maxnum” in the command line or is defined by
-`mu4e-search-results-limit'.  By default inherits from
-`mu4e-search-results-limit'."
-  :group 'consult-mu
-  :type '(choice (const :tag "Unlimited" -1)
-                 (integer :tag "Limit")))
-
-(defcustom consult-mu-search-sort-field mu4e-search-sort-field
-  "What field to sort results by?
-
-By defualt inherits from `mu4e-search-sort-field'."
-  :group 'consult-mu
-  :type '(radio (const :tag "Date" :date)
-                (const :tag "Subject" :subject)
-                (const :tag "File Size" :size)
-                (const :tag "Priority" :prio)
-                (const :tag "From (Sender)" :from)
-                (const :tag "To (Recipients)" :to)
-                (const :tag "Mailing List" :list)))
-
-(defcustom consult-mu-headers-fields mu4e-headers-fields
-  "A list of header fields to show in the headers buffer.
-
-By default inherits from `mu4e-headers-field'.
-
-From mu4e docs:
-
-Each element has the form (HEADER . WIDTH), where HEADER is one of
-the available headers (see `mu4e-header-info') and WIDTH is the
-respective width in characters.
-
-A width of nil means “unrestricted”, and this is best reserved
-for the rightmost \(last\) field.  Note that Emacs may become very
-slow with excessively long lines \(1000s of characters\), so if you
-regularly get such messages, you want to avoid fields with nil
-altogether."
-  :group 'consult-mu
-  :type `(repeat (cons (choice ,@(mapcar (lambda (h)
-                                           (list 'const
-                                                 :tag (plist-get (cdr h) :help)
-                                                 (car h)))
-                                         mu4e-header-info))
-                       (choice (integer :tag "width")
-                               (const :tag "unrestricted width" nil)))))
-
-(defcustom consult-mu-headers-template nil
-  "A template string to make custom header formats.
-
-If non-nil, `consult-mu' uses this string to format the headers instead of
-`consult-mu-headers-field'.
-
-The string should be of the format “%[char][integer]%[char][integer]...”,
-and allow dynamic insertion of the content.  Each “%[char][integer]“ chunk
-represents a different field and the integer defines the length of the
-field.
-
-The list of available fields are:
-
-  %f  sender(s) \(e.g. from: field of email\)
-  %t  receivers(s) \(i.e. to: field of email\)
-  %s  subject \(i.e. title of email\)
-  %d  date \(i.e. the date email was sent/received\)
-  %p  priority
-  %z  size
-  %i  message-id \(as defined by mu\)
-  %g  flags \(as defined by mu\)
-  %G  pretty flags \(this uses `mu4e~headers-flags-str' to pretify flags\)
-  %x  tags \(as defined by mu\)
-  %c  cc \(i.e. cc: field of the email\)
-  %h  bcc \(i.e. bcc: field of the email\)
-  %r  date chaged \(as defined by :changed in mu4e\)
-
-For exmaple, “%d15%s50” means 15 characters for date and 50 charcters for
-subject, and “%d13%s37%f17” would make a header containing 13 characters
-for Date, 37 characters for Subject, and 20 characters for From field,
-making a header that looks like this:
-
-Thu 09 Nov 23  Title of the Email Limited to 50 Char...  example@domain..."
-  :group 'consult-mu
-  :type '(choice (const :tag "Fromatted String" :format "%{%%d13%%s50%%f17%}")
-                 (function :tag "Custom Function")))
-
-(defcustom consult-mu-search-sort-direction mu4e-search-sort-direction
-  "Direction to sort by a symbol.
-
-By defualt inherits from `mu4e-search-sort-direction', and can either be
-\='descending (sorting  Z->A) or \='ascending (sorting A->Z)."
-
-  :group 'consult-mu
-  :type '(radio (const ascending)
-                (const descending)))
-
-
-(defcustom consult-mu-search-threads mu4e-search-threads
-  "Whether to calculate threads for search results.
-
-By defualt inherits from `mu4e-search-threads'.
-
-Note that per mu4e docs:
-When threading is enabled, the headers are exclusively sorted
-chronologically (:date) by the newest message in the thread."
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-group-by nil
-  "What field to use to group the results in the minibuffer.
-
-By default it is set to :date, but can be any of:
-
-  :subject      group by subject
-  :from         group by the name/email the sender(s)
-  :to           group by name/email of the reciver(s)
-  :date         group by date
-  :time         group by the time of email \(i.e. hour, minute, seconds\)
-  :datetime     group by date and time of the email
-  :year         group by the year of the email \(i.e. 2023, 2022, ...\)
-  :month        group by the month of the email \(i.e. Jan, Feb, ..., Dec\)
-  :week         group by the week number of the email
-                \(i.e. 1st week, 2nd week, ... 52nd week\)
-  :day-of-week  group by the day email was sent (i.e. Mondays, Tuesdays, ...)
-  :day          group by the day email was sent (similar to :day-of-week)
-  :size         group by the file size of the email
-  :flags        group by flags (as defined by mu)
-  :tags         group by tags (as defined by mu)
-  :changed      group by the date changed
-                \(as defined by :changed field in mu4e\)"
-  :group 'consult-mu
-  :type '(radio (const :date)
-                (const :subject)
-                (const :from)
-                (const :to)
-                (const :time)
-                (const :datetime)
-                (const :year)
-                (const :month)
-                (const :week)
-                (const :day-of-week)
-                (const :day)
-                (const :size)
-                (const :flags)
-                (const :tags)
-                (const :changed)
-                (const nil)))
-
-(defcustom consult-mu-mark-previewed-as-read nil
-  "Whether to mark PREVIEWED emails as read or not?"
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-mark-viewed-as-read t
-  "Whether to mark VIEWED emails as read or not?"
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-headers-buffer-name "*consult-mu-headers*"
-  "Default name for HEADERS buffer explicitly for `consult-mu'.
-
-For more info see `mu4e-headers-buffer-name'."
-  :group 'consult-mu
-  :type 'string)
-
-(defcustom consult-mu-view-buffer-name "*consult-mu-view*"
-  "Default name for VIEW buffer explicitly for `consult-mu'.
-
-For more info see `mu4e-view-buffer-name'."
-  :group 'consult-mu
-  :type 'string)
-
-(defcustom consult-mu-preview-key consult-preview-key
-  "Preview key for `consult-mu'.
-
-This is similar to `consult-preview-key' but explicitly for `consult-mu'."
-  :group 'consult-mu
-  :type '(choice (symbol :tag "Any key" 'any)
-                 (list :tag "Debounced"
-                       (const :debounce)
-                       (float :tag "Seconds" 0.1)
-                       (const any))
-                 (const :tag "No preview" nil)
-                 (key :tag "Key")
-                 (repeat :tag "List of keys" key)))
-
-
-(defcustom consult-mu-highlight-matches t
-  "Should `consult-mu' highlight search queries in preview buffers?"
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-use-wide-reply 'ask
-  "Reply to all or not?
-
-This defines whether `consult-mu--reply-action' should reply to all or not."
-  :group 'consult-mu
-  :type '(choice (symbol :tag "Ask for confirmation" 'ask)
-                 (const :tag "Do not reply to all" nil)
-                 (const :tag "Always reply to all" t)))
-
-(defcustom consult-mu-action #'consult-mu--view-action
-  "The function that is used when selecting a message.
-By default it is bound to `consult-mu--view-action'."
-  :group 'consult-mu
-  :type '(choice (function :tag "(Default) View Message in Mu4e Buffers" consult-mu--view-action)
-                 (function :tag "Reply to Message" consult-mu--reply-action)
-                 (function :tag "Forward Message" consult-mu--forward-action)
-                 (function :tag "Custom Function")))
-
-(defcustom consult-mu-default-command #'consult-mu-dynamic
-  "Which command should `consult-mu' call."
-  :group 'consult-mu
-  :type '(choice (function :tag "(Default) Use Dynamic Collection (i.e. `consult-mu-dynamic')" #'consult-mu-dynamic)
-                 (function :tag "Use Async Collection (i.e. `consult-mu-async')"  #'consult-mu-async)
-                 (function :tag "Custom Function")))
-
-;;; Other Variables
-(defvar consult-mu-category 'consult-mu
-  "Category symbol for the `consult-mu' package.")
-
-(defvar consult-mu-messages-category 'consult-mu-messages
-  "Category symbol for messages in `consult-mu' package.")
-
-(defvar consult-mu--view-buffers-list (list)
-  "List of currently open preview buffers for `consult-mu'.")
-
-(defvar consult-mu--history nil
-  "History variable for `consult-mu'.")
-
-(defvar consult-mu-delimiter "      "
-  "Delimiter to use for fields in mu command output.
-
-The idea is Taken from  https://github.com/seanfarley/counsel-mu.")
-
-(defvar consult-mu-saved-searches-dynamic (list)
-  "List of Favorite searches for `consult-mu-dynamic'.")
-
-(defvar consult-mu-saved-searches-async consult-mu-saved-searches-dynamic
-  "List of Favorite searches for `consult-mu-async'.")
-
-(defvar consult-mu--override-group nil
-  "Override grouping in `consult-mu' based on user input.")
-
-(defvar consult-mu--mail-headers '("Subject" "From" "To" "From/To" "Cc" "Bcc" "Reply-To" "Date" "Attachments" "Tags" "Flags" "Maildir" "Summary" "List" "Path" "Size" "Message-Id" "List-Id" "Changed")
-  "List of possible headers in a message.")
-
-;;; Faces
-
-(defface consult-mu-highlight-match-face
-  `((t :inherit 'consult-highlight-match))
-  "Highlight match face in `consult-mu' view buffer.
-
-By default inherits from `consult-highlight-match'.
-This is used to highlight matches of search queries in the minibufffer
-completion list.")
-
-(defface consult-mu-preview-match-face
-  `((t :inherit 'consult-preview-match))
-  "Preview match face in `consult-mu' preview buffers.
-
-By default inherits from `consult-preview-match'.
-This is used to highlight matches of search query terms in preview buffers
-\(i.e. `consult-mu-view-buffer-name'\).")
-
-(defface consult-mu-default-face
-  `((t :inherit 'default))
-  "Default face in `consult-mu' minibuffer annotations.
-
-By default inherits from `default' face.")
-
-(defface consult-mu-subject-face
-  `((t :inherit 'font-lock-keyword-face))
-  "Subject face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-keyword-face'.")
-
-(defface consult-mu-sender-face
-  `((t :inherit 'font-lock-variable-name-face))
-  "Contact face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-variable-name-face'.")
-
-(defface consult-mu-receiver-face
-  `((t :inherit 'font-lock-variable-name-face))
-  "Contact face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-variable-name-face'.")
-
-(defface consult-mu-date-face
-  `((t :inherit 'font-lock-preprocessor-face))
-  "Date face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-preprocessor-face'.")
-
-(defface consult-mu-count-face
-  `((t :inherit 'font-lock-string-face))
-  "Count face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-string-face'.")
-
-(defface consult-mu-size-face
-  `((t :inherit 'font-lock-string-face))
-  "Size face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-string-face'.")
-
-(defface consult-mu-tags-face
-  `((t :inherit 'font-lock-comment-face))
-  "Tags/Comments face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-comment-face'.")
-
-(defface consult-mu-flags-face
-  `((t :inherit 'font-lock-function-call-face))
-  "Flags face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-function-call-face'.")
-
-(defface consult-mu-url-face
-  `((t :inherit 'link))
-  "URL face in `consult-mu' minibuffer annotations;
-
-By default inherits from `link'.")
-
-(defun consult-mu--pulse-regexp (regexp)
-  "Find and pulse REGEXP."
-  (goto-char (point-min))
-  (while (re-search-forward regexp nil t)
-    (when-let* ((m (match-data))
-                (beg (car m))
-                (end (cadr m))
-                (ov (make-overlay beg end))
-                (pulse-delay 0.075))
-      (pulse-momentary-highlight-overlay ov 'highlight))))
-
-(defun consult-mu--pulse-region (beg end)
-  "Find and pulse region from BEG to END."
-  (let ((ov (make-overlay beg end))
-        (pulse-delay 0.075))
-    (pulse-momentary-highlight-overlay ov 'highlight)))
-
-(defun consult-mu--pulse-line ()
-  "Pulse line at point momentarily."
-  (let* ((pulse-delay 0.055)
-         (ov (make-overlay (car (bounds-of-thing-at-point 'line))
-                           (cdr (bounds-of-thing-at-point 'line)))))
-    (pulse-momentary-highlight-overlay ov 'highlight)))
-
-(defun consult-mu--set-string-width (string width &optional prepend)
-  "Set the STRING width to a fixed value, WIDTH.
-
-If the STRING is longer than WIDTH, it truncates the string and adds
-ellipsis, “...”.  If the string is shorter, it adds whitespace to the
-string.  If PREPEND is non-nil, it truncates or adds whitespace from the
-beginning of string, instead of the end."
-  (let* ((string (format "%s" string))
-         (w (string-width string)))
-    (when (< w width)
-      (if prepend
-          (setq string (format "%s%s" (make-string (- width w) ?\s) (substring string)))
-        (setq string (format "%s%s" (substring string) (make-string (- width w) ?\s)))))
-    (when (> w width)
-      (if prepend
-          (setq string (format "...%s" (substring string (- w (- width 3)) w)))
-        (setq string (format "%s..." (substring string 0 (- width (+ w 3)))))))
-    string))
-
-(defun consult-mu--justify-left (string prefix maxwidth)
-  "Set the width of  STRING+PREFIX justified from left.
-
-Use `consult-mu--set-string-width' to the width of the concatenate of
-STRING+PREFIX \(e.g. “(concat prefix string)”\) within MAXWIDTH.  This is
-used for aligning marginalia info in the minibuffer."
-  (let ((w (string-width prefix)))
-    (if (> maxwidth w)
-        (consult-mu--set-string-width string (- maxwidth w) t)
-      string)))
-
-(defun consult-mu--highlight-match (regexp str ignore-case)
-  "Highlight REGEXP in STR.
-
-If a REGEXP contains a capturing group, only the captured group is
-highlighted, otherwise, the whole match is highlighted.
-Case is ignored if IGNORE-CASE is non-nil.
-\(This is adapted from `consult--highlight-regexps'.\)"
-  (let ((i 0))
-    (while (and (let ((case-fold-search ignore-case))
-                  (string-match regexp str i))
-                (> (match-end 0) i))
-      (let ((m (match-data)))
-        (setq i (cadr m)
-              m (or (cddr m) m))
-        (while m
-          (when (car m)
-            (add-face-text-property (car m) (cadr m)
-                                    'consult-mu-highlight-match-face nil str))
-          (setq m (cddr m))))))
-  str)
-
-(defun consult-mu--overlay-match (match-str buffer ignore-case)
-  "Highlight MATCH-STR in BUFFER using an overlay.
-
-If IGNORE-CASE is non-nil, it uses case-insensitive match.
-
-This is used to highlight matches to use queries when viewing emails.  See
-`consult-mu-overlays-toggle' for toggling highligths on/off."
-  (with-current-buffer (or (get-buffer buffer) (current-buffer))
-    (remove-overlays (point-min) (point-max) 'consult-mu-overlay t)
-    (goto-char (point-min))
-    (let ((case-fold-search ignore-case))
-      (while (search-forward match-str nil t)
-        (when-let* ((m (match-data))
-                    (beg (car m))
-                    (end (cadr m))
-                    (overlay (make-overlay beg end)))
-          (overlay-put overlay 'consult-mu-overlay t)
-          (overlay-put overlay 'face 'consult-mu-highlight-match-face))))))
-
-(defun consult-mu-overlays-toggle (&optional buffer)
-  "Toggle overlay highlight in BUFFER.
-
-BUFFER defaults to `current-buffer'."
-  (interactive)
-  (let ((buffer (or buffer (current-buffer))))
-    (with-current-buffer buffer
-      (dolist (o (overlays-in (point-min) (point-max)))
-        (when (overlay-get o 'consult-mu-overlay)
-          (if (and (overlay-get o 'face) (eq (overlay-get o 'face) 'consult-mu-highlight-match-face))
-              (overlay-put o 'face nil)
-            (overlay-put o 'face 'consult-mu-highlight-match-face)))))))
-
-(defun consult-mu--format-date (string)
-  "Format the date STRING from mu output.
-
-STRING is the output form a mu command, for example:
-`mu find query --fields d`
-Returns the date in the format Day-of-Week Month Day Year Time
-\(e.g. Sat Nov 04 2023 09:46:54\)"
-  (let ((string (replace-regexp-in-string " " "0" string)))
-    (format "%s %s %s"
-            (substring string 0 10)
-            (substring string -4 nil)
-            (substring string 11 -4))))
-
-(defun consult-mu-flags-to-string (FLAG)
-  "Covert FLAGS, from mu output to strings.
-
-FLAG is the output form mu command in the terminal, for example:
- `mu find query --fields g`.
-This function converts each character in FLAG to an expanded string of the
-flag and returns the list of these strings."
-  (cl-loop for c across FLAG
-           collect
-           (pcase (string c)
-             ("D" 'draft)
-             ("F" 'flagged)
-             ("N" 'new)
-             ("P" 'forwarded)
-             ("R" 'replied)
-             ("S" 'read)
-             ("T" 'trashed)
-             ("a" 'attachment)
-             ("x" 'encrrypted)
-             ("s" 'signed)
-             ("u" 'unread)
-             ("l" 'list)
-             ("q" 'personal)
-             ("c" 'calendar)
-             (_ nil))))
-
-(defun consult-mu--message-extract-email-from-string (string)
-  "Find and return the first email address in the STRING."
-  (when (stringp string)
-    (string-match "[a-zA-Z0-9\_\.\+\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+" string)
-    (match-string 0 string)))
-
-(defun consult-mu--message-emails-string-to-list (string)
-  "Convert comma-separated STRING of email addresses to a list."
-  (when (stringp string)
-    (remove '(" " "\s" "\t")
-            (mapcar #'consult-mu--message-extract-email-from-string
-                    (split-string string ",\\|;\\|\t" t)))))
-
-(defun consult-mu--message-get-header-field (&optional field)
-  "Retrive FIELD header from the message/mail in the current buffer."
-  (save-match-data
-    (save-excursion
-      (when (or (derived-mode-p 'message-mode)
-                (derived-mode-p 'mu4e-view-mode)
-                (derived-mode-p 'org-msg-edit-mode)
-                (derived-mode-p 'mu4e-compose-mode))
-        (let* ((case-fold-search t)
-               (header-regexp (mapconcat (lambda (str) (concat "\n" str ": "))
-                                        consult-mu--mail-headers "\\|"))
-               (field (or (downcase field)
-                          (downcase (consult--read consult-mu--mail-headers
-                                                   :prompt "Header Field: ")))))
-          (if (string-prefix-p "attachment" field) (setq field "\\(attachment\\|attachments\\)"))
-          (goto-char (point-min))
-          (message-goto-body)
-          (let* ((match (re-search-backward (concat "^" field ": \\(?1:[[:ascii:][:nonascii:]]*?\\)\n\\(.*?:\\|\n\\)") nil t))
-                 (str (if (and match (match-string 1)) (string-trim (match-string 1)))))
-            (if (string-empty-p str) nil str)))))))
-
-(defun consult-mu--headers-append-handler (msglst)
-  "Append one-line descriptions of messages in MSGLST.
-
-This is used to override `mu4e~headers-append-handler' to ensure that
-buffer handling is done right for `consult-mu'."
-  (with-current-buffer "*consult-mu-headers*"
-    (let ((inhibit-read-only t))
-      (seq-do
-       ;; I use mu4e-column-faces and it overrides the default append-handler. To get the same effect I check if mu4e-column-faces is active and enabled.
-       (if (and (featurep 'mu4e-column-faces) mu4e-column-faces-mode)
-           (lambda (msg)
-             (mu4e-column-faces--insert-header msg (point-max)))
-         (lambda (msg)
-           (mu4e~headers-insert-header msg (point-max))))
-       msglst))))
-
-(defun consult-mu--view-msg (msg &optional buffername)
-  "Display the message MSG in a buffer with BUFFERNAME.
-
-BUFFERNAME defaults to `consult-mu-view-buffer-name'.
-
-This s used to overrides `mu4e-view' to ensure that buffer handling is done
-right for `consult-mu'."
-  (let* ((linked-headers-buffer (mu4e-get-headers-buffer "*consult-mu-headers*" t))
-         (mu4e-view-buffer-name (or buffername consult-mu-view-buffer-name)))
-    (setq gnus-article-buffer (mu4e-get-view-buffer linked-headers-buffer t))
-    (with-current-buffer gnus-article-buffer
-      (let ((inhibit-read-only t))
-        (remove-overlays (point-min) (point-max) 'mu4e-overlay t)
-        (erase-buffer)
-        (insert-file-contents-literally
-         (mu4e-message-readable-path msg) nil nil nil t)
-        (setq-local mu4e--view-message msg)
-        (mu4e--view-render-buffer msg)
-        (mu4e-loading-mode 0)
-        (with-current-buffer linked-headers-buffer
-          (setq-local mu4e~headers-view-win (mu4e-display-buffer gnus-article-buffer nil)))
-        (run-hooks 'mu4e-view-rendered-hook)))))
-
-(defun consult-mu--headers-clear (&optional text)
-  "Clear the headers buffer and related data structures.
-
-Optionally, show TEXT.
-
-This is used to override `mu4e~headers-clear' to ensure that buffer
-handling is done right for `consult-mu'."
-  (setq mu4e~headers-render-start (float-time)
-        mu4e~headers-hidden 0)
-  (with-current-buffer "*consult-mu-headers*"
-    (let ((inhibit-read-only t))
-      (mu4e--mark-clear)
-      (erase-buffer)
-      (when text
-        (goto-char (point-min))
-        (insert (propertize text 'face 'mu4e-system-face 'intangible t))))))
-
-(defun consult-mu--set-mu4e-search-sortfield (opts)
-  "Dynamically set the `mu4e-search-sort-field' based on user input.
-
-Uses user input (i.e. from `consult-mu' command) to define the sort field.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400 --sortfield from”
-
-`mu4e-search-sort-field' is set to :from
-
-Note that per mu4e docs:
-When threading is enabled, the headers are exclusively sorted
-chronologically (:date) by the newest message in the thread."
-  (let* ((sortfield (cond
-                     ((member "-s" opts) (nth (+ (cl-position "-s" opts :test 'equal) 1) opts))
-                     ((member "--sortfield" opts) (nth (+ (cl-position "--sortfield" opts :test 'equal) 1) opts))
-                     (t consult-mu-search-sort-field))))
-    (pcase sortfield
-      ('nil
-       consult-mu-search-sort-field)
-      ((or "date" "d")
-       :date)
-      ((or "subject" "s")
-       :subject)
-      ((or "size" "z")
-       :size)
-      ((or "prio" "p")
-       :prio)
-      ((or "from" "f")
-       :from)
-      ((or "to" "t")
-       :to)
-      ((or "list" "v")
-       :list)
-      ;; ((or "tags" "x")
-      ;;  :tags)
-      (_
-       consult-mu-search-sort-field))))
-
-(defun consult-mu--set-mu4e-search-sort-direction (opts)
-  "Dynamically set the `mu4e-search-sort-direction' based on user input.
-
-Uses user input \(i.e. from `consult-mu' command\) to define the sort field.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example, if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400 --sortfield from --reverse”
-
-The `mu4e-search-sort-direction' is reversed; If it is set to
-\='ascending, it is toggled to \='descending and vise versa."
-  (if (or (member "-z" opts) (member "--reverse" opts))
-      (pcase consult-mu-search-sort-direction
-        ('descending
-         'ascending)
-        ('ascending
-         'descending))
-    consult-mu-search-sort-direction))
-
-(defun consult-mu--set-mu4e-skip-duplicates (opts)
-  "Dynamically set the `mu4e-search-skip-duplicates' based on user input.
-
-Uses user input \(i.e. from `consult-mu' command\) to define whether to
-skip duplicates.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example, if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400 --skip-dups”
-
-The `mu4e-search-skip-duplicates' is set to t."
-  (if (or (member "--skip-dups" opts) mu4e-search-skip-duplicates) t nil))
-
-(defun consult-mu--set-mu4e-results-limit (opts)
-  "Dynamically set the `mu4e-search-results-limit' based on user input.
-
-
-Uses user input \(i.e. from `consult-mu' command\) to define the number of
-results shown.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example, if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400”
-
-The `mu4e-search-results-limit' is set to 400."
-  (cond
-   ((member "-n" opts) (string-to-number (nth (+ (cl-position "-n" opts :test 'equal) 1) opts)))
-   ((member "--maxnum" opts) (string-to-number (nth (+ (cl-position "--maxnum" opts :test 'equal) 1) opts)))
-   (t consult-mu-maxnum)))
-
-
-(defun consult-mu--set-mu4e-include-related (opts)
-  "Dynamically set the `mu4e-search-include-related' based on user input.
-
-Uses user input \(i.e. from `consult-mu' command\) to define whether to
-include related messages.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example if the user enters the following in the minibuffer:
-
-“#query -- --include-related”
-
-The `mu4e-search-include-related' is set to t."
-  (if (or (member "-r" opts) (member "--include-related" opts) mu4e-search-include-related) t nil))
-
-
-
-(defun consult-mu--set-mu4e-threads (opts)
-  "Set  the `mu4e-search-threads' based on `mu4e-search-sort-field'.
-
-Uses user input \(i.e. from `consult-mu' command\) to define whether to
-show threads.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-Note that per mu4e docs, when threading is enabled, the headers are
-exclusively sorted by date.  Here the logic is reversed in order to allow
-dynamically sorting by fields other than date \(even when threads are
-enabled\).  In other words, if the sort-field is not the :date, threading
-is disabled because otherwise sort field will be ignored.  This allows the
-user to use command line arguments to sort messages by fields other than
-the date.  For example, the user can enter the following in the minibuffer
-input to sort by subject
-
-“#query -- --sortfield subject”
-
-When the sort-field is :date, the default setting,
-`consult-mu-search-threads' is used, and if that is set to nil, the user
-can use command line arguments \(a.k.a. -t or --thread\) to enable it
-dynamically."
-  (cond
-   ((not (equal mu4e-search-sort-field :date))
-    nil)
-   ((or (member "-t" opts) (member "--threads" opts) consult-mu-search-threads)
-    t)))
-
-(defun consult-mu--update-headers (query ignore-history msg type)
-  "Search for QUERY, and update `consult-mu-headers-buffer-name' buffer.
-
-If IGNORE-HISTORY is true, does *not* update the query history stack,
-`mu4e--search-query-past'.
-If MSG is non-nil, put the cursor on MSG.
-TYPE can be either \=':dynamic or \=':async"
-  (consult-mu--execute-all-marks)
-  (cl-letf* (((symbol-function #'mu4e~headers-append-handler) #'consult-mu--headers-append-handler))
-    (unless (mu4e-running-p) (mu4e--server-start))
-    (let* ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t))
-           (view-buffer (get-buffer consult-mu-view-buffer-name))
-           (expr (car (consult--command-split (substring-no-properties query))))
-           (rewritten-expr (funcall mu4e-query-rewrite-function expr))
-           (mu4e-headers-fields consult-mu-headers-fields))
-      (pcase type
-        (:dynamic)
-        (:async
-         (setq rewritten-expr (funcall mu4e-query-rewrite-function (concat "msgid:" (plist-get msg :message-id)))))
-        (_ ))
-
-      (with-current-buffer buf
-        (save-excursion
-          (let ((inhibit-read-only t))
-            (erase-buffer)
-            (mu4e-headers-mode)
-            (setq-local mu4e-view-buffer-name consult-mu-view-buffer-name)
-            (if view-buffer
-                (setq-local mu4e~headers-view-win (mu4e-display-buffer gnus-article-buffer nil)))
-            (unless ignore-history
-                                        ; save the old present query to the history list
-              (when mu4e--search-last-query
-                (mu4e--search-push-query mu4e--search-last-query 'past)))
-            (setq mu4e--search-last-query rewritten-expr)
-            (setq list-buffers-directory rewritten-expr)
-            (mu4e--modeline-update)
-            (run-hook-with-args 'mu4e-search-hook expr)
-            (consult-mu--headers-clear mu4e~search-message)
-            (setq mu4e~headers-search-start (float-time))
-
-            (pcase-let* ((`(,_arg . ,opts) (consult--command-split query))
-                         (mu4e-search-sort-field (consult-mu--set-mu4e-search-sortfield opts))
-                         (mu4e-search-sort-direction (consult-mu--set-mu4e-search-sort-direction opts))
-                         (mu4e-search-skip-duplicates (consult-mu--set-mu4e-skip-duplicates opts))
-                         (mu4e-search-results-limit (consult-mu--set-mu4e-results-limit opts))
-                         (mu4e-search-threads (consult-mu--set-mu4e-threads opts))
-                         (mu4e-search-include-related (consult-mu--set-mu4e-include-related opts)))
-              (mu4e--server-find
-               rewritten-expr
-               mu4e-search-threads
-               mu4e-search-sort-field
-               mu4e-search-sort-direction
-               mu4e-search-results-limit
-               mu4e-search-skip-duplicates
-               mu4e-search-include-related))
-            (while (or (string-empty-p (buffer-substring (point-min) (point-max)))
-                       (equal (buffer-substring (point-min) (+ (point-min) (length mu4e~search-message))) mu4e~search-message)
-                       (not (or (equal (buffer-substring (- (point-max) (length mu4e~no-matches)) (point-max)) mu4e~no-matches) (equal (buffer-substring (- (point-max) (length mu4e~end-of-results)) (point-max)) mu4e~end-of-results))))
-              (sleep-for 0.005))))))))
-
-(defun consult-mu--execute-all-marks (&optional no-confirmation)
-  "Execute the actions for all marked messages.
-
-Executes all actions for marked messages in the buffer
-`consult-mu-headers-buffer-name'.
-
-If NO-CONFIRMATION is non-nil, don't ask user for confirmation.
-
-This is similar to `mu4e-mark-execute-all' but, with buffer/window
-handling set accordingly for `consult-mu'."
-  (interactive "P")
-  (when-let* ((buf (get-buffer consult-mu-headers-buffer-name)))
-    (with-current-buffer buf
-      (when (eq major-mode 'mu4e-headers-mode)
-        (mu4e--mark-in-context
-         (let* ((marknum (mu4e-mark-marks-num)))
-           (unless (zerop marknum)
-             (pop-to-buffer buf)
-             (unless (one-window-p) (delete-other-windows))
-             (mu4e-mark-execute-all no-confirmation)
-             (quit-window))))))))
-
-(defun consult-mu--headers-goto-message-id (msgid)
-  "Jump to message with MSGID.
-
-This is done in `consult-mu-headers-buffer-name' buffer."
-  (when-let ((buffer consult-mu-headers-buffer-name))
-    (with-current-buffer buffer
-      (setq mu4e-view-buffer-name consult-mu-view-buffer-name)
-      (mu4e-headers-goto-message-id msgid))))
-
-(defun consult-mu--get-message-by-id (msgid)
-  "Find the message with MSGID and return the mu4e MSG plist for it."
-  (cl-letf* (((symbol-function #'mu4e-view) #'consult-mu--view-msg))
-    (when-let ((buffer consult-mu-headers-buffer-name))
-      (with-current-buffer buffer
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)
-        (mu4e-headers-goto-message-id msgid)
-        (mu4e-message-at-point)))))
-
-(defun consult-mu--contact-string-to-plist (string)
-  "Convert STRING for contacts to plist.
-
-STRING is the output form mu command, for example from:
-`mu find query --fields f`
-
-Returns a plist with \=':email and \':name keys.
-
-For example
-
-“John Doe <john.doe@example.com>”
-
-will be converted to
-
-\(:name “John Doe” :email “john.doe@example.com”\)"
-  (let* ((string (replace-regexp-in-string ">,\s\\|>;\s" ">\n" string))
-         (list (split-string string "\n" t)))
-    (mapcar (lambda (item)
-              (cond
-               ((string-match "\\(?2:.*\\)\s+<\\(?1:.+\\)>" item)
-                (list :email (or (match-string 1 item) nil) :name (or (match-string 2 item) nil)))
-               ((string-match "^\\(?1:[a-zA-Z0-9\_\.\+\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+\\)" item)
-                (list :email (or (match-string 1 item) nil) :name nil))
-               (t
-                (list :email (format "%s" item) :name nil)))) list)))
-
-(defun consult-mu--contact-name-or-email (contact)
-  "Retrieve name or email of CONTACT.
-
-Looks at the contact plist \(e.g. (:name “John Doe” :email
-“john.doe@example.com”)\) and returns the name.  If the name is missing,
-returns the email address."
-  (cond
-   ((stringp contact)
-    contact)
-   ((listp contact)
-    (mapconcat (lambda (item) (or (plist-get item :name) (plist-get item :email) "")) contact ","))))
-
-(defun consult-mu--headers-template ()
-  "Make headers template using `consult-mu-headers-template'."
-  (if (and consult-mu-headers-template (functionp consult-mu-headers-template))
-      (funcall consult-mu-headers-template)
-    consult-mu-headers-template))
-
-(defun consult-mu--expand-headers-template (msg string)
-  "Expand STRING to create a custom header format for MSG.
-
-See `consult-mu-headers-template' for explanation of the format of
-STRING."
-
-  (cl-loop for c in (split-string string "%" t)
-           concat (concat (pcase  (substring c 0 1)
-                            ("f" (let ((sender (consult-mu--contact-name-or-email (plist-get msg :from)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if sender
-                                       (propertize (if (> length 0) (consult-mu--set-string-width sender length) sender) 'face 'consult-mu-sender-face))))
-                            ("t" (let ((receiver (consult-mu--contact-name-or-email (plist-get msg :to)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if receiver
-                                       (propertize (if (> length 0) (consult-mu--set-string-width receiver length) receiver) 'face 'consult-mu-sender-face))))
-                            ("s" (let ((subject (plist-get msg :subject))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if subject
-                                       (propertize (if (> length 0) (consult-mu--set-string-width subject length) subject) 'face 'consult-mu-subject-face))))
-                            ("d" (let ((date (format-time-string "%a %d %b %y" (plist-get msg :date)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if date
-                                       (propertize (if (> length 0) (consult-mu--set-string-width date length) date) 'face 'consult-mu-date-face))))
-
-                            ("p" (let ((priority (plist-get msg :priority))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if priority
-                                       (propertize (if (> length 0) (consult-mu--set-string-width (format "%s" priority) length) (format "%s" priority)) 'face 'consult-mu-size-face))))
-                            ("z" (let ((size (file-size-human-readable (plist-get msg :size)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if size
-                                       (propertize (if (> length 0) (consult-mu--set-string-width size length) size)  'face 'consult-mu-size-face))))
-                            ("i" (let ((id (plist-get msg :message-id))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if id
-                                       (propertize (if (> length 0) (consult-mu--set-string-width id length) id) 'face 'consult-mu-default-face))))
-
-                            ("g" (let ((flags  (plist-get msg :flags))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if flags
-                                       (propertize (if (> length 0) (consult-mu--set-string-width (format "%s" flags) length) (format "%s" flags)) 'face 'consult-mu-flags-face))))
-
-                            ("G" (let ((flags (plist-get msg :flags))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if flags
-                                       (propertize (if (> length 0) (consult-mu--set-string-width (format "%s" (mu4e~headers-flags-str flags)) length) (format "%s" (mu4e~headers-flags-str flags))) 'face 'consult-mu-flags-face))))
-
-                            ("x" (let ((tags (plist-get msg :tags))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if tags
-                                       (propertize (if (> length 0) (consult-mu--set-string-width tags length) tags) 'face 'consult-mu-tags-face) nil)))
-
-                            ("c" (let ((cc (consult-mu--contact-name-or-email (plist-get msg :cc)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if cc
-                                       (propertize (if (> length 0) (consult-mu--set-string-width cc length) cc) 'face 'consult-mu-tags-face))))
-
-                            ("h" (let ((bcc (consult-mu--contact-name-or-email (plist-get msg :bcc)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if bcc
-                                       (propertize (if (> length 0) (consult-mu--set-string-width bcc length) bcc) 'face 'consult-mu-tags-face))))
-
-                            ("r" (let ((changed (format-time-string "%a %d %b %y" (plist-get msg :changed)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if changed
-                                       (propertize (if (> length 0) (consult-mu--set-string-width changed length) changed) 'face 'consult-mu-tags-face))))
-                            (_ nil))
-                          "  ")))
-
-(defun consult-mu--quit-header-buffer ()
-  "Quits `consult-mu-headers-buffer-name' buffer."
-  (save-mark-and-excursion
-    (when-let* ((buf (get-buffer consult-mu-headers-buffer-name)))
-      (with-current-buffer buf
-        (if (eq major-mode 'mu4e-headers-mode)
-            (mu4e-mark-handle-when-leaving)
-          (quit-window t)
-          ;; clear the decks before going to the main-view
-          (mu4e--query-items-refresh 'reset-baseline))))))
-
-(defun consult-mu--quit-view-buffer ()
-  "Quits `consult-mu-view-buffer-name' buffer."
-  (when-let* ((buf (get-buffer consult-mu-view-buffer-name)))
-    (with-current-buffer buf
-      (if (eq major-mode 'mu4e-view-mode)
-          (mu4e-view-quit)))))
-
-(defun consult-mu--quit-main-buffer ()
-  "Quits `mu4e-main-buffer-name' buffer."
-  (when-let* ((buf (get-buffer mu4e-main-buffer-name)))
-    (with-current-buffer buf
-      (if (eq major-mode 'mu4e-main-mode)
-          (mu4e-quit)))))
-
-(defun consult-mu--lookup ()
-  "Lookup function for `consult-mu' or `consult-mu-async' candidates.
-
-This is passed as LOOKUP to `consult--read' on candidates and is used to
-format the output when a candidate is selected."
-  (lambda (sel cands &rest _args)
-    (let* ((info (cdr (assoc sel cands)))
-           (msg  (plist-get info :msg))
-           (subject (plist-get msg :subject)))
-      (cons subject info))))
-
-(defun consult-mu--group-name (cand)
-  "Get the group name of CAND using `consult-mu-group-by'.
-
-See `consult-mu-group-by' for details of grouping options."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (group (or consult-mu--override-group consult-mu-group-by))
-         (field (if (not (keywordp group)) (intern (concat ":" (format "%s" group))) group)))
-    (pcase field
-      (:date (format-time-string "%a %d %b %y" (plist-get msg field)))
-      (:from (cond
-              ((listp (plist-get msg field))
-               (mapconcat (lambda (item) (or (plist-get item :name) (plist-get item :email))) (plist-get msg field) ";"))
-              ((stringp (plist-get msg field)) (plist-get msg field))))
-      (:to (cond
-            ((listp (plist-get msg field))
-             (mapconcat (lambda (item) (or (plist-get item :name) (plist-get item :email))) (plist-get msg field) ";"))
-            ((stringp (plist-get msg field)) (plist-get msg field))))
-      (:changed (format-time-string "%a %d %b %y" (plist-get msg field)))
-      (:datetime (format-time-string "%F %r" (plist-get msg :date)))
-      (:time (format-time-string "%X" (plist-get msg :date)))
-      (:year (format-time-string "%Y" (plist-get msg :date)))
-      (:month (format-time-string "%B" (plist-get msg :date)))
-      (:day-of-week (format-time-string "%A" (plist-get msg :date)))
-      (:day (format-time-string "%A" (plist-get msg :date)))
-      (:week (format-time-string "%V" (plist-get msg :date)))
-      (:size (file-size-human-readable (plist-get msg field)))
-      (:flags (format "%s" (plist-get msg field)))
-      (:tags (format "%s" (plist-get msg field)))
-      (_ (if (plist-get msg field) (format "%s" (plist-get msg field)) nil)))))
-
-(defun consult-mu--group (cand transform)
-  "Group function for `consult-mu' or `consult-mu-async'.
-
-CAND is passed to `consult-mu--group-name' to get the group for CAND.
-When TRANSFORM is non-nil, the name of CAND is used for group."
-  (when-let ((name (consult-mu--group-name cand)))
-    (if transform (substring cand) name)))
-
-(defun consult-mu--view (msg noselect mark-as-read match-str)
-  "Opens MSG in `consult-mu-headers' and `consult-mu-view'.
-
-If NOSELECT is non-nil, does not select the view buffer/window.
-If MARK-AS-READ is non-nil, marks the MSG as read.
-If MATCH-STR is non-nil, highlights the MATCH-STR in the view buffer."
-  (let ((msgid (plist-get msg :message-id)))
-    (when-let ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t)))
-      (with-current-buffer buf
-        ;;(mu4e-headers-mode)
-        (goto-char (point-min))
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)
-        (unless noselect
-          (switch-to-buffer buf))))
-
-    (consult-mu--view-msg msg consult-mu-view-buffer-name)
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (if msgid
-          (progn
-            (mu4e-headers-goto-message-id msgid)
-            (if mark-as-read
-                (mu4e--server-move (mu4e-message-field-at-point :docid) nil "+S-u-N")))))
-
-    (when match-str
-      (add-to-history 'search-ring match-str)
-      (consult-mu--overlay-match match-str consult-mu-view-buffer-name t))
-
-    (with-current-buffer consult-mu-view-buffer-name
-      (goto-char (point-min)))
-
-    (unless noselect
-      (when msg
-        (select-window (get-buffer-window consult-mu-view-buffer-name))))
-    consult-mu-view-buffer-name))
-
-
-(defun consult-mu--view-action (cand)
-  "Open the candidate, CAND.
-
-This is a wrapper function around `consult-mu--view'.  It parses CAND to
-extract relevant MSG plist and other information and passes them to
-`consult-mu--view'.
-
-To use this as the default action for `consult-mu', set
-`consult-mu-default-action' to \=#'consult-mu--view-action."
-
-  (let* ((info (cdr cand))
-         (msg (plist-get info :msg))
-         (query (plist-get info :query))
-         (match-str (car (consult--command-split query))))
-    (consult-mu--view msg nil consult-mu-mark-viewed-as-read match-str)
-    (consult-mu-overlays-toggle consult-mu-view-buffer-name)))
-
-(defun consult-mu--reply (msg &optional wide-reply)
-  "Reply to MSG using `mu4e-compose-reply'.
-
-If WIDE-REPLY is non-nil use wide-reply \(a.k.a. reply all\) with
-`mu4e-compose-wide-reply'."
-  (let ((msgid (plist-get msg :message-id)))
-    (when-let ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t)))
-      (with-current-buffer buf
-        (goto-char (point-min))
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)))
-
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (mu4e-headers-goto-message-id msgid)
-      (if (not wide-reply)
-          (mu4e-compose-reply)
-        (mu4e-compose-wide-reply)))))
-
-(defun consult-mu--reply-action (cand &optional wide-reply)
-  "Reply to CAND.
-
-This is a wrapper function around `consult-mu--reply'.  It passes
-relevant message plist, from CAND, as well as WIDE-REPLY to
-`consult-mu--reply'.
-
-To use this as the default action for `consult-mu', set
-`consult-mu-default-action' to \=#'consult-mu--reply-action."
-  (let* ((info (cdr cand))
-         (msg (plist-get info :msg))
-         (wide-reply (or wide-reply
-                         (pcase consult-mu-use-wide-reply
-                           ('ask (y-or-n-p "Reply All?"))
-                           ('nil nil)
-                           ('t t)))))
-    (consult-mu--reply msg wide-reply)))
-
-(defun consult-mu--forward (msg)
-  "Forward the MSG using `mu4e-compose-forward'."
-  (let ((msgid (plist-get msg :message-id)))
-    (when-let ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t)))
-      (with-current-buffer buf
-        (goto-char (point-min))
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)))
-    (with-current-buffer consult-mu-headers-buffer-name
-      (mu4e-headers-goto-message-id msgid)
-      (mu4e-compose-forward))))
-
-(defun consult-mu--forward-action (cand)
-  "Forward CAND.
-
-This is a wrapper function around `consult-mu--forward'.  It passes
-the relevant message plist, from CAND to `consult-mu--forward'.
-
-To use this as the default action for `consult-mu', set
-`consult-mu-default-action' to \=#'consult-mu--forward-action."
-  (let* ((info (cdr cand))
-         (msg (plist-get info :msg)))
-    (consult-mu--forward msg)))
-
-(defun consult-mu--get-split-style-character (&optional style)
-  "Get the character for consult async split STYLE.
-
-STYLE defaults to `consult-async-split-style'."
-  (let ((style (or style consult-async-split-style 'none)))
-    (or (char-to-string (plist-get (alist-get style consult-async-split-styles-alist) :initial))
-        (char-to-string (plist-get (alist-get style consult-async-split-styles-alist) :separator))
-        "")))
-
-(defun consult-mu--dynamic-format-candidate (cand highlight)
-  "Format minibuffer candidate, CAND.
-
-CAND is the minibuffer completion candidate \(a mu4e message collected by
-`consult-mu--dynamic-collection'\).  If HIGHLIGHT is non-nil, it is
-highlighted with `consult-mu-highlight-match-face'."
-
-  (let* ((string (car cand))
-         (info (cadr cand))
-         (msg (plist-get info :msg))
-         (query (plist-get info :query))
-         (match-str (if (stringp query) (consult--split-escaped (car (consult--command-split query))) nil))
-         (headers-template (consult-mu--headers-template))
-         (str (if headers-template
-                  (consult-mu--expand-headers-template msg headers-template)
-                string))
-         (str (propertize str :msg msg :query query :type :dynamic)))
-    (if (and consult-mu-highlight-matches highlight)
-        (cond
-         ((listp match-str)
-          (mapc (lambda (match) (setq str (consult-mu--highlight-match match str t))) match-str))
-         ((stringp match-str)
-          (setq str (consult-mu--highlight-match match-str str t))))
-      str)
-    (when msg
-      (cons str (list :msg msg :query query :type :dynamic)))))
-
-(defun consult-mu--dynamic-collection (input)
-  "Dynamically collect mu4e search results.
-
-INPUT is the user input.  It is passed as QUERY to
-`consult-mu--update-headers', appends the result to
-`consult-mu-headers-buffer-name' and returns a list of found
-messages."
-
-  (save-excursion
-    (pcase-let* ((`(,_arg . ,opts) (consult--command-split input)))
-      (consult-mu--update-headers (substring-no-properties input) nil nil :dynamic)
-      (if (or (member "-g" opts)  (member "--group" opts))
-          (cond
-           ((member "-g" opts)
-            (setq consult-mu--override-group (intern (or (nth (+ (cl-position "-g" opts :test 'equal) 1) opts) "nil"))))
-           ((member "--group" opts)
-            (setq consult-mu--override-group (intern (or (nth (+ (cl-position "--group" opts :test 'equal) 1) opts) "nil")))))
-        (setq consult-mu--override-group nil)))
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (goto-char (point-min))
-      (remove nil
-              (cl-loop until (eobp)
-                       collect (consult-mu--dynamic-format-candidate (list (buffer-substring (point) (line-end-position)) (list :msg (ignore-errors (mu4e-message-at-point)) :query input)) t)
-                       do (forward-line 1))))))
-
-(defun consult-mu--dynamic-state ()
-  "State function for `consult-mu' candidates.
-This is passed as STATE to `consult--read' and is used to preview or do
-other actions on the candidate."
-  (lambda (action cand)
-    (let ((preview (consult--buffer-preview)))
-      (pcase action
-        ('preview
-         (if cand
-             (when-let* ((info (cdr cand))
-                         (msg (plist-get info :msg))
-                         (query (plist-get info :query))
-                         (msgid (substring-no-properties (plist-get msg :message-id)))
-                         (match-str (car (consult--command-split query)))
-                         (match-str (car (consult--command-split query)))
-                         (mu4e-headers-buffer-name consult-mu-headers-buffer-name)
-                         (buffer consult-mu-view-buffer-name))
-               ;;(get-buffer-create consult-mu-view-buffer-name)
-               (add-to-list 'consult-mu--view-buffers-list buffer)
-               (funcall preview action
-                        (consult-mu--view msg t consult-mu-mark-previewed-as-read match-str))
-               (with-current-buffer consult-mu-view-buffer-name
-                 (unless (one-window-p) (delete-other-windows))))))
-        ('return
-         (save-mark-and-excursion
-           (consult-mu--execute-all-marks))
-         (setq consult-mu--override-group nil)
-         cand)))))
-
-(defun consult-mu--dynamic (prompt collection &optional initial)
-  "Query mu4e messages dyunamically.
-
-This is a non-interactive internal function.  For the interactive version
-see `consult-mu'.
-
-It runs the `consult-mu--dynamic-collection' to do a `mu4e-search' with
-user input \(e.g. INITIAL\) and returns the results \(list of messages
-found\) as a completion table in minibuffer.
-
-The completion table gets dynamically updated as the user types in the
-minibuffer.  Each candidate in the minibuffer is formatted by
-`consult-mu--dynamic-format-candidate' to add annotation and other info to
-the candidate.
-
-Description of Arguments:
-  PROMPT     the prompt in the minibuffer
-             \(passed as PROMPT to   `consult--read'\)
-  COLLECTION a colection function passed to `consult--dynamic-collection'.
-  INITIAL    an optional arg for the initial input in the minibuffer.
-             \(passed as INITITAL to `consult--read'\)
-
-commandline arguments/options \(see `mu find --help` in the command line
-for details\) can be passed to the minibuffer input similar to
-`consult-grep'.  For example the user can enter:
-
-“#paper -- --maxnum 200 --sortfield from --reverse”
-
-this will search for mu4e messages with the query “paper”, retrives a
-maximum of 200 messages and sorts them by the “from:” field and reverses
-the sort direction (opposite of `consult-mu-search-sort-field').
-
-Note that some command line arguments are not supported by mu4e (for
-example sorting based on cc: or bcc: fields are not supported in
-`mu4e-search-sort-field')
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#paper -- --maxnum 200 --sortfield from --reverse#accepted”
-
-will retrieve the message as the example above, then narrows down the
-candidates to those that  that match “accepted”."
-  (consult--read
-   (consult--dynamic-collection (or collection #'consult-mu--dynamic-collection))
-   :prompt (or prompt "Select: ")
-   :lookup (consult-mu--lookup)
-   :state (funcall #'consult-mu--dynamic-state)
-   :initial initial
-   :group #'consult-mu--group
-   :add-history (append (list (thing-at-point 'symbol))
-                        consult-mu-saved-searches-dynamic)
-   :history '(:input consult-mu--history)
-   :require-match t
-   :category 'consult-mu-messages
-   :preview-key consult-mu-preview-key
-   :sort nil))
-
-(defun consult-mu-dynamic (&optional initial noaction)
-  "Lists results of `mu4e-search' dynamically.
-
-This is an interactive wrapper function around `consult-mu--dynamic'.  It
-queries the user for a search term in the minibuffer, then fetches a list
-of messages for the entered search term as a minibuffer completion table
-for selection.  The list of candidates in the completion table are
-dynamically updated as the user changes the entry.
-
-Upon selection of a candidate either
- - the candidate is returned if NOACTION is non-nil
- or
- - the candidate is passed to `consult-mu-action' if NOACTION is nil.
-
-Additional commandline arguments can be passed in the minibuffer entry by
-typing “--” followed by command line arguments.
-
-For example, the user can enter:
-
-“#consult-mu -- -n 10”
-
-this will run a `mu4e-search' with the query “consult-mu” and changes the
-search limit \(i.e. `mu4e-search-results-limit' to 10\).
-
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#consult-mu -- -n 10#github”
-
-will retrieve the messages as the example above, then narrows down the
-completion table to candidates that match “github”.
-
-INITIAL is an optional arg for the initial input in the minibuffer.
-\(passed as INITITAL to `consult-mu--dynamic'\)
-
-For more details on consult--async functionalities, see `consult-grep' and
-the official manual of consult, here:
-URL `https://github.com/minad/consult'"
-  (interactive)
-  (save-mark-and-excursion
-    (consult-mu--execute-all-marks))
-  (let* ((sel
-          (consult-mu--dynamic (concat "[" (propertize "consult-mu-dynamic" 'face 'consult-mu-sender-face) "]" " Search For:  ") #'consult-mu--dynamic-collection initial)))
-    (save-mark-and-excursion
-      (consult-mu--execute-all-marks))
-    (if noaction
-        sel
-      (progn
-        (funcall consult-mu-action sel)
-        sel))))
-
-(defun consult-mu--async-format-candidate (string input highlight)
-  "Formats minibuffer candidates for `consult-mu-async'.
-
-STRING is the output retrieved from `mu find INPUT ...` in the command line.
-INPUT is the query from the user.
-
-If HIGHLIGHT is t, input is highlighted with
-`consult-mu-highlight-match-face' in the minibuffer."
-
-  (let* ((query input)
-         (parts (split-string (replace-regexp-in-string "^\\\\->\s\\|^\\\/->\s" "" string) consult-mu-delimiter))
-         (msgid (car parts))
-         (date (date-to-time (cadr parts)))
-         (sender (cadr (cdr parts)))
-         (sender (consult-mu--contact-string-to-plist sender))
-         (receiver (cadr (cdr (cdr parts))))
-         (receiver (consult-mu--contact-string-to-plist receiver))
-         (subject (cadr (cdr (cdr (cdr parts)))))
-         (size (string-to-number (cadr (cdr (cdr (cdr (cdr parts)))))))
-         (flags (consult-mu-flags-to-string (cadr (cdr (cdr (cdr (cdr (cdr parts))))))))
-         (tags (cadr (cdr (cdr (cdr (cdr (cdr (cdr parts))))))))
-         (priority (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts)))))))))
-         (cc (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts))))))))))
-         (cc (consult-mu--contact-string-to-plist cc))
-         (bcc (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts)))))))))))
-         (bcc (consult-mu--contact-string-to-plist bcc))
-         (path (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts))))))))))))
-         (msg (list :subject subject :date date :from sender :to receiver :size size :message-id msgid :flags flags :tags tags :priority priority :cc cc :bcc bcc :path path))
-         (match-str (if (stringp input) (consult--split-escaped (car (consult--command-split query))) nil))
-         (headers-template (consult-mu--headers-template))
-         (str (if headers-template
-                  (consult-mu--expand-headers-template msg headers-template)
-                (format "%s\s\s%s\s\s%s\s\s%s\s\s%s\s\s%s"
-                        (propertize (consult-mu--set-string-width
-                                     (format-time-string "%x" date) 10)
-                                    'face 'consult-mu-date-face)
-                        (propertize (consult-mu--set-string-width (consult-mu--contact-name-or-email sender) (floor (* (frame-width) 0.2)))  'face 'consult-mu-sender-face)
-                        (propertize (consult-mu--set-string-width subject (floor (* (frame-width) 0.55))) 'face 'consult-mu-subject-face)
-                        (propertize (file-size-human-readable size) 'face 'consult-mu-size-face)
-                        (propertize (format "%s" flags) 'face 'consult-mu-flags-face)
-                        (propertize (if tags (format "%s" tags) nil) 'face 'consult-mu-tags-face))))
-         (str (propertize str :msg msg :query query :type :async)))
-    (if (and consult-mu-highlight-matches highlight)
-        (cond
-         ((listp match-str)
-          (mapc (lambda (match) (setq str (consult-mu--highlight-match match str t))) match-str))
-         ((stringp match-str)
-          (setq str (consult-mu--highlight-match match-str str t))))
-      str)
-    (cons str (list :msg msg :query query :type :async))))
-
-(defun consult-mu--async-state ()
-  "State function for `consult-mu-async' candidates.
-
-This is passed as STATE to `consult--read' and is used to preview or do
-other actions on the candidate."
-  (lambda (action cand)
-    (let ((preview (consult--buffer-preview)))
-      (pcase action
-        ('preview
-         (if cand
-             (when-let* ((info (cdr cand))
-                         (msg (plist-get info :msg))
-                         (msgid (substring-no-properties (plist-get msg :message-id)))
-                         (query (plist-get info :query))
-                         (match-str (car (consult--command-split query)))
-                         (mu4e-headers-buffer-name consult-mu-headers-buffer-name)
-                         (buffer consult-mu-view-buffer-name))
-               (add-to-list 'consult-mu--view-buffers-list buffer)
-               (funcall preview action
-                        (consult-mu--view msg t consult-mu-mark-previewed-as-read match-str))
-               (with-current-buffer consult-mu-view-buffer-name
-                 (unless (one-window-p) (delete-other-windows))))))
-        ('return
-         (save-mark-and-excursion
-           (consult-mu--execute-all-marks))
-         cand)))))
-
-(defun consult-mu--async-transform (input)
-  "Add annotation to minibuffer candiates for `consult-mu'.
-
-Format each candidates with `consult-gh--repo-format' and INPUT."
-  (lambda (cands)
-    (cl-loop for cand in cands
-             collect
-             (consult-mu--async-format-candidate cand input t))))
-
-(defun consult-mu--async-builder (input)
-  "Build mu command line for searching messages by INPUT (e.g. `mu find INPUT)`."
-  (pcase-let* ((consult-mu-args (append consult-mu-args '("find")))
-               (cmd (consult--build-args consult-mu-args))
-               (`(,arg . ,opts) (consult--command-split input))
-               (flags (append cmd opts))
-               (sortfield (cond
-                           ((member "-s" flags) (nth (+ (cl-position "-s" opts :test 'equal) 1) flags))
-                           ((member "--sortfield" flags) (nth (+ (cl-position "--sortfield" flags :test 'equal) 1) flags))
-                           (t (substring (symbol-name consult-mu-search-sort-field) 1))))
-               (threads (if (not (equal sortfield :date)) nil (or (member "-t" flags) (member "--threads" flags) mu4e-search-threads)))
-               (skip-dups (or (member "-u" flags) (member "--skip-dups" flags) mu4e-search-skip-duplicates))
-               (include-related (or (member "-r" flags) (member "--include-related" flags) mu4e-search-include-related)))
-    (if (or (member "-g" flags)  (member "--group" flags))
-        (cond
-         ((member "-g" flags)
-          (setq consult-mu--override-group (intern (or (nth (+ (cl-position "-g" opts :test 'equal) 1) opts) "nil")))
-          (setq opts (remove "-g" (remove (nth (+ (cl-position "-g" opts :test 'equal) 1) opts) opts))))
-         ((member "--group" flags)
-          (setq consult-mu--override-group (intern (or (nth (+ (cl-position "--group" opts :test 'equal) 1) opts) "nil")))
-          (setq opts (remove "--group" (remove (nth (+ (cl-position "--group" opts :test 'equal) 1) opts) opts)))))
-      (setq consult-mu--override-group nil))
-    (setq opts (append opts (list "--nocolor")))
-    (setq opts (append opts (list "--fields" (format "i%sd%sf%st%ss%sz%sg%sx%sp%sc%sh%sl"
-                                                     consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter))))
-    (unless (or (member "-s" flags) (member "--sortfiled" flags))
-      (setq opts (append opts (list "--sortfield" (substring (symbol-name consult-mu-search-sort-field) 1)))))
-    (if threads (setq opts (append opts (list "--thread"))))
-    (if skip-dups (setq opts (append opts (list "--skip-dups"))))
-    (if include-related (setq opts (append opts (list "--include-related"))))
-    (cond
-     ((and (member "-n" flags) (< (string-to-number (nth (+ (cl-position "-n" opts :test 'equal) 1) opts)) 0))
-      (setq opts (remove "-n" (remove (nth (+ (cl-position "-n" opts :test 'equal) 1) opts) opts))))
-     ((and (member "--maxnum" flags) (< (string-to-number (nth (+ (cl-position "--maxnum" opts :test 'equal) 1) opts)) 0))
-      (setq opts (remove "--maxnum" (remove (nth (+ (cl-position "--maxnum" opts :test 'equal) 1) opts) opts)))))
-    (unless (or (member "-n" flags)  (member "--maxnum" flags))
-      (if (and consult-mu-maxnum (> consult-mu-maxnum 0))
-          (setq opts (append opts (list "--maxnum" (format "%s" consult-mu-maxnum))))))
-
-    (pcase consult-mu-search-sort-direction
-      ('descending
-       (if (or (member "-z" flags) (member "--reverse" flags))
-           (setq opts (remove "-z" (remove "--reverse" opts)))
-         (setq opts (append opts (list "--reverse")))))
-      ('ascending)
-      (_))
-    (pcase-let* ((`(,re . ,hl) (funcall consult--regexp-compiler arg 'basic t)))
-      (when re
-        (cons (append cmd
-                      (list (string-join re " "))
-                      opts)
-              hl)))))
-
-(defun consult-mu--async (prompt builder &optional initial)
-  "Query mu4e messages asynchronously.
-
-This is a non-interactive internal function.  For the interactive
-version, see `consult-mu-async'.
-
-It runs the command line from `consult-mu--async-builder' in an async
-process and returns the results (list of messages) as a completion table
-in minibuffer that will be passed to `consult--read'.  The completion
-table gets dynamically updated as the user types in the minibuffer.  Each
-candidate in the minibuffer is formatted by `consult-mu--async-transform'
-to add annotation and other info to the candidate.
-
-Description of Arguments:
-
-PROMPT  the prompt in the minibuffer
-        \(passed as PROMPT to `consult--red'\)
-BUILDER an async builder function passed to `consult--async-command'
-INITIAL an optional arg for the initial input in the minibuffer
-        \(passed as INITITAL to `consult--read'\)
-
-commandline arguments/options \(see `mu find --help` in the command line
-for details\) can be passed to the minibuffer input similar to
-`consult-grep'.  For example the user can enter:
-
-“#paper -- --maxnum 200 --sortfield from --reverse”
-
-this will search for mu4e messages with the query “paper”, retrives a
-maximum of 200 messages sorts them by the “from:” field and reverses the
-sort direction (opposite of `consult-mu-search-sort-field').
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-`#paper -- --maxnum 200 --sortfield from --reverse#accepted'
-
-will retrieve the message as the example above, then narrows down the
-completion table to candidates that match “accepted”."
-  (consult--read
-   (consult--process-collection builder
-     :transform (consult--async-transform-by-input #'consult-mu--async-transform))
-   :prompt prompt
-   :lookup (consult-mu--lookup)
-   :state (funcall #'consult-mu--async-state)
-   :initial initial
-   :group #'consult-mu--group
-   :add-history (append (list (thing-at-point 'symbol))
-                        consult-mu-saved-searches-async)
-   :history '(:input consult-mu--history)
-   :require-match t
-   :category 'consult-mu-messages
-   :preview-key consult-mu-preview-key
-   :sort nil))
-
-(defun consult-mu-async (&optional initial noaction)
-  "Lists results of `mu find` Asynchronously.
-
-This is an interactive wrapper function around `consult-mu--async'.  It
-queries the user for a search term in the minibuffer, then fetches a list
-of messages for the entered search term as a minibuffer completion table
-for selection.  The list of candidates in the completion table are
-dynamically updated as the user changes the entry.
-
-Upon selection of a candidate either
- - the candidate is returned if NOACTION is non-nil
- or
- - the candidate is passed to `consult-mu-action' if NOACTION is nil.
-
-Additional commandline arguments can be passed in the minibuffer entry by
-typing `--` followed by command line arguments.
-
-For example the user can enter:
-
-`#consult-mu -- -n 10'
-
-this will run a `mu4e-search' with the query \"consult-my\" and changes the
-search limit (i.e. `mu4e-search-results-limit' to 10.
-
-
-Also, the results can further be narrowed by `consult-async-split-style'
-\(e.g. by entering “#” when `consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#consult-mu -- -n 10#github”
-
-will retrieve the message as the example above, then narrows down the
-completion table to candidates that match “github”.
-
-INITIAL is an optional arg for the initial input in the minibuffer.
-\(passed as INITITAL to `consult-mu--async'\).
-
-For more details on consult--async functionalities, see `consult-grep' and
-the official manual of consult, here:
-URL `https://github.com/minad/consult'
-
-Note that this is the async search directly using the commandline `mu`
-command and not mu4e-search. As a result, mu4e-headers buffers are not
-created until a single message is selected \(or interacted with using
-embark, etc.\)  Previews are shown in a mu4e-view buffer \(see
-`consult-mu-view-buffer-name'\) attached to an empty mu4e-headers buffer
-\(i.e. `consult-mu-headers-buffer-name'\).  This allows quick retrieval of
-many messages \(tens of thousands\) and previews, but not opening the
-results in a mu4e-headers buffer.  If you want ot open the results in a
-mu4e-headers buffer for other work flow, then you should use the
-dynamically collected function `consult-mu' which is slower if searching
-for many emails but allows follow up interactions in a mu4e-headers
-buffer."
-  (interactive)
-  (save-mark-and-excursion
-    (consult-mu--execute-all-marks))
-  (let* ((sel
-          (consult-mu--async (concat "[" (propertize "consult-mu async" 'face 'consult-mu-sender-face) "]" " Search For:  ") #'consult-mu--async-builder initial))
-         (info (cdr sel))
-         (msg (plist-get info :msg))
-         (query (plist-get info :query)))
-    (save-mark-and-excursion
-      (consult-mu--execute-all-marks))
-    (if noaction
-        sel
-      (progn
-        (consult-mu--update-headers query t msg :async))
-      (funcall consult-mu-action sel)
-      sel)))
-
-(defun consult-mu (&optional initial noaction)
-  "Default interactive command.
-
-This is a wrapper function that calls `consult-mu-default-command' with
-INITIAL and NOACTION.
-
-For example, the `consult-mu-default-command can be set to
- `#'consult-mu-dynamic' sets the default behavior to dynamic collection
- `#'consult-mu-async' sets the default behavior to async collection"
-
-  (interactive "P")
-  (funcall consult-mu-default-command initial noaction))
-
-;;; provide `consult-mu' module
-(provide 'consult-mu)
-
-;;; consult-mu.el ends here
dots/.config/emacs/old/lisp/consult-mu/consult-mu.org
@@ -1,3336 +0,0 @@
-* consult-mu.el
-:PROPERTIES:
-:header-args:emacs-lisp: :results none :lexical t :mkdirp yes :comments none :tangle ./consult-mu.el
-:END:
-** Header
-#+begin_src emacs-lisp
-;;; consult-mu.el --- Consult Mu4e asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2023 Armin Darvish
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-;;; Code:
-
-#+end_src
-
-** Requirements
-#+begin_src emacs-lisp
-;;; Requirements
-(require 'consult)
-(require 'mu4e)
-
-#+end_src
-
-** Define Group, Customs, Vars, etc.
-*** Group
-#+begin_src emacs-lisp
-;;; Group
-
-(defgroup consult-mu nil
-  "Options for `consult-mu'."
-  :group 'convenience
-  :group 'minibuffer
-  :group 'consult
-  :group 'mu4e
-  :prefix "consult-mu-")
-
-#+end_src
-
-*** Custom Variables
-#+begin_src emacs-lisp
-;;; Customization Variables
-
-(defcustom consult-mu-args '("mu")
-  "Command line arguments to call `mu` asynchronously.
-
-The dynamically computed arguments are appended.
-Can be either a string, or a list of strings or expressions."
-  :group 'consult-mu
-  :type '(choice string (repeat (choice string sexp))))
-
-(defcustom consult-mu-maxnum mu4e-search-results-limit
-  "Maximum number of results.
-
-This is normally passed to “--maxnum” in the command line or is defined by
-`mu4e-search-results-limit'.  By default inherits from
-`mu4e-search-results-limit'."
-  :group 'consult-mu
-  :type '(choice (const :tag "Unlimited" -1)
-                 (integer :tag "Limit")))
-
-(defcustom consult-mu-search-sort-field mu4e-search-sort-field
-  "What field to sort results by?
-
-By defualt inherits from `mu4e-search-sort-field'."
-  :group 'consult-mu
-  :type '(radio (const :tag "Date" :date)
-                (const :tag "Subject" :subject)
-                (const :tag "File Size" :size)
-                (const :tag "Priority" :prio)
-                (const :tag "From (Sender)" :from)
-                (const :tag "To (Recipients)" :to)
-                (const :tag "Mailing List" :list)))
-
-(defcustom consult-mu-headers-fields mu4e-headers-fields
-  "A list of header fields to show in the headers buffer.
-
-By default inherits from `mu4e-headers-field'.
-
-From mu4e docs:
-
-Each element has the form (HEADER . WIDTH), where HEADER is one of
-the available headers (see `mu4e-header-info') and WIDTH is the
-respective width in characters.
-
-A width of nil means “unrestricted”, and this is best reserved
-for the rightmost \(last\) field.  Note that Emacs may become very
-slow with excessively long lines \(1000s of characters\), so if you
-regularly get such messages, you want to avoid fields with nil
-altogether."
-  :group 'consult-mu
-  :type `(repeat (cons (choice ,@(mapcar (lambda (h)
-                                           (list 'const
-                                                 :tag (plist-get (cdr h) :help)
-                                                 (car h)))
-                                         mu4e-header-info))
-                       (choice (integer :tag "width")
-                               (const :tag "unrestricted width" nil)))))
-
-(defcustom consult-mu-headers-template nil
-  "A template string to make custom header formats.
-
-If non-nil, `consult-mu' uses this string to format the headers instead of
-`consult-mu-headers-field'.
-
-The string should be of the format “%[char][integer]%[char][integer]...”,
-and allow dynamic insertion of the content.  Each “%[char][integer]“ chunk
-represents a different field and the integer defines the length of the
-field.
-
-The list of available fields are:
-
-  %f  sender(s) \(e.g. from: field of email\)
-  %t  receivers(s) \(i.e. to: field of email\)
-  %s  subject \(i.e. title of email\)
-  %d  date \(i.e. the date email was sent/received\)
-  %p  priority
-  %z  size
-  %i  message-id \(as defined by mu\)
-  %g  flags \(as defined by mu\)
-  %G  pretty flags \(this uses `mu4e~headers-flags-str' to pretify flags\)
-  %x  tags \(as defined by mu\)
-  %c  cc \(i.e. cc: field of the email\)
-  %h  bcc \(i.e. bcc: field of the email\)
-  %r  date chaged \(as defined by :changed in mu4e\)
-
-For exmaple, “%d15%s50” means 15 characters for date and 50 charcters for
-subject, and “%d13%s37%f17” would make a header containing 13 characters
-for Date, 37 characters for Subject, and 20 characters for From field,
-making a header that looks like this:
-
-Thu 09 Nov 23  Title of the Email Limited to 50 Char...  example@domain..."
-  :group 'consult-mu
-  :type '(choice (const :tag "Fromatted String" :format "%{%%d13%%s50%%f17%}")
-                 (function :tag "Custom Function")))
-
-(defcustom consult-mu-search-sort-direction mu4e-search-sort-direction
-  "Direction to sort by a symbol.
-
-By defualt inherits from `mu4e-search-sort-direction', and can either be
-\='descending (sorting  Z->A) or \='ascending (sorting A->Z)."
-
-  :group 'consult-mu
-  :type '(radio (const ascending)
-                (const descending)))
-
-
-(defcustom consult-mu-search-threads mu4e-search-threads
-  "Whether to calculate threads for search results.
-
-By defualt inherits from `mu4e-search-threads'.
-
-Note that per mu4e docs:
-When threading is enabled, the headers are exclusively sorted
-chronologically (:date) by the newest message in the thread."
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-group-by nil
-  "What field to use to group the results in the minibuffer.
-
-By default it is set to :date, but can be any of:
-
-  :subject      group by subject
-  :from         group by the name/email the sender(s)
-  :to           group by name/email of the reciver(s)
-  :date         group by date
-  :time         group by the time of email \(i.e. hour, minute, seconds\)
-  :datetime     group by date and time of the email
-  :year         group by the year of the email \(i.e. 2023, 2022, ...\)
-  :month        group by the month of the email \(i.e. Jan, Feb, ..., Dec\)
-  :week         group by the week number of the email
-                \(i.e. 1st week, 2nd week, ... 52nd week\)
-  :day-of-week  group by the day email was sent (i.e. Mondays, Tuesdays, ...)
-  :day          group by the day email was sent (similar to :day-of-week)
-  :size         group by the file size of the email
-  :flags        group by flags (as defined by mu)
-  :tags         group by tags (as defined by mu)
-  :changed      group by the date changed
-                \(as defined by :changed field in mu4e\)"
-  :group 'consult-mu
-  :type '(radio (const :date)
-                (const :subject)
-                (const :from)
-                (const :to)
-                (const :time)
-                (const :datetime)
-                (const :year)
-                (const :month)
-                (const :week)
-                (const :day-of-week)
-                (const :day)
-                (const :size)
-                (const :flags)
-                (const :tags)
-                (const :changed)
-                (const nil)))
-
-(defcustom consult-mu-mark-previewed-as-read nil
-  "Whether to mark PREVIEWED emails as read or not?"
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-mark-viewed-as-read t
-  "Whether to mark VIEWED emails as read or not?"
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-headers-buffer-name "*consult-mu-headers*"
-  "Default name for HEADERS buffer explicitly for `consult-mu'.
-
-For more info see `mu4e-headers-buffer-name'."
-  :group 'consult-mu
-  :type 'string)
-
-(defcustom consult-mu-view-buffer-name "*consult-mu-view*"
-  "Default name for VIEW buffer explicitly for `consult-mu'.
-
-For more info see `mu4e-view-buffer-name'."
-  :group 'consult-mu
-  :type 'string)
-
-(defcustom consult-mu-preview-key consult-preview-key
-  "Preview key for `consult-mu'.
-
-This is similar to `consult-preview-key' but explicitly for `consult-mu'."
-  :group 'consult-mu
-  :type '(choice (symbol :tag "Any key" 'any)
-                 (list :tag "Debounced"
-                       (const :debounce)
-                       (float :tag "Seconds" 0.1)
-                       (const any))
-                 (const :tag "No preview" nil)
-                 (key :tag "Key")
-                 (repeat :tag "List of keys" key)))
-
-
-(defcustom consult-mu-highlight-matches t
-  "Should `consult-mu' highlight search queries in preview buffers?"
-  :group 'consult-mu
-  :type 'boolean)
-
-(defcustom consult-mu-use-wide-reply 'ask
-  "Reply to all or not?
-
-This defines whether `consult-mu--reply-action' should reply to all or not."
-  :group 'consult-mu
-  :type '(choice (symbol :tag "Ask for confirmation" 'ask)
-                 (const :tag "Do not reply to all" nil)
-                 (const :tag "Always reply to all" t)))
-
-(defcustom consult-mu-action #'consult-mu--view-action
-  "The function that is used when selecting a message.
-By default it is bound to `consult-mu--view-action'."
-  :group 'consult-mu
-  :type '(choice (function :tag "(Default) View Message in Mu4e Buffers" consult-mu--view-action)
-                 (function :tag "Reply to Message" consult-mu--reply-action)
-                 (function :tag "Forward Message" consult-mu--forward-action)
-                 (function :tag "Custom Function")))
-
-(defcustom consult-mu-default-command #'consult-mu-dynamic
-  "Which command should `consult-mu' call."
-  :group 'consult-mu
-  :type '(choice (function :tag "(Default) Use Dynamic Collection (i.e. `consult-mu-dynamic')" #'consult-mu-dynamic)
-                 (function :tag "Use Async Collection (i.e. `consult-mu-async')"  #'consult-mu-async)
-                 (function :tag "Custom Function")))
-
-#+end_src
-
-*** Other Variables
-#+begin_src emacs-lisp
-;;; Other Variables
-(defvar consult-mu-category 'consult-mu
-  "Category symbol for the `consult-mu' package.")
-
-(defvar consult-mu-messages-category 'consult-mu-messages
-  "Category symbol for messages in `consult-mu' package.")
-
-(defvar consult-mu--view-buffers-list (list)
-  "List of currently open preview buffers for `consult-mu'.")
-
-(defvar consult-mu--history nil
-  "History variable for `consult-mu'.")
-
-(defvar consult-mu-delimiter "      "
-  "Delimiter to use for fields in mu command output.
-
-The idea is Taken from  https://github.com/seanfarley/counsel-mu.")
-
-(defvar consult-mu-saved-searches-dynamic (list)
-  "List of Favorite searches for `consult-mu-dynamic'.")
-
-(defvar consult-mu-saved-searches-async consult-mu-saved-searches-dynamic
-  "List of Favorite searches for `consult-mu-async'.")
-
-(defvar consult-mu--override-group nil
-  "Override grouping in `consult-mu' based on user input.")
-
-(defvar consult-mu--mail-headers '("Subject" "From" "To" "From/To" "Cc" "Bcc" "Reply-To" "Date" "Attachments" "Tags" "Flags" "Maildir" "Summary" "List" "Path" "Size" "Message-Id" "List-Id" "Changed")
-  "List of possible headers in a message.")
-
-#+end_src
-
-** Define faces
-#+begin_src emacs-lisp
-;;; Faces
-
-(defface consult-mu-highlight-match-face
-  `((t :inherit 'consult-highlight-match))
-  "Highlight match face in `consult-mu' view buffer.
-
-By default inherits from `consult-highlight-match'.
-This is used to highlight matches of search queries in the minibufffer
-completion list.")
-
-(defface consult-mu-preview-match-face
-  `((t :inherit 'consult-preview-match))
-  "Preview match face in `consult-mu' preview buffers.
-
-By default inherits from `consult-preview-match'.
-This is used to highlight matches of search query terms in preview buffers
-\(i.e. `consult-mu-view-buffer-name'\).")
-
-(defface consult-mu-default-face
-  `((t :inherit 'default))
-  "Default face in `consult-mu' minibuffer annotations.
-
-By default inherits from `default' face.")
-
-(defface consult-mu-subject-face
-  `((t :inherit 'font-lock-keyword-face))
-  "Subject face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-keyword-face'.")
-
-(defface consult-mu-sender-face
-  `((t :inherit 'font-lock-variable-name-face))
-  "Contact face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-variable-name-face'.")
-
-(defface consult-mu-receiver-face
-  `((t :inherit 'font-lock-variable-name-face))
-  "Contact face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-variable-name-face'.")
-
-(defface consult-mu-date-face
-  `((t :inherit 'font-lock-preprocessor-face))
-  "Date face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-preprocessor-face'.")
-
-(defface consult-mu-count-face
-  `((t :inherit 'font-lock-string-face))
-  "Count face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-string-face'.")
-
-(defface consult-mu-size-face
-  `((t :inherit 'font-lock-string-face))
-  "Size face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-string-face'.")
-
-(defface consult-mu-tags-face
-  `((t :inherit 'font-lock-comment-face))
-  "Tags/Comments face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-comment-face'.")
-
-(defface consult-mu-flags-face
-  `((t :inherit 'font-lock-function-call-face))
-  "Flags face in `consult-mu' minibuffer annotations.
-
-By default inherits from `font-lock-function-call-face'.")
-
-(defface consult-mu-url-face
-  `((t :inherit 'link))
-  "URL face in `consult-mu' minibuffer annotations;
-
-By default inherits from `link'.")
-
-#+end_src
-
-** Backend functions
-This section includes functions (utilities, mu4e hacks, ...).
-*** general utility
-**** pulses
-***** pulse-regexp
-#+begin_src emacs-lisp
-(defun consult-mu--pulse-regexp (regexp)
-  "Find and pulse REGEXP."
-  (goto-char (point-min))
-  (while (re-search-forward regexp nil t)
-    (when-let* ((m (match-data))
-                (beg (car m))
-                (end (cadr m))
-                (ov (make-overlay beg end))
-                (pulse-delay 0.075))
-      (pulse-momentary-highlight-overlay ov 'highlight))))
-
-#+end_src
-***** pulse-region
-#+begin_src emacs-lisp
-(defun consult-mu--pulse-region (beg end)
-  "Find and pulse region from BEG to END."
-  (let ((ov (make-overlay beg end))
-        (pulse-delay 0.075))
-    (pulse-momentary-highlight-overlay ov 'highlight)))
-
-#+end_src
-***** pulse-line
-#+begin_src emacs-lisp
-(defun consult-mu--pulse-line ()
-  "Pulse line at point momentarily."
-  (let* ((pulse-delay 0.055)
-         (ov (make-overlay (car (bounds-of-thing-at-point 'line))
-                           (cdr (bounds-of-thing-at-point 'line)))))
-    (pulse-momentary-highlight-overlay ov 'highlight)))
-
-#+end_src
-
-**** formatting strings
-***** fix string length
-#+begin_src emacs-lisp
-(defun consult-mu--set-string-width (string width &optional prepend)
-  "Set the STRING width to a fixed value, WIDTH.
-
-If the STRING is longer than WIDTH, it truncates the string and adds
-ellipsis, “...”.  If the string is shorter, it adds whitespace to the
-string.  If PREPEND is non-nil, it truncates or adds whitespace from the
-beginning of string, instead of the end."
-  (let* ((string (format "%s" string))
-         (w (string-width string)))
-    (when (< w width)
-      (if prepend
-          (setq string (format "%s%s" (make-string (- width w) ?\s) (substring string)))
-        (setq string (format "%s%s" (substring string) (make-string (- width w) ?\s)))))
-    (when (> w width)
-      (if prepend
-          (setq string (format "...%s" (substring string (- w (- width 3)) w)))
-        (setq string (format "%s..." (substring string 0 (- width (+ w 3)))))))
-    string))
-
-(defun consult-mu--justify-left (string prefix maxwidth)
-  "Set the width of  STRING+PREFIX justified from left.
-
-Use `consult-mu--set-string-width' to the width of the concatenate of
-STRING+PREFIX \(e.g. “(concat prefix string)”\) within MAXWIDTH.  This is
-used for aligning marginalia info in the minibuffer."
-  (let ((w (string-width prefix)))
-    (if (> maxwidth w)
-        (consult-mu--set-string-width string (- maxwidth w) t)
-      string)))
-
-#+end_src
-***** highlight match with text-properties
-#+begin_src emacs-lisp
-(defun consult-mu--highlight-match (regexp str ignore-case)
-  "Highlight REGEXP in STR.
-
-If a REGEXP contains a capturing group, only the captured group is
-highlighted, otherwise, the whole match is highlighted.
-Case is ignored if IGNORE-CASE is non-nil.
-\(This is adapted from `consult--highlight-regexps'.\)"
-  (let ((i 0))
-    (while (and (let ((case-fold-search ignore-case))
-                  (string-match regexp str i))
-                (> (match-end 0) i))
-      (let ((m (match-data)))
-        (setq i (cadr m)
-              m (or (cddr m) m))
-        (while m
-          (when (car m)
-            (add-face-text-property (car m) (cadr m)
-                                    'consult-mu-highlight-match-face nil str))
-          (setq m (cddr m))))))
-  str)
-
-#+end_src
-***** highlight match with overlay
-#+begin_src emacs-lisp
-(defun consult-mu--overlay-match (match-str buffer ignore-case)
-  "Highlight MATCH-STR in BUFFER using an overlay.
-
-If IGNORE-CASE is non-nil, it uses case-insensitive match.
-
-This is used to highlight matches to use queries when viewing emails.  See
-`consult-mu-overlays-toggle' for toggling highligths on/off."
-  (with-current-buffer (or (get-buffer buffer) (current-buffer))
-    (remove-overlays (point-min) (point-max) 'consult-mu-overlay t)
-    (goto-char (point-min))
-    (let ((case-fold-search ignore-case))
-      (while (search-forward match-str nil t)
-        (when-let* ((m (match-data))
-                    (beg (car m))
-                    (end (cadr m))
-                    (overlay (make-overlay beg end)))
-          (overlay-put overlay 'consult-mu-overlay t)
-          (overlay-put overlay 'face 'consult-mu-highlight-match-face))))))
-
-(defun consult-mu-overlays-toggle (&optional buffer)
-  "Toggle overlay highlight in BUFFER.
-
-BUFFER defaults to `current-buffer'."
-  (interactive)
-  (let ((buffer (or buffer (current-buffer))))
-    (with-current-buffer buffer
-      (dolist (o (overlays-in (point-min) (point-max)))
-        (when (overlay-get o 'consult-mu-overlay)
-          (if (and (overlay-get o 'face) (eq (overlay-get o 'face) 'consult-mu-highlight-match-face))
-              (overlay-put o 'face nil)
-            (overlay-put o 'face 'consult-mu-highlight-match-face)))))))
-
-#+end_src
-
-**** format date
-#+begin_src emacs-lisp
-(defun consult-mu--format-date (string)
-  "Format the date STRING from mu output.
-
-STRING is the output form a mu command, for example:
-`mu find query --fields d`
-Returns the date in the format Day-of-Week Month Day Year Time
-\(e.g. Sat Nov 04 2023 09:46:54\)"
-  (let ((string (replace-regexp-in-string " " "0" string)))
-    (format "%s %s %s"
-            (substring string 0 10)
-            (substring string -4 nil)
-            (substring string 11 -4))))
-
-#+end_src
-**** flags to string
-#+begin_src emacs-lisp
-(defun consult-mu-flags-to-string (FLAG)
-  "Covert FLAGS, from mu output to strings.
-
-FLAG is the output form mu command in the terminal, for example:
- `mu find query --fields g`.
-This function converts each character in FLAG to an expanded string of the
-flag and returns the list of these strings."
-  (cl-loop for c across FLAG
-           collect
-           (pcase (string c)
-             ("D" 'draft)
-             ("F" 'flagged)
-             ("N" 'new)
-             ("P" 'forwarded)
-             ("R" 'replied)
-             ("S" 'read)
-             ("T" 'trashed)
-             ("a" 'attachment)
-             ("x" 'encrrypted)
-             ("s" 'signed)
-             ("u" 'unread)
-             ("l" 'list)
-             ("q" 'personal)
-             ("c" 'calendar)
-             (_ nil))))
-
-#+end_src
-**** extract email from string
-#+begin_src emacs-lisp
-(defun consult-mu--message-extract-email-from-string (string)
-  "Find and return the first email address in the STRING."
-  (when (stringp string)
-    (string-match "[a-zA-Z0-9\_\.\+\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+" string)
-    (match-string 0 string)))
-
-#+end_src
-**** split string of emails to list of emails
-#+begin_src emacs-lisp
-(defun consult-mu--message-emails-string-to-list (string)
-  "Convert comma-separated STRING of email addresses to a list."
-  (when (stringp string)
-    (remove '(" " "\s" "\t")
-            (mapcar #'consult-mu--message-extract-email-from-string
-                    (split-string string ",\\|;\\|\t" t)))))
-
-#+end_src
-**** get header field from message
-#+begin_src emacs-lisp
-(defun consult-mu--message-get-header-field (&optional field)
-  "Retrive FIELD header from the message/mail in the current buffer."
-  (save-match-data
-    (save-excursion
-      (when (or (derived-mode-p 'message-mode)
-                (derived-mode-p 'mu4e-view-mode)
-                (derived-mode-p 'org-msg-edit-mode)
-                (derived-mode-p 'mu4e-compose-mode))
-        (let* ((case-fold-search t)
-               (header-regexp (mapconcat (lambda (str) (concat "\n" str ": "))
-                                        consult-mu--mail-headers "\\|"))
-               (field (or (downcase field)
-                          (downcase (consult--read consult-mu--mail-headers
-                                                   :prompt "Header Field: ")))))
-          (if (string-prefix-p "attachment" field) (setq field "\\(attachment\\|attachments\\)"))
-          (goto-char (point-min))
-          (message-goto-body)
-          (let* ((match (re-search-backward (concat "^" field ": \\(?1:[[:ascii:][:nonascii:]]*?\\)\n\\(.*?:\\|\n\\)") nil t))
-                 (str (if (and match (match-string 1)) (string-trim (match-string 1)))))
-            (if (string-empty-p str) nil str)))))))
-#+end_src
-
-*** mu4e and message backend
-**** append-handler
-#+begin_src emacs-lisp
-(defun consult-mu--headers-append-handler (msglst)
-  "Append one-line descriptions of messages in MSGLST.
-
-This is used to override `mu4e~headers-append-handler' to ensure that
-buffer handling is done right for `consult-mu'."
-  (with-current-buffer "*consult-mu-headers*"
-    (let ((inhibit-read-only t))
-      (seq-do
-       ;; I use mu4e-column-faces and it overrides the default append-handler. To get the same effect I check if mu4e-column-faces is active and enabled.
-       (if (and (featurep 'mu4e-column-faces) mu4e-column-faces-mode)
-           (lambda (msg)
-             (mu4e-column-faces--insert-header msg (point-max)))
-         (lambda (msg)
-           (mu4e~headers-insert-header msg (point-max))))
-       msglst))))
-
-#+end_src
-
-**** view-msg
-#+begin_src emacs-lisp
-(defun consult-mu--view-msg (msg &optional buffername)
-  "Display the message MSG in a buffer with BUFFERNAME.
-
-BUFFERNAME defaults to `consult-mu-view-buffer-name'.
-
-This s used to overrides `mu4e-view' to ensure that buffer handling is done
-right for `consult-mu'."
-  (let* ((linked-headers-buffer (mu4e-get-headers-buffer "*consult-mu-headers*" t))
-         (mu4e-view-buffer-name (or buffername consult-mu-view-buffer-name)))
-    (setq gnus-article-buffer (mu4e-get-view-buffer linked-headers-buffer t))
-    (with-current-buffer gnus-article-buffer
-      (let ((inhibit-read-only t))
-        (remove-overlays (point-min) (point-max) 'mu4e-overlay t)
-        (erase-buffer)
-        (insert-file-contents-literally
-         (mu4e-message-readable-path msg) nil nil nil t)
-        (setq-local mu4e--view-message msg)
-        (mu4e--view-render-buffer msg)
-        (mu4e-loading-mode 0)
-        (with-current-buffer linked-headers-buffer
-          (setq-local mu4e~headers-view-win (mu4e-display-buffer gnus-article-buffer nil)))
-        (run-hooks 'mu4e-view-rendered-hook)))))
-
-#+end_src
-
-**** headers-clear
-#+begin_src emacs-lisp
-(defun consult-mu--headers-clear (&optional text)
-  "Clear the headers buffer and related data structures.
-
-Optionally, show TEXT.
-
-This is used to override `mu4e~headers-clear' to ensure that buffer
-handling is done right for `consult-mu'."
-  (setq mu4e~headers-render-start (float-time)
-        mu4e~headers-hidden 0)
-  (with-current-buffer "*consult-mu-headers*"
-    (let ((inhibit-read-only t))
-      (mu4e--mark-clear)
-      (erase-buffer)
-      (when text
-        (goto-char (point-min))
-        (insert (propertize text 'face 'mu4e-system-face 'intangible t))))))
-
-#+end_src
-
-
-**** set mu4e search properties from opts
-#+begin_src emacs-lisp
-(defun consult-mu--set-mu4e-search-sortfield (opts)
-  "Dynamically set the `mu4e-search-sort-field' based on user input.
-
-Uses user input (i.e. from `consult-mu' command) to define the sort field.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400 --sortfield from”
-
-`mu4e-search-sort-field' is set to :from
-
-Note that per mu4e docs:
-When threading is enabled, the headers are exclusively sorted
-chronologically (:date) by the newest message in the thread."
-  (let* ((sortfield (cond
-                     ((member "-s" opts) (nth (+ (cl-position "-s" opts :test 'equal) 1) opts))
-                     ((member "--sortfield" opts) (nth (+ (cl-position "--sortfield" opts :test 'equal) 1) opts))
-                     (t consult-mu-search-sort-field))))
-    (pcase sortfield
-      ('nil
-       consult-mu-search-sort-field)
-      ((or "date" "d")
-       :date)
-      ((or "subject" "s")
-       :subject)
-      ((or "size" "z")
-       :size)
-      ((or "prio" "p")
-       :prio)
-      ((or "from" "f")
-       :from)
-      ((or "to" "t")
-       :to)
-      ((or "list" "v")
-       :list)
-      ;; ((or "tags" "x")
-      ;;  :tags)
-      (_
-       consult-mu-search-sort-field))))
-
-(defun consult-mu--set-mu4e-search-sort-direction (opts)
-  "Dynamically set the `mu4e-search-sort-direction' based on user input.
-
-Uses user input \(i.e. from `consult-mu' command\) to define the sort field.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example, if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400 --sortfield from --reverse”
-
-The `mu4e-search-sort-direction' is reversed; If it is set to
-\='ascending, it is toggled to \='descending and vise versa."
-  (if (or (member "-z" opts) (member "--reverse" opts))
-      (pcase consult-mu-search-sort-direction
-        ('descending
-         'ascending)
-        ('ascending
-         'descending))
-    consult-mu-search-sort-direction))
-
-(defun consult-mu--set-mu4e-skip-duplicates (opts)
-  "Dynamically set the `mu4e-search-skip-duplicates' based on user input.
-
-Uses user input \(i.e. from `consult-mu' command\) to define whether to
-skip duplicates.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example, if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400 --skip-dups”
-
-The `mu4e-search-skip-duplicates' is set to t."
-  (if (or (member "--skip-dups" opts) mu4e-search-skip-duplicates) t nil))
-
-(defun consult-mu--set-mu4e-results-limit (opts)
-  "Dynamically set the `mu4e-search-results-limit' based on user input.
-
-
-Uses user input \(i.e. from `consult-mu' command\) to define the number of
-results shown.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example, if the user enters the following in the minibuffer:
-
-“#query -- --maxnum 400”
-
-The `mu4e-search-results-limit' is set to 400."
-  (cond
-   ((member "-n" opts) (string-to-number (nth (+ (cl-position "-n" opts :test 'equal) 1) opts)))
-   ((member "--maxnum" opts) (string-to-number (nth (+ (cl-position "--maxnum" opts :test 'equal) 1) opts)))
-   (t consult-mu-maxnum)))
-
-
-(defun consult-mu--set-mu4e-include-related (opts)
-  "Dynamically set the `mu4e-search-include-related' based on user input.
-
-Uses user input \(i.e. from `consult-mu' command\) to define whether to
-include related messages.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-For example if the user enters the following in the minibuffer:
-
-“#query -- --include-related”
-
-The `mu4e-search-include-related' is set to t."
-  (if (or (member "-r" opts) (member "--include-related" opts) mu4e-search-include-related) t nil))
-
-
-
-(defun consult-mu--set-mu4e-threads (opts)
-  "Set  the `mu4e-search-threads' based on `mu4e-search-sort-field'.
-
-Uses user input \(i.e. from `consult-mu' command\) to define whether to
-show threads.
-
-OPTS is the command line options for mu and can be set by entering options
-in the minibuffer input.  For more details, refer to `consult-grep' and
-consult async documentation.
-
-Note that per mu4e docs, when threading is enabled, the headers are
-exclusively sorted by date.  Here the logic is reversed in order to allow
-dynamically sorting by fields other than date \(even when threads are
-enabled\).  In other words, if the sort-field is not the :date, threading
-is disabled because otherwise sort field will be ignored.  This allows the
-user to use command line arguments to sort messages by fields other than
-the date.  For example, the user can enter the following in the minibuffer
-input to sort by subject
-
-“#query -- --sortfield subject”
-
-When the sort-field is :date, the default setting,
-`consult-mu-search-threads' is used, and if that is set to nil, the user
-can use command line arguments \(a.k.a. -t or --thread\) to enable it
-dynamically."
-  (cond
-   ((not (equal mu4e-search-sort-field :date))
-    nil)
-   ((or (member "-t" opts) (member "--threads" opts) consult-mu-search-threads)
-    t)))
-
-#+end_src
-**** update headers
-#+begin_src emacs-lisp
-(defun consult-mu--update-headers (query ignore-history msg type)
-  "Search for QUERY, and update `consult-mu-headers-buffer-name' buffer.
-
-If IGNORE-HISTORY is true, does *not* update the query history stack,
-`mu4e--search-query-past'.
-If MSG is non-nil, put the cursor on MSG.
-TYPE can be either \=':dynamic or \=':async"
-  (consult-mu--execute-all-marks)
-  (cl-letf* (((symbol-function #'mu4e~headers-append-handler) #'consult-mu--headers-append-handler))
-    (unless (mu4e-running-p) (mu4e--server-start))
-    (let* ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t))
-           (view-buffer (get-buffer consult-mu-view-buffer-name))
-           (expr (car (consult--command-split (substring-no-properties query))))
-           (rewritten-expr (funcall mu4e-query-rewrite-function expr))
-           (mu4e-headers-fields consult-mu-headers-fields))
-      (pcase type
-        (:dynamic)
-        (:async
-         (setq rewritten-expr (funcall mu4e-query-rewrite-function (concat "msgid:" (plist-get msg :message-id)))))
-        (_ ))
-
-      (with-current-buffer buf
-        (save-excursion
-          (let ((inhibit-read-only t))
-            (erase-buffer)
-            (mu4e-headers-mode)
-            (setq-local mu4e-view-buffer-name consult-mu-view-buffer-name)
-            (if view-buffer
-                (setq-local mu4e~headers-view-win (mu4e-display-buffer gnus-article-buffer nil)))
-            (unless ignore-history
-                                        ; save the old present query to the history list
-              (when mu4e--search-last-query
-                (mu4e--search-push-query mu4e--search-last-query 'past)))
-            (setq mu4e--search-last-query rewritten-expr)
-            (setq list-buffers-directory rewritten-expr)
-            (mu4e--modeline-update)
-            (run-hook-with-args 'mu4e-search-hook expr)
-            (consult-mu--headers-clear mu4e~search-message)
-            (setq mu4e~headers-search-start (float-time))
-
-            (pcase-let* ((`(,_arg . ,opts) (consult--command-split query))
-                         (mu4e-search-sort-field (consult-mu--set-mu4e-search-sortfield opts))
-                         (mu4e-search-sort-direction (consult-mu--set-mu4e-search-sort-direction opts))
-                         (mu4e-search-skip-duplicates (consult-mu--set-mu4e-skip-duplicates opts))
-                         (mu4e-search-results-limit (consult-mu--set-mu4e-results-limit opts))
-                         (mu4e-search-threads (consult-mu--set-mu4e-threads opts))
-                         (mu4e-search-include-related (consult-mu--set-mu4e-include-related opts)))
-              (mu4e--server-find
-               rewritten-expr
-               mu4e-search-threads
-               mu4e-search-sort-field
-               mu4e-search-sort-direction
-               mu4e-search-results-limit
-               mu4e-search-skip-duplicates
-               mu4e-search-include-related))
-            (while (or (string-empty-p (buffer-substring (point-min) (point-max)))
-                       (equal (buffer-substring (point-min) (+ (point-min) (length mu4e~search-message))) mu4e~search-message)
-                       (not (or (equal (buffer-substring (- (point-max) (length mu4e~no-matches)) (point-max)) mu4e~no-matches) (equal (buffer-substring (- (point-max) (length mu4e~end-of-results)) (point-max)) mu4e~end-of-results))))
-              (sleep-for 0.005))))))))
-
-#+end_src
-
-**** execute-marks
-#+begin_src emacs-lisp
-(defun consult-mu--execute-all-marks (&optional no-confirmation)
-  "Execute the actions for all marked messages.
-
-Executes all actions for marked messages in the buffer
-`consult-mu-headers-buffer-name'.
-
-If NO-CONFIRMATION is non-nil, don't ask user for confirmation.
-
-This is similar to `mu4e-mark-execute-all' but, with buffer/window
-handling set accordingly for `consult-mu'."
-  (interactive "P")
-  (when-let* ((buf (get-buffer consult-mu-headers-buffer-name)))
-    (with-current-buffer buf
-      (when (eq major-mode 'mu4e-headers-mode)
-        (mu4e--mark-in-context
-         (let* ((marknum (mu4e-mark-marks-num)))
-           (unless (zerop marknum)
-             (pop-to-buffer buf)
-             (unless (one-window-p) (delete-other-windows))
-             (mu4e-mark-execute-all no-confirmation)
-             (quit-window))))))))
-
-#+end_src
-
-**** goto-message by message-id
-#+begin_src emacs-lisp
-(defun consult-mu--headers-goto-message-id (msgid)
-  "Jump to message with MSGID.
-
-This is done in `consult-mu-headers-buffer-name' buffer."
-  (when-let ((buffer consult-mu-headers-buffer-name))
-    (with-current-buffer buffer
-      (setq mu4e-view-buffer-name consult-mu-view-buffer-name)
-      (mu4e-headers-goto-message-id msgid))))
-
-#+end_src
-**** get message form message-id
-#+begin_src emacs-lisp
-(defun consult-mu--get-message-by-id (msgid)
-  "Find the message with MSGID and return the mu4e MSG plist for it."
-  (cl-letf* (((symbol-function #'mu4e-view) #'consult-mu--view-msg))
-    (when-let ((buffer consult-mu-headers-buffer-name))
-      (with-current-buffer buffer
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)
-        (mu4e-headers-goto-message-id msgid)
-        (mu4e-message-at-point)))))
-
-#+end_src
-**** make or retrive from/to/cc/bcc plist
-#+begin_src emacs-lisp
-(defun consult-mu--contact-string-to-plist (string)
-  "Convert STRING for contacts to plist.
-
-STRING is the output form mu command, for example from:
-`mu find query --fields f`
-
-Returns a plist with \=':email and \':name keys.
-
-For example
-
-“John Doe <john.doe@example.com>”
-
-will be converted to
-
-\(:name “John Doe” :email “john.doe@example.com”\)"
-  (let* ((string (replace-regexp-in-string ">,\s\\|>;\s" ">\n" string))
-         (list (split-string string "\n" t)))
-    (mapcar (lambda (item)
-              (cond
-               ((string-match "\\(?2:.*\\)\s+<\\(?1:.+\\)>" item)
-                (list :email (or (match-string 1 item) nil) :name (or (match-string 2 item) nil)))
-               ((string-match "^\\(?1:[a-zA-Z0-9\_\.\+\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+\\)" item)
-                (list :email (or (match-string 1 item) nil) :name nil))
-               (t
-                (list :email (format "%s" item) :name nil)))) list)))
-
-#+end_src
-
-#+begin_src emacs-lisp
-(defun consult-mu--contact-name-or-email (contact)
-  "Retrieve name or email of CONTACT.
-
-Looks at the contact plist \(e.g. (:name “John Doe” :email
-“john.doe@example.com”)\) and returns the name.  If the name is missing,
-returns the email address."
-  (cond
-   ((stringp contact)
-    contact)
-   ((listp contact)
-    (mapconcat (lambda (item) (or (plist-get item :name) (plist-get item :email) "")) contact ","))))
-
-#+end_src
-**** make custom headers info
-***** make headers template
-#+begin_src emacs-lisp
-(defun consult-mu--headers-template ()
-  "Make headers template using `consult-mu-headers-template'."
-  (if (and consult-mu-headers-template (functionp consult-mu-headers-template))
-      (funcall consult-mu-headers-template)
-    consult-mu-headers-template))
-
-#+end_src
-***** expand headers template
-#+begin_src emacs-lisp
-(defun consult-mu--expand-headers-template (msg string)
-  "Expand STRING to create a custom header format for MSG.
-
-See `consult-mu-headers-template' for explanation of the format of
-STRING."
-
-  (cl-loop for c in (split-string string "%" t)
-           concat (concat (pcase  (substring c 0 1)
-                            ("f" (let ((sender (consult-mu--contact-name-or-email (plist-get msg :from)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if sender
-                                       (propertize (if (> length 0) (consult-mu--set-string-width sender length) sender) 'face 'consult-mu-sender-face))))
-                            ("t" (let ((receiver (consult-mu--contact-name-or-email (plist-get msg :to)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if receiver
-                                       (propertize (if (> length 0) (consult-mu--set-string-width receiver length) receiver) 'face 'consult-mu-sender-face))))
-                            ("s" (let ((subject (plist-get msg :subject))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if subject
-                                       (propertize (if (> length 0) (consult-mu--set-string-width subject length) subject) 'face 'consult-mu-subject-face))))
-                            ("d" (let ((date (format-time-string "%a %d %b %y" (plist-get msg :date)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if date
-                                       (propertize (if (> length 0) (consult-mu--set-string-width date length) date) 'face 'consult-mu-date-face))))
-
-                            ("p" (let ((priority (plist-get msg :priority))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if priority
-                                       (propertize (if (> length 0) (consult-mu--set-string-width (format "%s" priority) length) (format "%s" priority)) 'face 'consult-mu-size-face))))
-                            ("z" (let ((size (file-size-human-readable (plist-get msg :size)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if size
-                                       (propertize (if (> length 0) (consult-mu--set-string-width size length) size)  'face 'consult-mu-size-face))))
-                            ("i" (let ((id (plist-get msg :message-id))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if id
-                                       (propertize (if (> length 0) (consult-mu--set-string-width id length) id) 'face 'consult-mu-default-face))))
-
-                            ("g" (let ((flags  (plist-get msg :flags))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if flags
-                                       (propertize (if (> length 0) (consult-mu--set-string-width (format "%s" flags) length) (format "%s" flags)) 'face 'consult-mu-flags-face))))
-
-                            ("G" (let ((flags (plist-get msg :flags))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if flags
-                                       (propertize (if (> length 0) (consult-mu--set-string-width (format "%s" (mu4e~headers-flags-str flags)) length) (format "%s" (mu4e~headers-flags-str flags))) 'face 'consult-mu-flags-face))))
-
-                            ("x" (let ((tags (plist-get msg :tags))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if tags
-                                       (propertize (if (> length 0) (consult-mu--set-string-width tags length) tags) 'face 'consult-mu-tags-face) nil)))
-
-                            ("c" (let ((cc (consult-mu--contact-name-or-email (plist-get msg :cc)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if cc
-                                       (propertize (if (> length 0) (consult-mu--set-string-width cc length) cc) 'face 'consult-mu-tags-face))))
-
-                            ("h" (let ((bcc (consult-mu--contact-name-or-email (plist-get msg :bcc)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if bcc
-                                       (propertize (if (> length 0) (consult-mu--set-string-width bcc length) bcc) 'face 'consult-mu-tags-face))))
-
-                            ("r" (let ((changed (format-time-string "%a %d %b %y" (plist-get msg :changed)))
-                                       (length (string-to-number (substring c 1 nil))))
-                                   (if changed
-                                       (propertize (if (> length 0) (consult-mu--set-string-width changed length) changed) 'face 'consult-mu-tags-face))))
-                            (_ nil))
-                          "  ")))
-
-#+end_src
-*** consult-mu backend
-**** buffer handling
-***** quit header buffer
-#+begin_src emacs-lisp
-(defun consult-mu--quit-header-buffer ()
-  "Quits `consult-mu-headers-buffer-name' buffer."
-  (save-mark-and-excursion
-    (when-let* ((buf (get-buffer consult-mu-headers-buffer-name)))
-      (with-current-buffer buf
-        (if (eq major-mode 'mu4e-headers-mode)
-            (mu4e-mark-handle-when-leaving)
-          (quit-window t)
-          ;; clear the decks before going to the main-view
-          (mu4e--query-items-refresh 'reset-baseline))))))
-
-#+end_src
-***** quit view buffer
-#+begin_src emacs-lisp
-(defun consult-mu--quit-view-buffer ()
-  "Quits `consult-mu-view-buffer-name' buffer."
-  (when-let* ((buf (get-buffer consult-mu-view-buffer-name)))
-    (with-current-buffer buf
-      (if (eq major-mode 'mu4e-view-mode)
-          (mu4e-view-quit)))))
-
-#+end_src
-***** quit main buffer
-#+begin_src emacs-lisp
-(defun consult-mu--quit-main-buffer ()
-  "Quits `mu4e-main-buffer-name' buffer."
-  (when-let* ((buf (get-buffer mu4e-main-buffer-name)))
-    (with-current-buffer buf
-      (if (eq major-mode 'mu4e-main-mode)
-          (mu4e-quit)))))
-
-#+end_src
-**** minibuffer completion utilities
-***** lookup
-#+begin_src emacs-lisp
-(defun consult-mu--lookup ()
-  "Lookup function for `consult-mu' or `consult-mu-async' candidates.
-
-This is passed as LOOKUP to `consult--read' on candidates and is used to
-format the output when a candidate is selected."
-  (lambda (sel cands &rest _args)
-    (let* ((info (cdr (assoc sel cands)))
-           (msg  (plist-get info :msg))
-           (subject (plist-get msg :subject)))
-      (cons subject info))))
-
-#+end_src
-
-
-***** group
-#+begin_src emacs-lisp
-(defun consult-mu--group-name (cand)
-  "Get the group name of CAND using `consult-mu-group-by'.
-
-See `consult-mu-group-by' for details of grouping options."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (group (or consult-mu--override-group consult-mu-group-by))
-         (field (if (not (keywordp group)) (intern (concat ":" (format "%s" group))) group)))
-    (pcase field
-      (:date (format-time-string "%a %d %b %y" (plist-get msg field)))
-      (:from (cond
-              ((listp (plist-get msg field))
-               (mapconcat (lambda (item) (or (plist-get item :name) (plist-get item :email))) (plist-get msg field) ";"))
-              ((stringp (plist-get msg field)) (plist-get msg field))))
-      (:to (cond
-            ((listp (plist-get msg field))
-             (mapconcat (lambda (item) (or (plist-get item :name) (plist-get item :email))) (plist-get msg field) ";"))
-            ((stringp (plist-get msg field)) (plist-get msg field))))
-      (:changed (format-time-string "%a %d %b %y" (plist-get msg field)))
-      (:datetime (format-time-string "%F %r" (plist-get msg :date)))
-      (:time (format-time-string "%X" (plist-get msg :date)))
-      (:year (format-time-string "%Y" (plist-get msg :date)))
-      (:month (format-time-string "%B" (plist-get msg :date)))
-      (:day-of-week (format-time-string "%A" (plist-get msg :date)))
-      (:day (format-time-string "%A" (plist-get msg :date)))
-      (:week (format-time-string "%V" (plist-get msg :date)))
-      (:size (file-size-human-readable (plist-get msg field)))
-      (:flags (format "%s" (plist-get msg field)))
-      (:tags (format "%s" (plist-get msg field)))
-      (_ (if (plist-get msg field) (format "%s" (plist-get msg field)) nil)))))
-
-(defun consult-mu--group (cand transform)
-  "Group function for `consult-mu' or `consult-mu-async'.
-
-CAND is passed to `consult-mu--group-name' to get the group for CAND.
-When TRANSFORM is non-nil, the name of CAND is used for group."
-  (when-let ((name (consult-mu--group-name cand)))
-    (if transform (substring cand) name)))
-
-#+end_src
-
-***** actions
-In this section we define action functions that can be run on a candidate for example view, reply, forward, etc.
-****** view messages
-#+begin_src emacs-lisp
-(defun consult-mu--view (msg noselect mark-as-read match-str)
-  "Opens MSG in `consult-mu-headers' and `consult-mu-view'.
-
-If NOSELECT is non-nil, does not select the view buffer/window.
-If MARK-AS-READ is non-nil, marks the MSG as read.
-If MATCH-STR is non-nil, highlights the MATCH-STR in the view buffer."
-  (let ((msgid (plist-get msg :message-id)))
-    (when-let ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t)))
-      (with-current-buffer buf
-        ;;(mu4e-headers-mode)
-        (goto-char (point-min))
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)
-        (unless noselect
-          (switch-to-buffer buf))))
-
-    (consult-mu--view-msg msg consult-mu-view-buffer-name)
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (if msgid
-          (progn
-            (mu4e-headers-goto-message-id msgid)
-            (if mark-as-read
-                (mu4e--server-move (mu4e-message-field-at-point :docid) nil "+S-u-N")))))
-
-    (when match-str
-      (add-to-history 'search-ring match-str)
-      (consult-mu--overlay-match match-str consult-mu-view-buffer-name t))
-
-    (with-current-buffer consult-mu-view-buffer-name
-      (goto-char (point-min)))
-
-    (unless noselect
-      (when msg
-        (select-window (get-buffer-window consult-mu-view-buffer-name))))
-    consult-mu-view-buffer-name))
-
-
-(defun consult-mu--view-action (cand)
-  "Open the candidate, CAND.
-
-This is a wrapper function around `consult-mu--view'.  It parses CAND to
-extract relevant MSG plist and other information and passes them to
-`consult-mu--view'.
-
-To use this as the default action for `consult-mu', set
-`consult-mu-default-action' to \=#'consult-mu--view-action."
-
-  (let* ((info (cdr cand))
-         (msg (plist-get info :msg))
-         (query (plist-get info :query))
-         (match-str (car (consult--command-split query))))
-    (consult-mu--view msg nil consult-mu-mark-viewed-as-read match-str)
-    (consult-mu-overlays-toggle consult-mu-view-buffer-name)))
-
-#+end_src
-
-****** reply to message
-#+begin_src emacs-lisp
-(defun consult-mu--reply (msg &optional wide-reply)
-  "Reply to MSG using `mu4e-compose-reply'.
-
-If WIDE-REPLY is non-nil use wide-reply \(a.k.a. reply all\) with
-`mu4e-compose-wide-reply'."
-  (let ((msgid (plist-get msg :message-id)))
-    (when-let ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t)))
-      (with-current-buffer buf
-        (goto-char (point-min))
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)))
-
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (mu4e-headers-goto-message-id msgid)
-      (if (not wide-reply)
-          (mu4e-compose-reply)
-        (mu4e-compose-wide-reply)))))
-
-(defun consult-mu--reply-action (cand &optional wide-reply)
-  "Reply to CAND.
-
-This is a wrapper function around `consult-mu--reply'.  It passes
-relevant message plist, from CAND, as well as WIDE-REPLY to
-`consult-mu--reply'.
-
-To use this as the default action for `consult-mu', set
-`consult-mu-default-action' to \=#'consult-mu--reply-action."
-  (let* ((info (cdr cand))
-         (msg (plist-get info :msg))
-         (wide-reply (or wide-reply
-                         (pcase consult-mu-use-wide-reply
-                           ('ask (y-or-n-p "Reply All?"))
-                           ('nil nil)
-                           ('t t)))))
-    (consult-mu--reply msg wide-reply)))
-
-#+end_src
-
-****** forward a message
-#+begin_src emacs-lisp
-(defun consult-mu--forward (msg)
-  "Forward the MSG using `mu4e-compose-forward'."
-  (let ((msgid (plist-get msg :message-id)))
-    (when-let ((buf (mu4e-get-headers-buffer consult-mu-headers-buffer-name t)))
-      (with-current-buffer buf
-        (goto-char (point-min))
-        (setq mu4e-view-buffer-name consult-mu-view-buffer-name)))
-    (with-current-buffer consult-mu-headers-buffer-name
-      (mu4e-headers-goto-message-id msgid)
-      (mu4e-compose-forward))))
-
-(defun consult-mu--forward-action (cand)
-  "Forward CAND.
-
-This is a wrapper function around `consult-mu--forward'.  It passes
-the relevant message plist, from CAND to `consult-mu--forward'.
-
-To use this as the default action for `consult-mu', set
-`consult-mu-default-action' to \=#'consult-mu--forward-action."
-  (let* ((info (cdr cand))
-         (msg (plist-get info :msg)))
-    (consult-mu--forward msg)))
-
-#+end_src
-
-**** get consult split style character
-#+begin_src emacs-lisp
-(defun consult-mu--get-split-style-character (&optional style)
-  "Get the character for consult async split STYLE.
-
-STYLE defaults to `consult-async-split-style'."
-  (let ((style (or style consult-async-split-style 'none)))
-    (or (char-to-string (plist-get (alist-get style consult-async-split-styles-alist) :initial))
-        (char-to-string (plist-get (alist-get style consult-async-split-styles-alist) :separator))
-        "")))
-
-#+end_src
-** Frontend Interactive Commands
-**** consult-mu-dynamic (dynamic collection)
-***** format candidate
-#+begin_src emacs-lisp
-(defun consult-mu--dynamic-format-candidate (cand highlight)
-  "Format minibuffer candidate, CAND.
-
-CAND is the minibuffer completion candidate \(a mu4e message collected by
-`consult-mu--dynamic-collection'\).  If HIGHLIGHT is non-nil, it is
-highlighted with `consult-mu-highlight-match-face'."
-
-  (let* ((string (car cand))
-         (info (cadr cand))
-         (msg (plist-get info :msg))
-         (query (plist-get info :query))
-         (match-str (if (stringp query) (consult--split-escaped (car (consult--command-split query))) nil))
-         (headers-template (consult-mu--headers-template))
-         (str (if headers-template
-                  (consult-mu--expand-headers-template msg headers-template)
-                string))
-         (str (propertize str :msg msg :query query :type :dynamic)))
-    (if (and consult-mu-highlight-matches highlight)
-        (cond
-         ((listp match-str)
-          (mapc (lambda (match) (setq str (consult-mu--highlight-match match str t))) match-str))
-         ((stringp match-str)
-          (setq str (consult-mu--highlight-match match-str str t))))
-      str)
-    (when msg
-      (cons str (list :msg msg :query query :type :dynamic)))))
-#+end_src
-
-***** dynamic collection
-#+begin_src emacs-lisp
-(defun consult-mu--dynamic-collection (input)
-  "Dynamically collect mu4e search results.
-
-INPUT is the user input.  It is passed as QUERY to
-`consult-mu--update-headers', appends the result to
-`consult-mu-headers-buffer-name' and returns a list of found
-messages."
-
-  (save-excursion
-    (pcase-let* ((`(,_arg . ,opts) (consult--command-split input)))
-      (consult-mu--update-headers (substring-no-properties input) nil nil :dynamic)
-      (if (or (member "-g" opts)  (member "--group" opts))
-          (cond
-           ((member "-g" opts)
-            (setq consult-mu--override-group (intern (or (nth (+ (cl-position "-g" opts :test 'equal) 1) opts) "nil"))))
-           ((member "--group" opts)
-            (setq consult-mu--override-group (intern (or (nth (+ (cl-position "--group" opts :test 'equal) 1) opts) "nil")))))
-        (setq consult-mu--override-group nil)))
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (goto-char (point-min))
-      (remove nil
-              (cl-loop until (eobp)
-                       collect (consult-mu--dynamic-format-candidate (list (buffer-substring (point) (line-end-position)) (list :msg (ignore-errors (mu4e-message-at-point)) :query input)) t)
-                       do (forward-line 1))))))
-#+end_src
-***** state/preview
-#+begin_src emacs-lisp
-(defun consult-mu--dynamic-state ()
-  "State function for `consult-mu' candidates.
-This is passed as STATE to `consult--read' and is used to preview or do
-other actions on the candidate."
-  (lambda (action cand)
-    (let ((preview (consult--buffer-preview)))
-      (pcase action
-        ('preview
-         (if cand
-             (when-let* ((info (cdr cand))
-                         (msg (plist-get info :msg))
-                         (query (plist-get info :query))
-                         (msgid (substring-no-properties (plist-get msg :message-id)))
-                         (match-str (car (consult--command-split query)))
-                         (match-str (car (consult--command-split query)))
-                         (mu4e-headers-buffer-name consult-mu-headers-buffer-name)
-                         (buffer consult-mu-view-buffer-name))
-               ;;(get-buffer-create consult-mu-view-buffer-name)
-               (add-to-list 'consult-mu--view-buffers-list buffer)
-               (funcall preview action
-                        (consult-mu--view msg t consult-mu-mark-previewed-as-read match-str))
-               (with-current-buffer consult-mu-view-buffer-name
-                 (unless (one-window-p) (delete-other-windows))))))
-        ('return
-         (save-mark-and-excursion
-           (consult-mu--execute-all-marks))
-         (setq consult-mu--override-group nil)
-         cand)))))
-
-#+end_src
-
-***** internal dynamic call
-#+begin_src emacs-lisp
-(defun consult-mu--dynamic (prompt collection &optional initial)
-  "Query mu4e messages dyunamically.
-
-This is a non-interactive internal function.  For the interactive version
-see `consult-mu'.
-
-It runs the `consult-mu--dynamic-collection' to do a `mu4e-search' with
-user input \(e.g. INITIAL\) and returns the results \(list of messages
-found\) as a completion table in minibuffer.
-
-The completion table gets dynamically updated as the user types in the
-minibuffer.  Each candidate in the minibuffer is formatted by
-`consult-mu--dynamic-format-candidate' to add annotation and other info to
-the candidate.
-
-Description of Arguments:
-  PROMPT     the prompt in the minibuffer
-             \(passed as PROMPT to   `consult--read'\)
-  COLLECTION a colection function passed to `consult--dynamic-collection'.
-  INITIAL    an optional arg for the initial input in the minibuffer.
-             \(passed as INITITAL to `consult--read'\)
-
-commandline arguments/options \(see `mu find --help` in the command line
-for details\) can be passed to the minibuffer input similar to
-`consult-grep'.  For example the user can enter:
-
-“#paper -- --maxnum 200 --sortfield from --reverse”
-
-this will search for mu4e messages with the query “paper”, retrives a
-maximum of 200 messages and sorts them by the “from:” field and reverses
-the sort direction (opposite of `consult-mu-search-sort-field').
-
-Note that some command line arguments are not supported by mu4e (for
-example sorting based on cc: or bcc: fields are not supported in
-`mu4e-search-sort-field')
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#paper -- --maxnum 200 --sortfield from --reverse#accepted”
-
-will retrieve the message as the example above, then narrows down the
-candidates to those that  that match “accepted”."
-  (consult--read
-   (consult--dynamic-collection (or collection #'consult-mu--dynamic-collection))
-   :prompt (or prompt "Select: ")
-   :lookup (consult-mu--lookup)
-   :state (funcall #'consult-mu--dynamic-state)
-   :initial initial
-   :group #'consult-mu--group
-   :add-history (append (list (thing-at-point 'symbol))
-                        consult-mu-saved-searches-dynamic)
-   :history '(:input consult-mu--history)
-   :require-match t
-   :category 'consult-mu-messages
-   :preview-key consult-mu-preview-key
-   :sort nil))
-
-#+end_src
-
-***** interactive command
-#+begin_src emacs-lisp
-(defun consult-mu-dynamic (&optional initial noaction)
-  "Lists results of `mu4e-search' dynamically.
-
-This is an interactive wrapper function around `consult-mu--dynamic'.  It
-queries the user for a search term in the minibuffer, then fetches a list
-of messages for the entered search term as a minibuffer completion table
-for selection.  The list of candidates in the completion table are
-dynamically updated as the user changes the entry.
-
-Upon selection of a candidate either
- - the candidate is returned if NOACTION is non-nil
- or
- - the candidate is passed to `consult-mu-action' if NOACTION is nil.
-
-Additional commandline arguments can be passed in the minibuffer entry by
-typing “--” followed by command line arguments.
-
-For example, the user can enter:
-
-“#consult-mu -- -n 10”
-
-this will run a `mu4e-search' with the query “consult-mu” and changes the
-search limit \(i.e. `mu4e-search-results-limit' to 10\).
-
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#consult-mu -- -n 10#github”
-
-will retrieve the messages as the example above, then narrows down the
-completion table to candidates that match “github”.
-
-INITIAL is an optional arg for the initial input in the minibuffer.
-\(passed as INITITAL to `consult-mu--dynamic'\)
-
-For more details on consult--async functionalities, see `consult-grep' and
-the official manual of consult, here:
-URL `https://github.com/minad/consult'"
-  (interactive)
-  (save-mark-and-excursion
-    (consult-mu--execute-all-marks))
-  (let* ((sel
-          (consult-mu--dynamic (concat "[" (propertize "consult-mu-dynamic" 'face 'consult-mu-sender-face) "]" " Search For:  ") #'consult-mu--dynamic-collection initial)))
-    (save-mark-and-excursion
-      (consult-mu--execute-all-marks))
-    (if noaction
-        sel
-      (progn
-        (funcall consult-mu-action sel)
-        sel))))
-#+end_src
-
-**** consult-mu-async
-***** format candidate
-#+begin_src emacs-lisp
-(defun consult-mu--async-format-candidate (string input highlight)
-  "Formats minibuffer candidates for `consult-mu-async'.
-
-STRING is the output retrieved from `mu find INPUT ...` in the command line.
-INPUT is the query from the user.
-
-If HIGHLIGHT is t, input is highlighted with
-`consult-mu-highlight-match-face' in the minibuffer."
-
-  (let* ((query input)
-         (parts (split-string (replace-regexp-in-string "^\\\\->\s\\|^\\\/->\s" "" string) consult-mu-delimiter))
-         (msgid (car parts))
-         (date (date-to-time (cadr parts)))
-         (sender (cadr (cdr parts)))
-         (sender (consult-mu--contact-string-to-plist sender))
-         (receiver (cadr (cdr (cdr parts))))
-         (receiver (consult-mu--contact-string-to-plist receiver))
-         (subject (cadr (cdr (cdr (cdr parts)))))
-         (size (string-to-number (cadr (cdr (cdr (cdr (cdr parts)))))))
-         (flags (consult-mu-flags-to-string (cadr (cdr (cdr (cdr (cdr (cdr parts))))))))
-         (tags (cadr (cdr (cdr (cdr (cdr (cdr (cdr parts))))))))
-         (priority (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts)))))))))
-         (cc (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts))))))))))
-         (cc (consult-mu--contact-string-to-plist cc))
-         (bcc (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts)))))))))))
-         (bcc (consult-mu--contact-string-to-plist bcc))
-         (path (cadr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr parts))))))))))))
-         (msg (list :subject subject :date date :from sender :to receiver :size size :message-id msgid :flags flags :tags tags :priority priority :cc cc :bcc bcc :path path))
-         (match-str (if (stringp input) (consult--split-escaped (car (consult--command-split query))) nil))
-         (headers-template (consult-mu--headers-template))
-         (str (if headers-template
-                  (consult-mu--expand-headers-template msg headers-template)
-                (format "%s\s\s%s\s\s%s\s\s%s\s\s%s\s\s%s"
-                        (propertize (consult-mu--set-string-width
-                                     (format-time-string "%x" date) 10)
-                                    'face 'consult-mu-date-face)
-                        (propertize (consult-mu--set-string-width (consult-mu--contact-name-or-email sender) (floor (* (frame-width) 0.2)))  'face 'consult-mu-sender-face)
-                        (propertize (consult-mu--set-string-width subject (floor (* (frame-width) 0.55))) 'face 'consult-mu-subject-face)
-                        (propertize (file-size-human-readable size) 'face 'consult-mu-size-face)
-                        (propertize (format "%s" flags) 'face 'consult-mu-flags-face)
-                        (propertize (if tags (format "%s" tags) nil) 'face 'consult-mu-tags-face))))
-         (str (propertize str :msg msg :query query :type :async)))
-    (if (and consult-mu-highlight-matches highlight)
-        (cond
-         ((listp match-str)
-          (mapc (lambda (match) (setq str (consult-mu--highlight-match match str t))) match-str))
-         ((stringp match-str)
-          (setq str (consult-mu--highlight-match match-str str t))))
-      str)
-    (cons str (list :msg msg :query query :type :async))))
-
-#+end_src
-
-
-***** state/preview
-#+begin_src emacs-lisp
-(defun consult-mu--async-state ()
-  "State function for `consult-mu-async' candidates.
-
-This is passed as STATE to `consult--read' and is used to preview or do
-other actions on the candidate."
-  (lambda (action cand)
-    (let ((preview (consult--buffer-preview)))
-      (pcase action
-        ('preview
-         (if cand
-             (when-let* ((info (cdr cand))
-                         (msg (plist-get info :msg))
-                         (msgid (substring-no-properties (plist-get msg :message-id)))
-                         (query (plist-get info :query))
-                         (match-str (car (consult--command-split query)))
-                         (mu4e-headers-buffer-name consult-mu-headers-buffer-name)
-                         (buffer consult-mu-view-buffer-name))
-               (add-to-list 'consult-mu--view-buffers-list buffer)
-               (funcall preview action
-                        (consult-mu--view msg t consult-mu-mark-previewed-as-read match-str))
-               (with-current-buffer consult-mu-view-buffer-name
-                 (unless (one-window-p) (delete-other-windows))))))
-        ('return
-         (save-mark-and-excursion
-           (consult-mu--execute-all-marks))
-         cand)))))
-
-#+end_src
-
-
-***** transform
-#+begin_src emacs-lisp
-(defun consult-mu--async-transform (input)
-  "Add annotation to minibuffer candiates for `consult-mu'.
-
-Format each candidates with `consult-gh--repo-format' and INPUT."
-  (lambda (cands)
-    (cl-loop for cand in cands
-             collect
-             (consult-mu--async-format-candidate cand input t))))
-
-#+end_src
-
-***** builder
-#+begin_src emacs-lisp
-(defun consult-mu--async-builder (input)
-  "Build mu command line for searching messages by INPUT (e.g. `mu find INPUT)`."
-  (pcase-let* ((consult-mu-args (append consult-mu-args '("find")))
-               (cmd (consult--build-args consult-mu-args))
-               (`(,arg . ,opts) (consult--command-split input))
-               (flags (append cmd opts))
-               (sortfield (cond
-                           ((member "-s" flags) (nth (+ (cl-position "-s" opts :test 'equal) 1) flags))
-                           ((member "--sortfield" flags) (nth (+ (cl-position "--sortfield" flags :test 'equal) 1) flags))
-                           (t (substring (symbol-name consult-mu-search-sort-field) 1))))
-               (threads (if (not (equal sortfield :date)) nil (or (member "-t" flags) (member "--threads" flags) mu4e-search-threads)))
-               (skip-dups (or (member "-u" flags) (member "--skip-dups" flags) mu4e-search-skip-duplicates))
-               (include-related (or (member "-r" flags) (member "--include-related" flags) mu4e-search-include-related)))
-    (if (or (member "-g" flags)  (member "--group" flags))
-        (cond
-         ((member "-g" flags)
-          (setq consult-mu--override-group (intern (or (nth (+ (cl-position "-g" opts :test 'equal) 1) opts) "nil")))
-          (setq opts (remove "-g" (remove (nth (+ (cl-position "-g" opts :test 'equal) 1) opts) opts))))
-         ((member "--group" flags)
-          (setq consult-mu--override-group (intern (or (nth (+ (cl-position "--group" opts :test 'equal) 1) opts) "nil")))
-          (setq opts (remove "--group" (remove (nth (+ (cl-position "--group" opts :test 'equal) 1) opts) opts)))))
-      (setq consult-mu--override-group nil))
-    (setq opts (append opts (list "--nocolor")))
-    (setq opts (append opts (list "--fields" (format "i%sd%sf%st%ss%sz%sg%sx%sp%sc%sh%sl"
-                                                     consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter consult-mu-delimiter))))
-    (unless (or (member "-s" flags) (member "--sortfiled" flags))
-      (setq opts (append opts (list "--sortfield" (substring (symbol-name consult-mu-search-sort-field) 1)))))
-    (if threads (setq opts (append opts (list "--thread"))))
-    (if skip-dups (setq opts (append opts (list "--skip-dups"))))
-    (if include-related (setq opts (append opts (list "--include-related"))))
-    (cond
-     ((and (member "-n" flags) (< (string-to-number (nth (+ (cl-position "-n" opts :test 'equal) 1) opts)) 0))
-      (setq opts (remove "-n" (remove (nth (+ (cl-position "-n" opts :test 'equal) 1) opts) opts))))
-     ((and (member "--maxnum" flags) (< (string-to-number (nth (+ (cl-position "--maxnum" opts :test 'equal) 1) opts)) 0))
-      (setq opts (remove "--maxnum" (remove (nth (+ (cl-position "--maxnum" opts :test 'equal) 1) opts) opts)))))
-    (unless (or (member "-n" flags)  (member "--maxnum" flags))
-      (if (and consult-mu-maxnum (> consult-mu-maxnum 0))
-          (setq opts (append opts (list "--maxnum" (format "%s" consult-mu-maxnum))))))
-
-    (pcase consult-mu-search-sort-direction
-      ('descending
-       (if (or (member "-z" flags) (member "--reverse" flags))
-           (setq opts (remove "-z" (remove "--reverse" opts)))
-         (setq opts (append opts (list "--reverse")))))
-      ('ascending)
-      (_))
-    (pcase-let* ((`(,re . ,hl) (funcall consult--regexp-compiler arg 'basic t)))
-      (when re
-        (cons (append cmd
-                      (list (string-join re " "))
-                      opts)
-              hl)))))
-
-#+end_src
-
-
-***** internal async command
-#+begin_src emacs-lisp
-(defun consult-mu--async (prompt builder &optional initial)
-  "Query mu4e messages asynchronously.
-
-This is a non-interactive internal function.  For the interactive
-version, see `consult-mu-async'.
-
-It runs the command line from `consult-mu--async-builder' in an async
-process and returns the results (list of messages) as a completion table
-in minibuffer that will be passed to `consult--read'.  The completion
-table gets dynamically updated as the user types in the minibuffer.  Each
-candidate in the minibuffer is formatted by `consult-mu--async-transform'
-to add annotation and other info to the candidate.
-
-Description of Arguments:
-
-PROMPT  the prompt in the minibuffer
-        \(passed as PROMPT to `consult--red'\)
-BUILDER an async builder function passed to `consult--async-command'
-INITIAL an optional arg for the initial input in the minibuffer
-        \(passed as INITITAL to `consult--read'\)
-
-commandline arguments/options \(see `mu find --help` in the command line
-for details\) can be passed to the minibuffer input similar to
-`consult-grep'.  For example the user can enter:
-
-“#paper -- --maxnum 200 --sortfield from --reverse”
-
-this will search for mu4e messages with the query “paper”, retrives a
-maximum of 200 messages sorts them by the “from:” field and reverses the
-sort direction (opposite of `consult-mu-search-sort-field').
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-`#paper -- --maxnum 200 --sortfield from --reverse#accepted'
-
-will retrieve the message as the example above, then narrows down the
-completion table to candidates that match “accepted”."
-  (consult--read
-   (consult--process-collection builder
-     :transform (consult--async-transform-by-input #'consult-mu--async-transform))
-   :prompt prompt
-   :lookup (consult-mu--lookup)
-   :state (funcall #'consult-mu--async-state)
-   :initial initial
-   :group #'consult-mu--group
-   :add-history (append (list (thing-at-point 'symbol))
-                        consult-mu-saved-searches-async)
-   :history '(:input consult-mu--history)
-   :require-match t
-   :category 'consult-mu-messages
-   :preview-key consult-mu-preview-key
-   :sort nil))
-
-#+end_src
-
-***** interactive command
-#+begin_src emacs-lisp
-(defun consult-mu-async (&optional initial noaction)
-  "Lists results of `mu find` Asynchronously.
-
-This is an interactive wrapper function around `consult-mu--async'.  It
-queries the user for a search term in the minibuffer, then fetches a list
-of messages for the entered search term as a minibuffer completion table
-for selection.  The list of candidates in the completion table are
-dynamically updated as the user changes the entry.
-
-Upon selection of a candidate either
- - the candidate is returned if NOACTION is non-nil
- or
- - the candidate is passed to `consult-mu-action' if NOACTION is nil.
-
-Additional commandline arguments can be passed in the minibuffer entry by
-typing `--` followed by command line arguments.
-
-For example the user can enter:
-
-`#consult-mu -- -n 10'
-
-this will run a `mu4e-search' with the query \"consult-my\" and changes the
-search limit (i.e. `mu4e-search-results-limit' to 10.
-
-
-Also, the results can further be narrowed by `consult-async-split-style'
-\(e.g. by entering “#” when `consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#consult-mu -- -n 10#github”
-
-will retrieve the message as the example above, then narrows down the
-completion table to candidates that match “github”.
-
-INITIAL is an optional arg for the initial input in the minibuffer.
-\(passed as INITITAL to `consult-mu--async'\).
-
-For more details on consult--async functionalities, see `consult-grep' and
-the official manual of consult, here:
-URL `https://github.com/minad/consult'
-
-Note that this is the async search directly using the commandline `mu`
-command and not mu4e-search. As a result, mu4e-headers buffers are not
-created until a single message is selected \(or interacted with using
-embark, etc.\)  Previews are shown in a mu4e-view buffer \(see
-`consult-mu-view-buffer-name'\) attached to an empty mu4e-headers buffer
-\(i.e. `consult-mu-headers-buffer-name'\).  This allows quick retrieval of
-many messages \(tens of thousands\) and previews, but not opening the
-results in a mu4e-headers buffer.  If you want ot open the results in a
-mu4e-headers buffer for other work flow, then you should use the
-dynamically collected function `consult-mu' which is slower if searching
-for many emails but allows follow up interactions in a mu4e-headers
-buffer."
-  (interactive)
-  (save-mark-and-excursion
-    (consult-mu--execute-all-marks))
-  (let* ((sel
-          (consult-mu--async (concat "[" (propertize "consult-mu async" 'face 'consult-mu-sender-face) "]" " Search For:  ") #'consult-mu--async-builder initial))
-         (info (cdr sel))
-         (msg (plist-get info :msg))
-         (query (plist-get info :query)))
-    (save-mark-and-excursion
-      (consult-mu--execute-all-marks))
-    (if noaction
-        sel
-      (progn
-        (consult-mu--update-headers query t msg :async))
-      (funcall consult-mu-action sel)
-      sel)))
-
-#+end_src
-
-
-**** consult-mu
-
-***** interactive command
-#+begin_src emacs-lisp
-(defun consult-mu (&optional initial noaction)
-  "Default interactive command.
-
-This is a wrapper function that calls `consult-mu-default-command' with
-INITIAL and NOACTION.
-
-For example, the `consult-mu-default-command can be set to
- `#'consult-mu-dynamic' sets the default behavior to dynamic collection
- `#'consult-mu-async' sets the default behavior to async collection"
-
-  (interactive "P")
-  (funcall consult-mu-default-command initial noaction))
-
-#+end_src
-
-
-** Provide
-#+begin_src emacs-lisp
-;;; provide `consult-mu' module
-(provide 'consult-mu)
-
-#+end_src
-** Footer
-#+begin_src emacs-lisp
-;;; consult-mu.el ends here
-#+end_src
-
-* consult-mu-embark.el
-:PROPERTIES:
-:header-args:emacs-lisp: :results none :mkdirp yes :comments none :tangle ./consult-mu-embark.el
-:END:
-*** Header
-#+begin_src  emacs-lisp
-;;; consult-mu-embark.el --- Emabrk Actions for consult-mu -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021-2023
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-;;; Code:
-
-#+end_src
-
-*** Main
-This section includes additional useful embark actions as well as possible keymaps. This will be provided as examples and starting point to users, so that they can make their own custom embark actions and functions.
-
-#+begin_src emacs-lisp
-;;; Requirements
-(require 'embark)
-(require 'consult-mu)
-
-;;; Customization Variables
-(defcustom consult-mu-embark-noconfirm-before-execute nil
-  "Should consult-mu-embark skip confirmation when executing marks?"
-  :group 'consult-mu
-  :type 'boolean)
-
-;;; Define Embark Action Functions
-(defun consult-mu-embark-default-action (cand)
-  "Run `consult-mu-action' on the candidate, CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand))
-         (newcand (cons cand `(:msg ,msg :query ,query :type ,type))))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (funcall consult-mu-action newcand)))
-
-
-
-(defun consult-mu-embark-reply (cand)
-  "Reply to message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (consult-mu--reply msg nil)))
-
-(defun consult-mu-embark-wide-reply (cand)
-  "Reply all for message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (consult-mu--reply msg )))
-
-(defun consult-mu-embark-forward (cand)
-  "Forward the message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (consult-mu--forward msg)))
-
-(defun consult-mu-embark-kill-message-field (cand)
-  "Get a header field of message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand))
-         (msg-id (plist-get msg :message-id)))
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-    (with-current-buffer consult-mu-headers-buffer-name
-      (unless (equal (mu4e-message-field-at-point :message-id) msg-id)
-        (mu4e-headers-goto-message-id msg-id))
-      (if (equal (mu4e-message-field-at-point :message-id) msg-id)
-          (progn
-            (mu4e~headers-update-handler msg nil nil))))
-
-    (with-current-buffer consult-mu-view-buffer-name
-      (kill-new (consult-mu--message-get-header-field))
-      (consult-mu--pulse-region (point) (line-end-position)))))
-
-(defun consult-mu-embark-save-attachmnts (cand)
-  "Save attachments of CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (query (get-text-property 0 :query cand))
-         (type (get-text-property 0 :type cand))
-         (msg-id (plist-get msg :message-id)))
-
-    (if (equal type :async)
-        (consult-mu--update-headers query t msg :async))
-
-    (with-current-buffer consult-mu-headers-buffer-name
-      (unless (equal (mu4e-message-field-at-point :message-id) msg-id)
-        (mu4e-headers-goto-message-id msg-id))
-      (if (equal (mu4e-message-field-at-point :message-id) msg-id)
-          (progn
-            (mu4e~headers-update-handler msg nil nil))))
-
-    (with-current-buffer consult-mu-view-buffer-name
-      (goto-char (point-min))
-      (re-search-forward "^\\(Attachment\\|Attachments\\): " nil t)
-      (consult-mu--pulse-region (point) (line-end-position))
-      (mu4e-view-save-attachments t))))
-
-(defun consult-mu-embark-search-messages-from-contact (cand)
-  "Search messages from the same sender as the message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         (from (car (plist-get msg :from)))
-         (email (plist-get from :email)))
-    (consult-mu (concat "from:" email))))
-
-(defun consult-mu-embark-search-messages-with-subject (cand)
-  "Search all messages for the same subject as the message in CAND."
-  (let* ((msg (get-text-property 0 :msg cand))
-         ;;(subject (replace-regexp-in-string ":\\|#\\|\\.\\|\\+" "" (plist-get msg :subject)))
-         (subject (replace-regexp-in-string ":\\|#\\|\\.\\|\\+\\|\\(\\[.*\\]\\)" "" (format "%s" (plist-get msg :subject)))))
-    (consult-mu (concat "subject:" subject))))
-
-;; macro for defining functions for marks
-(defmacro consult-mu-embark--defun-mark-for (mark)
-  "Define a function mu4e-view-mark-for- MARK."
-  (let ((funcname (intern (format "consult-mu-embark-mark-for-%s" mark)))
-        (docstring (format "Mark the current message for %s." mark)))
-    `(progn
-       (defun ,funcname (cand) ,docstring
-              (let* ((msg (get-text-property 0 :msg cand))
-                     (msgid (plist-get msg  :message-id))
-                     (query (get-text-property 0 :query cand))
-                     (buf (get-buffer consult-mu-headers-buffer-name)))
-                (if buf
-                    (progn
-                      (with-current-buffer buf
-                        (if (eq major-mode 'mu4e-headers-mode)
-                            (progn
-                              (goto-char (point-min))
-                              (mu4e-headers-goto-message-id msgid)
-                              (if (equal (mu4e-message-field-at-point :message-id) msgid)
-                                  (mu4e-headers-mark-and-next ',mark)
-                                (progn
-                                  (consult-mu--update-headers query t msg :async)
-                                  (with-current-buffer buf
-                                    (goto-char (point-min))
-                                    (mu4e-headers-goto-message-id msgid)
-                                    (if (equal (mu4e-message-field-at-point :message-id) msgid)
-                                        (mu4e-headers-mark-and-next ',mark))))))
-                          (progn
-                            (consult-mu--update-headers query t msg :async)
-                            (with-current-buffer buf
-                              (goto-char (point-min))
-                              (mu4e-headers-goto-message-id msgid)
-                              (if (equal (mu4e-message-field-at-point :message-id) msgid)
-                                  (mu4e-headers-mark-and-next ',mark)))))))))))))
-
-;; add embark functions for marks
-(defun consult-mu-embark--defun-func-for-marks (marks)
-  "Run the macro `consult-mu-embark--defun-mark-for' on MARKS.
-
-MARKS is a list of marks.
-
-This is useful for creating embark functions for all the `mu4e-marks'
-elements."
-  (mapcar (lambda (mark) (eval `(consult-mu-embark--defun-mark-for ,mark))) marks))
-
-;; use consult-mu-embark--defun-func-for-marks to make a function for each `mu4e-marks' element.
-(consult-mu-embark--defun-func-for-marks (mapcar 'car mu4e-marks))
-
-;;; Define Embark Keymaps
-(defvar-keymap consult-mu-embark-general-actions-map
-  :doc "Keymap for consult-mu-embark"
-  :parent embark-general-map)
-
-(add-to-list 'embark-keymap-alist '(consult-mu . consult-mu-embark-general-actions-map))
-
-
-(defvar-keymap consult-mu-embark-messages-actions-map
-  :doc "Keymap for consult-mu-embark-messages"
-  :parent consult-mu-embark-general-actions-map
-  "r" #'consult-mu-embark-reply
-  "w" #'consult-mu-embark-wide-reply
-  "f" #'consult-mu-embark-forward
-  "?" #'consult-mu-embark-kill-message-field
-  "c" #'consult-mu-embark-search-messages-from-contact
-  "s" #'consult-mu-embark-search-messages-with-subject
-  "S" #'consult-mu-embark-save-attachmnts)
-
-(add-to-list 'embark-keymap-alist '(consult-mu-messages . consult-mu-embark-messages-actions-map))
-
-
-;; add mark keys to `consult-mu-embark-messages-actions-map' keymap
-(defun consult-mu-embark--add-keys-for-marks (marks)
-  "Add a key for each mark in MARKS to embark map.
-
-Adds the keys in `consult-mu-embark-messages-actions-map', and binds the
-combination “m key”, where key is the :char in mark plist in the
-`consult-mu-embark-messages-actions-map' to the function defined by the
-prefix “consult-mu-embark-mark-for-” and mark.
-
-This is useful for adding all `mu4e-marks' to embark key bindings under a
-submenu (called by “m”), for example, the default mark-for-archive mark
-that is bound to r in mu4e buffers can be called in embark by “m r”."
-  (mapcar (lambda (mark)
-            (let* ((key (plist-get (cdr mark) :char))
-                   (key (cond ((consp key) (car key)) ((stringp key) key)))
-                   (func (intern (concat "consult-mu-embark-mark-for-" (format "%s" (car mark)))))
-                   (key (concat "m" key)))
-              (define-key consult-mu-embark-messages-actions-map key func)))
-          marks))
-
-;; add all `mu4e-marks to embark keybindings. See `consult-mu-embark--add-keys-for-marks' above for more details
-(consult-mu-embark--add-keys-for-marks mu4e-marks)
-
-;; change the default action on `consult-mu-messages' category.
-(add-to-list 'embark-default-action-overrides '(consult-mu-messages . consult-mu-embark-default-action))
-
-
-;;; Provide `consult-mu-embark' module
-
-(provide 'consult-mu-embark)
-
-;;; consult-mu-embark.el ends here
-#+end_src
-
-
-* consult-mu-compose.el
-:PROPERTIES:
-:header-args:emacs-lisp: :results none :mkdirp yes :comments none :tangle ./extras/consult-mu-compose.el
-:END:
-** Header
-#+begin_src emacs-lisp
-;;; consult-mu-compose.el --- Consult Mu4e asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2023 Armin Darvish
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-;;; Code:
-
-#+end_src
-
-** Requirements
-#+begin_src emacs-lisp
-(require 'consult-mu)
-
-#+end_src
-
-** Define Group, Customs, Vars, etc.
-*** Custom Variables
-#+begin_src emacs-lisp
-;;; Customization Variables
-(defcustom consult-mu-compose-use-dired-attachment 'in-dired
-  "Use a Dired buffer for multiple file attachment?
-
-If set to \='in-dired uses `dired' buffer and `dired' marks only when inside
-a `dired' buffer.  If \='t, a `dired' buffer will be used for selecting attachment files similar to what Doom Emacs does:
-URL `https://github.com/doomemacs/doomemacs/blob/bea81278fd2ecb65db6a63dbcd6db2f52921ee41/modules/email/mu4e/autoload/email.el#L272'.
-
-If \='nil, consult-mu uses minibuffer completion for selection files to
-attach, even if inside a `dired' buffer.
-
-By default this is set to \='in-dired."
-  :group 'consult-mu
-  :type '(choice (const :tag "Only use Dired if inside Dired Buffer" 'in-dired)
-                 (const :tag "Always use Dired" t)
-                 (const :tag "Never use Dired" nil)))
-
-(defcustom consult-mu-large-file-warning-threshold large-file-warning-threshold
-  "Threshold for size of file to require confirmation for preview.
-
-This is used when selecting files to attach to emails.  Files larger than this value in size will require user confirmation before previewing the file.  Default value is set by `large-file-warning-threshold'.  If nil, no cofnirmation is required."
-  :group 'consult-mu
-  :type '(choice integer (const :tag "Never request confirmation" nil)))
-
-
-(defcustom consult-mu-compose-preview-key consult-mu-preview-key
-  "Preview key for `consult-mu-compose'.
-
-This is similar to `consult-mu-preview-key' but explicitly for
-consult-mu-compose.  It is recommended to set this to something other than
-\='any to avoid loading preview buffers for each file."
-  :group 'consult-mu
-  :type '(choice (const :tag "Any key" any)
-                 (list :tag "Debounced"
-                       (const :debounce)
-                       (float :tag "Seconds" 0.1)
-                       (const any))
-                 (const :tag "No preview" nil)
-                 (key :tag "Key")
-                 (repeat :tag "List of keys" key)))
-
-(defcustom consult-mu-embark-attach-file-key nil
-  "Embark key binding for interactive file attachement."
-  :group 'consult-mu
-  :type '(choice (key :tag "Key")
-                 (const :tag "no key binding" nil)))
-
-#+end_src
-*** Others
-#+begin_src emacs-lisp
-(defvar consult-mu-compose-attach-history nil
-  "History variable for file attachment.
-
-It is used in `consult-mu-compose--read-file-attach'.")
-
-(defvar consult-mu-compose-current-draft-buffer nil
-  "Store the buffer that is being edited.")
-
-#+end_src
-
-** Backend Functions
-
-*** utilities
-**** read file name to attach
-#+begin_src emacs-lisp
-(defun consult-mu-compose--read-file-attach (&optional initial)
-  "Read files in the minibuffer to attach to an email.
-
-INITIAL is the initial input in the minibuffer."
-  (consult--read (completion-table-in-turn #'completion--embedded-envvar-table
-                                           #'completion--file-name-table)
-                 :prompt "Attach File: "
-                 :require-match t
-                 :category 'file
-                 :initial (or initial default-directory)
-                 :lookup (lambda (sel cands &rest args)
-                           (file-truename sel))
-                 :state (lambda (action cand)
-                          (let ((preview (consult--buffer-preview)))
-                            (pcase action
-                              ('preview
-                               (if cand
-                                   (when (not (file-directory-p cand))
-                                     (let* ((filename (file-truename cand))
-                                            (filesize (float
-                                                       (file-attribute-size
-                                                        (file-attributes filename))))
-                                            (confirm (if (and filename
-                                                              (>= filesize consult-mu-large-file-warning-threshold))
-                                                         (yes-or-no-p (format "File is %s Bytes.  Do you really want to preview it?" filesize))
-                                                       t)))
-                                       (if confirm
-                                           (funcall preview action
-                                                    (find-file-noselect (file-truename cand))))))))
-                              ('return
-                               cand))))
-                 :preview-key consult-mu-compose-preview-key
-                 :add-history (list mu4e-attachment-dir)
-                 :history 'consult-mu-compose-attach-history))
-#+end_src
-
-**** read file to remove
-#+begin_src emacs-lisp
-(defun consult-mu-compose--read-file-remove (&optional initial)
-  "Select attached files to remove from email.
-
-INITIAL is the initial input in the minibuffer."
-
-  (if-let ((current-files (pcase major-mode
-                            ('org-msg-edit-mode
-                             (org-msg-get-prop "attachment"))
-                            ((or 'mu4e-compose-mode 'message-mode)
-                             (goto-char (point-max))
-                             (cl-loop while (re-search-backward "<#part.*filename=\"\\(?1:.*\\)\"[[:ascii:][:nonascii:]]*?/part>" nil t)
-                                      collect (match-string-no-properties 1)))
-                            (_
-                             (error "Not in a compose message buffer")
-                             nil))))
-
-      (consult--read current-files
-                     :prompt "Remove File:"
-                     :category 'file
-                     :state (lambda (action cand)
-                              (let ((preview (consult--buffer-preview)))
-                                (pcase action
-                                  ('preview
-                                   (if cand
-                                       (when (not (file-directory-p cand))
-                                         (let* ((filename (file-truename cand))
-                                                (filesize (float
-                                                           (file-attribute-size
-                                                            (file-attributes filename))))
-                                                (confirm (if (and filename
-                                                                  (>= filesize consult-mu-large-file-warning-threshold))
-                                                             (yes-or-no-p (format "File is %s Bytes.  Do you really want to preview it?" filesize))
-                                                           t)))
-                                           (if confirm
-                                               (funcall preview action
-                                                        (find-file-noselect (file-truename cand))))))))
-                                  ('return
-                                   cand))))
-                     :preview-key consult-mu-compose-preview-key
-                     :initial initial)
-    (progn
-      (message "No files currently attached!")
-      nil)))
-
-#+end_src
-
-**** get draft buffer
-#+begin_src emacs-lisp
-(defun consult-mu-compose-get-draft-buffer ()
-  "Query user to select a mu4e compose draft buffer."
-  (save-excursion
-  (if (and (consult-mu-compose-get-current-buffers)
-           (y-or-n-p "Attach the files to an existing compose buffer? "))
-      (consult--read (consult-mu-compose-get-current-buffers)
-                     :prompt "Select Message Buffer: "
-                     :require-match nil
-                     :category 'consult-mu-messages
-                     :preview-key consult-mu-preview-key
-                     :lookup (lambda (sel cands &rest args)
-                               (or (get-buffer sel) sel))
-                     :state (lambda (action cand)
-                              (let ((preview (consult--buffer-preview)))
-                                (pcase action
-                                  ('preview
-                                   (if (and cand (buffer-live-p cand))
-                                       (funcall preview action
-                                                cand)))
-                                  ('return
-                                   cand))))))))
-
-#+end_src
-**** get current compose buffers
-#+begin_src emacs-lisp
-(defun consult-mu-compose-get-current-buffers ()
-  "Return a list of active compose message buffers."
-  (let (buffers)
-    (save-current-buffer
-      (dolist (buffer (buffer-list t))
-        (set-buffer buffer)
-        (when (or (and (derived-mode-p 'message-mode)
-                       (null message-sent-message-via))
-                  (derived-mode-p 'org-msg-edit-mode)
-                  (derived-mode-p 'mu4e-compose-mode))
-          (push (buffer-name buffer) buffers))))
-    (nreverse buffers)))
-#+end_src
-*** actions
-**** add attachment
-***** attach a file
-#+begin_src emacs-lisp
-(defun consult-mu-compose--attach-files (files &optional mail-buffer &rest _args)
-  "Attach FILES to email in MAIL-BUFFER compose buffer."
-  (let ((files (if (stringp files) (list files) files))
-        (mail-buffer (or mail-buffer (if (version<= mu4e-mu-version "1.12")
-                                 (mu4e-compose 'new) (mu4e-compose-new)))))
-    (with-current-buffer mail-buffer
-      (pcase major-mode
-        ('org-msg-edit-mode
-         (save-excursion
-           (let* ((new-files (delete-dups (append (org-msg-get-prop "attachment") files))))
-             (org-msg-set-prop "attachment" new-files))
-           (goto-last-change 0)
-           (org-reveal)
-           (consult-mu--pulse-line)))
-        ((or 'mu4e-compose-mode 'message-mode)
-         (save-excursion
-           (dolist (file files)
-             (goto-char (point-max))
-             (unless (eq (current-column) 0)
-               (insert "\n\n")
-               (forward-line 2))
-             (mail-add-attachment (file-truename file))
-             (goto-last-change 0)
-             (forward-line -2)
-             (consult-mu--pulse-line))))
-        (_
-         (error "%s is not a compose buffer" (current-buffer)))))))
-#+end_src
-
-**** remove attachment
-#+begin_src emacs-lisp
-(defun consult-mu-compose--remove-files (files &optional mail-buffer &rest _args)
-  "Remove FILES from current attachments in MAIL-BUFFER."
-  (let ((files (if (stringp files) (list files) files))
-        (mail-buffer (or mail-buffer (current-buffer))))
-    (with-current-buffer mail-buffer
-      (save-excursion
-        (pcase major-mode
-          ('org-msg-edit-mode
-           (let ((current-files (org-msg-get-prop "attachment"))
-                 (removed-files (list)))
-             (mapcar (lambda (file)
-                       (when (member file current-files)
-                         (org-msg-set-prop "attachment" (delete-dups (remove file current-files)))
-                         (add-to-list 'removed-files file)
-                         (setq current-files (org-msg-get-prop "attachment"))
-                         (goto-last-change 0)
-                         (org-reveal)
-                         (consult-mu--pulse-line)))
-                     files)
-             (message "file(s) %s detached" (mapconcat 'identity removed-files ","))))
-          ('mu4e-compose-mode
-           (let ((removed-files (list)))
-             (mapcar (lambda (file)
-                       (goto-char (point-min))
-                       (while (re-search-forward (format "<#part.*filename=\"%s\"[[:ascii:][:nonascii:]]*?/part>" file) nil t)
-                         (replace-match "" nil nil)
-                         (setq removed-files (append removed-files (list file)))
-                         (goto-last-change 0)
-                         (consult-mu--pulse-line)
-                         (whitespace-cleanup)))
-                     files)
-             (message "file(s) %s detached" (mapconcat 'identity removed-files ", ")))))))))
-#+end_src
-
-** Frontend Interactive Commands
-#+begin_src emacs-lisp
-(defun consult-mu-compose-attach (&optional files mail-buffer)
-  "Attach FILES to email in MAIL-BUFFER interactively.
-
-MAIL-BUFFER defaults to `consult-mu-compose-current-draft-buffer'."
-  (interactive)
-  (let* ((consult-mu-compose-current-draft-buffer (cond
-                                                   ((or (derived-mode-p 'mu4e-compose-mode) (derived-mode-p 'org-msg-edit-mode) (derived-mode-p 'message-mode)) (current-buffer))
-                                                   ((derived-mode-p 'dired-mode)
-                                                    (and (bound-and-true-p dired-mail-buffer) (buffer-live-p dired-mail-buffer) dired-mail-buffer))
-                                                   (t
-                                                    consult-mu-compose-current-draft-buffer)))
-         (mail-buffer (or mail-buffer
-                          (and (buffer-live-p consult-mu-compose-current-draft-buffer) consult-mu-compose-current-draft-buffer)
-                          nil))
-         (files (or files
-                    (if (and (derived-mode-p 'dired-mode) consult-mu-compose-use-dired-attachment)
-                        (delq nil
-                              (mapcar
-                               ;; don't attach directories
-                               (lambda (f) (if (file-directory-p f)
-                                               nil
-                                             f))
-                               (nreverse (dired-map-over-marks (dired-get-filename) nil))))
-                      (consult-mu-compose--read-file-attach files)))))
-    (pcase major-mode
-      ((or 'mu4e-compose-mode 'org-msg-edit-mode 'message-mode)
-       (setq mail-buffer (current-buffer))
-       (setq consult-mu-compose-current-draft-buffer mail-buffer)
-       (cond
-        ((stringp files)
-         (cond
-          ((and (not (file-directory-p files)) (file-truename files))
-           (consult-mu-compose--attach-files (file-truename files) mail-buffer))
-          ((and (file-directory-p files) (eq consult-mu-compose-use-dired-attachment 'always))
-           (progn
-             (split-window-sensibly)
-             (with-current-buffer (dired files)
-               (setq-local dired-mail-buffer mail-buffer))))
-          ((and (file-directory-p files) (not (eq consult-mu-compose-use-dired-attachment 'always)))
-           (progn
-             (while (file-directory-p files)
-               (setq files (consult-mu-compose--read-file-attach files)))
-             (consult-mu-compose--attach-files (file-truename files) mail-buffer)))))
-        ((listp files)
-         (consult-mu-compose--attach-files files mail-buffer))))
-      ('dired-mode
-       (setq mail-buffer (or (and (bound-and-true-p dired-mail-buffer) (buffer-live-p dired-mail-buffer) dired-mail-buffer)
-                             (consult-mu-compose-get-draft-buffer)
-                             (if (version<= mu4e-mu-version "1.12")
-                                 (mu4e-compose 'new) (mu4e-compose-new))))
-
-       (cond
-        ((and mail-buffer (buffer-live-p mail-buffer)))
-        ((stringp mail-buffer) (with-current-buffer (if (version<= mu4e-mu-version "1.12")
-                                                        (mu4e-compose 'new) (mu4e-compose-new))
-                                 (save-excursion (message-goto-subject)
-                                                 (insert mail-buffer)
-                                                 (rename-buffer mail-buffer t)))
-         (setq mail-buffer (get-buffer mail-buffer))))
-
-       (if (and mail-buffer (buffer-live-p mail-buffer))
-           (progn
-             (setq-local dired-mail-buffer mail-buffer)
-             (switch-to-buffer mail-buffer)
-             (cond
-              ((not files)
-               (message "no files were selected!"))
-              ((stringp files)
-               (cond
-                ((and (file-truename files) (not (file-directory-p files)))
-                 (consult-mu-compose--attach-files (file-truename files) mail-buffer))
-                ((and (not consult-mu-compose-use-dired-attachment) (file-directory-p files))
-                 (progn
-                   (while (file-directory-p files)
-                     (setq files (consult-mu-compose--read-file-attach files)))
-                   (consult-mu-compose--attach-files (file-truename files) mail-buffer)))))
-              ((listp files)
-               (consult-mu-compose--attach-files files mail-buffer))))))
-      (_
-       (setq mail-buffer (or
-                          consult-mu-compose-current-draft-buffer
-                          (consult-mu-compose-get-draft-buffer)
-                          (if (version<= mu4e-mu-version "1.12")
-                              (mu4e-compose 'new) (mu4e-compose-new))))
-       (cond
-        ((and mail-buffer (buffer-live-p mail-buffer)))
-        ((stringp mail-buffer) (with-current-buffer (if (version<= mu4e-mu-version "1.12")
-                                                        (mu4e-compose 'new) (mu4e-compose-new))
-                                 (save-excursion (message-goto-subject)
-                                                 (insert mail-buffer)
-                                                 (rename-buffer mail-buffer t)))
-         (setq mail-buffer (get-buffer mail-buffer))))
-       (if (and mail-buffer (buffer-live-p mail-buffer))
-           (progn
-             (switch-to-buffer mail-buffer)
-             (setq consult-mu-compose-current-draft-buffer mail-buffer)
-             (cond
-              ((and (not (file-directory-p files)) (file-truename files))
-               (consult-mu-compose--attach-files (file-truename files) mail-buffer))
-              ((and (file-directory-p files) (eq consult-mu-compose-use-dired-attachment 'always))
-               (progn
-                 (split-window-sensibly)
-                 (with-current-buffer (dired files)
-                   (setq-local dired-mail-buffer mail-buffer)
-                   )))
-              ((and (file-directory-p files) (not (eq consult-mu-compose-use-dired-attachment 'always)))
-               (progn
-                 (while (file-directory-p files)
-                   (setq files (consult-mu-compose--read-file-attach files)))
-                 (consult-mu-compose--attach-files (file-truename files) mail-buffer)))
-              ((listp files)
-               (consult-mu-compose--attach-files files mail-buffer))))))))
-  mail-buffer)
-
-(defun consult-mu-compose-detach (&optional file)
-  "Remove FILE from email attachments interactively."
-  (interactive)
-  (save-mark-and-excursion
-    (when-let (file (consult-mu-compose--read-file-remove))
-      (consult-mu-compose--remove-files file))))
-#+end_src
-
-** Provide
-#+begin_src emacs-lisp
-;;; provide `consult-mu-compose' module
-(provide 'consult-mu-compose)
-#+end_src
-** Footer
-#+begin_src emacs-lisp
-;;; consult-mu-compose.el ends here
-#+end_src
-* consult-mu-compose-embark.el
-:PROPERTIES:
-:header-args:emacs-lisp: :results none :mkdirp yes :comments none :tangle ./extras/consult-mu-compose-embark.el
-:END:
-*** Header
-#+begin_src  emacs-lisp
-;;; consult-mu-compose-embark.el --- Emabrk Actions for consult-mu-compose -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021-2023
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-
-;;; Code:
-#+end_src
-*** Main
-#+begin_src emacs-lisp
-;;; Requirements
-(require 'embark)
-(require 'consult-mu)
-(require 'consult-mu-embark)
-
-(defun consult-mu-compose-embark-attach-file (cand)
-  "Run `consult-mu-attach-files' on CAND."
-  (funcall (apply-partially #'consult-mu-compose-attach cand)))
-
-;;; add consult-mu-attach to embark-file-map
-(defun consult-mu-compose-embark-bind-attach-file-key (&optional key)
-  "Binds `consult-mu-embark-attach-file-key'.
-
-Bind `consult-mu-embark-attach-file-key' to
-`consult-mu-compose-embark-attach-file' in `embark-file-map'.  If KEY is
-non-nil binds KEY instead of `consult-mu-embark-attach-file-key'."
-  (if-let ((keyb (or key (kbd consult-mu-embark-attach-file-key))))
-      (define-key embark-file-map keyb #'consult-mu-compose-embark-attach-file)))
-
-(consult-mu-compose-embark-bind-attach-file-key)
-
-;; change the default action on `consult-mu-contacts category.
-(add-to-list 'embark-default-action-overrides '((file . consult-mu-compose--read-file-attach)  . consult-mu-compose-attach))
-(add-to-list 'embark-default-action-overrides '((file . consult-mu-compose-attach)  . consult-mu-compose-attach))
-
-;;; Provide `consult-mu-compose-embark' module
-
-(provide 'consult-mu-compose-embark)
-
-;;; consult-mu-compose-embark.el ends here
-#+end_src
-
-* consult-mu-contacts.el
-:PROPERTIES:
-:header-args:emacs-lisp: :results none :mkdirp yes :comments none :tangle ./extras/consult-mu-contacts.el
-:END:
-** Header
-#+begin_src emacs-lisp
-;;; consult-mu-contacts.el --- Consult Mu4e asynchronously -*- lexical-binding: t -*-
-
-;; Copyright (C) 2023 Armin Darvish
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-
-;;; Code:
-
-#+end_src
-
-** Requirements
-#+begin_src emacs-lisp
-(require 'consult-mu)
-
-#+end_src
-** Define Group, Customs, Vars, etc.
-*** Custom Variables
-#+begin_src emacs-lisp
-;;; Customization Variables
-
-(defcustom consult-mu-contacts-group-by :name
-  "What field to use to group the results in the minibuffer?
-
-By default it is set to :name, but can be any of:
-
-  :name    group by contact name
-  :email   group by email of the contact
-  :domain  group by the domain of the contact's email
-           \(e.g. domain.com in user@domain.com\)
-  :user    group by the ncontact's user name
-           \(e.g. user in user@domain.com\)"
-  :group 'consult-mu
-  :type '(radio (const :name)
-                (const :email)
-                (const :domain)
-                (const :user)))
-
-(defcustom consult-mu-contacts-action #'consult-mu-contacts--list-messages-action
-  "Which function to use when selecting a contact?
-
-By default it is bound to
-`consult-mu-contacts--list-messages-action'."
-  :group 'consult-mu
-  :type '(choice (function :tag "(Default) Show Messages from Contact" #'consult-mu-contacts--list-messages-action)
-                 (function :tag "Insert Email" #'consult-mu-contacts--insert-email-action)
-                 (function :tag "Copy Email to Kill Ring" #'consult-mu-contacts--copy-email-action)
-                 (function :tag "Custom Function")))
-
-(defcustom consult-mu-contacts-ignore-list (list)
-  "List of Regexps to ignore when searching contacts.
-
-This is useful to filter certain addreses from contacts.  For example, you
-can remove no-reply adresses by setting this variable to
-\='((“no-reply@example.com”))."
-  :group 'consult-mu
-  :type '(repeat :tag "Regexp List" regexp))
-
-(defcustom consult-mu-contacts-ignore-case-fold-search case-fold-search
-  "Whether to ignore case when matching against ignore-list?
-
-When non-nil, `consult-mu-contacts' performs case *insensitive* match with
-`consult-mu-contacts-ignore-list' and removes matches from candidates.
-
-By default it is inherited from `case-fold-search'."
-  :group 'consult-mu
-  :type 'boolean)
-
-#+end_src
-
-*** Other Variables
-#+begin_src emacs-lisp
-;;; Other Variables
-
-(defvar consult-mu-contacts-category 'consult-mu-contacts
-  "Category symbol for contacts in `consult-mu' package.")
-
-(defvar consult-mu-contacts--override-group nil
-  "Override grouping in `consult-mu-contacs' based on user input.")
-
-(defvar consult-mu-contacts--history nil
-  "History variable for `consult-mu-contacts'.")
-
-#+end_src
-
-** Backend Commands
-*** view messages form contact
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--list-messages (contact)
-  "List messages from CONTACT using `consult-mu'."
-  (let* ((consult-mu-maxnum nil)
-         (email (plist-get contact :email)))
-    (consult-mu (format "contact:%s" email))))
-
-(defun consult-mu-contacts--list-messages-action (cand)
-  "Search the messages from contact candidate, CAND.
-
-This is a wrapper function around `consult-mu-contacts--list-messages'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--list-messages'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to
-\=#'consult-mu-contacts--list-messages-action."
-
-
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--list-messages contact)))
-
-#+end_src
-*** insert contact
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--insert-email (contact)
-  "Insert email of CONTACT at point.
-
-This is useful for inserting email when composing an email to contact."
-  (let* ((email (plist-get contact :email)))
-    (insert (concat email "; "))))
-
-(defun consult-mu-contacts--insert-email-action (cand)
-  "Insert the email from contact candidate, CAND.
-
-This is a wrapper function around `consult-mu-contacts--insert-email'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--insert-email'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to
-\=#'consult-mu-contacts--insert-email-action."
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--insert-email contact)))
-
-#+end_src
-*** copy contact
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--copy-email (contact)
-  "Copy email of CONTACT to kill ring."
-  (let* ((email (plist-get contact :email)))
-      (kill-new email)))
-
-(defun consult-mu-contacts--copy-email-action (cand)
-  "Copy the email from contact candidate, CAND, to kill ring.
-
-This is a wrapper function around `consult-mu-contacts--copy-email'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--copy-email'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to
-\=#'consult-mu-contacts--copy-email-action."
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--copy-email contact)))
-
-#+end_src
-*** compose email
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--compose-to (contact)
-  "Compose an email to CONTACT using `mu4e-compose-new'."
-  (let* ((email (plist-get contact :email)))
-         (mu4e-compose-new email)))
-
-(defun consult-mu-contacts--compose-to-action (cand)
-  "Open a new buffer to compose a message to contact candidate, CAND.
-
-This is a wrapper function around `consult-mu-contacts--compose-to'.  It
-parses CAND to extract relevant CONTACT plist and other information and
-passes them to `consult-mu-contacts--compose-to'.
-
-To use this as the default action for consult-mu-contacts, set
-`consult-mu-contacts-default-action' to \=#'consult-mu-contacts--compose-to-action."
-
-  (let* ((info (cdr cand))
-         (contact (plist-get info :contact)))
-    (consult-mu-contacts--compose-to contact)))
-
-#+end_src
-** Fontend Interactive Commands
-**** consult-mu-contacts
-***** format candidate
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--format-candidate (string input highlight)
-  "Format minibuffer candidates for `consult-mu-contacts'.
-
-STRING is the output retrieved from “mu cfind INPUT ...” in the command
-line.
-
-INPUT is the query from the user.
-
-If HIGHLIGHT is non-nil, input is highlighted with
-`consult-mu-highlight-match-face' in the minibuffer."
-  (let* ((query input)
-         (email (consult-mu--message-extract-email-from-string string))
-         (name (string-trim (replace-regexp-in-string email "" string nil t nil nil)))
-         (contact (list :name name :email email))
-         (match-str (if (stringp input) (consult--split-escaped (car (consult--command-split query))) nil))
-         (str (format "%s\s\s%s"
-                      (propertize (consult-mu--set-string-width email (floor (* (frame-width) 0.55))) 'face 'consult-mu-sender-face)
-                      (propertize name 'face 'consult-mu-subject-face)))
-         (str (propertize str :contact contact :query query)))
-    (if (and consult-mu-highlight-matches highlight)
-        (cond
-         ((listp match-str)
-          (mapc (lambda (match) (setq str (consult-mu--highlight-match match str t))) match-str))
-         ((stringp match-str)
-          (setq str (consult-mu--highlight-match match-str str t))))
-      str)
-    (cons str (list :contact contact :query query))))
-
-#+end_src
-***** add history
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--add-history ()
-  "Get list of emails in the current buffer.
-
-This is used to add the emails in the current buffer to history."
-  (let ((add (list)))
-    (pcase major-mode
-      ((or mu4e-view-mode mu4e-compose-mode org-msg-edit-mode message-mode)
-       (mapcar (lambda (item)
-                 (concat "#" (consult-mu--message-extract-email-from-string item)))
-               (append add
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "from"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "to"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "cc"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "bcc"))
-                       (consult-mu--message-emails-string-to-list (consult-mu--message-get-header-field "reply-to")))))
-      (_ (list)))))
-
-#+end_src
-***** group
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--group-name (cand)
-  "Get the group name of CAND using `consult-mu-contacts-group-by'.
-
-See `consult-mu-contacts-group-by' for details of grouping options."
-(let* ((contact (get-text-property 0 :contact cand))
-       (email (plist-get contact :email))
-       (name (plist-get contact :name))
-       (_ (string-match "\\(?1:[a-zA-Z0-9\_\.\+\-]+\\)@\\(?2:[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+\\)" email))
-       (user (match-string 1 email))
-       (domain (match-string 2 email))
-       (group (or consult-mu-contacts--override-group consult-mu-contacts-group-by))
-      (field (if (not (keywordp group)) (intern (concat ":" (format "%s" group))) group)))
-      (pcase field
-        (:email email)
-        (:name (if (string-empty-p name) "n/a" name))
-        (:domain domain)
-        (:user user)
-        (_ nil))))
-
-(defun consult-mu-contacts--group (cand transform)
-"Group function for `consult-mu-contacts' candidates.
-
-CAND `consult-mu-contacts--group-name' to get the group name for contact.
-When TRANSFORM is non-nil, the name of the candiate is used as group title."
-  (when-let ((name (consult-mu-contacts--group-name cand)))
-    (if transform (substring cand) name)))
-
-#+end_src
-
-***** lookup
-#+begin_src emacs-lisp
-(defun consult-mu-contacs--lookup ()
-  "Lookup function for `consult-mu-contacs' minibuffer candidates.
-
-This is passed as LOOKUP to `consult--read' on candidates and is used to
-format the output when a candidate is selected."
-  (lambda (sel cands &rest args)
-    (let* ((info (cdr (assoc sel cands)))
-           (contact  (plist-get info :contact))
-           (name (plist-get contact :name))
-           (email (plist-get contact :email)))
-      (cons (or name email) info))))
-
-#+end_src
-
-***** predicate
-#+begin_src emacs-lisp
-(defun consult-mu-contatcs--predicate (cand)
-  "Predicate function for `consult-mu-contacs' candidate, CAND.
-
-This is passed as Predicate to `consult--read' on candidates and is used to
-remove contacts matching `consult-mu-contacts-ignore-list' from the list of
-candidtaes.
-
-Note that `consult-mu-contacts-ignore-case-fold-search' is used to define
-case (in)sensitivity as well."
-
-  (let* ((contact (plist-get (cdr cand) :contact))
-         (email (plist-get contact :email))
-         (name (plist-get contact :name))
-         (case-fold-search consult-mu-contacts-ignore-case-fold-search))
-    (if (seq-empty-p (seq-filter (lambda (reg) (or (string-match-p reg email)
-                                                   (string-match-p reg name)))
-                                 consult-mu-contacts-ignore-list))
-        t
-      nil)))
-#+end_src
-***** state/preview
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--state ()
-  "State function for `consult-mu-contacts' candidates.
-
-This is passed as STATE to `consult--read' and is used to preview or do
-other actions on the candidate."
-  (lambda (action cand)
-    (let ((preview (consult--buffer-preview)))
-      (pcase action
-        ('preview)
-        ('return
-         (save-mark-and-excursion
-           (consult-mu--execute-all-marks))
-         (setq consult-mu-contacts--override-group nil)
-         cand)))))
-
-#+end_src
-
-
-***** transform
-#+begin_src emacs-lisp :lexical t
-(defun consult-mu-contacts--transform (input)
-  "Add annotation to minibuffer candiates for `consult-mu-contacts'.
-
-Format each candidates with `consult-gh--repo-format' and INPUT."
-  (lambda (cands)
-    (cl-loop for cand in cands
-             collect
-             (consult-mu-contacts--format-candidate cand input t))))
-
-#+end_src
-
-***** builder
-#+begin_src emacs-lisp
-(defun consult-mu-contacts--builder (input)
-  "Build mu command line for searching contacts by INPUT."
-  (pcase-let* ((consult-mu-args (append consult-mu-args '("cfind")))
-               (cmd (consult--build-args consult-mu-args))
-               (`(,arg . ,opts) (consult--command-split input))
-               (flags (append cmd opts)))
-    (unless (or (member "-n" flags) (member "--maxnum" flags))
-      (if (and consult-mu-maxnum (> consult-mu-maxnum 0))
-          (setq opts (append opts (list "--maxnum" (format "%s" consult-mu-maxnum))))))
-    (if (or (member "-g" opts)  (member "--group" opts))
-        (cond
-         ((member "-g" opts)
-          (setq consult-mu-contacts--override-group (ignore-errors (intern (nth (+ (cl-position "-g" opts :test 'equal) 1) opts))))
-          (setq opts (remove "-g" (remove (ignore-errors (nth (+ (cl-position "-g" opts :test 'equal) 1) opts)) opts))))
-         ((member "--group" opts)
-          (setq consult-mu-contacts--override-group (ignore-errors (intern (nth (+ (cl-position "--group" opts :test 'equal) 1) opts))))
-          (setq opts (remove "--group" (remove (ignore-errors (nth (+ (cl-position "--group" opts :test 'equal) 1) opts)) opts)))))
-      (setq consult-mu-contacts--override-group nil))
-    (pcase-let* ((`(,re . ,hl) (funcall consult--regexp-compiler arg 'pcre t)))
-      (when re
-        (cons (append cmd
-                      (list (string-join re " "))
-                      opts)
-              hl)))))
-
-#+end_src
-
-
-***** internal async command
-#+begin_src emacs-lisp :lexical t
-(defun consult-mu-contacts--async (prompt builder &optional initial)
-  "Query mu4e contacts asynchronously.
-
-This is a non-interactive internal function.  For the interactive version
-see `consult-mu-contacts'.
-
-It runs the command line from `consult-mu-contacts--builder' in an async
-process and returns the results \(list of contacts\) as a completion table
-in minibuffer that will be passed to `consult--read'.  The completion table
-gets dynamically updated as the user types in the minibuffer.  Each
-candidate in the minibuffer is formatted by
-`consult-mu-contacts--transform' to add annotation and other info to the
-candidate.
-
-Description of Arguments:
-  PROMPT  the prompt in the minibuffer.
-          \(passed as PROMPT to `consult--red'\)
-  BUILDER an async builder function passed to `consult--async-command'.
-  INITIAL an optional arg for the initial input in the minibuffer.
-          \(passed as INITITAL to `consult--read'\)
-
-commandline arguments/options \(run “mu cfind --help” in the command line
-for details\) can be passed to the minibuffer input similar to
-`consult-grep'.  For example the user can enter:
-
-“#john -- --maxnum 10”
-
-This will search for contacts with the query “john”, and retrives a maximum
-of 10 contacts.
-
-Also, the results can further be narrowed by
-`consult-async-split-style' \(e.g. by entering “#” when
-`consult-async-split-style' is set to \='perl\).
-
-For example:
-
-“#john -- --maxnum 10#@gmail”
-
-Will retrieve the message as the example above, then narrows down the
-completion table to candidates that match “@gmail”."
-  (consult--read
-   (consult--process-collection builder
-     :transform (consult--async-transform-by-input #'consult-mu-contacts--transform))
-   :prompt prompt
-   :lookup (consult-mu-contacs--lookup)
-   :state (funcall #'consult-mu-contacts--state)
-   :initial initial
-   :group #'consult-mu-contacts--group
-   :add-history (consult-mu-contacts--add-history)
-   :history '(:input consult-mu-contacts--history)
-   :category 'consult-mu-contacts
-   :preview-key consult-mu-preview-key
-   :predicate #'consult-mu-contatcs--predicate
-   :sort t))
-
-#+end_src
-
-
-***** interactive command
-#+begin_src emacs-lisp
-(defun consult-mu-contacts (&optional initial noaction)
-    "List results of “mu cfind” asynchronously.
-
-This is an interactive wrapper function around
-`consult-mu-contacts--async'.  It queries the user for a search term in the
-minibuffer, then fetches a list of contacts for the entered search term as
-a minibuffer completion table for selection.  The list of candidates in the
-completion table are dynamically updated as the user changes the entry.
-
-INITIAL is an optional arg for the initial input in the minibuffer \(passed
-as INITITAL to `consult-mu-contacts--async'\).
-
-Upon selection of a candidate either
- - the candidate is returned if NOACTION is non-nil
- or
- - the candidate is passed to `consult-mu-contacts-action' if NOACTION is
-   nil.
-
-Additional commandline arguments can be passed in the minibuffer entry by
-typing “--” followed by command line arguments.
-
-For example the user can enter:
-
-“#john doe -- -n 10”
-
-This will run a contact search with the query “john doe” and changes the
-search limit to 10.
-
-Also, the results can further be narrowed by `consult-async-split-style'
-\(e.g. by entering “#” when `consult-async-split-style' is set to \='perl\).
-
-
-For example:
-
-“#john doe -- -n 10#@gmail”
-
-will retrieve the message as the example above, then narrows down to the
-candidates that match “@gmail”.
-
-For more details on consult--async functionalities, see `consult-grep' and
-the official manual of consult, here: https://github.com/minad/consult."
-  (interactive)
-  (save-mark-and-excursion
-  (consult-mu--execute-all-marks))
-  (let* ((sel
-        (consult-mu-contacts--async (concat "[" (propertize "consult-mu-contacts" 'face 'consult-mu-sender-face) "]" " Search Contacts:  ") #'consult-mu-contacts--builder initial)))
-    (save-mark-and-excursion
-      (consult-mu--execute-all-marks))
-    (if noaction
-        sel
-      (progn
-        (funcall consult-mu-contacts-action sel)
-        sel))))
-
-#+end_src
-
-** Provide
-#+begin_src emacs-lisp
-;;; provide `consult-mu-contacts' module
-(provide 'consult-mu-contacts)
-
-#+end_src
-** Footer
-#+begin_src emacs-lisp
-;;; consult-mu-contacts.el ends here
-#+end_src
-* consult-mu-contacts-embark.el
-:PROPERTIES:
-:header-args:emacs-lisp: :results none :mkdirp yes :comments none :tangle ./extras/consult-mu-contacts-embark.el
-:END:
-*** Header
-#+begin_src  emacs-lisp
-;;; consult-mu-contacts-embark.el --- Emabrk Actions for consult-mu-contacts -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021-2023
-
-;; Author: Armin Darvish
-;; Maintainer: Armin Darvish
-;; Created: 2023
-;; Version: 1.0
-;; Package-Requires: ((emacs "28.0") (consult "2.0"))
-;; Homepage: https://github.com/armindarvish/consult-mu
-;; Keywords: convenience, matching, tools, email
-;; Homepage: https://github.com/armindarvish/consult-mu
-
-;; SPDX-License-Identifier: GPL-3.0-or-later
-
-;; 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 3 of the License,
-;; 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 this file.  If not, see <https://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-
-;; This package provides an alternative interactive serach interface for
-;; mu and mu4e (see URL `https://djcbsoftware.nl/code/mu/mu4e.html').
-;; It uses a consult-based minibuffer completion for searching and
-;; selecting, and marking emails, as well as additional utilities for
-;; composing emails and more.
-
-;;  This package requires mu4e version "1.10.8" or later.
-
-
-;;; Code:
-
-#+end_src
-
-*** Main
-This section includes additional useful embark actions as well as possible keymaps. This will be provided as examples and starting point to users, so that they can make their own custom embark actions and functions.
-
-#+begin_src emacs-lisp
-;;; Requirements
-
-(require 'embark)
-(require 'consult-mu)
-(require 'consult-mu-embark)
-
-(defun consult-mu-contacts-embark-insert-email (cand)
-  "Embark function for inserting CAND's email."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (email (plist-get contact :email)))
-    (insert (concat email "; "))))
-
-(defun consult-mu-contacts-embark-kill-email (cand)
-  "Embark function for copying CAND's email."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (email (plist-get contact :email)))
-    (kill-new email)))
-
-(defun consult-mu-contacts-embark-get-alternative (cand)
-  "Embark function for copying CAND's email."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (name (string-trim (plist-get contact :name)))
-         (email (plist-get contact :email))
-         (user (string-trim (replace-regexp-in-string "@.*" "" email))))
-    (consult-mu-contacts (cond
-                          ((not (string-empty-p name))
-                           name)
-                          ((not (string-empty-p user))
-                           user)
-                          ((t ""))))))
-
-(defun consult-mu-contacts-embark-compose (cand)
-  "Embark function for composing an email to CAND."
-  (let* ((contact (get-text-property 0 :contact cand)))
-    (consult-mu-contacts--compose-to contact)))
-
-(defun consult-mu-contacts-embark-search-messages (cand)
-  "Embark function for searching messages from CAND using `consult-mu'."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (email (plist-get contact :email)))
-    (consult-mu (concat "from:" email))))
-
-(defun consult-mu-contacts-embark-default-action (cand)
-  "Run `consult-mu-contacts-action' on CAND."
-  (let* ((contact (get-text-property 0 :contact cand))
-         (query (get-text-property 0 :query cand))
-         (newcand (cons cand `(:contact ,contact :query ,query))))
-    (funcall #'consult-mu-contacts--insert-email-action newcand)))
-
-;;; Define Embark Keymaps
-(defvar-keymap consult-mu-embark-contacts-actions-map
-  :doc "Keymap for consult-mu-embark-contacts"
-  :parent consult-mu-embark-general-actions-map
-  "c" #'consult-mu-contacts-embark-compose
-  "s" #'consult-mu-contacts-embark-search-messages
-  "i" #'consult-mu-contacts-embark-insert-email
-  "w" #'consult-mu-contacts-embark-kill-email
-  "a" #'consult-mu-contacts-embark-get-alternative)
-
-
-(add-to-list 'embark-keymap-alist '(consult-mu-contacts . consult-mu-embark-contacts-actions-map))
-
-;; change the default action on `consult-mu-contacts category.
-(add-to-list 'embark-default-action-overrides '(consult-mu-contacts . consult-mu-contacts-embark-default-action))
-
-;;; Provide `consult-mu-contacts-embark' module
-
-(provide 'consult-mu-contacts-embark)
-
-;;; consult-mu-contacts-embark.el ends here
-#+end_src
dots/.config/emacs/old/lisp/consult-mu/LICENSE
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program 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 3 of the License, or
-    (at your option) any later version.
-
-    This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.
dots/.config/emacs/old/lisp/consult-mu/README.org
@@ -1,555 +0,0 @@
-#+include: ~/OrgFiles/armin/org-macros.setup
-#+OPTIONS: h:1 num:nil toc:nil d:nil
-
-#+TITLE: consult-mu - use consult to search mu4e dynamically or asynchronously
-#+AUTHOR: Armin Darvish
-#+LANGUAGE: en
-
-#+html: <a href="https://github.com/armindarvish"><img alt="Armin Darvish" src="https://img.shields.io/static/v1?label=Armin%20Darvish&message=consult-mu&color=00A8B0&logo=github"/></a>
-#+html: <a href="https://www.gnu.org/software/emacs/"><img alt="GNU Emacs" src="https://img.shields.io/static/v1?label=Made%20For&message=GNU%20Emacs&color=7a5aba&logo=gnuemacs&logoColor=white"/></a>
-
-* About consult-mu
-Consult-mu provides a dynamically updated search interface to mu4e. It uses the awesome package [[https://github.com/minad/consult][consult]] by [[https://github.com/minad][Daniel Mendler]] and [[https://github.com/djcb/mu][mu/mu4e]] by [[https://github.com/djcb/][Dirk-Jan C. Binnema,]] and optionally [[https://github.com/oantolin/embark][Embark]] by [[https://github.com/oantolin][Omar Antolín Camarena]] to improve the search experience of mu4e.
-
-** Main Interactive Commands
- There two main interactive commands:
-
-1. =consult-mu-dynamic=: Provides a dynamic version of =mu4e-search=. As the user types inputs, the result gets updated. This command uses a modified version of =mu4e-search= and then takes the content of =mu4e-headers= buffer to populate minibuffer completion table. This allows the user to change the query or search properties (such as number of results, sort-field, sort-direction, ...) dynamically by changing the input in the minibuffer. In addition previews of the results can be viewed similar to other consult functions. Once a candidate is selected, the user will see the search result sin =mu4e-headers=, and =mu4e-view= buffers similar to mu4e-search results.
-
-2. =consult-mu-async=: This function provides a very fast search without loading mu4e-headers, which means mu4e functionalities (like marks, reply, forwards, etc.) are not available in the preview buffer. This is very useful for finding individual emails or threads in a large pool quickly (in other words "a needle in a haystack" scenarios!). Previews can be seen while the results are being populated asynchronously (without populating mu4e-headers buffer). Upon selection of a candidate, mu4e-headers buffer is populated with only an individual email (or thread). From here all the normal functionalities of mu4e is again available.
-
-3. =consult-mu=: This is simply a wrapper that calls =consult-mu-default-command=, which can be set to either the dynamic or async command for quick access. In other words, set =consult-mu-default-command= to either 1 or 2 above depending on your use case and then use =consult-mu= for convinience and you don't need to remember the difference between the two anymore.
-
-The advantage of =consult-mu-async= over =consult-mu-dynamic= is that it is very fast for searching several thousands of messages (even faster than [[https://github.com/emacsmirror/consult-notmuch][consult-notmuch]]!), but cannot populate a mu4e-headers buffer with all the results. On the other hand, =consult-mu-dynamic= is slower when there are thousands of hits for the search term but provides full functionality for all the results (provides full functionality of =mu4e-search=). Therefore, depending on the use case, the user can chose which functions serves the purpose better.
-
-Furthermore, =consult-mu=, also provides a number of useful [[https://github.com/oantolin/embark][Embark]] actions that can be called from within minibuffer (see examples below). However, when using embark actions, be advised that sometimes you may get an error especially when using =consult-mu-async=. These are likely not critical errors hapening when the databse is out of sync with the results. In such cases syncing the database should resolve the issue.
-
-
-* Getting Started
-** Installation
-Before you start, make sure you understand that this is work in progress in its early stage and bugs and breaks are very much expected.
-
-*note that*: Because [[https://github.com/djcb/mu][mu4e]] tends to take over buffer/windows management, I had to reimplement (a.k.a. hack) some of the functionalities in order to provide quick previews that stay out of your way when the minibuffer command is done (or canceled), and as a result there is a good chance that errors will arise in edge cases that I have not tested.
-
-*** Requirements
-In order to use consult-mu, you need the following requirements:
-
-**** [[https://github.com/djcb/mu][mu4e]]:
-
-You can access the official documentation for mu4e here: [[https://www.djcbsoftware.nl/code/mu/mu4e/][mu4e official manual]]. If you need step-by-step instructions or prefer videos, there are many useful tutorials online.  Here are a few good links:
-
-- EmacsWiki: [[https://www.emacswiki.org/emacs/mu4e][EmacsWiki: mu4e]]
-- SystemCrafters Videos: [[https://www.youtube.com/watch?v=yZRyEhi4y44][Streamline Your E-mail Management with mu4e - Emacs Mail - YouTube]] & [[https://www.youtube.com/watch?v=olXpfaSnf0o][Managing Multiple Email Accounts with mu4e and mbsync - Emacs Mail - YouTube]]
-- Setting Mu4e on MacOS: [[https://macowners.club/posts/email-emacs-mu4e-macos/][Email setup in Emacs with Mu4e on macOS | macOS & (open-source) Software]]
-
-**** [[https://github.com/minad/consult][consult]]:
-
-To install consult follow the official instructions here: [[https://github.com/minad/consult#configuration][Configuration of Consult.]]
-
-Also, make sure you review Consult's README since it recommends some other packages and useful configurations for different settings. Some of those may improve your experience of consult-mu as well. In particular, the section about [[https://github.com/minad/consult#asynchronous-search][asynchronous search]] is important for learning how to use inputs to search for result and narrow down in minibuffer.
-
-
-*** Installing consult-mu package
-consult-mu is not currently on [[https://elpa.gnu.org/packages/consult.html][ELPA]] or [[https://melpa.org/#/consult][MELPA]]. Therefore, you need to install it using an alternative non-standard package manager such as [[https://github.com/radian-software/straight.el][straight.el]] or use manual installation.
-
-**** straight.el
-To install consult-mu with straight.el you can use the following command. Make sure you load consult-mu after loading mu4e and consult (e.g. =require consult=, =require mu4e=).
-
-#+begin_src emacs-lisp
-(straight-use-package
- '(consult-mu :type git :host github :repo "armindarvish/consult-mu" :branch "main" :files (:defaults "extras/*.el")))
-#+end_src
-
-or if you use =use-package= macro with straight, you can do:
-
-#+begin_src emacs-lisp
-(use-package consult-mu
-	:straight (consult-mu :type git :host github :repo "armindarvish/consult-mu" :files (:defaults "extras/*.el"))
-        :after (mu4e consult)
-)
-#+end_src
-
-You can also fork this repository and use your own repo.
-
-**** manual installation
-Clone this repo and make sure the files are on your load path, as described on [[https://www.emacswiki.org/emacs/LoadPath][EmacsWiki]].
-
-Make sure you load consult and mu4e (e.g. =require consult=, =require mu4e=) before you load consult-mu.
-
-** Configuration
-consult-mu is built with the idea that the user should be able to customize everything based on their use-case, therefore the user is very much expected to configure consult-mu.
-
-I recommend you read through this section and understand how to configure the package according to your needs and for your specific use-case, but if you just want a drop-in minimal config, look at the snippet below (for snippet with extended settings see [[id:99667231-6F96-4913-834F-7C031E3CC44C][extended feature config]]).
-
-*** Minimal Config
-#+begin_src emacs-lisp
-(use-package consult-mu
-  :straight (consult-mu :type git :host github :repo "armindarvish/consult-mu" :branch "main")
-  :after (consult mu4e)
-  :custom
-  ;;maximum number of results shown in minibuffer
-  (consult-mu-maxnum 200)
-  ;;show preview when pressing any keys
-  (consult-mu-preview-key 'any)
-  ;;do not mark email as read when previewed
-  (consult-mu-mark-previewed-as-read nil)
-  ;;do not amrk email as read when selected. This is a good starting point to ensure you would not miss important emails marked as read by mistake especially when trying this package out. Later you can change this to t.
-  (consult-mu-mark-viewed-as-read nil)
-  ;; open the message in mu4e-view-buffer when selected.
-  (consult-mu-action #'consult-mu--view-action)
-  )
-#+end_src
-
-*** Extended Feature Config
-:PROPERTIES:
-:ID:       99667231-6F96-4913-834F-7C031E3CC44C
-:END:
-
-Here is a customization that gives you the full feature experience including utilities for attaching/detaching files and searching contacts, etc.
-
-#+begin_src emacs-lisp
-(use-package consult-mu
-  :straight (consult-mu :type git :host github :repo "armindarvish/consult-mu" :branch "develop" :files (:defaults "extras/*.el"))
-  :after (consult mu4e)
-  :custom
-  ;;maximum number of results shown in minibuffer
-  (consult-mu-maxnum 200)
-  ;;show preview when pressing any keys
-  (consult-mu-preview-key 'any)
-  ;;do not mark email as read when previewed. If you turn this to t, be aware that the auto-loaded preview if the preview-key above is 'any would also get marked as read!
-  (consult-mu-mark-previewed-as-read nil)
-  ;;mark email as read when selected.
-  (consult-mu-mark-viewed-as-read t)
-  ;;use reply to all when composing reply emails
-  (consult-mu-use-wide-reply t)
-  ;; define a template for headers view in minibuffer. The example below adjusts the width based on the width of the screen.
-  (consult-mu-headers-template (lambda () (concat "%f" (number-to-string (floor (* (frame-width) 0.15))) "%s" (number-to-string (floor (* (frame-width) 0.5))) "%d13" "%g" "%x")))
-
-  :config
-  ;;create a list of saved searches for quick access using `histroy-next-element' with `M-n' in minibuffer. Note the "#" character at the beginning of each query! Change these according to
-  (setq consult-mu-saved-searches-dynamics '("#flag:unread"))
-  (setq consult-mu-saved-searches-async '("#flag:unread"))
-  ;; require embark actions for marking, replying, forwarding, etc. directly from minibuffer
-  (require 'consult-mu-embark)
-  ;; require extra module for composing (e.g. for interactive attachment) as well as embark actions
-  (require 'consult-mu-compose)
-  (require 'consult-mu-compose-embark)
-  ;; require extra module for searching contacts and runing embark actions on contacts
-  (require 'consult-mu-contacts)
-  (require 'consult-mu-contacts-embark)
-  ;; change the prefiew key for compose so you don't open a preview of every file when selecting files to attach
-  (setq consult-mu-compose-preview-key "M-o")
-  ;; pick a key to bind to consult-mu-compose-attach in embark-file-map
-  (setq consult-mu-embark-attach-file-key "C-a")
-  (setq consult-mu-contacts-ignore-list '("^.*no.*reply.*"))
-  (setq consult-mu-contacts-ignore-case-fold-search t)
-  (consult-mu-compose-embark-bind-attach-file-key)
-  ;; choose if you want to use dired for attaching files (choice of 'always, 'in-dired, or nil)
-  (setq consult-mu-compose-use-dired-attachment 'in-dired)
-  )
-
-#+end_src
-
-*** Customization  Variables
-The following customizable variables are provided:
-
-**** main
-***** =consult-mu-default-command=
-A command function that is called when =M-x consult-mu= is called. This is useful for defining special conditions to use =consult-mu-dynamics= or =consult-mu-async=. By default it is bound to =consult-mu-dynamics=, therefore =M-x consult-mu= simply calls =consult-mu-dynamics=.
-
-***** =consult-mu-headers-buffer-name=
-This is the default name for HEADERS buffer explicitly for consult-mu. It is, by default, set to ="**consult-mu-headers**"=. Note that currently, the header-buffer name is a constant string and shared between all instances of consult-mu calls. This is to prevent running operations in parallel that cause out-of-sync issues.
-
-***** =consult-mu-view-buffer-name=
-This is the default name for VIEW buffer explicitly for consult-mu. It is, by default, set to ="**consult-mu-view**"=. Note that currently, the view-buffer name is a constant string and shared between all instances of consult-mu calls. This is to prevent creating too many preview buffers and executing operations (such as marking) in parallel that cause out-of-sync issues.
-
-***** =consult-mu-args=
-This is the default name of the =mu= command line argument. It is set to ="mu"= by default, but can be modified for example if mu is at a different path on your system.
-
-***** =consult-mu-maxnum=
-Maximum number of messages shown in search results (in consult-mu minibuffer completion table). This is a global option for consult-mu and consult-mu-async, but can be overriden by providing command line arguments in input for example, the following search would fetch up to 1000 results
-
-#+begin_example
-#github -- --maxnum 1000
-#+end_example
-
-***** =consult-mu-headers-fields=
-This variable is used to format the headers inside minibuffer. This takes a similar format to =mu4e-headers-fields= and changes the format of the header only in minibuffer (=consult-mu-dynamic= or =consult-mu-async=).
-
-Note that it is generally recommended to use =consult-mu-headers-template= below because it has more options and does not affect the consult-mu-headers buffer.
-
-***** =consult-mu-headers-template=
-:PROPERTIES:
-:ID:       155CF359-63D0-4D4D-B0BD-7C089E2D9B3C
-:END:
-This is a template string that overrides the consult-mu-headers-field to format headers. It provides more options than =consult-mu-headers-field= and is generally the recommended approach to make custom headers.
-Special chaacters in the string (either “%[char]" or “%[char][integer]”) in the string get expanded to create headers. Each character represents a different field and the integer defines the length of the field. For exmaple "%d15%s50" means 15 characters for date and 50 charcters for subject.
-
-The list of available fields are:
-
-  %f  sender(s) (e.g. from: field of email)
-  %t  receivers(s) (i.e. to: field of email)
-  %s  subject (i.e. title of email)
-  %d  date (i.e. the date email was sent/received) with the format "Thu 09 Nov 23"
-  %p  priority
-  %z  size
-  %i  message-id (as defined by mu)
-  %g  flags (as defined by mu)
-  %G  pretty flags (this uses mu4e~headers-flags-str to pretify flags)
-  %x  tags (as defined by mu)
-  %c  cc (i.e. cc: field of the email)
-  %h  bcc (i.e. bcc: field of the email)
-  %r  date chaged (as defined by :changed in mu4e)
-
-For example, the string ="%d13%s50%f17%G"= would make a header containing =13= characters for =date=, =50= characters for =subject=, and =20= characters for =from= field, making headers that looks like this:
-#+attr_org: :width 800px :height nilpx
-#+attr_latex: :width 800px :height nilpx
-#+attr_html: :width 800px :height nilpx
-[[https://github.com/armindarvish/consult-mu/blob/screenshots/screenshots/consult-mu-headers-template.png]]
-
-***** =consult-mu-search-sort-field=
-This defines the field that is used for sorting the results (refer to documentation on the variable =mu4e-search-sort-field= for more info). It has to be one of the keywords:
-- =:date=  sort by date
-- =:subject= sort by title of the email
-- =:size= sort by file size
-- =:prio= sort by priority
-- =:from= sort by name/email of the sender(s)
-- =:to= sort by name/email of receivers
-- =:list= sort by mailing list
-
-
-Note that the sort field can dynamically be changed by providing command line arguments in the minibuffer input.
-
-For example the following input in the minibuffer will search for emails that are flagged unread but then overrides the sort field and change it t =subject=. For details on how to use command line arguments refer to mu  manual (e.g. by running =mu find --help= in the command line)
-
-#+begin_example
-#flag:unread -- -s s
-#+end_example
-
-***** =consult-mu-search-sort-direction=
-Direction of sort. It can either be ='ascending= for A->Z (low number to high number) or ='descending= for Z->A (high number to low number). Note that if a command line argument for reverse order (either -z or --reverse) is provided in the minibuffer, the order will be reverse of the setting defined by this variable.
-
-For example, if =consult-mu-search-sort-field= is set to =:date= and =consult-mu-search-sort-direction= is set to ='descending= the messages are sortes chronologically from the newest on top to the oldest. Then providing a reverse order argument in the minibuffer can dynamically reverse the sort direction:
-
-For example the following input in the minibuffer searches for all =unread= emails under ="./inbox"= path then *reverses the sort direction* (because of =-z= command line argument)
-#+begin_example
-#(maildir:/inbox) AND flag:unread -- -z
-#+end_example
-
-
-***** =consult-mu-search-threads=
-This variable determines whether threads are calculated for search results or not similar to the =mu4e-search-threads= variable.
-
-Note that per mu4e docs:
-When threading is enabled, the headers are exclusively sorted chronologically (:date) by the newest message in the thread.
-
-When this variable is set to nil, it can still be truned on by adding command line arguments (i.e. =-t= or =--thread=) in the input. For example the following input in the minibuffer will ensure that threads are on even if =consult-mu-search-threads= is set to nil.
-
-#+begin_example
-#flag:unread -- -t
-#+end_example
-
-***** =consult-mu-group-by=
-This variable determines what field is used to group messages. This aloows quick movement between groups (For example with =vertico-next-group= if you use [[https://github.com/minad/vertico][vertico]])
-
-By default it is set to :date. But can be any of the following keywords:
-
-  - =:subject=      group by mail title
-  - =:from=         group by name/email of the sender(s)
-  - =:to=           group by name/email of the receiver(s)
-  - =:date=         group by date in the format "Thu 09 Nov 23"
-  - =:time=         group by the time of email in the format "20:30:07"
-  - =:datetime=     group by date and time of the email with the format "2023-11-04 08:30:07 PM"
-  - =:year=         group by the year of the email (i.e. 2023, 2022, ...)
-  - =:month=        group by the month of the email (i.e. Jan, Feb, ..., Dec)
-  - =:week=         group by the week number of the email (.i.e. 1, 2, 3, ..., 52)
-  - =:day-of-week=  group by the day email was sent (i.e. Monday, Tuesday, ...)
-  - =:size=         group by the file size of the email
-  - =:flags=        group by flags (as defined by mu)
-  - =:tags=         group by tags (as defined by mu)
-  - =:changed=      group by the date changed (as defined by :changed field in mu4e)
-
-Note that grouping works alongside sorting. For example if  =consult-mu-group-by= is set to =:day-of-week= and =consult-mu-search-sort-field= is set to =:date=, then the messages are grouped by day of week (e.g. all emails on Tuesdays will be in one group) then ordered chronologically within each group. The screenshot below shows some examples:
-#+attr_org: :width 800px :height nilpx
-#+attr_latex: :width 800px :height nilpx
-#+attr_html: :width 800px :height nilpx
-[[https://github.com/armindarvish/consult-mu/blob/screenshots/screenshots/consult-mu-grouping-example.png]]
-
-***** =consult-mu-mark-previewed-as-read=
-This determines whether a message is marked as =read= when it is simply previewed (see =consult-mu-preview-key= above and documentation on =consult-preview-key=).
-
-Note that when =consult-mu-preview-key= is set to ='any=, then as soon as =consult-mu= or =consult-mu-async= retrieve some results a preview for the first message is shown and this can be marked as read if =consult-mu-mark-previewed-as-read= is set to t.
-
-***** =consult-mu-mark-viewed-as-read=
-This determines whether a message is marked as =read= when it is viewed (i.e. when the minibuffer candidate is selected by hitting =RET=).
-
-***** =consult-mu-preview-key=
-This is similar to =consult-preview-key= but only for =consult-mu=. By default, it is set to the value of consult-preview-key to keep consistent experience across different consult packages, but you can set this variable explicitly for consult-mu.
-
-The recommended option is to set this to ='any= so as you naviagte over the candidates you see previews updated.
-
-#+begin_src emacs-lisp
-(setq consult-mu-preview-key 'any)
-#+end_src
-
-If the option above slows down your system, and you only want to load previews on demand, then you can set it to a specific key such as ="M-o"=.
-
-#+begin_src emacs-lisp
-(setq consult-mu-preview-key "M-o")
-#+end_src
-
-You can also turn previews off by setting this variable to =nil=, but this is not generally recommended.
-
-
-***** =consult-mu-highlight-matches=
-This variable determines if consult-mu highlights search queries in minibuffer or preview buffers. By default it is set to t.
-
-When it is set to t, all matches of the search term are highlighted in the minibuffer allowing you to notice why the email is a search hit.
-
-For example in the screenshot below, I am searching for the term =consult= and all the matches of consult are highlighted in the titles.
-#+attr_org: :width 800px :height nilpx
-#+attr_latex: :width 800px :height nilpx
-#+attr_html: :width 800px :height nilpx
-[[https://github.com/armindarvish/consult-mu/blob/screenshots/screenshots/consult-mu-highlight-matches-minibuffer.png]]
-
-
-Furthermore if I look at a preview, all the instances of consult-gh matches in the preview buffer are also highlighted:
-#+attr_org: :width 800px :height nilpx
-#+attr_latex: :width 800px :height nilpx
-#+attr_html: :width 800px :height nilpx
-[[https://github.com/armindarvish/consult-mu/blob/screenshots/screenshots/consult-mu-highlight-matches-preview.png]]
-
-Note that when the candidate is selected (i.e. by pressing =RET=), the highlight overlay is turned off, so you can see the orignial message as is, but you can call =consult-mu-overlays-toggle= (i.e. =M-x consult-mu-overlays-toggle=) to see the highlights of the query again.
-#+attr_org: :width 800px :height nilpx
-#+attr_latex: :width 800px :height nilpx
-#+attr_html: :width 800px :height nilpx
-[[https://github.com/armindarvish/consult-mu/blob/screenshots/screenshots/consult-mu-highlight-matches-view.png]]
-
-***** =consult-mu-action=
-This variable stores the function that is called when a message is selected (i.e. =RET= is pressed in the minibuffer). By default it is bound to =consult-mu--view-action= which opens both the headers buffer and view buffer and shows the content of the selected message.
-
-**** compose
-These variables are only available after loading the compose module;
-#+begin_src emacs-lisp
-(require 'consult-mu-compose)
-#+end_src
-
-***** =consult-mu-compose-use-dired-attachment=
-This variable defines, whether =consult-mu= uses dired buffers for selecting files to attach. If it is set to ='always=, consult-mu will always jump to a dired buffer for selecting files to attach. It it is set to ='in-dired=, consult-mu only uses dired (a.k.a. file at point or marked files) for attaching files when already inside a dired buffer. If it is set to =nil=, consult-mu uses minibuffer completion for file selection for attachments.
-***** =consult-mu-large-file-warning-threshold=
-A threshold to make sure very large files are not accidentally opened when previewing files that the user wants to attach to an email. If file is larger than this threshold, the user is asked to confirm before loading the file buffer.
-
-***** =consult-mu-compose-preview-key=
-This is similar to =consult-mu-preview-key= but only for =consult-mu-compose=. This is used to preview files when selecting files for attachments. By default, it is set to the follow the value of =consult-mu-preview-key= to keep consistent experience across the package. *But it is recommended to change this to something other than ='any= becuase otherweise every file is previewd as the user is navigating through folders to select files to attach to an email.
-
-#+begin_src emacs-lisp
-(setq consult-mu-compose-preview-key "M-o")
-#+end_src
-
-***** =consult-mu-embark-attach-file-key=
-This variable defines a key that can be bound to =consult-mu-compose-attach= in =emabrk-file-map=, therefore one can call embark on any file and use this key to attach it to an email. This can be bound to "a" or "C-a":
-
-#+begin_src emacs-lisp
-(setq consult-mu-embark-attach-file-key "C-a")
-#+end_src
-
-Running the function =consult-mu-compose-embark-bind-attach-file-key= binds this key, but any other key can be passed to this function as well to override the customization variable:
-
-#+begin_src emacs-lisp
-(consult-mu-compose-embark-bind-attach-file-key)
-#+end_src
-
-**** contacts
-These variables are only available after loading the contacts module;
-#+begin_src emacs-lisp
-(require 'consult-mu-contacts)
-#+end_src 
-
-***** =consult-mu-contacts-group-by=
-This variable determines what field is used to group contacts, which allows quick movement between groups (For example with =vertico-next-group= if you use [[https://github.com/minad/vertico][vertico]])
-
-By default it is set to name. But can be any of the following keywords:
-
-  - =:name=         group by contact name
-  - =:email=        group by email of the contact
-  - =:domain=       group by the domain of the contact's email (e.g. domain.com in user@domain.com)
-  - =:user=         group by the ncontact's user name (e.g. user in user@domain.com)
-
-For example if =consult-mu-contacts-group-by= is set to =:domain= then the domain of the email address is used to group contacts. This is useful for example if you are looking for all emails from a specific company!
-
-***** =consult-mu-contacts-action= 
-This variable stores the function that is called when a contact is selected (i.e. =RET= is pressed in the minibuffer). By default it is bound to =consult-mu-contacts--list-messages-action= which searches for all the messages from that contact by calling =consult-mu=. You can also set this action to other functions such =consult-mu-contacts--insert-email-action= or =consult-mu-contacts--copy-email-action= for inserting or copying the email from contact.
-
-Note that the default action for =consult-mu-contacts-embark= is inserting the email. This is useful for quickly adding contacts when composing messages. You cna also use =embark-collect= or =embark-export= to select multiple contacts and act on all of them (e.g. insert all in "To:" field in a compose buffer).
-
-***** =consult-mu-contacts-ignore-list=
-  This is a list of rgexp that gets ignored when searching contacts.
-  This is useful to filter certain invalid addreses (e.g. "no-reply" addresses from contacts). For example you can remove no-reply adresses by setting this variable as follows;
-  #+begin_src emacs-lisp
-(setq consult-mu-contacts-ignore-list '("^.*no.*reply.*$"))
-
-  #+end_src
-
-***** =consult-mu-contacts-ignore-case-fold-search=
-This variable defines whether =consult-mu-contacts= uses case insensitive search when matching against  =consult-mu-contacts-ignore-list= (see above). if you set this to =t=, it will preform case *in*sensitive match.
-
-* Features and Demos
-For a detailed description of why this package is useful, and some useful screenshosts showing work flows, you can read my blog post here:
-
-[[https://www.armindarvish.com/post/improve_your_mu4e_workflow_with_consult-mu/]]
-
-** Search
-consult-mu uses [[https://github.com/minad/consult#asynchronous-search][consult's asynchronous search]] feature. In order to search a query you can type your standard Mu4e query after =#= sign in the minibuffer. Here are some examples:
-
-#+begin_example
-#tickets
-#flag:unread
-#(flag:unread AND maildir:/inbox)
-#(maildir:/drafts OR maildir:/sent)
-#+end_example
-
-
-In addition, you can pass command line arguments that you can normally pass to =mu= (see =mu find --help=) in the command line to consult-mu by using a =--= separator like this:
-
-#+begin_example
-#tickets -- --maxnum 500 -s s
-#+end_example
-
-In the example above, the maximum number of results to retrieve are set to 500 (=--maxnum 500=) and the result are sorted by the subject (=-s s=). For more details on command line options, you can refer to mu's help (i.e. run =mu find --help= in terminal).
-
-Once consult-mu retrieves a list of results, you can further narrow down the list of candidates by using a second =#=.
-
-#+begin_example
-#tickets -- -z #concert
-#+end_example
-
-In the example above, we first run a search for *tickets* and sort the results with reverse order (using =-z= option) then narrow down the list of candidates by the word, *concert*.
-
-Note that narrow downs are similar to other narrow downs in the minibuffer, therefore here you cannot use mu4e search syntax but you can use regular expressions. Also, the narrow down searches in the entire header string, therefore you can use any information available in the headers (date, title, email addresses, flags,...) for narrow down. (to change the format of the header, take a look at [[id:155CF359-63D0-4D4D-B0BD-7C089E2D9B3C][=consult-mu-headers-template=]]. Here is a screenshot for doing a search and narrow:
-
-#+ATTR_ORG: :width 800px
-#+ATTR_LATEX: :width 800px
-#+ATTR_HTML: :width 800px
-[[https://github.com/armindarvish/consult-mu/blob/screenshots/screenshots/consult-mu-search-narrow.gif]]
-
-** Saved Searches and Quick Access History
-consult-mu does have a history variable and keeps record of your previous searches. These searches can quickly be accessed using =previous-history-element= (bound to =M-p= by default). In addition, you can have a list of saved searches for quick access by modifying the variable =consult-mu-saved-searches-dynamic= or =consult-mu-saved-searches-async= for =consult-mu-dynamic= and =consult-mu-async=, respectively. These are lists of mu4e query strings that get added to future-history when you run consult-mu-dynamic or consult-mu-async. By default, =consult-mu-saved-searches-async= is set to inherit from =consult-mu-saved-searches-dynamic=, but you can modify them independently. This allows separating saved searches that are more suitable for async search from those that are better done with dynamic collection.
-
-Similarly =consult-mu-compose-attach=, =consult-mu-compose-detach=, and =consult-mu-contacts= have their own history elements as wels future history elemetns (for example email in the current message buffer gets added to future-history for searching contacts).
-
-** Integration with Embark
-consult-mu provides integration with [[https://github.com/oantolin/embark][embark]] defined in =consult-mu-embark.el= If you use embark, you can use these commands to run actions on the search results directly from minibuffer. For example, you can call =consult-mu-embark-reply= to reply to a message or =consult-mu-embark-mark-for-refile= to refile (a.k.a. archive) the message and so on.
-
-For marking, note that, by default when consult-mu-embark is loaded, it creates a function for every item in the =mu4e-marks= and binds them to the =:char= for that mark in =consult-mu-embark-messages-actions-map=.
-
-You can also use =embark-select= and =embark-act-all= to run the same command on multiple messages, but this only works in consult-mu-dynamic and not so well with consult-mu-async because with consult-my-async, only one message at a time is added to the headers view and therefore running commands on multiple candidates with embark is not supported.
-
-** Extras (attachments, contacts, ...)
-In addition to improvements for searching, consult-mu also provides extra features for composing, contacts, ... These features are defined in the files under the =extras= folder.
-*** Attachments
-By default, attaching files to emails with mu4e is not very intuitive or interactive. If you use [[https://github.com/jeremy-compostella/org-msg][org-msg]], it provides an interactive command for attaching files, but it is only for one file at a time and for each file you need to go through some menus. Some emacs configs, like [[https://github.com/doomemacs/doomemacs][doomemacs]], do provide their own commands to allow using a dired buffer to attach multiple files to an email (see [[https://github.com/doomemacs/doomemacs/blob/986398504d09e585c7d1a8d73a6394024fe6f164/modules/email/mu4e/autoload/email.el#L272C8-L272C26][+mu4e/attach-files]]). Personally, I prefer using a minibuffer completion (instead of switching to a dired buffer) unless I am already in a dired buffer. The [[file:extras/consult-mu-compose.el][consult-mu-compose]] provides the utilities and customization settings to achieve interactive multi-file attachment.
-
-To use attachment extras, you need to load the compose module by:
-#+begin_src emacs-lisp
-(require 'consult-mu-compose)
-(require 'consult-mu-compose-embark) ;;optionally load embark actions for compose
-#+end_src
-
-It is highly recommended that you also change the preview key binding for =consult-mu-compose= to something other than ='any= because seeing a preview of every file when you are navigating through the minibuffer may be slow and annoying. It's easier to get a preview of the files you are interested in with a key binding like =M-o= than to see a preview of every file.
-
-#+begin_src emacs-lisp
-(setq consult-mu-compose-preview-key "M-o")
-#+end_src
-**** Attaching Files
-=consult-mu-compose-attach= provides an interactive command to attach files to an email and it tries its best to provide an intuitive interface. 
-
-Here are some features:
-
-- interactively selecitng draft compose buffer:
-In a compose buffer (e.g. =mu4e-compose-mode=, =message-mode=, =org-msg-edit-mode=), it assumes that the user wants to attach files to the current message. In other buffers it asks the user to select a current compose buffer or creates a new one if noe exists.
-
-- interactively selecting files:
-For selecting files, it can either use minibuffer completion or a dired buffer. If the customization variable =consult-mu-compose-use-dired-attachment= is set to =always=, it always uses dired buffer similar to what dom emacs does. If it is set to ='in-dired= it only uses dired when inside a dired-mode buffer. and if it is set to =nil=, it will always use minibuffer completion.
-When using dired to chose files, one can mark multiple files to attach to a message. Furthermore, if the command =consult-mu-compose-attach= is called from within a compose buffer (e.g. =mu4e-compose-mode=, =message-mode=, =org-msg-edit-mode=), runing =embrak-dwim= on the file will attach the file to the current message. This is specially useful if you use =embark-dwim= with =no-quit= option ([[https://github.com/oantolin/embark#quitting-the-minibuffer-after-an-action][embark#quitting-the-minibuffer-after-an-action]]). Here is an example on how to define =embark-dwim-noquit=:
-
-#+begin_src emacs-lisp
-(defun embark-dwim-noquit ()
-     "Run action but don't quit the minibuffer afterwards."
-     (interactive)
-     (let ((embark-quit-after-action nil))
-       (embark-dwim)))
-#+end_src
-Then you can just attach multiple files to the same message from any folder by using the minibuffer completion. See the screenshot in my blog post here: https://www.armindarvish.com/post/improve_your_mu4e_workflow_with_consult-mu/
-
-**** Removing attachments:
-Similarly, =consult-mu-compose-detach= provides an interactive command to remove files that are already attached to the current message. It uses minibuffer completion to select a file to remove. Similar to what mentioned above, embark-dwim (or a no-quit version of it) can be used to remove multiple files from the same message. note that the minibuffer completion list does not get dynamically updated when a file is removed (This is something I may improve in the future but for now it works just fine I think).
-See the screenshot in my blog post here: https://www.armindarvish.com/post/improve_your_mu4e_workflow_with_consult-mu/
-
-
-*** Contacts
-=consult-mu-contacts= provides an interactive way to search mu contacs. By default, when a candidate is selected, all the emails form the contact is searched by using =consult-mu=. This can be customized to oyher functions (e.g. compose an email to the contact) by seeting =consult-mu-contacts-action=. Note that mu does not have a stored list of contacts. Rather, contacts are generated dynamically from the email fields in all messages in the database, including email fields that might be invalid! To use =consult-mu-contacts=, you need to load the contacts module by:
-
-#+begin_src emacs-lisp
-(require 'consult-mu-contacts)
-(require 'consult-mu-contacts-embark) ;;optionally load embark actions for contacts
-#+end_src
-
-See the screenshot in my blog post here: https://www.armindarvish.com/post/improve_your_mu4e_workflow_with_consult-mu/
-
-
-* Bug reports
-To report bug, first check if it is already reported in the [[https://github.com/armindarvish/consult-mu/issues][*issue tracker*]] and see if there is an existing solution or add relevant comments and discussion under the same issue. If not file a new issue following these steps:
-
-1. Make sure the dependencies are installed, and both =mu4e= and =consult= work as expected.
-
-3. Remove the package and install the latest version (along with dependencies) and see if the issue persists.
-
-4. In a bare bone vanilla Emacs (>=28) (e.g. =emacs -Q=), install the latest version of consult-mu (and its dependencies) without any configuration or other packages and see if the issue still persists.
-
-5. File an issue and provide important information and context in as much detail as possible in your bug report. Important information can include:
-- Your operating system, version of Emacs (or the version of emacsen you are using), version of mu/mu4e and consult (see [[https://github.com/emacsorphanage/pkg-info][pkg-info]]).
-- The installation method and the configuration you are using with your consult-mu.
-- If there is an error message, turn debug-on-error on (by =M-x toggle-debug-on-error=) and include the backtrace content in your report.
-- If the error only exists when you have some other packages installed, list those packages (e.g. problem happens when evil is installed)
-- It would be useful, if you can look at consult-mu buffers while the minibuffer command is active (by default they are named =*consult-mu-headers*= and =*consult-mu-view*= buffers) and report whether theya re getting populated properly or not.
-
-* Contributions
-This is an open source package, and I appreciate feedback, suggestions, ideas, etc. There are lots of functionalities that can be added to this package to improve different user's workflows, so if you have some ideas, feel free to file an issue for a feature request.
-
-If you want to contribute to the code, please note that the main branch is currently stable (as stable as a work in progress like this can be) and the develop branch is the current work in progress. So, *start from the develop branch* to get the latest work-in-progress updates and create a new branch with names such as feature/name-of-the-feature or fix/issue, ... Do the edits and then create a new pull request to merge back with the *develop* branch when you are done with your edits.
-
-Importantly, keep in mind that I am using a *literate programming approach* (given that this is a small project with very limited number of files) where everything goes into *consult-mu.org* and then gets tangled to appropriate files (for now that includes consult-mu.el and consult-mu-embark.el). If you open a pull-request where you directly edited the .el files, I will likely not approve it because that will then get overwritten later when I tangle from the .org file. In other words, *Do Not Edit The .el Files!* only edit the .org file and tangle to .el files.
-
-
-* What about other packages? Why we need a new package such as consult-mu?
-While mu4e's built-in search is great and provides ways to edit search terms (e.g. =mu4e-search-edit=) or toggle search properties (e.g. =mu4e-search-toggle-property=), the interface is not really intuitive. We are simply too impatient in 2024 to use a static search field and edit in steps. A dynamically updated search results is somewhat expected with any modern tools. Try searching in Thunderbird, or Outlook, and you instantly see suggestions and results. This is what consult-mu provides. Hopefully, in the future a dynamics search approach comes built-in with mu4e but until then, this package intends to fill the gap.
-
-*** What about alternative approaches like [[https://github.com/seanfarley/counsel-mu][counsel-mu]] or [[https://github.com/emacsmirror/consult-notmuch][consult-notmuch]]?
-
-You can read my blog post for some thoughts on this:
- https://www.armindarvish.com/post/improve_your_mu4e_workflow_with_consult-mu/
-
-
-Both [[https://github.com/seanfarley/counsel-mu][counsel-mu]] and [[https://github.com/emacsmirror/consult-notmuch][consult-notmuch]] inspired this package. But this package provides soemthing more than those packages. Here is the comparison:
-
-- [[https://github.com/seanfarley/counsel-mu][counsel-mu]]: counsel-mu provides an async search for mu, and when the candidate is selected, the single message is loaded by using =mu4e-view-message-with-message-id=. =consult-mu= takes a similar approach in =consult-mu-async= but expands on that with the following features:
-
-  a. ability to dynamically add command line options (e.g. using =query -- -s s -z= as input).
-     This includes dynamically changing the number of results. This is important because with counsel-mu, one ha to change the variable =mu4e-search-results-limit= globally to see many results, which then affects every mu4e-search that is done.
-
-  b. ability to load a preview without leaving minibuffer search
-
-  c. ability to use emabrk actions on candidates from the minibuffer with =consult-mu-embark=
-
-  d. ability to see whole threads when selecting a candidate rather than just single messages
-
-  In addition, =consult-mu= provides the =consult-mu-dynamic= interactive command that uses dynamic collection using =mu4e-search= (and not =mu= commands). This allows doing dynamic search in the minibuffer and then getting a full list of results similar to the built-in mu4e-search.
-
-
-- [[https://github.com/emacsmirror/consult-notmuch][consult-notmuch]]: consult-notmuch is great IF you use [[https://notmuchmail.org/notmuch-emacs/][notmuch-emacs]]. consult-mu on the other hand provides similar functionality for [[https://github.com/djcb/mu][mu/mu4e]].
-  The comparison therefore comes down to comparing mu4e and notmuch. While notmuch is light and fast, I think it lacks lots of basic functionalities of an email client. It is supposed to be *not much* after all! As a result, using notmuch as an everyday email client can be challenging especially if you want to use it along with other IMAP-based email clients (e.g. mobile apps). This is because the philosophy of using tags instead of folders requires a complete redesign of some workflows. While some services, like Gmail, use labels, others may not and even if they do, in IMAP-based clients labels are treated as different folders and therefore syncing back custom notmuch labels everywhere (e.g. between notmuch on your desktop machine and your mobile app client) becomes tricky. Of course, in Emacs nothing is impossible and there are ways to improve the experience by adding additional custom elisp (see [[https://www.youtube.com/watch?v=g7iF11qamh8][Emacs: Notmuch demo (notmuch.el) - YouTube]]  and [[https://www.reddit.com/r/emacs/comments/qo3eza/notmuch_as_an_alternative_to_mu4e/?share_id=8WUviRO3gGGIO4bQgoSzU&utm_content=2&utm_medium=android_app&utm_name=androidcss&utm_source=share&utm_term=10][Notmuch as an alternative to mu4e : emacs]] for some examples), but at the end, the results will still likely lack some important features (like multi-account contexts, ...).
-
-More importantly, a common reason to choose notmuch over mu4e is its speed, but using the underlying =mu= server and command line can also be very fast. In fact, at least in my own tests, =consult-mu-async=, which uses the command line =mu= commands was faster than =consult-notmuch=. With the latest release of mu4e (version 1.12), even =consult-mu-dynamics= (a.k.a. built-in mu4e-search) is now very fast. Therefore, using =mu4e= with =consult-mu= provides the best of both worlds to me. When I need speed and simplicity, I can use =consult-mu-async= to do a fast search (and find thousands of hits) and quickly narrow down to what I am looking for; and when I need a more complete and full-feature client I can use =mu4e= built-in functionalities, and with addition of dynamically built searches with =consult-mu-dynamic=, I have a modern intuitive interface as well.
-
-* Acknowledgments
-Obviously this package would not have been possible without the fabulous [[https://github.com/djcb/mu][mu/mu4e]], and [[https://github.com/minad/consult][consult]] packages. It also took inspiration from other packages including but not limited to [[https://github.com/seanfarley/counsel-mu][counsel-mu]], [[https://github.com/emacsmirror/consult-notmuch][consult-notmuch]], and [[https://github.com/doomemacs/doomemacs][doomemacs]].
dots/.config/emacs/old/lisp/gh-notifications-mode.el
@@ -1,513 +0,0 @@
-;;; github-notifications-gh.el --- Display GitHub notifications in Emacs using gh CLI -*- lexical-binding: t -*-
-
-;; Author: Your Name
-;; Version: 1.0
-;; Package-Requires: ((emacs "27.1"))
-
-;;; Commentary:
-;; This package provides functionality to fetch and display GitHub notifications
-;; in a dedicated buffer using the GitHub CLI (gh) and tabulated-list-mode.
-;; Make sure you have gh installed and authenticated before using this package.
-
-;;; For pull-request, fetch the diff from the diff_url field
-;;; For CI status, use the statuses_url
-
-;;; Code:
-
-(require 'json)
-(require 'tabulated-list)
-(require 'diff-mode)
-
-(defgroup github-notifications nil
-  "GitHub notifications in Emacs."
-  :group 'applications)
-
-(defcustom github-notifications-refresh-interval 300
-  "Number of seconds between automatic refresh of notifications."
-  :type 'integer
-  :group 'github-notifications)
-
-(defface github-notifications-unread-face
-  '((t :weight bold))
-  "Face for unread notifications."
-  :group 'github-notifications)
-
-(defvar github-notifications-buffer-name "*GitHub Notifications*"
-  "Name of the buffer for displaying GitHub notifications.")
-
-(defvar github-notifications-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "g") 'github-notifications-refresh)
-    (define-key map (kbd "m") 'github-notifications-mark-read)
-    (define-key map (kbd "c") 'github-notifications-comment-on-pr)
-    (define-key map (kbd "d") 'github-notifications-mark-done)
-    (define-key map (kbd "a") 'github-notifications-approve-pr)
-    (define-key map (kbd "w") 'github-notifications-copy-url)
-    (define-key map (kbd "r") 'github-notifications-request-changes-on-pr)
-    (define-key map (kbd "v") 'github-notifications-show-details)
-    (define-key map (kbd "RET") 'github-notifications-open-at-point)
-    ;; m for mark
-    map)
-  "Keymap for GitHub notifications buffer.")
-
-(defvar github-notifications-detail-buffer-name "*GitHub Notification Detail*"
-  "Name of the buffer for displaying GitHub notification details.")
-
-(defvar github-notifications-detail-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "q") 'quit-window)
-    map)
-  "Keymap for GitHub notification detail buffer.")
-
-(define-derived-mode github-notifications-detail-mode special-mode "GitHub-Notification-Detail"
-  "Major mode for displaying GitHub notification details."
-  (setq buffer-read-only t))
-
-(defvar github-notifications--process-buffer "*github-notifications-process*"
-  "Buffer for GitHub notifications processes.")
-
-(defun github-notifications--call-process-async (callback _buf name &rest args)
-  "Call gh process asynchronously with ARGS and CALLBACK when done.
-Creates a temporary buffer for the process output."
-  (let ((temp-buffer (generate-new-buffer (format " *gh-%s*" name))))
-    (setenv "TERM" "dumb")
-    (setenv "CLICOLOR" "0")
-    (setenv "PAGER" "cat")
-    (make-process
-     :name name
-     :buffer temp-buffer
-     :command (cons "gh" args)
-     :sentinel (lambda (process _event)
-                 (unwind-protect
-                     (when (eq (process-status process) 'exit)
-                       (if (= (process-exit-status process) 0)
-                           (with-current-buffer (process-buffer process)
-                             (funcall callback (buffer-string)))
-                         (message "GitHub CLI process failed")))
-                   (kill-buffer temp-buffer))))))
-
-(define-derived-mode github-notifications-mode tabulated-list-mode "GitHub-Notifications"
-  "Major mode for displaying GitHub notifications."
-  (setq tabulated-list-format
-        [("Status" 6 t)
-         ("CI" 8 t)
-         ("Repository" 30 t)
-         ("Type" 15 t)
-         ("Title" 60 t)
-         ("Updated" 20 t)])
-  (setq tabulated-list-sort-key '("Updated" . t))
-  (setq tabulated-list-padding 2)
-  (tabulated-list-init-header))
-
-(defun github-notifications--ensure-gh ()
-  "Ensure gh command line tool is available."
-  (unless (executable-find "gh")
-    (error "GitHub CLI (gh) not found. Please install it first")))
-
-(defun github-notifications--parse-json (json-string)
-  "Parse JSON-STRING into Lisp objects."
-  (json-read-from-string json-string))
-
-(defun github-notifications--format-time (time-string)
-  "Format TIME-STRING to a human-readable format."
-  (format-time-string
-   "%Y-%m-%d %H:%M"
-   (date-to-time time-string)))
-
-(defun github-notifications--format-list-entry (notification)
-  "Format a NOTIFICATION as a tabulated list entry."
-  (let-alist notification
-    (list .id
-          (vector
-           (github-notifications--format-unread .unread)
-           (if (string= .type "PullRequest")
-	       (github-notifications--format-ci-status .ci_status)
-	     " ")
-	   ;; (if (string= .type "PullRequest")
-	   ;; 	 (or .ci_status "?")
-           ;;   "")
-           .repo
-           .type
-           (propertize .title
-                       'notification-id .id
-                       'notification-url .url  ; Add this line
-                       'github-notifications--copy-url .url
-                       'notification-type .type
-                       'repo .repo)
-           (github-notifications--format-time .updated)))))
-
-(defun github-notifications-fetch ()
-  "Fetch notifications using gh CLI asynchronously."
-  (github-notifications--ensure-gh)
-  (github-notifications--call-process-async
-   (lambda (output)
-     (let* ((raw-notifications (github-notifications--parse-json output))
-            (normalized-notifications
-             (mapcar #'github-notifications--normalize-notification raw-notifications)))
-       ;; For each PR notification, fetch its status
-       (dolist (notif normalized-notifications)
-         (when (and (equal (alist-get 'type notif) "PullRequest"))
-           (github-notifications--get-pr-statuses notif))
-	 ;; FIXME there is a bug here, it share the same thing
-         (github-notifications--display normalized-notifications))))
-   (get-buffer-create github-notifications--process-buffer)
-   "github-notifications"
-   "api"
-   "-H" "Accept: application/vnd.github+json"
-   "/notifications?all=true"))
-
-(defun github-notifications--normalize-notification (notif)
-  "Convert raw notification to normalized format."
-  (let-alist notif
-    `((id . ,.id)
-      (type . ,.subject.type)
-      (title . ,.subject.title)
-      (repo . ,.repository.full_name)
-      (url . ,.subject.url)
-      (updated . ,.updated_at)
-      (unread . ,.unread)
-      (ci_status . nil)
-      (statuses_url . ,.subject.statuses_url))))
-
-(defun github-notifications--display (notifications)
-  "Display NOTIFICATIONS in the buffer."
-  (with-current-buffer (get-buffer-create github-notifications-buffer-name)
-    (github-notifications-mode)
-    (setq tabulated-list-entries
-          (mapcar #'github-notifications--format-list-entry notifications))
-    (tabulated-list-print t)))
-
-(defun github-notifications-refresh ()
-  "Refresh the notifications buffer."
-  (interactive)
-  (github-notifications-fetch))
-
-(defun github-notifications-mark-read ()
-  "Mark notification at point as read."
-  (interactive)
-  (when-let* ((entry (github-notifications--get-entry-data))
-              (id (nth 4 entry)))
-    (github-notifications--ensure-gh)
-    (with-temp-buffer
-      (unless (= 0 (call-process "gh" nil t nil
-                                 "api"
-                                 "-X" "PATCH"
-                                 (format "/notifications/threads/%s" id)))
-        (error "Failed to mark notification as read")))
-    (github-notifications-refresh)))
-
-(defun github-notifications-mark-done ()
-  "Mark notification at point as done."
-  (interactive)
-  (when-let* ((entry (github-notifications--get-entry-data))
-              (id (nth 4 entry)))
-    (github-notifications--ensure-gh)
-    (with-temp-buffer
-      (unless (= 0 (call-process "gh" nil t nil
-                                 "api"
-                                 "-X" "DELETE"
-                                 (format "/notifications/threads/%s" id)))
-        (error "Failed to mark notification as done")))
-    (github-notifications-refresh)))
-
-(defun github-notifications--copy-url ()
-  "Copy the URL of the notification item at point."
-  (interactive)
-  (let* ((entry (github-notifications--get-entry-data))
-	 (api-url (nth 3 entry))
-	 (url (replace-regexp-in-string
-               "api\\.github\\.com/repos"
-               "github.com"
-               (replace-regexp-in-string
-                "/pulls/"
-                "/pull/"
-                api-url))))
-    (kill-new url)))
-
-(defun github-notifications-open-at-point ()
-  "Open the notification at point in a web browser."
-  (interactive)
-  (when-let* ((entry (tabulated-list-get-entry))
-              (title-col (aref entry 3))
-              (url (get-text-property 0 'notification-url title-col)))
-    (let ((web-url (replace-regexp-in-string
-                    "api\\.github\\.com/repos"
-                    "github.com"
-                    (replace-regexp-in-string
-                     "/pulls/"
-                     "/pull/"
-                     url))))
-      (browse-url web-url))))
-
-(defun github-notifications--get-entry-data ()
-  "Get PR data from current entry."
-  (let* ((entry (tabulated-list-get-entry))
-	 (id (aref entry 3))
-         (title-cell (aref entry 4))
-         (repo (get-text-property 0 'repo title-cell))
-         (url (get-text-property 0 'notification-url title-cell))
-         (notification-id (get-text-property 0 'notification-id title-cell))
-         (pr-number (github-notifications--get-pr-number url)))
-    (list id repo pr-number url notification-id)))
-
-(defun github-notifications-comment-on-pr ()
-  "Add a comment to the pull request at point."
-  (interactive)
-  (let* ((pr-data (github-notifications--get-entry-data))
-         (repo (nth 1 pr-data))
-         (pr-number (nth 2 pr-data))
-         (comment (read-string "Comment: "))),
-    (when (and repo pr-number (not (string-empty-p comment)))
-      (let ((default-directory (make-temp-file "gh-pr" t)))
-        (call-process "gh" nil "*github-notifications process*" nil
-                      "pr" "comment"
-		      pr-number
-                      "--body" comment
-		      "--repo" repo)
-        (message "Comment posted successfully")))))
-
-(defun github-notifications-request-changes-on-pr ()
-  "Add a comment to the pull request at point."
-  (interactive)
-  (let* ((pr-data (github-notifications--get-entry-data))
-         (repo (nth 1 pr-data))
-         (pr-number (nth 2 pr-data))
-         (comment (read-string "Comment: ")))
-    (when (and repo pr-number (not (string-empty-p comment)))
-      (let ((default-directory (make-temp-file "gh-pr" t)))
-        (call-process "gh" nil "*github-notifications process*" nil
-                      "pr" "review"
-		      pr-number
-                      "--body" comment
-		      "--request-changes"
-		      "--repo" repo)
-        (message "Comment posted successfully")))))
-
-(defun github-notifications-approve-pr (&optional comment)
-  "Approve the pull request at point with an optional comment."
-  (interactive
-   (list (read-string "Approval comment (optional): ")))
-  (let* ((pr-data (github-notifications--get-entry-data))
-         (repo (nth 1 pr-data))
-         (pr-number (nth 2 pr-data))
-         (args (list "pr" "review"
-                     pr-number
-                     "--approve"
-		     "--repo" repo)))
-    (when (and repo pr-number)
-      (when (and comment (not (string-empty-p comment)))
-        (setq args (append args (list "--body" comment))))
-      (let ((default-directory (make-temp-file "gh-pr" t)))
-        (apply #'call-process "gh" nil "*github-notifications process*" nil args)
-        (message "PR approved successfully")))))
-
-(defun github-notifications--get-pr-statuses (notification)
-  "Get CI statuses for a PR using the GitHub GraphQL API."
-  (let* ((url (alist-get 'url notification))
-         (repo (alist-get 'repo notification))
-	 (pr-number(github-notifications--get-pr-number url)))
-    (when (and repo pr-number)
-      (with-temp-buffer
-	(github-notifications--call-process-async
-	 (lambda (output)
-	   (let* ((response (github-notifications--parse-json (buffer-string)))
-		  (contexts (thread-last response
-					 (alist-get 'data)
-					 (alist-get 'repository)
-					 (alist-get 'pullRequest)
-					 (alist-get 'commits)
-					 (alist-get 'nodes)
-					 (seq-first)
-					 (alist-get 'commit)
-					 (alist-get 'statusCheckRollup)
-					 (alist-get 'contexts)
-					 (alist-get 'nodes)))
-		  (statuses (seq-map
-			     (lambda (ctx)
-                               (let ((state (or (alist-get 'state ctx)
-						(alist-get 'conclusion ctx))))
-				 (cond
-				  ((member state '("SUCCESS" "success" "COMPLETED")) "success")
-				  ((member state '("FAILURE" "failure" "ERROR" "error")) "failure")
-				  (t "pending"))))
-			     contexts))
-		  (total (length statuses))
-		  (successes (seq-count (lambda (s) (string= s "success")) statuses))
-		  (failures (seq-count (lambda (s) (string= s "failure")) statuses))
-		  (pendings (seq-count (lambda (s) (string= s "pending")) statuses))
-		  (ci-status (list :total total
-				   :successes successes
-				   :failures failures
-				   :pendings pendings)))
-	     (setf (alist-get 'ci_status notification) ci-status)))
-	 (get-buffer-create (format "*github-notifications-%s-%s-process*" repo pr-number))
-	 (format "github-notifications-%s-%s" repo pr-number)
-	 "api" "graphql" "-f"
-	 (format "query=%s"
-		 (github-notifications--make-graphql-query repo pr-number)))))))
-
-(defun github-notifications--format-ci-status (statuses)
-  "Format CI status with appropriate face and count information."
-  (if (null statuses)
-      (propertize "?" 'face '(:foreground "gray"))
-    (let* ((total (plist-get statuses :total))
-           (successes (plist-get statuses :successes))
-           (failures (plist-get statuses :failures))
-           (pendings (plist-get statuses :pendings))
-           (indicator
-            (cond
-             ((> failures 0) "✗")
-             ((> pendings 0) "○")
-             ((= successes total) "✓")
-             (t "?")))
-           (face
-            (cond
-             ((> failures 0) '(:foreground "red"))
-             ((> pendings 0) '(:foreground "orange"))
-             ((= successes total) '(:foreground "green"))
-             (t '(:foreground "gray"))))
-           (count-str (format "%d/%d" successes total)))
-      (concat
-       (propertize indicator 'face face)
-       " "
-       (propertize count-str 'face face)))))
-
-(defun github-notifications--make-graphql-query (repo pr-number)
-  "Create a GraphQL query for PR status checks."
-  (format "query {
-    repository(owner: \"%s\", name: \"%s\") {
-      pullRequest(number: %s) {
-        commits(last: 1) {
-          nodes {
-            commit {
-              statusCheckRollup {
-                state
-                contexts(first: 100) {
-                  nodes {
-                    ... on StatusContext {
-                      state
-                      context
-                    }
-                    ... on CheckRun {
-                      status
-                      conclusion
-                      name
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }"
-          (car (split-string repo "/"))
-          (cadr (split-string repo "/"))
-          pr-number))
-
-(defun github-notifications--format-unread (unread)
-  "Return a propertized string to showcase the status of the notifications"
-  ;; (cond ((unread) (propertize "●" 'face 'github-notifications-unread-face))
-  ;; 	((not unread) (propertize "○" 'face 'github-notifications-unread-face))
-  ;; 	(t (propertize "?" 'face 'github-notifications-unread-face)))
-  (cond (unread (propertize "●" 'face 'github-notifications-unread-face))
-	((not unread) (propertize "○" 'face 'github-notifications-unread-face))
-	(t (propertize "?" 'face 'github-notifications-unread-face))))
-
-(defun github-notifications--get-pr-number (url)
-  "Extract pull request number from URL."
-  (when (string-match "/pulls/\\([0-9]+\\)" url)
-    (match-string 1 url)))
-
-(defun github-notifications-show-details ()
-  "Show detailed view of the notification at point."
-  (interactive)
-  (when-let* ((entry (tabulated-list-get-entry))
-              (title-cell (aref entry 4))
-              (type (get-text-property 0 'notification-type title-cell))
-              (repo (get-text-property 0 'repo title-cell))
-              (url (get-text-property 0 'github-notifications--copy-url title-cell)))
-    (let ((buffer (get-buffer-create github-notifications-detail-buffer-name)))
-      (with-current-buffer buffer
-        (let ((inhibit-read-only t))
-          (erase-buffer)
-          (github-notifications-detail-mode)
-          (cond
-           ((string= type "PullRequest")
-            (github-notifications--show-pr-details repo url))
-           ((string= type "Issue")
-            (github-notifications--show-issue-details repo url))
-           (t
-            (insert "No detailed view available for this notification type."))))
-        (goto-char (point-min)))
-      (display-buffer buffer))))
-
-(defun github-notifications--show-pr-details (repo url)
-  "Show pull request details for REPO and URL."
-  (let ((pr-number (github-notifications--get-pr-number url)))
-    (when pr-number
-      (insert (format "=== Pull Request #%s ===\n\n" pr-number))
-      ;; Fetch PR details
-      (github-notifications--call-process-async
-       (lambda (output)
-         (let ((inhibit-read-only t))
-           (save-excursion
-             (goto-char (point-min))
-             (forward-line 2)
-             (let* ((pr-data (github-notifications--parse-json output)))
-               (insert (format "Title: %s\n" (alist-get 'title pr-data)))
-               (insert (format "State: %s\n" (alist-get 'state pr-data)))
-               (insert (format "\nDescription:\n%s\n" (alist-get 'body pr-data)))))))
-       nil
-       "pr-details"
-       "pr" "view" pr-number "--json" "title,body,state" "--repo" repo)
-      
-      ;; Fetch and display diff
-      (insert "\n=== Diff ===\n\n")
-      (github-notifications--call-process-async
-       (lambda (output)
-         (let ((inhibit-read-only t))
-           (save-excursion
-             (goto-char (point-max))
-             (insert output)
-             (let ((diff-start (save-excursion
-                                 (goto-char (point-min))
-                                 (search-forward "\n=== Diff ===\n\n" nil t))))
-               (when diff-start
-                 (diff-mode-setup))))))
-       nil
-       "pr-diff"
-       "pr" "diff" pr-number "--repo" repo))))
-
-(defun github-notifications--get-issue-number (url)
-  "Extract issue number from URL."
-  (when (string-match "/issues/\\([0-9]+\\)" url)
-    (match-string 1 url)))
-
-(defun github-notifications--format-checks (checks)
-  "Format checks data for display."
-  (mapconcat
-   (lambda (check)
-     (let-alist check
-       (format "%s: %s"
-               .name
-               (propertize .status 'face
-                           (pcase .status
-                             ("success" '(:foreground "green"))
-                             ("failure" '(:foreground "red"))
-                             (_ '(:foreground "yellow")))))))
-   checks "\n"))
-
-;;;###autoload
-(defun github-notifications ()
-  "Display GitHub notifications in a buffer."
-  (interactive)
-  (github-notifications--ensure-gh)
-  (let ((buffer (get-buffer-create github-notifications-buffer-name)))
-    (with-current-buffer buffer
-      (github-notifications-fetch))
-    (switch-to-buffer buffer)))
-
-(provide 'github-notifications-gh)
-;;; github-notifications-gh.el ends here
dots/.config/emacs/old/lisp/gotest-ui.el
@@ -1,631 +0,0 @@
-;;; gotest-ui.el --- Major mode for running go test -json
-
-;; Copyright 2018 Andreas Fuchs
-;; Authors: Andreas Fuchs <asf@boinkor.net>
-
-;; URL: https://github.com/antifuchs/gotest-ui-mode
-;; Created: Feb 18, 2018
-;; Keywords: languages go
-;; Version: 0.1.0
-;; Package-Requires: ((emacs "25") (s "1.12.0") (gotest "0.14.0"))
-
-;; This file is not a part of GNU Emacs.
-
-;; This program 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 3.0, or
-;; (at your option) any later version.
-
-;; This program 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 this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;; Commentary:
-
-;;  Provides support for running go tests with a nice user interface
-;;  that allows folding away output, highlighting failing tests.
-
-;;; Code:
-
-(eval-when-compile
-  (require 'cl))
-
-(require 'subr-x)
-(require 'ewoc)
-(require 'json)
-(require 'compile)
-
-(defgroup gotest-ui nil
-  "The go test runner."
-  :group 'tools)
-
-(defface gotest-ui-pass-face '((t :foreground "green"))
-  "Face for displaying the status of a passing test."
-  :group 'gotest-ui)
-
-(defface gotest-ui-skip-face '((t :foreground "grey"))
-  "Face for displaying the status of a skipped test."
-  :group 'gotest-ui)
-
-(defface gotest-ui-fail-face '((t :foreground "pink" :weight bold))
-  "Face for displaying the status of a failed test."
-  :group 'gotest-ui)
-
-(defface gotest-ui-link-face '((t :foreground "white" :weight bold))
-  "Face for displaying links to go source files."
-  :group 'gotest-ui)
-
-(defcustom gotest-ui-expand-test-statuses '(fail)
-  "Statuses to expand test cases for.
-Whenever a test enters this state, it is automatically expanded."
-  :group 'gotest-ui)
-
-(defcustom gotest-ui-test-binary '("go")
-  "Command list used to invoke the `go' binary."
-  :group 'gotest-ui)
-
-(defcustom gotest-ui-test-args '("test" "-json")
-  "Argument list used to run tests with JSON output."
-  :group 'gotest-ui)
-
-(defcustom gotest-ui-additional-test-args '()
-  "Additional args to pass to `go test'."
-  :group 'gotest-ui)
-
-;;;; Data model:
-
-(defstruct (gotest-ui-section :named
-                              (:constructor gotest-ui-section-create)
-                              (:type vector)
-                              (:predicate gotest-ui-section-p))
-  title tests node)
-
-;;; `gotest-ui-thing' is a thing that can be under test: a
-;;; package, or a single test.
-
-(defstruct gotest-ui-thing
-  (name)
-  (node)
-  (expanded-p)
-  (status)
-  (buffer)    ; the buffer containing this test's output
-  (elapsed)   ; a floating-point amount of seconds
-  )
-
-;;; `gotest-ui-test' is a single test. It contains a status and
-;;; output.
-(defstruct (gotest-ui-test (:include gotest-ui-thing)
-                           (:constructor gotest-ui--make-test-1))
-  (package)
-  (reason))
-
-(defun gotest-ui-test->= (test1 test2)
-  "Returns true if TEST1's name sorts greater than TEST2's."
-  (let ((pkg1 (gotest-ui-test-package test1))
-        (pkg2 (gotest-ui-test-package test2))
-        (name1 (or (gotest-ui-thing-name test1) ""))
-        (name2 (or (gotest-ui-thing-name test2) "")))
-    (if (string= pkg1 pkg2)
-        (string> name1 name2)
-      (string> pkg1 pkg2))))
-
-(defstruct (gotest-ui-status (:constructor gotest-ui--make-status-1))
-  (state)
-  (cmdline)
-  (dir)
-  (output)
-  (node))
-
-(cl-defun gotest-ui--make-status (ewoc cmdline dir)
-  (let ((status (gotest-ui--make-status-1 :state 'run :cmdline (s-join " " cmdline) :dir dir)))
-    (let ((node (ewoc-enter-first ewoc status)))
-      (setf (gotest-ui-status-node status) node))
-    status))
-
-(cl-defun gotest-ui--make-test (ewoc &rest args &key status package name &allow-other-keys)
-  (apply #'gotest-ui--make-test-1 :status (or status "run") args))
-
-;;; Data manipulation routines:
-
-(cl-defun gotest-ui-ensure-test (ewoc package-name base-name &key (status 'run))
-  (let* ((test-name (format "%s.%s" package-name base-name))
-         (test (gethash test-name gotest-ui--tests)))
-    (if test
-        test
-      (setf (gethash test-name gotest-ui--tests)
-            (gotest-ui--make-test ewoc :name base-name :package package-name :status status)))))
-
-(defun gotest-ui-update-status (new-state)
-  (setf (gotest-ui-status-state gotest-ui--status) new-state)
-  (ewoc-invalidate gotest-ui--ewoc (gotest-ui-status-node gotest-ui--status)))
-
-(defun gotest-ui-update-status-output (new-output)
-  (setf (gotest-ui-status-output gotest-ui--status) new-output)
-  (ewoc-invalidate gotest-ui--ewoc (gotest-ui-status-node gotest-ui--status)))
-
-(defun gotest-ui-ensure-output-buffer (thing)
-  (unless (gotest-ui-thing-buffer thing)
-    (with-current-buffer
-        (setf (gotest-ui-thing-buffer thing)
-              (generate-new-buffer (format " *%s" (gotest-ui-thing-name thing))))
-      (setq-local gotest-ui-parse-marker (point-min-marker))
-      (setq-local gotest-ui-insertion-marker (point-min-marker))
-      (set-marker-insertion-type gotest-ui-insertion-marker t)))
-  (gotest-ui-thing-buffer thing))
-
-(defun gotest-ui-mouse-open-file (event)
-  "In gotest-ui mode, open the file/line reference in another window."
-  (interactive "e")
-  (let ((window (posn-window (event-end event)))
-        (pos (posn-point (event-end event)))
-        file line)
-    (if (not (windowp window))
-        (error "No file chosen"))
-    (with-current-buffer (window-buffer window)
-      (goto-char pos)
-      (gotest-ui-open-file-at-point))))
-
-(defun gotest-ui-open-file-at-point ()
-  (interactive)
-  (let ((file (gotest-ui-get-file-for-visit))
-        (line (gotest-ui-get-line-for-visit)))
-    (unless (file-exists-p file)
-      (error "Could not open %s:%d" file line))
-    (with-current-buffer (find-file-other-window file)
-      (goto-char (point-min))
-      (when line
-        (forward-line (1- line))))))
-
-(defun gotest-ui-get-file-for-visit ()
-  (get-text-property (point) 'gotest-ui-file))
-
-(defun gotest-ui-get-line-for-visit ()
-  (string-to-number (get-text-property (point) 'gotest-ui-line)))
-
-(defun gotest-ui-file-from-gopath (package file-basename)
-  (if (or (file-name-absolute-p file-basename)
-          (string-match-p "/" file-basename))
-      file-basename
-    (let ((gopath (or (getenv "GOPATH")
-                      (expand-file-name "~/go"))))
-      (expand-file-name (concat gopath "/src/" package "/" file-basename)))))
-
-(defvar gotest-ui-click-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [mouse-2] 'gotest-ui-mouse-open-file)
-    map))
-
-(defun gotest-ui-ensure-parsed (thing)
-  (save-excursion
-    (goto-char gotest-ui-parse-marker)
-    (while (re-search-forward "\\([^ \t]+\\.go\\):\\([0-9]+\\)" gotest-ui-insertion-marker t)
-      (let* ((file-basename (match-string 1))
-             (file (gotest-ui-file-from-gopath (gotest-ui-test-package thing) file-basename)))
-        (set-text-properties (match-beginning 0) (match-end 0)
-                             `(face gotest-ui-link-face
-                                    gotest-ui-file ,file
-                                    gotest-ui-line ,(match-string 2)
-                                    keymap ,gotest-ui-click-map
-                                    follow-link t
-                                    ))))
-    (set-marker gotest-ui-parse-marker gotest-ui-insertion-marker)))
-
-(defun gotest-ui-update-thing-output (thing output)
-  (with-current-buffer (gotest-ui-ensure-output-buffer thing)
-    (goto-char gotest-ui-insertion-marker)
-    (let ((overwrites (split-string output "\r")))
-      (insert (car overwrites))
-      (dolist (segment (cdr overwrites))
-        (let ((delete-to (point)))
-          (forward-line 0)
-          (delete-region (point) delete-to))
-        (insert segment)))
-    (set-marker gotest-ui-insertion-marker (point))
-    (gotest-ui-ensure-parsed thing)))
-
-;; TODO: clean up buffers on kill
-
-;;;; Mode definition
-
-(defvar gotest-ui-mode-map
-  (let ((m (make-sparse-keymap)))
-    (suppress-keymap m)
-    ;; key bindings go here
-    (define-key m (kbd "TAB") 'gotest-ui-toggle-expanded)
-    (define-key m (kbd "g") 'gotest-ui-rerun)
-    (define-key m (kbd "RET") 'gotest-ui-open-file-at-point)
-    m))
-
-(define-derived-mode gotest-ui-mode special-mode "go test UI"
-  "Major mode for running go test with JSON output."
-  (setq truncate-lines t)
-  (setq buffer-read-only t)
-  (setq-local line-move-visual t)
-  (setq show-trailing-whitespace nil)
-  (setq list-buffers-directory default-directory)
-  (make-local-variable 'text-property-default-nonsticky)
-  (push (cons 'keymap t) text-property-default-nonsticky))
-
-
-(defun gotest-ui--clear-buffer (buffer)
-  (let ((dir default-directory))
-    (with-current-buffer buffer
-      (when (buffer-live-p gotest-ui--process-buffer)
-        (kill-buffer gotest-ui--process-buffer))
-      (kill-all-local-variables)
-      (let  ((buffer-read-only nil))
-        (erase-buffer))
-      (buffer-disable-undo)
-      (setq-local default-directory dir))))
-
-(defun gotest-ui--setup-buffer (buffer name cmdline dir)
-  (setq-local default-directory dir)
-  (setq gotest-ui--cmdline cmdline
-        gotest-ui--dir dir)
-  (let ((ewoc (ewoc-create 'gotest-ui--pp-test nil nil t))
-        (tests (make-hash-table :test #'equal)))
-    (setq gotest-ui--tests tests)
-    (setq gotest-ui--ewoc ewoc)
-    ;; Drop in the first few ewoc nodes:
-    (setq gotest-ui--status (gotest-ui--make-status ewoc cmdline dir))
-    (gotest-ui-add-section gotest-ui--ewoc 'fail "Failed Tests:")
-    (gotest-ui-add-section gotest-ui--ewoc 'run "Currently Running:")
-    (gotest-ui-add-section gotest-ui--ewoc 'skip "Skipped:")
-    (gotest-ui-add-section gotest-ui--ewoc 'pass "Passed Tests:"))
-  ;; Set up the other buffers:
-  (setq gotest-ui--stderr-process-buffer (generate-new-buffer (format " *%s (stderr)" name)))
-  (with-current-buffer gotest-ui--stderr-process-buffer
-    (setq gotest-ui--ui-buffer buffer))
-  (setq gotest-ui--process-buffer (generate-new-buffer (format " *%s" name)))
-  (with-current-buffer gotest-ui--process-buffer
-    (setq gotest-ui--ui-buffer buffer)))
-
-(defun gotest-ui-add-section (ewoc state name)
-  (let ((section (gotest-ui-section-create :title name :tests (list nil))))
-    (setf (gotest-ui-section-node section)
-          (ewoc-enter-last ewoc section))
-    (push (cons state section) gotest-ui--section-alist)))
-
-(defun gotest-ui-sort-test-into-section (test previous-state)
-  (let (invalidate-nodes)
-    (when-let ((previous-section* (and previous-state
-                                       (assoc previous-state gotest-ui--section-alist))))
-      (let ((previous-section (cdr previous-section*)))
-        (setf (gotest-ui-section-tests previous-section)
-              (delete test (gotest-ui-section-tests previous-section)))
-        (when (null (cdr (gotest-ui-section-tests previous-section)))
-          (push (gotest-ui-section-node previous-section) invalidate-nodes))))
-    ;; Drop the node from the buffer:
-    (when-let (node (gotest-ui-thing-node test))
-      (let ((buffer-read-only nil))
-        (ewoc-delete gotest-ui--ewoc node))
-      (setf (gotest-ui-thing-node test) nil))
-
-    ;; Put it in the next secion:
-    (when-let ((section* (assoc (gotest-ui-thing-status test)
-                                gotest-ui--section-alist)))
-      (let* ((section (cdr section*))
-             (insertion-cons (gotest-ui-section-tests section)))
-        (while (and (cdr insertion-cons)
-                    (gotest-ui-test->= test (cadr insertion-cons)))
-          (setq insertion-cons (cdr insertion-cons)))
-        (rplacd insertion-cons (cons test (cdr insertion-cons)))
-        (let ((insertion-node (if (car insertion-cons)
-                                  (gotest-ui-thing-node (car insertion-cons))
-                                (gotest-ui-section-node section))))
-         (setf (gotest-ui-thing-node test)
-               (ewoc-enter-after gotest-ui--ewoc insertion-node test)))
-        (when (null (cddr (gotest-ui-section-tests section)))
-          (push (gotest-ui-section-node section) invalidate-nodes))))
-    (unless (null invalidate-nodes)
-      (apply 'ewoc-invalidate gotest-ui--ewoc invalidate-nodes))
-    (gotest-ui-thing-node test)))
-
-;;;; Commands:
-
-(defun gotest-ui-toggle-expanded ()
-  "Toggle expandedness of a test/package node"
-  (interactive)
-  (let* ((node (ewoc-locate gotest-ui--ewoc (point)))
-         (data (ewoc-data node)))
-    (when (and data (gotest-ui-thing-p data))
-      (setf (gotest-ui-thing-expanded-p data)
-            (not (gotest-ui-thing-expanded-p data)))
-      (ewoc-invalidate gotest-ui--ewoc node))))
-
-(defun gotest-ui-rerun ()
-  (interactive)
-  (gotest-ui gotest-ui--cmdline :dir gotest-ui--dir))
-
-;;;; Displaying the data:
-
-(defvar-local gotest-ui--tests nil)
-(defvar-local gotest-ui--section-alist nil)
-(defvar-local gotest-ui--ewoc nil)
-(defvar-local gotest-ui--status nil)
-(defvar-local gotest-ui--process-buffer nil)
-(defvar-local gotest-ui--stderr-process-buffer nil)
-(defvar-local gotest-ui--ui-buffer nil)
-(defvar-local gotest-ui--process nil)
-(defvar-local gotest-ui--stderr-process nil)
-(defvar-local gotest-ui--cmdline nil)
-(defvar-local gotest-ui--dir nil)
-
-(cl-defun gotest-ui (cmdline &key dir)
-  (let* ((dir (or dir default-directory))
-         (name (format "*go test: %s in %s" (s-join " " cmdline) dir))
-         (buffer (get-buffer-create name)))
-    (unless (eql buffer (current-buffer))
-      (display-buffer buffer))
-    (with-current-buffer buffer
-      (let ((default-directory dir))
-        (gotest-ui--clear-buffer buffer)
-        (gotest-ui-mode)
-        (gotest-ui--setup-buffer buffer name cmdline dir))
-      (setq gotest-ui--stderr-process
-            (make-pipe-process :name (s-concat name "(stderr)")
-                               :buffer gotest-ui--stderr-process-buffer
-                               :sentinel #'gotest-ui--stderr-process-sentinel
-                               :filter #'gotest-ui-read-stderr))
-      (setq gotest-ui--process
-            (make-process :name name
-                          :buffer gotest-ui--process-buffer
-                          :sentinel #'gotest-ui--process-sentinel
-                          :filter #'gotest-ui-read-stdout
-                          :stderr gotest-ui--stderr-process
-                          :command cmdline)))))
-
-(defun gotest-ui-pp-status (status)
-  (propertize (format "%s" status)
-              'face
-              (case status
-                (fail 'gotest-ui-fail-face)
-                (skip 'gotest-ui-skip-face)
-                (pass 'gotest-ui-pass-face)
-                (otherwise 'default))))
-
-(defun gotest-ui--pp-test-output (test)
-  (with-current-buffer (gotest-ui-ensure-output-buffer test)
-    (propertize (buffer-substring (point-min) (point-max))
-                'line-prefix "\t")))
-
-(defun gotest-ui--pp-test (test)
-  (cond
-   ((gotest-ui-section-p test)
-    (unless (null (cdr (gotest-ui-section-tests test)))
-      (insert "\n" (gotest-ui-section-title test) "\n")))
-   ((gotest-ui-status-p test)
-    (insert (gotest-ui-pp-status (gotest-ui-status-state test)))
-    (insert (format " %s in %s\n\n"
-                    (gotest-ui-status-cmdline test)
-                    (gotest-ui-status-dir test)))
-    (unless (zerop (length (gotest-ui-status-output test)))
-      (insert (format "\n\n%s" (gotest-ui-status-output test)))))
-   ((gotest-ui-test-p test)
-    (let ((status (gotest-ui-thing-status test))
-          (package (gotest-ui-test-package test))
-          (name (gotest-ui-thing-name test)))
-      (insert (gotest-ui-pp-status status))
-      (insert " ")
-      (insert (if name
-                  (format "%s.%s" package name)
-                package))
-      (when-let ((elapsed (gotest-ui-thing-elapsed test)))
-        (insert (format " (%.3fs)" elapsed)))
-      (when-let ((reason (gotest-ui-test-reason test)))
-        (insert (format " [%s]" reason))))
-    (when (and (gotest-ui-thing-expanded-p test)
-               (> (length (gotest-ui--pp-test-output test)) 0))
-      (insert "\n")
-      (insert (gotest-ui--pp-test-output test)))
-    (insert "\n"))))
-
-;;;; Handling input:
-
-(defun gotest-ui--process-sentinel (proc event)
-  (let* ((process-buffer (process-buffer proc))
-         (ui-buffer (with-current-buffer process-buffer gotest-ui--ui-buffer))
-         (inhibit-quit t))
-    (with-local-quit
-      (with-current-buffer ui-buffer
-        (cond
-         ((string= event "finished\n")
-          (gotest-ui-update-status 'pass))
-         ((s-prefix-p "exited abnormally" event)
-          (gotest-ui-update-status 'fail))
-         (t
-          (gotest-ui-update-status event)))))))
-
-(defun gotest-ui--stderr-process-sentinel (proc event)
-  ;; ignore all events
-  nil)
-
-(defun gotest-ui-read-stderr (proc input)
-  (let* ((process-buffer (process-buffer proc))
-         (ui-buffer (with-current-buffer process-buffer gotest-ui--ui-buffer))
-         (inhibit-quit t))
-    (with-local-quit
-      (when (buffer-live-p process-buffer)
-        (with-current-buffer process-buffer
-          (gotest-ui-read-compiler-spew proc process-buffer ui-buffer input))))))
-
-(defun gotest-ui-read-stdout (proc input)
-  (let* ((process-buffer (process-buffer proc))
-         (ui-buffer (with-current-buffer process-buffer gotest-ui--ui-buffer))
-         (inhibit-quit t))
-    (with-local-quit
-      (when (buffer-live-p process-buffer)
-        (gotest-ui-read-json process-buffer (process-mark proc) input)))))
-
-(defun gotest-ui-read-json (process-buffer marker input)
-  (with-current-buffer process-buffer
-    (gotest-ui-read-json-1 process-buffer marker gotest-ui--ui-buffer input)))
-
-(defvar-local gotest-ui--current-failing-test nil)
-
-(defun gotest-ui-read-failing-package (ui-buffer)
-  (when (looking-at "^# \\(.*\\)$")
-    (let* ((package (match-string 1))
-           test)
-      (with-current-buffer ui-buffer
-        (setq test (gotest-ui-ensure-test gotest-ui--ewoc package nil :status 'fail))
-        (gotest-ui-maybe-expand test)
-        (gotest-ui-sort-test-into-section test nil))
-      (forward-line 1)
-      test)))
-
-(defun gotest-ui-read-compiler-spew (proc process-buffer ui-buffer input)
-  (with-current-buffer process-buffer
-    (save-excursion
-      (goto-char (point-max))
-      (insert input)
-      (goto-char (process-mark proc))
-      (while (and (/= (point-max) (line-end-position)) ; incomplete line
-                  (/= (point-max) (point)))
-        (cond
-         (gotest-ui--current-failing-test
-          (cond
-           ((looking-at "^# \\(.*\\)$")
-            (gotest-ui-read-failing-package ui-buffer))
-           (t
-            (let* ((line (buffer-substring (point) (line-end-position)))
-                   (test gotest-ui--current-failing-test))
-              (forward-line 1)
-              (set-marker (process-mark proc) (point))
-              (with-current-buffer ui-buffer
-                (gotest-ui-update-thing-output test (concat line "\n"))
-                (ewoc-invalidate gotest-ui--ewoc (gotest-ui-thing-node test)))))))
-         (t
-          (let ((test (gotest-ui-read-failing-package ui-buffer)))
-            (setq gotest-ui--current-failing-test test)
-            (set-marker (process-mark proc) (point))
-            (with-current-buffer ui-buffer
-              (ewoc-invalidate gotest-ui--ewoc (gotest-ui-thing-node test))))))))))
-
-(defun gotest-ui-read-json-1 (process-buffer marker ui-buffer input)
-  (with-current-buffer process-buffer
-    (save-excursion
-      ;; insert the chunk of output at the end
-      (goto-char (point-max))
-      (insert input)
-
-      ;; try to read the next object (which is hopefully complete now):
-      (let ((nodes
-             (cl-loop
-              for (node . continue) = (gotest-ui-read-test-event process-buffer marker ui-buffer)
-              when node collect node into nodes
-              while continue
-              finally (return nodes))))
-        (when nodes
-          (with-current-buffer ui-buffer
-            (apply #'ewoc-invalidate gotest-ui--ewoc
-                   (cl-remove-if-not (lambda (node) (marker-buffer (ewoc-location node))) (cl-remove-duplicates nodes)))))))))
-
-(defun gotest-ui-read-test-event (process-buffer marker ui-buffer)
-  (goto-char marker)
-  (when (= (point) (line-end-position))
-    (forward-line 1))
-  (case (char-after (point))
-    (?\{
-     ;; It's JSON:
-     (condition-case err
-         (let ((obj (json-read)))
-           (set-marker marker (point))
-           (with-current-buffer ui-buffer
-             (cons (gotest-ui-update-test-status obj) t)))
-       (json-error (cons nil nil))
-       (wrong-type-argument
-        (if (and (eql (cadr err) 'characterp)
-                 (eql (caddr err) :json-eof))
-            ;; This is peaceful & we can ignore it:
-            (cons nil nil)
-          (signal 'wrong-type-argument err)))))
-    (?\F
-     ;; It's a compiler error:
-     (when (looking-at "^FAIL\t\\(.*\\)\s+\\[\\([^]]+\\)\\]\n")
-       (let* ((package-name (match-string 1))
-              (reason (match-string 2))
-              test node)
-         (with-current-buffer ui-buffer
-           (setq test (gotest-ui-ensure-test gotest-ui--ewoc package-name nil :status 'fail)
-                 node (gotest-ui-thing-node test))
-           (setf (gotest-ui-test-reason test) reason)
-           (gotest-ui-sort-test-into-section test nil)
-           (gotest-ui-maybe-expand test))
-         (forward-line 1)
-         (set-marker marker (point))
-         (cons node t))))
-    (otherwise
-     ;; We're done:
-     (cons nil nil))))
-
-(defun gotest-ui-maybe-expand (test)
-  (when (memq (gotest-ui-test-status test) gotest-ui-expand-test-statuses)
-    (setf (gotest-ui-test-expanded-p test) t)))
-
-(defun gotest-ui-update-test-status (json)
-  (let-alist json
-    (let* ((action (intern .Action))
-           (test (gotest-ui-ensure-test gotest-ui--ewoc .Package .Test))
-           (previous-status (gotest-ui-thing-status test)))
-      (case action
-        (run
-         (gotest-ui-sort-test-into-section test nil))
-        (output (gotest-ui-update-thing-output test .Output))
-        (pass
-         (setf (gotest-ui-thing-status test) 'pass
-               (gotest-ui-thing-elapsed test) .Elapsed)
-         (gotest-ui-sort-test-into-section test previous-status)
-         (gotest-ui-maybe-expand test))
-        (fail
-         (setf (gotest-ui-thing-status test) 'fail
-               (gotest-ui-thing-elapsed test) .Elapsed)
-         (gotest-ui-sort-test-into-section test previous-status)
-         (gotest-ui-maybe-expand test))
-        (skip
-         (setf (gotest-ui-thing-status test) 'skip
-               (gotest-ui-thing-elapsed test) .Elapsed)
-         (gotest-ui-sort-test-into-section test previous-status)
-         (gotest-ui-maybe-expand test))
-        (otherwise
-         (setq test nil)))
-      (when test (gotest-ui-thing-node test)))))
-
-;;;; Commands for go-mode:
-
-(defun gotest-ui--command-line (&rest cmdline)
-  (append gotest-ui-test-binary gotest-ui-test-args gotest-ui-additional-test-args
-          cmdline))
-
-;;;###autoload
-(defun gotest-ui-current-test ()
-  "Launch go test with the test that (point) is in."
-  (interactive)
-  (cl-destructuring-bind (test-suite test-name) (go-test--get-current-test-info)
-    (let ((test-flag (if (> (length test-suite) 0) "-m" "-run")))
-      (when test-name
-        (gotest-ui (gotest-ui--command-line test-flag (s-concat test-name "$") "."))))))
-
-;;;###autoload
-(defun gotest-ui-current-file ()
-  "Launch go test on the current buffer file."
-  (interactive)
-  (let* ((data (go-test--get-current-file-testing-data))
-         (run-flag (s-concat "-run=" data "$")))
-    (gotest-ui (gotest-ui--command-line run-flag "."))))
-
-;;;###autoload
-(defun gotest-ui-current-project ()
-  "Launch go test on the current buffer's project."
-  (interactive)
-  (let ((default-directory (projectile-project-root)))
-    (gotest-ui (gotest-ui--command-line "./..."))))
-
-(provide 'gotest-ui)
-
-;;; gotest-ui.el ends here
dots/.config/emacs/old/lisp/init-func.el
@@ -1,19 +0,0 @@
-;;; init-func.el --- -*- lexical-binding: t -*-
-;;
-
-;;;###autoload
-(defun vde/el-load-dir (dir)
-  "Load el files from the given folder `DIR'."
-  (let ((files (directory-files dir nil "\.el$")))
-    (while files
-      (load-file (concat dir (pop files))))))
-
-;;;###autoload
-(defun vde/short-hostname ()
-  "Return hostname in short (aka wakasu.local -> wakasu)."
-  (string-match "[0-9A-Za-z-]+" system-name)
-  (substring system-name (match-beginning 0) (match-end 0)))
-
-
-(provide 'init-func)
-;;; init-func.el ends here
dots/.config/emacs/old/lisp/mcp-hub.el
@@ -1,313 +0,0 @@
-;;; mcp-hub.el --- manager mcp server                -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2025  lizqwer scott
-
-;; Author: lizqwer scott <lizqwerscott@gmail.com>
-;; Keywords: ai, mcp
-
-;; This program 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 3 of the License, or
-;; (at your option) any later version.
-
-;; This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;
-
-;;; Code:
-
-(require 'mcp)
-
-(defcustom mcp-hub-servers nil
-  "Configuration for MCP servers.
-Each server configuration is a list of the form
- (NAME . (:command COMMAND :args ARGS)) or (NAME . (:url URL)), where:
-- NAME is a string identifying the server.
-- COMMAND is the command to start the server.
-- ARGS is a list of arguments passed to the command.
-- URL is a string arguments to connect sse mcp server."
-  :group 'mcp-hub
-  :type '(list (cons string (list symbol string))))
-
-(defun mcp-hub--start-server (server &optional inited-callback)
-  "Start an MCP server with the given configuration.
-SERVER should be a cons cell of the form (NAME . CONFIG) where:
-- NAME is a string identifying the server
-- CONFIG is a plist containing either:
-  - :command and :args for local servers
-  - :url for remote servers
-
-Optional argument INITED-CALLBACK is a function called when the server
-has successfully initialized and tools are available. The callback
-receives no arguments."
-  (apply #'mcp-connect-server
-         (append (list (car server))
-                 (cdr server)
-                 (list :initial-callback
-                       #'(lambda (_)
-                           (mcp-hub-update))
-                       :tools-callback
-                       #'(lambda (_ _)
-                           (mcp-hub-update)
-                           (when inited-callback
-                             (funcall inited-callback)))
-                       :prompts-callback
-                       #'(lambda (_ _)
-                           (mcp-hub-update))
-                       :resources-callback
-                       #'(lambda (_ _)
-                           (mcp-hub-update))
-                       :error-callback
-                       #'(lambda (_ _)
-                           (mcp-hub-update))))))
-
-;;;###autoload
-(cl-defun mcp-hub-get-all-tool (&key asyncp categoryp)
-  "Retrieve all available tools from connected MCP servers.
-This function collects all tools from currently connected MCP servers,
-filtering out any invalid entries. Each tool is created as a text tool
-that can be used for interaction.
-
-When ASYNCP is non-nil, the tools will be created asynchronously.
-
-When CATEGORYP is non-nil, the tools will be add to a category.
-
-Returns a list of text tools created from all valid tools across all
-connected servers. The list excludes any tools that couldn't be created
-due to missing or invalid names.
-
-Example:
-  (mcp-hub-get-all-tool)  ; Get all tools synchronously
-  (mcp-hub-get-all-tool t)  ; Get all tools asynchronously"
-  (let ((res ))
-    (maphash #'(lambda (name server)
-                 (when (and server
-                          (equal (mcp--status server)
-                                 'connected))
-                   (when-let* ((tools (mcp--tools server))
-                               (tool-names (mapcar #'(lambda (tool) (plist-get tool :name)) tools)))
-                     (dolist (tool-name tool-names)
-                       (push (let ((tool (mcp-make-text-tool name tool-name asyncp)))
-                               (if categoryp
-                                   (plist-put
-                                    tool
-                                    :category
-                                    (format "mcp-%s"
-                                            name))
-                                 tool))
-                             res)))))
-             mcp-server-connections)
-    (nreverse res)))
-
-;;;###autoload
-(defun mcp-hub-start-all-server (&optional callback servers)
-  "Start all configured MCP servers.
-This function will attempt to start each server listed in `mcp-hub-servers'
-if it's not already running.
-
-Optional argument CALLBACK is a function to be called when all servers have
-either started successfully or failed to start.The callback receives no
-arguments.
-
-Optional argument SERVERS is a list of server names (strings) to filter which
-servers should be started. When nil, all configured servers are considered."
-  (interactive)
-  (let* ((servers-to-start (cl-remove-if (lambda (server)
-                                           (or (not (cl-find (car server) servers :test #'string=))
-                                               (gethash (car server) mcp-server-connections)))
-                                         mcp-hub-servers))
-         (total (length servers-to-start))
-         (started 0))
-    (if (zerop total)
-        (progn
-          (message "All MCP servers already running")
-          (when callback (funcall callback)))
-      (message "Starting %d MCP server(s)..." total)
-      (dolist (server servers-to-start)
-        (condition-case err
-            (mcp-hub--start-server
-             server
-             (lambda ()
-               (cl-incf started)
-               (message "Started server %s (%d/%d)" (car server) started total)
-               (when (and callback (>= started total))
-                 (funcall callback))))
-          (error
-           (message "Failed to start server %s: %s" (car server) err)
-           (cl-incf started)
-           (when (and callback (>= started total))
-             (funcall callback))))))))
-
-;;;###autoload
-(defun mcp-hub-close-all-server ()
-  "Stop all running MCP servers.
-This function will attempt to stop each server listed in `mcp-hub-servers'
-that is currently running."
-  (interactive)
-  (dolist (server mcp-hub-servers)
-    (when (gethash (car server)
-                   mcp-server-connections)
-      (mcp-stop-server (car server))))
-  (mcp-hub-update))
-
-;;;###autoload
-(defun mcp-hub-restart-all-server ()
-  "Restart all configured MCP servers.
-This function first stops all running servers, then starts them again.
-It's useful for applying configuration changes or recovering from errors."
-  (interactive)
-  (mcp-hub-close-all-server)
-  (mcp-hub-start-all-server))
-
-(defun mcp-hub-get-servers ()
-  "Retrieve status information for all configured servers.
-Returns a list of server statuses, where each status is a plist containing:
-- :name - The server's name
-- :status - Either `connected' or `stop'
-- :tools - Available tools (if connected)
-- :resources - Available resources (if connected)
-- :prompts - Available prompts (if connected)"
-  (mapcar #'(lambda (server)
-              (let ((name (car server)))
-                (if-let* ((connection (gethash name mcp-server-connections)))
-                    (list :name name
-                          :type (mcp--connection-type connection)
-                          :status (mcp--status connection)
-                          :tools (mcp--tools connection)
-                          :resources (mcp--resources connection)
-                          :prompts (mcp--prompts connection))
-                  (list :name name :status 'stop))))
-          mcp-hub-servers))
-
-(defun mcp-hub-update ()
-  "Update the MCP Hub display with current server status.
-If called interactively, ARG is the prefix argument.
-When SILENT is non-nil, suppress any status messages.
-This function refreshes the *Mcp-Hub* buffer with the latest server information,
-including connection status, available tools, resources, and prompts."
-  (interactive "P")
-  (when-let* ((server-list (mcp-hub-get-servers))
-              (server-show (mapcar #'(lambda (server)
-                                       (let* ((name (plist-get server :name))
-                                              (status (plist-get server :status)))
-                                         (append (list name
-                                                       (symbol-name (plist-get server :type))
-                                                       (pcase status
-                                                         ('connected
-                                                          (propertize (symbol-name status)
-                                                                      'face 'success))
-                                                         ('error
-                                                          (propertize (symbol-name status)
-                                                                      'face 'error))
-                                                         (_
-                                                          (symbol-name status))))
-                                                 (if (equal status 'connected)
-                                                     (mapcar #'(lambda (x)
-                                                                 (format "%d"
-                                                                         (length x)))
-                                                             (list (plist-get server :tools)
-                                                                   (plist-get server :resources)
-                                                                   (plist-get server :prompts)))
-                                                   (list "nil" "nil" "nil")))))
-                                   server-list)))
-    (with-current-buffer (get-buffer-create "*Mcp-Hub*")
-      (setq tabulated-list-entries
-            (cl-mapcar #'(lambda (statu index)
-                           (list (format "%d" index)
-                                 (vconcat statu)))
-                       server-show
-                       (number-sequence 1 (length server-list))))
-      (tabulated-list-print t))))
-
-;;;###autoload
-(defun mcp-hub ()
-  "View mcp hub server."
-  (interactive)
-  ;; start all server
-  (when (and mcp-hub-servers
-           (= (hash-table-count mcp-server-connections)
-              0))
-    (mcp-hub-start-all-server))
-  ;; show buffer
-  (pop-to-buffer "*Mcp-Hub*" nil)
-  (mcp-hub-mode))
-
-;;;###autoload
-(defun mcp-hub-start-server ()
-  "Start the currently selected MCP server.
-This function starts the server that is currently highlighted in the *Mcp-Hub*
-buffer. It sets up callbacks for connection status, tools, prompts, and
-resources updates, and refreshes the hub view after starting the server."
-  (interactive)
-  (when-let* ((server (tabulated-list-get-entry))
-              (name (elt server 0))
-              (server-arg (cl-find name mcp-hub-servers :key #'car :test #'equal)))
-    (mcp-hub--start-server server-arg)
-    (mcp-hub-update)))
-
-;;;###autoload
-(defun mcp-hub-close-server ()
-  "Stop the currently selected MCP server.
-This function stops the server that is currently highlighted in the *Mcp-Hub*
-buffer and updates the hub view to reflect the change in status."
-  (interactive)
-  (when-let* ((server (tabulated-list-get-entry))
-              (name (elt server 0)))
-    (mcp-stop-server name)
-    (mcp-hub-update)))
-
-;;;###autoload
-(defun mcp-hub-restart-server ()
-  "Restart the currently selected MCP server.
-This function stops and then starts the server that is currently highlighted
-in the *Mcp-Hub* buffer. It's useful for applying configuration changes or
-recovering from errors."
-  (interactive)
-  (mcp-hub-close-server)
-  (mcp-hub-start-server))
-
-;;;###autoload
-(defun mcp-hub-view-log ()
-  "View the event log for the currently selected MCP server.
-This function opens a buffer showing the event log for the server that is
-currently highlighted in the *Mcp-Hub* buffer."
-  (interactive)
-  (when-let* ((server (tabulated-list-get-entry))
-              (name (elt server 0)))
-    (switch-to-buffer (format "*%s events*"
-                              name))))
-
-(define-derived-mode mcp-hub-mode tabulated-list-mode "Mcp Hub"
-  "A major mode for viewing a list of mcp server."
-  (setq-local revert-buffer-function #'mcp-hub-update)
-  (setq tabulated-list-format
-        [("Name" 18 t)
-         ("Type" 10 t)
-         ("Status" 15 t)
-         ("Tools" 10 t)
-         ("Resources" 10 t)
-         ("Prompts" 10 t)])
-  (setq tabulated-list-padding 2)
-  (setq tabulated-list-sort-key '("Name" . nil))
-  (tabulated-list-init-header)
-
-  (keymap-set mcp-hub-mode-map "l" #'mcp-hub-view-log)
-  (keymap-set mcp-hub-mode-map "s" #'mcp-hub-start-server)
-  (keymap-set mcp-hub-mode-map "k" #'mcp-hub-close-server)
-  (keymap-set mcp-hub-mode-map "r" #'mcp-hub-restart-server)
-  (keymap-set mcp-hub-mode-map "S" #'mcp-hub-start-all-server)
-  (keymap-set mcp-hub-mode-map "R" #'mcp-hub-restart-all-server)
-  (keymap-set mcp-hub-mode-map "K" #'mcp-hub-close-all-server)
-
-  (mcp-hub-update))
-
-(provide 'mcp-hub)
-;;; mcp-hub.el ends here
dots/.config/emacs/old/lisp/mcp.el
@@ -1,973 +0,0 @@
-;;; mcp.el --- Model Context Protocol                -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2025  lizqwer scott
-
-;; Author: lizqwer scott <lizqwerscott@gmail.com>
-;; Version: 0.1.0
-;; Package-Requires: ((emacs "30.1") (jsonrpc "1.0.25"))
-;; Keywords: ai, mcp
-;; URL: https://github.com/lizqwerscott/mcp.el
-
-;; This program 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 3 of the License, or
-;; (at your option) any later version.
-
-;; This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;
-
-;;; Code:
-
-(require 'jsonrpc)
-(require 'cl-lib)
-(require 'url)
-
-(defconst *MCP-VERSION* "2024-11-05"
-  "MCP support version.")
-
-(defcustom mcp-server-start-time 60
-  "The Seconds of mcp server start time."
-  :group 'mcp
-  :type 'integer)
-
-(defcustom mcp-server-wait-initial-time 2
-  "Seconds to wait after server init before fetching MCP resources.
-
-This delay is applied after server initialization completes, but
-before requesting tools, prompts and resources. Gives the server
-time to fully initialize all components before handling requests."
-  :group 'mcp
-  :type 'integer)
-
-(defcustom mcp-log-level 'info
-  "The min log level for mcp server.
-Available levels:
-- debug: Detailed debugging information (function entry/exit points)
-- info: General informational messages (operation progress updates)
-- notice: Normal but significant events (configuration changes)
-- warning: Warning conditions (deprecated feature usage)
-- error: Error conditions (operation failures)
-- critical: Critical conditions (system component failures)
-- alert: Action must be taken immediately (data corruption detected)
-- emergency: System is unusable (complete system failure)"
-  :group 'mcp
-  :type '(choice (const :tag "debug" debug)
-          (const :tag "info" info)
-          (const :tag "notice" notice)
-          (const :tag "warning" warning)
-          (const :tag "error" error)
-          (const :tag "critical" critical)
-          (const :tag "alert" alert)
-          (const :tag "emergency" emergency)))
-
-(defclass mcp-process-connection (jsonrpc-process-connection)
-  ((connection-type
-    :initarg :connection-type
-    :accessor mcp--connection-type)
-   (-status
-    :initform 'init
-    :accessor mcp--status)
-   (-capabilities
-    :initform nil
-    :accessor mcp--capabilities)
-   (-serverinfo
-    :initform nil
-    :accessor mcp--server-info)
-   (-prompts
-    :initform nil
-    :accessor mcp--prompts)
-   (-tools
-    :initform nil
-    :accessor mcp--tools)
-   (-resources
-    :initform nil
-    :accessor mcp--resources))
-  :documentation "A MCP connection over an Emacs process.")
-
-(defclass mcp-sse-process-connection (mcp-process-connection)
-  ((-host
-    :initarg :host
-    :accessor mcp--host)
-   (-port
-    :initarg :port
-    :accessor mcp--port)
-   (-tls
-    :initarg :tls
-    :accessor mcp--tls)
-   (-endpoint
-    :initform nil
-    :accessor mcp--endpoint))
-  :documentation "A sse MCP connection over an Emacs process.")
-
-(defclass mcp-stdio-process-connection (mcp-process-connection)
-  ()
-  :documentation "A stdio MCP connection over an Emacs process.")
-
-(cl-defmethod initialize-instance :after ((_ mcp-process-connection) slots)
-  "Init mcp process connection."
-  (cl-destructuring-bind (&key ((:process proc)) &allow-other-keys) slots
-    (set-process-filter proc #'mcp--process-filter)))
-
-(cl-defmethod jsonrpc-connection-send ((connection mcp-process-connection)
-                                       &rest args
-                                       &key
-                                       id
-                                       method
-                                       _params
-                                       (_result nil result-supplied-p)
-                                       error
-                                       _partial)
-  "Send JSON-RPC message to CONNECTION.
-CONNECTION is an MCP process connection instance. ARGS is a plist
-containing the message components:
-
-METHOD - Method name (string, symbol or keyword)
-PARAMS - Parameters for the method (optional)
-ID     - Request ID (optional)
-RESULT - Response result (for replies)
-error   - Error object (for error replies)
-partial - Partial response flag (optional)
-
-For requests, both :method and :id should be provided.
-For notifications, only :method is required.
-For replies, either :_result or :error should be provided.
-
-The message is sent differently based on connection type:
-- SSE connections use HTTP POST requests
-- Stdio connections write directly to the process"
-  (when method
-    ;; sanitize method into a string
-    (setq args
-          (plist-put args :method
-                     (cond ((keywordp method) (substring (symbol-name method) 1))
-                           ((symbolp method) (symbol-name method))
-                           ((stringp method) method)
-                           (t (error "[jsonrpc] invalid method %s" method))))))
-  (let* ((kind (cond ((or result-supplied-p error) 'reply)
-                     (id 'request)
-                     (method 'notification)))
-         (converted (jsonrpc-convert-to-endpoint connection args kind))
-         (json (jsonrpc--json-encode converted)))
-    (pcase (mcp--connection-type connection)
-      ('sse
-       (let ((url-request-method "POST")
-             (url-request-extra-headers
-              '(("Content-Type" . "application/json")))
-             (url-request-data (encode-coding-string
-                                json
-                                'utf-8))
-             (url (format "%s://%s:%s%s"
-                          (if (mcp--tls connection) "https" "http")
-                          (mcp--host connection)
-                          (mcp--port connection)
-                          (mcp--endpoint connection))))
-         (url-retrieve url
-                       #'(lambda (_)
-                           (when (buffer-live-p (current-buffer))
-                             (goto-char (point-min))
-                             ;; (when (search-forward "\n\n" nil t)
-                             ;;   (let* ((headers (buffer-substring (point-min) (point)))
-                             ;;          (body (buffer-substring (point) (point-max)))
-                             ;;          (response-code (string-match "HTTP/.* \\([0-9]+\\)" headers)))))
-                             (kill-buffer))))))
-      ('stdio
-       (process-send-string
-        (jsonrpc--process connection)
-        (format "%s\r\n" json))))
-    (jsonrpc--event
-     connection
-     'client
-     :json json
-     :kind  kind
-     :message args
-     :foreign-message converted)))
-
-(defvar mcp--in-process-filter nil
-  "Non-nil if inside `mcp--process-filter'.")
-
-(cl-defun mcp--process-filter (proc string)
-  "Called when new data STRING has arrived for PROC."
-  (when mcp--in-process-filter
-    ;; Problematic recursive process filters may happen if
-    ;; `jsonrpc-connection-receive', called by us, eventually calls
-    ;; client code which calls `process-send-string' (which see) to,
-    ;; say send a follow-up message.  If that happens to writes enough
-    ;; bytes for pending output to be received, we will lose JSONRPC
-    ;; messages.  In that case, remove recursiveness by re-scheduling
-    ;; ourselves to run from within a timer as soon as possible
-    ;; (bug#60088)
-    (run-at-time 0 nil #'mcp--process-filter proc string)
-    (cl-return-from mcp--process-filter))
-  (when (buffer-live-p (process-buffer proc))
-    (with-current-buffer (process-buffer proc)
-      (let* ((conn (process-get proc 'jsonrpc-connection))
-             (queue (or (process-get proc 'jsonrpc-mqueue) nil))
-             (buf (or (process-get proc 'jsonrpc-pending)
-                      (plist-get (process-put
-                                  proc 'jsonrpc-pending
-                                  (generate-new-buffer " *mcp-jsonrpc-pending*"))
-                                 'jsonrpc-pending)))
-             (data (with-current-buffer buf
-                     (goto-char (point-max))
-                     (insert string)
-                     (buffer-string)))
-             (type (mcp--connection-type conn))
-             (parsed-messages nil)
-             (lines (split-string data "\n"))
-             (parsed-index 0)
-             (endpoint-waitp nil)
-             (line-index 0))
-        (dolist (line lines)
-          (pcase type
-            ('sse
-             (cond
-              ((and (<= (+ line-index 1) (length lines))
-                    (string-prefix-p "event:" (elt lines (+ line-index 1)))))
-              ((string-prefix-p "event: endpoint" line)
-               (setq endpoint-waitp t))
-              ((string-prefix-p "data: " line)
-               (let ((json-str (if (and endpoint-waitp
-                                        (string-match "http://[^/]+\\(/[^[:space:]]+\\)" line))
-                                   (match-string 1 line)
-                                 (string-trim (substring line 6)))))
-                 (unless (string-empty-p json-str)
-                   (if endpoint-waitp
-                       (setf (mcp--endpoint conn) json-str)
-                     (push (cons parsed-index json-str) parsed-messages)
-                     (cl-incf parsed-index)))))
-              ((and (mcp--endpoint conn)
-                    (not (or (string-prefix-p "2d" line)
-                             (string-prefix-p ": ping" line)
-                             (string-prefix-p "event: message" line)))
-                    (not (with-current-buffer buf (= (point-min) (point-max)))))
-               (let ((json-str (string-trim line)))
-                 (unless (string-empty-p json-str)
-                   (push (cons parsed-index json-str) parsed-messages)
-                   (cl-incf parsed-index))))))
-            ('stdio
-             (let ((json-str (string-trim line)))
-               (unless (string-empty-p json-str)
-                 (push (cons parsed-index json-str) parsed-messages)
-                 (cl-incf parsed-index)))))
-          (cl-incf line-index))
-        (setq parsed-messages (nreverse parsed-messages))
-
-        (with-current-buffer buf (erase-buffer))
-        ;; Add messages to MQUEUE
-        (dolist (msg parsed-messages)
-          (pcase-let ((`(,_index . ,json-str) msg))
-            (let ((json nil)
-                  (json-str (with-current-buffer buf
-                              (if (= (point-min) (point-max))
-                                  json-str
-                                (goto-char (point-max))
-                                (insert json-str)
-                                (buffer-string)))))
-              (condition-case-unless-debug err
-                  (setq json (json-parse-string json-str
-                                                :object-type 'plist
-                                                :null-object nil
-                                                :false-object :json-false))
-                (json-parse-error
-                 ;; parse error and not because of incomplete json
-                 (jsonrpc--warn "Invalid JSON: %s\t %s" (cdr err) json-str))
-                (json-end-of-file
-                 ;; Save remaining data to pending for next processing
-                 (with-current-buffer buf
-                   (goto-char (point-max))
-                   (insert json-str)
-                   (process-put proc 'jsonrpc-pending buf))))
-              (when json
-                (with-current-buffer buf (erase-buffer))
-                (when (listp json)
-                  (setq json (plist-put json :jsonrpc-json json-str))
-                  (push json queue))))))
-
-        ;; Save updated queue
-        (process-put proc 'jsonrpc-mqueue queue)
-
-        ;; Dispatch messages in timer
-        (cl-loop with time = (current-time)
-                 for msg = (pop queue) while msg
-                 do (let ((timer (timer-create)))
-                      (timer-set-time timer time)
-                      (timer-set-function timer
-                                          (lambda (conn msg)
-                                            (with-temp-buffer
-                                              (jsonrpc-connection-receive conn msg)))
-                                          (list conn msg))
-                      (timer-activate timer)))
-
-        ;; Save final queue (might have been consumed by timer pop)
-        (process-put proc 'jsonrpc-mqueue queue)))))
-
-(defun mcp--sse-connect (process host port path)
-  "Establish SSE connection to server.
-PROCESS is the network process object. HOST and PORT specify the
-server address. PATH is the endpoint path for SSE connection.
-Sends HTTP GET request with SSE headers to initiate the event
-stream connection. Used internally by MCP for SSE-based JSON-RPC
-communication."
-  (process-send-string process
-                       (concat
-                        (format "GET %s HTTP/1.1\r\n"
-                                path)
-                        (format "Host: %s:%s\r\n"
-                                host
-                                port)
-                        "Accept: text/event-stream\r\n"
-                        "Cache-Control: no-cache\r\n"
-                        "Connection: keep-alive\r\n\r\n")))
-
-(cl-defun mcp-notify (connection method &optional (params nil))
-  "Send notification to CONNECTION without expecting response.
-METHOD is the notification name (string or symbol). PARAMS is an
-optional plist of parameters.
-This is a thin wrapper around =jsonrpc-connection-send' that
-omits the :id parameter to indicate it's a notification rather
-than a request."
-  (apply #'jsonrpc-connection-send
-         `(,connection
-           :method ,method
-           ,@(when params
-               (list :params params)))))
-
-(defvar mcp-server-connections (make-hash-table :test #'equal)
-  "Mcp server process.")
-
-(defun mcp-request-dispatcher (name method params)
-  "Default handler for MCP server requests.
-NAME identifies the server connection. METHOD is the requested
-method name. PARAMS contains the method parameters.
-
-This basic implementation just logs the request. Applications
-should override this to implement actual request handling."
-  (message "%s Received request: method=%s, params=%s" name method params))
-
-(defun mcp-notification-dispatcher (connection name method params)
-  "Handle notifications from MCP server.
-CONNECTION is the JSON-RPC connection object. NAME identifies the
-server. METHOD is the notification name. PARAMS contains the
-notification data."
-  (pcase method
-    ('notifications/message
-     (cond ((or (plist-member (mcp--capabilities connection) :logging)
-                (and (plist-member params :level)
-                     (plist-member params :data)))
-            (cl-destructuring-bind (&key level data &allow-other-keys) params
-              (let ((logger (plist-get params :logger)))
-                (message "[mcp][%s][%s]%s: %s"
-                         name
-                         level
-                         (if logger
-                             (format "[%s]" logger)
-                           "")
-                         data))))))
-    (_
-     (message "%s Received notification: method=%s, params=%s" name method params))))
-
-(defun mcp-on-shutdown (name)
-  "When NAME mcp server shutdown."
-  (message "%s connection shutdown" name))
-
-(defun mcp--parse-http-url (url)
-  "Parse HTTP/HTTPS URL into connection components.
-URL should be a string in format http(s)://host[:port][/path].
-
-Returns a plist with connection parameters:
-:tls   - Boolean indicating HTTPS (t) or HTTP (nil)
-:host  - Server hostname (string)
-:port  - Port number (integer, defaults to 80/443)
-:path  - URL path component (string)
-
-Returns nil if URL is invalid or not HTTP/HTTPS."
-  (when-let* ((url (url-generic-parse-url url))
-              (type (url-type url))
-              (host (url-host url))
-              (filename (url-filename url)))
-    (when (or (string= type "http")
-              (string= type "https"))
-      (let ((port (url-port url))
-            (tls (string= "https" type)))
-        (list :tls tls
-              :host host
-              :port (if port
-                        port
-                      (if tls
-                          443
-                        80))
-              :path filename)))))
-
-;;;###autoload
-(cl-defun mcp-connect-server (name &key command args url env initial-callback
-                                   tools-callback prompts-callback
-                                   resources-callback error-callback)
-  "Connect to an MCP server with NAME, COMMAND, and ARGS or URL.
-
-NAME is a string representing the name of the server.
-COMMAND is a string representing the command to start the server
-in stdio mcp server.
-ARGS is a list of arguments to pass to the COMMAND.
-URL is a string arguments to connect sse mcp server.
-ENV is a plist argument to set mcp server env.
-
-INITIAL-CALLBACK is a function called when the server completes
-the connection.
-TOOLS-CALLBACK is a function called to handle the list of tools
-provided by the server.
-PROMPTS-CALLBACK is a function called to handle the list of prompts
-provided by the server.
-RESOURCES-CALLBACK is a function called to handle the list of
-resources provided by the server.
-ERROR-CALLBACK is a function to call on error.
-
-This function creates a new process for the server, initializes a connection,
-and sends an initialization message to the server. The connection is stored
-in the `mcp-server-connections` hash table for future reference."
-  (unless (gethash name mcp-server-connections)
-    (when-let* ((server-config (cond (command
-                                      (list :connection-type 'stdio
-                                            :command command
-                                            :args args))
-                                     (url
-                                      (when-let* ((res (mcp--parse-http-url url)))
-                                        (plist-put res
-                                                   :connection-type 'sse)))))
-                (connection-type (plist-get server-config :connection-type))
-                (buffer-name (format "*Mcp %s server*" name))
-                (process-name (format "mcp-%s-server" name))
-                (process (pcase connection-type
-                           ('sse
-                            (get-buffer-create buffer-name)
-                            (open-network-stream process-name
-                                                 buffer-name
-                                                 (plist-get server-config :host)
-                                                 (plist-get server-config :port)
-                                                 :type (if (plist-get server-config :tls)
-                                                           'tls
-                                                         'network)))
-                           ('stdio
-                            (let ((env (mapcar #'(lambda (item)
-                                                   (pcase-let* ((`(,key ,value) item))
-                                                     (let ((key (symbol-name key)))
-                                                       (list (substring key 1)
-                                                             (format "%s" value)))))
-                                               (seq-partition env 2)))
-                                  (process-environment (copy-sequence process-environment)))
-                              (when env
-                                (dolist (elem env)
-                                  (setenv (car elem) (cadr elem))))
-                              (make-process
-                               :name name
-                               :command (append (list command)
-                                                (plist-get server-config :args))
-                               :connection-type 'pipe
-                               :coding 'utf-8-emacs-unix
-                               ;; :noquery t
-                               :stderr (get-buffer-create
-                                        (format "*%s stderr*" name))
-                               ;; :file-handler t
-                               ))))))
-      (when (equal connection-type 'sse)
-        (mcp--sse-connect process
-                          (plist-get server-config :host)
-                          (plist-get server-config :port)
-                          (plist-get server-config :path)))
-      (let ((connection (apply #'make-instance
-                               `(,(pcase connection-type
-                                    ('sse
-                                     'mcp-sse-process-connection)
-                                    ('stdio
-                                     'mcp-stdio-process-connection))
-                                 :connection-type ,connection-type
-                                 :name ,name
-                                 :process ,process
-                                 :request-dispatcher ,(lambda (_ method params)
-                                                        (funcall #'mcp-request-dispatcher name method params))
-                                 :notification-dispatcher ,(lambda (connection method params)
-                                                             (funcall #'mcp-notification-dispatcher connection name method params))
-                                 :on-shutdown ,(lambda (_)
-                                                 (funcall #'mcp-on-shutdown name))
-                                 ,@(when (equal connection-type 'sse)
-                                     (list :host (plist-get server-config :host)
-                                           :port (plist-get server-config :port)
-                                           :tls (plist-get server-config :tls))))))
-            (initial-use-time 0)
-            (initial-timer nil))
-        ;; Initialize connection
-        (puthash name connection mcp-server-connections)
-        (when (equal connection-type 'sse)
-          (setf (mcp--status connection)
-                'waitendpoint))
-        ;; Send the Initialize message
-        (setf initial-timer
-              (run-with-idle-timer
-               1
-               t
-               #'(lambda ()
-                   (cl-incf initial-use-time)
-                   (if (jsonrpc-running-p connection)
-                       (when (or (equal connection-type 'stdio)
-                                 (and (equal connection-type 'sse)
-                                      (mcp--endpoint connection)))
-                         (cancel-timer initial-timer)
-                         (mcp-async-initialize-message
-                          connection
-                          #'(lambda (protocolVersion serverInfo capabilities)
-                              (if (string= protocolVersion *MCP-VERSION*)
-                                  (progn
-                                    (message "[mcp] Connected! Server `MCP (%s)' now managing." (jsonrpc-name connection))
-                                    (setf (mcp--capabilities connection) capabilities
-                                          (mcp--server-info connection) serverInfo)
-                                    ;; Notify server initialized
-                                    (mcp-notify connection
-                                                :notifications/initialized)
-                                    ;; handle logging
-                                    (when (plist-member capabilities :logging)
-                                      (mcp-async-set-log-level connection mcp-log-level))
-                                    (when initial-callback
-                                      (funcall initial-callback connection))
-                                    (run-with-idle-timer mcp-server-wait-initial-time
-                                                         nil
-                                                         #'(lambda ()
-                                                             ;; Get prompts
-                                                             (when (plist-member capabilities :prompts)
-                                                               (mcp-async-list-prompts connection prompts-callback))
-                                                             ;; Get tools
-                                                             (when (plist-member capabilities :tools)
-                                                               (mcp-async-list-tools connection tools-callback))
-                                                             ;; Get resources
-                                                             (when (plist-member capabilities :resources)
-                                                               (mcp-async-list-resources connection resources-callback)))
-                                                         )
-                                    (setf (mcp--status connection)
-                                          'connected))
-                                (progn
-                                  (message "[mcp] Error %s server protocolVersion(%s) not support, client Version: %s."
-                                           (jsonrpc-name connection)
-                                           protocolVersion
-                                           *MCP-VERSION*)
-                                  (mcp-stop-server (jsonrpc-name connection)))))
-                          #'(lambda (code message)
-                              (when error-callback
-                                (funcall error-callback code message))
-                              (setf (mcp--status connection)
-                                    'error)
-                              (message "Sadly, mpc server reports %s: %s"
-                                       code message)))
-                         (when (> initial-use-time mcp-server-start-time)
-                           (mcp-stop-server name)
-                           (cancel-timer initial-timer)
-                           (message "Sadly: mcp server start error timeout")))
-                     (cancel-timer initial-timer)
-                     (when error-callback
-                       (funcall error-callback -1 "mcp server process start error")
-                       (setf (mcp--status connection)
-                             'error)
-                       (message "Sadly, %s mcp server process start error" name))))))))))
-
-;;;###autoload
-(defun mcp-stop-server (name)
-  "Stop the MCP server with the given NAME.
-If the server is running, it will be shutdown and its connection will be removed
-from `mcp-server-connections'. If no server with the given NAME is found,
-a message will be displayed indicating that the server is not running."
-  (if-let* ((connection (gethash name mcp-server-connections)))
-      (progn
-        (jsonrpc-shutdown connection)
-        (setf (gethash name mcp-server-connections) nil))
-    (message "mcp %s server not started" name)))
-
-(defun mcp--parse-tool-args (properties required)
-  "Parse tool arguments from PROPERTIES and REQUIRED lists.
-
-PROPERTIES is a plist of tool argument properties.
-REQUIRED is a list of required argument names.
-
-The function processes each argument in PROPERTIES, marking optional arguments
-if they are not in REQUIRED. Each argument is parsed into a structured plist
-with :name, :type, and :optional fields.
-
-Returns a list of parsed argument plists."
-  (let ((need-length (- (/ (length properties) 2)
-                        (length required))))
-    (cl-mapcar #'(lambda (arg-value required-name)
-                   (pcase-let* ((`(,key ,value) arg-value))
-                     `( :name ,(substring (symbol-name key) 1)
-                        ,@value
-                        ,@(unless required-name
-                            `(:optional t)))))
-               (seq-partition properties 2)
-               (append required
-                       (when (> need-length 0)
-                         (make-list need-length nil))))))
-
-
-(defun mcp--parse-tool-call-result (res)
-  "Parse the result of a tool call from RES.
-
-RES is a plist representing the tool call result.
-
-The function extracts text content from the result, concatenating it into
-a single string if multiple text entries are present.
-
-Returns the concatenated text or nil if no text content is found."
-  (string-join
-   (cl-remove-if #'null
-                 (mapcar #'(lambda (content)
-                             (when (string= "text" (plist-get content :type))
-                               (plist-get content :text)))
-                         (plist-get res :content)))
-   "\n"))
-
-(defun mcp--generate-tool-call-args (args properties)
-  "Generate tool call arguments from ARGS and PROPERTIES.
-
-ARGS is a list of argument values provided by the caller.
-PROPERTIES is a plist of tool argument properties.
-
-The function matches ARGS to PROPERTIES, filling in default values for missing
-optional arguments. It ensures the generated arguments match the tool's schema.
-
-Returns a plist of argument names and values ready for tool invocation."
-  (let ((need-length (- (/ (length properties) 2)
-                        (length args))))
-    (apply #'append
-           (cl-mapcar #'(lambda (arg value)
-                          (when-let* ((value (if value
-                                                 value
-                                               (plist-get (cl-second arg)
-                                                          :default))))
-                            (list (cl-first arg)
-                                  value)))
-                      (seq-partition properties 2)
-                      (append args
-                              (when (> need-length 0)
-                                (make-list need-length nil)))))))
-
-;;;###autoload
-(defun mcp-make-text-tool (name tool-name &optional asyncp)
-  "Create a `gptel' tool with the given NAME, TOOL-NAME, and ASYNCP.
-
-NAME is the name of the server connection.
-TOOL-NAME is the name of the tool to be created.
-
-Currently, only synchronous messages are supported.
-
-This function retrieves the tool definition from the server connection,
-constructs a basic tool with the appropriate properties, and returns it.
-The tool is configured to handle input arguments, call the server, and process
-the response to extract and return text content."
-  (when-let* ((connection (gethash name mcp-server-connections))
-              (tools (mcp--tools connection))
-              (tool (cl-find tool-name tools :test #'equal :key #'(lambda (tool) (plist-get tool :name)))))
-    (cl-destructuring-bind (&key description ((:inputSchema input-schema)) &allow-other-keys) tool
-      (cl-destructuring-bind (&key properties required &allow-other-keys) input-schema
-        (list
-         :function (if asyncp
-                       #'(lambda (callback &rest args)
-                           (when (< (length args) (length required))
-                             (error "Error: args not match: %s -> %s" required args))
-                           (if-let* ((connection (gethash name mcp-server-connections)))
-                               (mcp-async-call-tool connection
-                                                    tool-name
-                                                    (mcp--generate-tool-call-args args properties)
-                                                    #'(lambda (res)
-                                                        (funcall callback
-                                                                 (mcp--parse-tool-call-result res)))
-                                                    #'(lambda (code message)
-                                                        (funcall callback
-                                                                 (format "call %s tool error with %s: %s"
-                                                                         tool-name
-                                                                         code
-                                                                         message))))
-                             (error "Error: %s server not connect" name)))
-                     #'(lambda (&rest args)
-                         (when (< (length args) (length required))
-                           (error "Error: args not match: %s -> %s" required args))
-                         (if-let* ((connection (gethash name mcp-server-connections)))
-                             (if-let* ((res (mcp-call-tool connection
-                                                           tool-name
-                                                           (mcp--generate-tool-call-args args properties))))
-                                 (mcp--parse-tool-call-result res)
-                               (error "Error: call %s tool error" tool-name))
-                           (error "Error: %s server not connect" name))))
-         :name tool-name
-         :async asyncp
-         :description description
-         :args
-         (mcp--parse-tool-args properties (or required '())))))))
-
-(defun mcp-async-set-log-level (connection log-level)
-  "Asynchronously set the log level for the MCP server.
-
-CONNECTION is the MCP connection object.
-LOG-LEVEL is the desired log level, which must be one of:
-- `debug': Detailed debugging information (function entry/exit points)
-- `info': General informational messages (operation progress updates)
-- `notice': Normal but significant events (configuration changes)
-- `warning': Warning conditions (deprecated feature usage)
-- `error': Error conditions (operation failures)
-- `critical': Critical conditions (system component failures)
-- `alert': Action must be taken immediately (data corruption detected)
-- `emergency': System is unusable (complete system failure)
-
-On success, displays a message confirming the log level change.
-On error, displays an error message with the server's response code and message."
-  (jsonrpc-async-request connection
-                         :logging/setLevel
-                         (list :level (format "%s" log-level))
-                         :success-fn
-                         #'(lambda (res)
-                             (message "[mcp] setLevel success: %s" res))
-                         :error-fn (jsonrpc-lambda (&key code message _data)
-                                     (message "Sadly, mpc server reports %s: %s"
-                                              code message))))
-
-(defun mcp-async-ping (connection)
-  "Send an asynchronous ping request to the MCP server via CONNECTION.
-
-The function uses `jsonrpc-async-request' to send a ping request.
-On success, it displays a message with the response.
-On error, it displays an error message with the code from the server."
-  (jsonrpc-async-request connection
-                         :ping
-                         nil
-                         :success-fn
-                         #'(lambda (res)
-                             (message "[mcp] ping success: %s" res))
-                         :error-fn (jsonrpc-lambda (&key code message _data)
-                                     (message "Sadly, mpc server reports %s: %s"
-                                              code message))))
-
-(defun mcp-async-initialize-message (connection callback &optional error-callback)
-  "Sending an `initialize' request to the CONNECTION.
-
-CONNECTION is the MCP connection object.
-CALLBACK is a function to call upon successful initialization.
-ERROR-CALLBACK is an optional function to call if an error occurs.
-
-This function sends an `initialize' request to the server
-with the client's capabilities and version information."
-  (jsonrpc-async-request connection
-                         :initialize
-                         (list :protocolVersion "2024-11-05"
-                               :capabilities '(:roots (:listChanged t))
-                               :clientInfo '(:name "mcp-emacs" :version "0.1.0"))
-                         :success-fn
-                         #'(lambda (res)
-                             (cl-destructuring-bind (&key protocolVersion serverInfo capabilities &allow-other-keys) res
-                               (funcall callback protocolVersion serverInfo capabilities)))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (if error-callback
-                               (funcall error-callback code message)
-                             (message "Sadly, mpc server reports %s: %s"
-                                      code message)))))
-
-(defun mcp-async-list-tools (connection &optional callback error-callback)
-  "Get a list of tools from the MCP server using the provided CONNECTION.
-
-CONNECTION is the MCP connection object.
-CALLBACK is a function to call with the result of the request.
-ERROR-CALLBACK is an optional function to call if the request fails.
-
-This function sends a request to the server to list available tools.
-The result is stored in the `mcp--tools' slot of the CONNECTION object."
-  (jsonrpc-async-request connection
-                         :tools/list
-                         '(:cursor "")
-                         :success-fn
-                         #'(lambda (res)
-                             (cl-destructuring-bind (&key tools &allow-other-keys) res
-                               (setf (mcp--tools connection)
-                                     tools)
-                               (when callback
-                                 (funcall callback connection tools))))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (if error-callback
-                               (funcall error-callback code message)
-                             (message "Sadly, mpc server reports %s: %s"
-                                      code message)))))
-
-(defun mcp-call-tool (connection name arguments)
-  "Call a tool on the remote CONNECTION with NAME and ARGUMENTS.
-
-CONNECTION is the MCP connection object.
-NAME is the name of the tool to call.
-ARGGUMENTS is a list of arguments to pass to the tool."
-  (jsonrpc-request connection
-                   :tools/call
-                   (list :name name
-                         :arguments (if arguments
-                                        arguments
-                                      #s(hash-table)))))
-
-(defun mcp-async-call-tool (connection name arguments callback error-callback)
-  "Async Call a tool on the remote CONNECTION with NAME and ARGUMENTS.
-
-CONNECTION is the MCP connection object.
-NAME is the name of the tool to call.
-ARGUMENTS is a list of arguments to pass to the tool.
-CALLBACK is a function to call on success.
-ERROR-CALLBACK is a function to call on error."
-  (jsonrpc-async-request connection
-                         :tools/call
-                         (list :name name
-                               :arguments (if arguments
-                                              arguments
-                                            #s(hash-table)))
-                         :success-fn
-                         #'(lambda (res)
-                             (funcall callback res))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (funcall error-callback code message))))
-
-(defun mcp-async-list-prompts (connection &optional callback error-callback)
-  "Get list of prompts from the MCP server using the provided CONNECTION.
-
-CONNECTION is the MCP connection object. CALLBACK is an optional function to
-call on success,which will receive the CONNECTION and the list of prompts.
-ERROR-CALLBACK is an optional function to call on error, which will receive the
-error code and message.
-
-The result is stored in the `mcp--prompts' slot of the CONNECTION object."
-  (jsonrpc-async-request connection
-                         :prompts/list
-                         '(:cursor "")
-                         :success-fn
-                         #'(lambda (res)
-                             (cl-destructuring-bind (&key prompts &allow-other-keys) res
-                               (setf (mcp--prompts connection)
-                                     prompts)
-                               (when callback
-                                 (funcall callback connection prompts))))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (if error-callback
-                               (funcall error-callback code message)
-                             (message "Sadly, mpc server reports %s: %s"
-                                      code message)))))
-
-(defun mcp-get-prompt (connection name arguments)
-  "Call a prompt on the remote CONNECTION with NAME and ARGUMENTS.
-
-CONNECTION is the MCP connection object.
-NAME is the name of the prompt to call.
-ARGGUMENTS is a list of arguments to pass to the prompt"
-  (jsonrpc-request connection
-                   :prompts/get
-                   (list :name name
-                         :arguments (if arguments
-                                        arguments
-                                      #s(hash-table)))))
-
-(defun mcp-async-get-prompt (connection name arguments callback error-callback)
-  "Async Call a prompt on the remote CONNECTION with NAME and ARGUMENTS.
-
-CONNECTION is the MCP connection object.
-NAME is the name of the prompt to call.
-ARGUMENTS is a list of arguments to pass to the prompt.
-CALLBACK is a function to call on successful response.
-ERROR-CALLBACK is a function to call on error."
-  (jsonrpc-async-request connection
-                         :prompts/get
-                         (list :name name
-                               :arguments (if arguments
-                                              arguments
-                                            #s(hash-table)))
-                         :success-fn
-                         #'(lambda (res)
-                             (funcall callback res))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (funcall error-callback code message))))
-
-(defun mcp-async-list-resources (connection &optional callback error-callback)
-  "Get list of resources from the MCP server using the provided CONNECTION.
-
-CONNECTION is the MCP connection object. CALLBACK is an optional function to
-call upon successful retrieval of resources. ERROR-CALLBACK is an optional
-function to call if an error occurs during the request.
-
-The result is stored in the `mcp--resources' slot of the CONNECTION object."
-  (jsonrpc-async-request connection
-                         :resources/list
-                         '(:cursor "")
-                         :success-fn
-                         #'(lambda (res)
-                             (cl-destructuring-bind (&key resources &allow-other-keys) res
-                               (setf (mcp--resources connection)
-                                     resources)
-                               (when callback
-                                 (funcall callback connection resources))))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (if error-callback
-                               (funcall error-callback code message)
-                             (message "Sadly, mpc server reports %s: %s"
-                                      code message)))))
-(defun mcp-read-resource (connection uri)
-  "Call a resource on the remote CONNECTION with URI.
-
-CONNECTION is the MCP connection object.
-URI is the uri of the resource to call."
-  (jsonrpc-request connection
-                   :resources/read
-                   (list :uri uri)))
-
-(defun mcp-async-read-resource (connection uri &optional callback error-callback)
-  "Call a resource on the remote CONNECTION with URI.
-
-CONNECTION is the MCP connection object.
-URI is the URI of the resource to call.
-CALLBACK is a function to call with the result on success.
-ERROR-CALLBACK is a function to call with the error code and message on failure.
-
-This function asynchronously reads a resource from the remote connection
-using the specified URI. The result is passed to CALLBACK if the request
-succeeds, or ERROR-CALLBACK if it fails."
-  (jsonrpc-async-request connection
-                         :resources/read
-                         (list :uri uri)
-                         :success-fn
-                         #'(lambda (res)
-                             (funcall callback res))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (funcall error-callback code message))))
-
-(defun mcp-async-list-resource-templates (connection &optional callback error-callback)
-  "Get list of resource templates from the MCP server using the CONNECTION.
-
-CONNECTION is the MCP connection object. CALLBACK is an optional function to
-call upon successful retrieval of resources. ERROR-CALLBACK is an optional
-function to call if an error occurs during the request."
-  (jsonrpc-async-request connection
-                         :resources/templates/list
-                         '(:cursor "")
-                         :success-fn
-                         #'(lambda (res)
-                             (cl-destructuring-bind (&key resourceTemplates &allow-other-keys) res
-                               (when callback
-                                 (funcall callback connection resourceTemplates))))
-                         :error-fn
-                         (jsonrpc-lambda (&key code message _data)
-                           (if error-callback
-                               (funcall error-callback code message)
-                             (message "Sadly, mpc server reports %s: %s"
-                                      code message)))))
-
-(provide 'mcp)
-;;; mcp.el ends here
dots/.config/emacs/old/lisp/ol-github.el
@@ -1,70 +0,0 @@
-;;; ol-github.el --- Links to GitHub -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020 Vincent Demeester
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; Keywords: org link github
-;; Version: 0.1
-;; URL: https://gitlab.com/vdemeester/vorg
-;; Package-Requires: ((emacs "26.0") (org "9.0"))
-;;
-;; This file is not part of GNU Emacs.
-
-;; This program 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 3.0, or
-;; (at your option) any later version.
-
-;; This program 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 this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to GitHub from within Org mode.
-;; gh:tektoncd/pipeline   : project
-;; gh:tektoncd/pipeline#1 : issue or pr #1
-
-;;; Code:
-
-(require 'ol)
-
-;; Install the link type
-(org-link-set-parameters "gh"
-                         :follow #'org-github-follow-link
-                         :export #'org-github-export
-                         :face '(:foreground "DimGrey" :underline t))
-
-
-(defun org-github-export (link description format)
-  "Export a github page link from Org files."
-  (let ((path (org-github-get-url link))
-        (desc (or description link)))
-    (cond
-     ((eq format 'html) (format "<a hrefl=\"_blank\" href=\"%s\">%s</a>" path desc))
-     ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
-     ((eq format 'texinfo) (format "@uref{%s,%s}" path desc))
-     ((eq format 'ascii) (format "%s (%s)" desc path))
-     (t path))))
-
-(defun org-github-follow-link (issue)
-  "Browse github issue/pr specified."
-  (browse-url (org-github-get-url issue)))
-
-(defun org-github-get-url (path)
-  "Translate org-mode link `gh:foo/bar#1' to github url."
-  (setq expressions (split-string path "#"))
-  (setq project (nth 0 expressions))
-  (setq issue (nth 1 expressions))
-  (if issue
-      (format "https://github.com/%s/issues/%s" project issue)
-    (format "https://github.com/%s" project)))
-
-(provide 'ol-github)
-;;; ol-github.el ends here
dots/.config/emacs/old/lisp/ol-gitlab.el
@@ -1,81 +0,0 @@
-;;; ol-gitlab.el --- Links to Gitlab -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020 Vincent Demeester
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; Keywords: org link gitlab
-;; Version: 0.1
-;; URL: https://gitlab.com/vdemeester/vorg
-;; Package-Requires: ((emacs "26.0") (org "9.0"))
-;;
-;; This file is not part of GNU Emacs.
-
-;; This program 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 3.0, or
-;; (at your option) any later version.
-
-;; This program 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 this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Gitlab from within Org mode.
-;; gl:vdemeester/emacs-config    : project
-;; gl:vdemeester/emacs-config#1  : issue #1
-;; gl:vdemeester/emacs-config##1 : merge-request #1
-
-;;; Code:
-
-(require 'ol)
-
-;; Install the link type
-(org-link-set-parameters "gl"
-                         :follow #'org-gitlab-follow-link
-                         :export #'org-gitlab-export
-                         :face '(:foreground "DimGrey" :underline t))
-
-
-(defun org-gitlab-export (link description format)
-  "Export a gitlab page link from Org files."
-  (let ((path (org-gitlab-get-url link))
-        (desc (or description link)))
-    (cond
-     ((eq format 'html) (format "<a hrefl=\"_blank\" href=\"%s\">%s</a>" path desc))
-     ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
-     ((eq format 'texinfo) (format "@uref{%s,%s}" path desc))
-     ((eq format 'ascii) (format "%s (%s)" desc path))
-     (t path))))
-
-(defun org-gitlab-follow-link (issue)
-  "Browse gitlab issue/pr specified."
-  (browse-url (org-gitlab-get-url issue)))
-
-(defun org-gitlab-get-url (path)
-  "Translate org-mode link `gh:foo/bar#1' to gitlab url."
-  (setq expressions (split-string path "#"))
-  (setq project (nth 0 expressions))
-  (setq issue (nth 1 expressions))
-  (setq mr (nth 2 expressions))
-  (message (format "issue: %s" issue))
-  (message (format "mr: %s" mr))
-  (if (not (empty-string-p mr))
-      (format "https://gitlab.com/%s/-/merge_requests/%s" project mr)
-    (if (not (empty-string-p issue))
-        (format "https://gitlab.com/%s/-/issues/%s" project issue)
-      (format "https://gitlab.com/%s" project))))
-
-(defun empty-string-p (string)
-  "Return true if the STRING is empty or nil. Expects string type."
-  (or (null string)
-      (zerop (length (string-trim string)))))
-
-(provide 'ol-gitlab)
-;;; ol-gitlab.el ends here
dots/.config/emacs/old/lisp/ol-grep.el
@@ -1,57 +0,0 @@
-;;; ol-grep.el --- Links to Grep -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020 Vincent Demeester
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; Keywords: org link grep
-;; Version: 0.1
-;; URL: https://gitlab.com/vdemeester/vorg
-;; Package-Requires: ((emacs "26.0") (org "9.0"))
-;;
-;; This file is not part of GNU Emacs.
-
-;; This program 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 3.0, or
-;; (at your option) any later version.
-
-;; This program 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 this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Grep from within Org mode.
-;; grep:orgmode         : run grep on current working dir with orgmode expression
-;; grep:orgmode:config/ : run grep on config/ dir with orgmode expression
-
-;;; Code:
-
-(require 'ol)
-
-;; Install the link type
-(org-link-set-parameters "rg"
-                         :follow #'org-grep-follow-link
-                         :face '(:foreground "DarkRed" :underline t))
-
-(defun org-grep-follow-link (issue)
-  "Run `rgrep' with REGEXP and FOLDER as argument,
-like this : [[grep:REGEXP:FOLDER]]."
-  (setq expressions (split-string regexp ":"))
-  (setq exp (nth 0 expressions))
-  (grep-compute-defaults)
-  (if (= (length expressions) 1)
-      (progn
-        (rgrep exp "*" (expand-file-name "./")))
-    (progn
-      (setq folder (nth 1 expressions))
-      (rgrep exp "*" (expand-file-name folder)))))
-
-(provide 'ol-grep)
-;;; ol-grep.el ends here
dots/.config/emacs/old/lisp/ol-rg.el
@@ -1,61 +0,0 @@
-;;; ol-rg.el --- Links to rg -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020 Vincent Demeester
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; Keywords: org link ripgrep rg.el
-;; Version: 0.1
-;; URL: https://gitlab.com/vdemeester/vorg
-;; Package-Requires: ((emacs "26.0") (org "9.0") (rg "1.8.0"))
-;;
-;; This file is not part of GNU Emacs.
-
-;; This program 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 3.0, or
-;; (at your option) any later version.
-
-;; This program 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 this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Ripgrep from within Org mode.
-;; rg:orgmode             : run ripgrep on current working dir with orgmode expression
-;; rg:orgmode:config/     : run ripgrep on config/ dir with orgmode expression
-;; rg:orgmode:config/#org : run ripgrep on config/ dir with orgmode expression
-
-;;; Code:
-
-(require 'rg)
-(require 'ol)
-
-;; Install the link type
-(org-link-set-parameters "rg"
-                         :follow #'org-rg-follow-link
-                         :face '(:foreground "DarkGreen" :underline t))
-
-(defun org-rg-follow-link (regexp)
-  "Run `rg` with REXEP as argument,
-like this : [[rg:REGEXP:FOLDER#FILTER]]"
-  (setq expressions (split-string regexp ":"))
-  (setq exp (nth 0 expressions))
-  (setq folderpart (nth 1 expressions))
-  (setq files (split-string folderpart "#"))
-  (setq folder (nth 0 files))
-  (setq filter (nth 1 files))
-  (if folderpart
-      (if filter
-          (rg exp (concat "*." filter) folder)
-        (rg exp "*" folder))
-    (rg exp "*" "./")))
-
-(provide 'ol-rg)
-;;; ol-rg.el ends here
dots/.config/emacs/old/lisp/org-extra-emphasis.el
@@ -1,805 +0,0 @@
-;;; org-extra-emphasis.el --- Extra Emphasis markers for Org -*- lexical-binding: t; coding: utf-8-emacs; -*-
-
-;; Copyright (C) 2022 Jambunathan K <kjambunathan at gmail dot com>
-;; Copyright (C) 2004-2022 Free Software Foundation, Inc.
-
-;; Author: Jambunathan K <kjambunathan at gmail dot com>
-;; Keywords: org
-;; Homepage: https://github.com/kjambunathan/org-extra-emphasis
-;; Version: 1.0
-;; Package-Requires: ((ox-odt "9.5.3.467"))
-
-;; This file is NOT part of GNU Emacs.
-
-;; This program 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 3 of the
-;; License, or (at your option) any later version.
-
-;; This program 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.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Overview
-;; ========
-;;
-;; This library provides two additional markers `!!' and `!@' over
-;; and above those in `org-emphasis-alist'.'
-;;
-;; - Text enclosed in `!!' is highlighted in yellow, and exported likewise
-;; - Text enclosed in `!@' is displayed in red, and exported likewise
-;;
-;; Following backends are supported: HTML and ODT. For export of extra
-;; emphasis markers to the ODT side, you need
-;; [[https://github.com/kjambunathan/org-mode-ox-odt][Enhanced ODT]]
-;; exporter with version >= 9.5.3.467 (dtd. June 14, 2022 IST).  This
-;; is the first version of the exporter that defines the user option
-;; `org-odt-extra-styles'.
-;;
-;; Example
-;; =======
-;;
-;; Setup
-;; =====
-;;
-;; Add the following to your `user-init-file' and restart Emacs.
-;;
-;;    (requrie 'org-extra-emphasis)
-;;
-;; Test Run
-;; ========
-;;
-;; 1. Create an `org' file, say `org-export-emphasis.org' and fill it
-;;    with following content or you can download the file from
-;;    https://raw.githubusercontent.com/kjambunathan/org-extra-emphasis/main/org-extra-emphasis.org
-
-	  ;; #+TITLE: Test file for ==org-extra-emphasis== library
-
-	  ;; * Demo of extra emphasis markers ==!!== and ==!@==
-
-	  ;; !!Ea consectetur laboris adipiscing et ipsum labore esse qui minim
-	  ;; pariatur et sunt sunt nostrud anim laborum culpa.!!
-
-	  ;; !@Minim reprehenderit excepteur elit, dolore elit, veniam, eu.
-	  ;; Ullamco dolore elit, cupidatat sed labore ea aute.!@
-
-	  ;; Pariatur !!et lorem cupidatat !@minim irure!@ proident, ad.!!  Eiusmod
-	  ;; sunt et lorem labore ex aliqua aute esse.
-
-	  ;; Ut mollit !@duis velit est est magna in quis ipsum.  !!Aliqua aliqua
-	  ;; non laboris exercitation cupidatat aliqua incididunt.!!  Qui voluptate
-	  ;; irure aute occaecat laborum cillum est.!@  Quis magna dolor ullamco
-	  ;; magna do consectetur est laborum enim ut.
-
-	  ;; * !!Demo of extra emphasis markers in a styled paragraph!!
-
-	  ;; #+ATTR_ODT: :target "extra_styles"
-	  ;; #+begin_src nxml
-	  ;; <style:style style:name="Warn"
-	  ;;	     style:parent-style-name="Text_20_body"
-	  ;;	     style:family="paragraph">
-	  ;;   <style:paragraph-properties>
-	  ;;     <style:tab-stops />
-	  ;;   </style:paragraph-properties>
-	  ;;   <style:text-properties fo:background-color="#ff0000"
-	  ;;		       fo:color="#ffffff"
-	  ;;		       fo:font-size="20pt"
-	  ;;		       fo:font-style="italic"
-	  ;;		       fo:font-weight="bold" />
-	  ;; </style:style>
-	  ;; #+end_src
-
-	  ;; #+ATTR_ODT: :style "Warn"
-	  ;; Proident, duis dolore consectetur sed nisi ea pariatur.  Esse
-	  ;; proident, cillum duis qui ullamco sint cillum magna.  !!Eiusmod
-	  ;; veniam, !@sint officia!@ non consectetur laboris cillum.!!  Cillum
-	  ;; mollit consequat eu dolore ullamco qui reprehenderit anim cillum
-	  ;; in consectetur consequat sunt dolore aliquip voluptate
-	  ;; consectetur anim ea.  Voluptate nisi est incididunt aliquip
-	  ;; excepteur aliqua id do enim ut non consequat.
-;;
-;; 2. Note that portions of text marked with `!!' and `!@' are fontified as described above.
-;;
-;; 3. Export the file to HTML with `C-c C-e h O'.
-;;
-;;    Note that the text enclosed in the above emphasis markers are
-;;    colorized in HTML file.
-;;
-;; 4. Export the file to ODT with `C-c C-e o O'.
-;;
-;;    Note that the text enclosed in the above emphasis markers are
-;;    colorized in ODT file.
-;;
-;; The HTML, ODT, PDF generated in steps (3) and (4) above are
-;; available at https://github.com/kjambunathan/org-extra-emphasis and
-;; the screenshots can be seen in https://github.com/kjambunathan/org-extra-emphasis/tree/main/screenshots
-;;
-
-;; Default Settings
-;; ================
-;;
-;; 16 Emphasis Markers
-;; ===================
-;;
-;; This library defines the following 16 emphasis markers,
-;;
-;; |----+----+----+----|
-;; | !! | !@ | !% | !& |
-;; |----+----+----+----|
-;; | @! | @@ | @% | @& |
-;; |----+----+----+----|
-;; | %! | %@ | %% | %& |
-;; |----+----+----+----|
-;; | &! | &@ | &% | && |
-;; |----+----+----+----|
-;;
-;; The above markers are all pairings of the following four characters:
-;;     ! @ % &
-;;
-;; It is hoped that these set of emphasis markers don't pose issues
-;; while exporting.
-;;
-;; 17 Extra Emphasis Faces
-;; =======================
-;;
-;; This library defines 17 faces:
-;;
-;; - one base face `org-extra-emphasis'
-;; - 16 more faces `org-extra-emphasis-01',`org-extra-emphasis-02',
-;;  ..., `org-extra-emphasis-16'.
-;;
-;; The later 16 faces derive from `org-extra-emphasis' face.  Of
-;; these, only the first two faces `org-extra-emphasis-01' and
-;; `org-extra-emphasis-02' are explicitly configured.  If you are
-;; using more than 2 emphasis markers, you may want to configure the
-;; other 14 faces.
-;;
-;; `org-extra-emphasis-alist' already associated 16 emphasis markers
-;; with 16 different faces.
-;;
-;; Customization
-;; =============
-;;
-;; Configuring your own Emphasis Markers
-;; =====================================
-;;
-;; 16 numbers of emphasis markers should suffice in practice.
-;; However, if none of the above emphasis markers resonate with you,
-;; you can customize `org-extra-emphasis-alist', and plug in your own
-;; markers.  When choosing your own marker, ensure that you exercise
-;; some care.  For example, if you choose `#' as a marker you are
-;; likely to get malformed `html' and `odt' files.
-;;
-;; Configuring Extra Emphasis Faces
-;; ===============================
-;;
-;; You can use `M-x customize-group RET org-extra-emphasis-faces RET'
-;; to configure the extra emphasis faces.
-;;
-;; Disabling the Extra Emphasis
-;; =============================
-;;
-;; You can use `M-x org-extra-emphasis-mode' to toggle this feature.
-;;
-;; Adding additional export backends
-;; =================================
-;;
-;; To add additional backends, modify `org-extra-emphasis-formatter'
-;; and `org-extra-emphasis-build-backend-regexp'.
-
-;;; Code:
-
-(require 'org)
-(require 'ox-odt)
-(require 'rx)
-(require 'htmlfontify)
-
-;;; PART-1: `org-extra-emphasis-mode'
-
-;;;; Internal Variables
-
-(defvar org-extra-emphasis-backends
-  '(html odt ods))
-
-(defvar org-extra-emphasis-info
-  (list :enabled nil))
-
-;; Helper snippets to convert a Emacs Face to Inine CSS and ODT Text Properties
-;;
-;; (defun org-extra-emphasis-emacs-face->inline-css (face)
-;;   (let ((s (cdr (hfy-face-to-css-default face))))
-;;     (when (string-match (rx-to-string '(and "{" (group (zero-or-more any)) "}")) s)
-;;       (format "<span style=\"%s\">%%s</span>" (match-string 1 s)))))
-;;
-;; (org-extra-emphasis-emacs-face->inline-css 'hi-yellow)
-;; (org-extra-emphasis-emacs-face->inline-css 'hi-red-b)
-;;
-;; (defun org-extra-emphasis-emacs-face->odt-text-properties (face)
-;;   (org-odt--lisp-to-xml
-;;    (assoc 'style:text-properties
-;;	  (org-odt--xml-to-lisp
-;;	   (cdr (org-odt-hfy-face-to-css face))))))
-;;
-;; (org-extra-emphasis-emacs-face->odt-text-properties 'hi-yellow)
-;; (org-extra-emphasis-emacs-face->odt-text-properties 'hi-red-b)
-
-(defun org-extra-emphasis-update (&rest _ignored)
-  "Workhorse function that responds to configuration changes.
-
-Current state is maintined in `org-extra-emphasis-info', a plist."
-  ;; When `org-extra-emaphasis' is ON, override use
-  ;; `org-extra-emphasis-org-do-emphasis-faces'.
-  ;; Otherwise, use `org-do-emphasis-faces'.
-  (cond
-   ((plist-get org-extra-emphasis-info :enabled)
-    (advice-add 'org-do-emphasis-faces :override
-		'org-extra-emphasis-org-do-emphasis-faces))
-   (t
-    (advice-remove 'org-do-emphasis-faces
-		   'org-extra-emphasis-org-do-emphasis-faces)))
-  ;; `org-extra-emphasis-alist' is effective only if
-  ;; `org-extra-emphasis' is enabled.
-  (plist-put org-extra-emphasis-info :work-alist
-	     (when (plist-get org-extra-emphasis-info :enabled)
-	       (plist-get org-extra-emphasis-info :alist)))
-  ;; Set properties that control fontification.
-  ;; The property names and their values mimics the corresponding
-  ;; variables in `org-set-emph-re'.
-  (plist-put org-extra-emphasis-info :org-emphasis-alist
-	     (when (and (boundp 'org-emphasis-regexp-components)
-			org-emphasis-alist org-emphasis-regexp-components)
-	       (append (plist-get org-extra-emphasis-info :work-alist)
-		       org-emphasis-alist)))
-  (plist-put org-extra-emphasis-info :org-emph-re-template
-	     (when (and (boundp 'org-emphasis-regexp-components)
-			org-emphasis-alist org-emphasis-regexp-components)
-	       (pcase-let*
-		   ((`(,pre ,post ,border ,body ,nl) org-emphasis-regexp-components)
-		    (body (if (<= nl 0) body
-			    (format "%s*?\\(?:\n%s*?\\)\\{0,%d\\}" body body nl))))
-		 (format (concat "\\([%s]\\|^\\)" ;before markers
-				 "\\(\\(%%s\\)\\([^%s]\\|[^%s]%s[^%s]\\)\\3\\)"
-				 "\\([%s]\\|$\\)") ;after markers
-			 pre border border body border post))))
-  (plist-put org-extra-emphasis-info :org-emph-re
-	     (format (plist-get org-extra-emphasis-info :org-emph-re-template)
-		     (rx-to-string
-		      `(or ,@(mapcar #'car
-				     (cl-remove-if (lambda (l)
-						     (eq 'verbatim (nth 2 l)))
-						   (plist-get org-extra-emphasis-info :org-emphasis-alist)))))))
-  (plist-put org-extra-emphasis-info :org-verbatim-re
-	     (format (plist-get org-extra-emphasis-info :org-emph-re-template)
-		     (rx-to-string
-		      `(or ,@(mapcar #'car
-				     (cl-remove-if-not (lambda (l)
-							 (eq 'verbatim (nth 2 l)))
-						       (plist-get org-extra-emphasis-info :org-emphasis-alist)))))
-		     (rx-to-string
-		      `(or ,@(mapcar #'car
-				     (cl-remove-if-not (lambda (l)
-							 (eq 'verbatim (nth 2 l)))
-						       (plist-get org-extra-emphasis-info :org-emphasis-alist)))))))
-  ;; Set properties that control Export backends
-  ;; - Regexp to search for in the final exported document
-  (plist-put org-extra-emphasis-info :export-alist
-	     (org-extra-emphasis-build-backend-regexp))
-
-  ;; - Generate ODT character styles for the extra emphasis faces and
-  ;;   dump those in `org-odt-extra-styles' and `org-ods-automatic-styles'.
-  (plist-put org-extra-emphasis-info :odt-extra-styles
-	     (let* ((odt-styles
-		     (concat (mapconcat #'identity
-					(cl-loop for (_marker face) in (plist-get org-extra-emphasis-info :alist)
-						 collect (cdr (org-odt-hfy-face-to-css face)))
-					"\n\n"))))
-	       (with-no-warnings
-		 (unless (boundp 'org-odt-extra-styles)
-		   (message "`org-odt-extra-styles' not found.  Upgrade to `ox-odt-9.5.3.467' or later.")
-		   ;; (sleep-for 2)
-		   (setq org-odt-extra-styles nil))
-		 (setq org-odt-extra-styles
-		       (concat (or (when (boundp 'org-odt-extra-styles)
-				     (get 'org-odt-extra-styles 'saved-value))
-				   "")
-			       "\n\n"
-			       odt-styles))
-		 (setq org-ods-automatic-styles
-		       (concat (or (when (boundp 'org-ods-automatic-styles)
-				     (get 'org-ods-automatic-styles 'saved-value))
-				   "")
-			       "\n\n"
-			       odt-styles))
-		 (message "`org-odt-extra-styles' and `org-ods-automatic-styles' is updated for this session")
-		 ;; (sleep-for 1)
-		 )
-	       odt-styles))
-  ;; Re-fontify all Org buffers based on current configuration.
-  (dolist (buffer (buffer-list))
-    (with-current-buffer buffer
-      (when (derived-mode-p 'org-mode)
-	(font-lock-flush)))))
-
-;;;; Fontify Extra Emphasis Markers
-
-(defun org-extra-emphasis-org-do-emphasis-faces (limit)
-  "Workhorse function that does fontification This function is
-based on `org-do-emphasis-faces'.  The property names and values
-correspond to the variables used in `org-do-emphasis-faces'.  Key
-differences are:
-
-    - `:org-emphasis-alist' includes entries for both standard
-      emphasis markers and extra emphasis markers.
-
-    - The regexes used for search-based fontification allow for
-      the possibility that the emphasis markers _in all
-      likelihood_ are multi-char strings, as opposed to single
-      chars."
-  (let* ((quick-re (format "\\([%s]\\|^\\)\\(%s\\)"
-			   (car org-emphasis-regexp-components)
-			   (rx-to-string
-			    `(or ,@(mapcar #'car (plist-get org-extra-emphasis-info :org-emphasis-alist)))))))
-    (catch :exit
-      (while (re-search-forward quick-re limit t)
-	(let* ((marker (match-string 2))
-	       (verbatim? (member marker '("~" "="))))
-	  (when (save-excursion
-		  (goto-char (match-beginning 0))
-		  (and
-		   ;; Do not match table hlines.
-		   (not (and (equal marker "+")
-			     (org-match-line
-			      "[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[ \t]*$")))
-		   ;; Do not match headline stars.  Do not consider
-		   ;; stars of a headline as closing marker for bold
-		   ;; markup either.
-		   (not (and (equal marker "*")
-			     (save-excursion
-			       (forward-char)
-			       (skip-chars-backward "*")
-			       (looking-at-p org-outline-regexp-bol))))
-		   ;; Match full emphasis markup regexp.
-		   (looking-at (if verbatim? (plist-get org-extra-emphasis-info :org-verbatim-re)
-				 (plist-get org-extra-emphasis-info :org-emph-re)))
-		   ;; Do not span over paragraph boundaries.
-		   (not (string-match-p org-element-paragraph-separate
-					(match-string 2)))
-		   ;; Do not span over cells in table rows.
-		   (not (and (save-match-data (org-match-line "[ \t]*|"))
-			     (string-match-p "|" (match-string 4))))))
-	    (pcase-let ((`(,_ ,face ,_) (assoc marker (plist-get org-extra-emphasis-info :org-emphasis-alist)))
-			(m (if org-hide-emphasis-markers 4 2)))
-	      (font-lock-prepend-text-property
-	       (match-beginning m) (match-end m) 'face face)
-	      (when verbatim?
-		(org-remove-flyspell-overlays-in
-		 (match-beginning 0) (match-end 0))
-		(remove-text-properties (match-beginning 2) (match-end 2)
-					'(display t invisible t intangible t)))
-	      (add-text-properties (match-beginning 2) (match-end 2)
-				   '(font-lock-multiline t org-emphasis t))
-	      (when (and org-hide-emphasis-markers
-			 (not (org-at-comment-p)))
-		(add-text-properties (match-end 4) (match-beginning 5)
-				     '(invisible t))
-		(add-text-properties (match-beginning 3) (match-end 3)
-				     '(invisible t)))
-	      (throw :exit t))))))))
-
-;; There is no `:set' function for `deffaces'.  So, when the extra
-;; faces `org-extra-emphasis-01', `org-extra-emphasis-02' reconfigured,
-;; we don't get a notification.  The following export hook ensures
-;; that `org-extra-emphasis-info' is in sync with user configuration.
-(add-hook 'org-export-before-processing-hook 'org-extra-emphasis-update)
-
-;;;; Export Extra Emphasis Markers
-
-(defun org-extra-emphasis-formatter (marker text backend)
-  "Style TEXT in the same font face as the face MARKER is mapped to.
-Note that TEXT is in BACKEND format.
-
-This currently supports HTML and ODT backends.
-
-See `org-extra-emphasis-alist' for MARKER to face mappings."
-  (let* ((face (car (assoc-default marker (plist-get org-extra-emphasis-info :work-alist))))
-         (encode-attribute-value
-	  (lambda (text)
-	    (dolist (pair '(("&" . "&amp;")
-			    ("<" . "&lt;")
-			    (">" . "&gt;")
-			    ("'" . "&apos;")
-			    ("\"" . "&quot;")))
-	      (setq text (replace-regexp-in-string (car pair) (cdr pair) text t t)))
-	    text)))
-    (cl-case backend
-      ((odt ods)
-       (format "<text:span text:style-name=\"%s\">%s</text:span>"
-	       (car (org-odt-hfy-face-to-css face)) text))
-      (html
-       (format "<span class=\"%s\" style=\"%s\">%s</span>"
-	       face
-	       ;; An alternate implementation of
-	       ;; `hfy-face-to-css-default' which performs correctly
-	       ;; when a face specifies a `:family', and/or inherits
-	       ;; some attributes from other faces.  Note that the
-	       ;; flattening (or non-duplication) of face attributes
-	       ;; here is done by Emacs itself.
-	       (mapconcat (lambda (x)
-			    (when (cdr x)
-			      (format "%s: %s;" (car x)
-                                      (funcall encode-attribute-value (cdr x)))))
-			  (hfy-face-to-style-i
-			   (cl-loop with props = (mapcar #'car face-attribute-name-alist)
-				    for prop in props
-				    for value = (face-attribute face prop nil 'default)
-				    unless (eq prop :inherit)
-				    append (list prop value)))
-			  " ")
-	       text))
-      (_ text))))
-
-(defun org-extra-emphasis-build-backend-regexp ()
-  "Regexp to search for emphasized text in exported file.
-This function transcode an emphasis MARKER which is in plain text
-format, to the BACKEND format.  That is, if you use `<<' as an
-emphasis marker, you need to search for `&lt;&lt;' in the
-exported HTML file.
-
-See `org-extra-emphasis-alist' for more information"
-  (cl-loop for (marker . spec) in (plist-get org-extra-emphasis-info :work-alist) collect
-	   (cons marker
-		 (cl-loop for backend in org-extra-emphasis-backends collect
-			  (cons backend
-				(rx-to-string `(and ,(org-export-data-with-backend marker backend nil)
-						    (group (minimal-match
-							    (zero-or-more (or any "\n"))))
-						    ,(org-export-data-with-backend marker backend nil))))))))
-
-(defun org-extra-emphasis-plain-text-filter (text backend _info)
-  "Transcode TEXT in to BACKEND format.
-Uses `org-extra-emphasis-formatter' to do the transcoding.
-
-Search TEXT for one or more transcoded MARKERs, and mark it up as
-specified in `org-extra-emphasis-alist'."
-  (with-temp-buffer
-    (insert text)
-    (cl-loop for (marker . spec) in (plist-get org-extra-emphasis-info :export-alist)
-	     for regex = (assoc-default backend spec)
-	     do (goto-char (point-min))
-	     (if (not regex) text
-	       (while (re-search-forward regex nil t)
-		 (let* ((contents (match-string 1))
-			(emphasized-contents (save-match-data
-					       (org-extra-emphasis-formatter
-						marker contents backend))))
-		   (replace-match emphasized-contents t t)))))
-    (buffer-substring-no-properties (point-min) (point-max))))
-
-;; Install export filter for transcoding extra emphasis markers.
-(defun org-extra-emphasis-update-filter-functions (&optional export-filter-functions)
-  (let* ((all-filter-functions (thread-last org-export-filters-alist
-					    (seq-map #'cdr)
-					    (seq-sort #'string<))))
-    (dolist (filter-fn '(org-extra-emphasis-plain-text-filter org-extra-emphasis-strip-zws-maybe))
-      (dolist (it all-filter-functions)
-        (set it (delq filter-fn (symbol-value it))))
-      (dolist (it export-filter-functions)
-        (add-to-list it filter-fn)))))
-
-;;;; User Options & Commands
-
-;;;;; Custom Groups
-
-(defgroup org-extra-emphasis nil
-  "Options for highlighting and exporting extra emphasis markers in Org files."
-  :tag "Org Extra Emphasis"
-  :group 'org)
-
-(defgroup org-extra-emphasis-faces nil
-  "Faces for Org Extra Emphasis."
-  :group 'org-extra-emphasis
-  :group 'faces)
-
-;;;; Custom Faces
-
-(defface org-extra-emphasis nil
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-01
-  '((t (:inherit org-extra-emphasis :background "yellow")))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-02
-  '((t (:inherit org-extra-emphasis :foreground "red")))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-03
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-04
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-05
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-06
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-07
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-08
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-09
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-10
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-11
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-12
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-13
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-14
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-15
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-(defface org-extra-emphasis-16
-  '((t (:inherit org-extra-emphasis)))
-  "A face for Org Extra Emphasis."
-  :group 'org-extra-emphasis-faces)
-
-;;;;; Useful Org Setting
-
-(setcar (last org-emphasis-regexp-components) 5)
-
-(defcustom org-extra-emphasis-alist
-  '(("!!" org-extra-emphasis-01)
-    ("!@" org-extra-emphasis-02)
-    ("!%" org-extra-emphasis-03)
-    ("!&" org-extra-emphasis-04)
-    ("@!" org-extra-emphasis-05)
-    ("@@" org-extra-emphasis-06)
-    ("@%" org-extra-emphasis-07)
-    ("@&" org-extra-emphasis-08)
-    ("%!" org-extra-emphasis-09)
-    ("%@" org-extra-emphasis-10)
-    ("%%" org-extra-emphasis-11)
-    ("%&" org-extra-emphasis-12)
-    ("&!" org-extra-emphasis-13)
-    ("&@" org-extra-emphasis-14)
-    ("&%" org-extra-emphasis-15)
-    ("&&" org-extra-emphasis-16))
-  "Alist of emphasis marker and its associated face."
-  :group 'org-extra-emphasis
-  :type '(repeat
-	  (list
-	   (string :tag "Emphasis Marker")
-	   (face :tag "Face")))
-  :set (lambda (var val)
-	 (set var val)
-	 (plist-put org-extra-emphasis-info :alist val)
-	 (org-extra-emphasis-update)))
-
-(defcustom org-extra-emphasis t
-  "When non-nil, enable Org Extra Emphasis."
-  :group 'org-extra-emphasis
-  :type '(boolean "Org Extra Emphasis")
-  :set (lambda (var val)
-	 (set var val)
-	 (plist-put org-extra-emphasis-info :enabled val)
-	 (org-extra-emphasis-update)))
-
-(defcustom org-extra-emphasis-filter-functions
-  '(
-    org-export-filter-headline-functions
-    org-export-filter-paragraph-functions
-    org-export-filter-table-cell-functions
-    )
-  "List of places to which `org-extra-emphasis-plain-text-filter'
-and `org-extra-emphasis-strip-zws-maybe' hooks itself.
-
-The places should be one among the values that occur in
-`org-export-filters-alist'.
-
-By default, the list includes
-    - `org-export-filter-headline-functions'
-    - `org-export-filter-paragraph-functions'
-    - `org-export-filter-table-cell-functions',
-
-This means that text with extra emphasis which appears as plain
-text, or within headlines and table cells will be, fontified."
-  :group 'org-extra-emphasis
-  :type `(set
-          ,@(thread-last org-export-filters-alist
-			 (seq-map #'cdr)
-                         (seq-sort #'string<)
-			 (seq-map (lambda (it)
-			            (list 'const it)))))
-  :set (lambda (var value)
-         (set-default var value)
-         (org-extra-emphasis-update-filter-functions value)))
-
-;;;;; `M-x org-extra-emphasis-mode'
-
-(defun org-extra-emphasis-mode (&optional arg)
-  "Enable / Disable Org Extra Emphasis.
-
-If called interactively, toggle Extra Emphasis.
-
-When called non-interactively, enable Extra Emphasis if ARG is
-positive; disable otherwise."
-  (interactive "p")
-  (cond
-   ;; Called interactively; Toggle
-   ((called-interactively-p 'any)
-    (setq org-extra-emphasis (not org-extra-emphasis)))
-   ;; Called programatically; enable if arg >= 1
-   ((and (numberp arg)
-	 (>= arg 1))
-    (setq org-extra-emphasis t))
-   ;; Otherwise, disable
-   (t
-    (setq org-extra-emphasis nil)))
-  (plist-put org-extra-emphasis-info :enabled org-extra-emphasis)
-  (org-extra-emphasis-update))
-
-;;; PART-2: `org-extra-emphasis-intraword-emphasis-mode'
-
-;;;; User options
-
-(defface org-extra-emphasis-zws-face
-  '((t (:inherit org-extra-emphasis :foreground "red")))
-  "Use this face to highlight the ZERO WIDTH SPACE character."
-  :group 'org-extra-emphasis-faces)
-
-(defcustom org-extra-emphasis-zws-display-char ?\N{SPACING UNDERSCORE}
-  "Use the glyph of this character to display ZERO WIDTH SPACE.
-
-Set this to nil, if you want the ZERO WIDTH SPACE to remain
-inconspicuous in the buffer.  Note that even if ZERO WIDTH SPACE
-is inconspicuos in the buffer, the ZERO WIDTH SPACE will be
-stripped from the export output accoding to the value of
-`org-extra-emphasis-intraword-emphasis-mode'."
-  :type '(choice (const :tag "Disabled" nil)
-		 (character :tag "Display ZERO WIDTH SPACE as "))
-  :group 'org-extra-emphasis)
-
-;;;; Internal Variables
-
-(defvar-local org-extra-emphasis-stashed-display-table nil
-  "Stashed value of `buffer-display-table'.
-
-This is the value of `buffer-display-table' before
-`org-extra-emphasis-intraword-emphasis-mode' is turned on in the
-buffer.
-
-Use this value to restore a buffer's `buffer-display-table' when
-`org-extra-emphasis-intraword-emphasis-mode' is turned off in the
-buffer.")
-
-;;;;  `M-x org-extra-emphasis-intraword-emphasis-mode'
-
-;;;###autoload
-(define-minor-mode org-extra-emphasis-intraword-emphasis-mode
-  "Toggle intra word emphasis in `org-mode' export.
-
-When `org-extra-emphasis-intraword-emphasis-mode' is enabled:
-
-- ZERO WIDTH SPACE characters are stripped from export backends.
-- ZERO WIDTH SPACE characters are displayed using
-  `org-extra-emphasis-zws-display-char' and highlighted with
-  `org-extra-emphasis-zws-face' space.
-
-TIPS for the user:
-
-1. You can insert ZERO WIDTH SPACE using
-
-       `M-x insert-char RET ZERO WIDTH SPACE RET'
-
-   One another way is to store that the ZERO WIDTH SPACE in a
-   register, say SPC, and
-
-       (set-register ?\N{SPACE} \"\N{ZERO WIDTH SPACE}\")
-       
-   and use the \\[insert-register] command on that register to insert
-   the ZERO WIDTH SPACE character.
-
-2. You can examine the presence of ZERO WIDTH SPACE character in the
-   export output by turning on the `glyphless-display-mode'."
-  :lighter " ZWS"
-  :init-value nil
-  :global t
-  :group 'org-extra-emphasis
-  (cond
-   ;; Turn ON `org-extra-emphasis-intraword-emphasis-mode'
-   (org-extra-emphasis-intraword-emphasis-mode
-    (when org-extra-emphasis-zws-display-char
-	    ;; Display ZERO WIDTH CHAR in a conspicuous way.
-	    (setq org-extra-emphasis-stashed-display-table (copy-sequence buffer-display-table))
-	    (unless buffer-display-table
-	      (setq buffer-display-table (make-display-table)))
-	    (aset buffer-display-table
-		  ?\N{ZERO WIDTH SPACE}
-		  (vector (make-glyph-code org-extra-emphasis-zws-display-char
-					   'org-extra-emphasis-zws-face)))))
-   (t
-    ;; Turn OFF `org-extra-emphasis-intraword-emphasis-mode'
-    (when org-extra-emphasis-zws-display-char
-      ;; Restore the buffer's original `buffer-display-table'.
-      (setq buffer-display-table org-extra-emphasis-stashed-display-table)))))
-
-;; Adjust `buffer-display-table' so that ZERO WIDTH SPACE characters
-;; are displayed.
-(add-hook 'org-mode-hook 'org-extra-emphasis-intraword-emphasis-mode t)
-
-;;;; Export hook to strip ZERO WIDTH SPACE
-
-(defun org-extra-emphasis-strip-zws-maybe (text _backend _info)
-  "Strip ZERO WIDTH SPACE from TEXT.
-
-If `org-extra-emphasis-intraword-emphasis-mode' is enabled, strip
-ZERO WIDTH SPACE from TEXT.  Otherwise, return TEXT unmodified."
-  (cond
-   ;; `org-extra-emphasis-intraword-emphasis-mode' is ON
-   (org-extra-emphasis-intraword-emphasis-mode
-    ;; Strip ZERO WIDTH SPACE.
-    (replace-regexp-in-string
-     (rx-to-string `(one-or-more ,(char-to-string ?\N{ZERO WIDTH SPACE})))
-     "" text t t))
-   ;; `org-extra-emphasis-intraword-emphasis-mode' is OFF.
-   (t
-    ;; Nothing to do.
-    text)))
-
-;; Configure Org Export Engine to strip ZERO WIDTH SPACE, if needed.
-;; (dolist (it '(org-export-filter-table-cell-functions
-;; 	      org-export-filter-paragraph-functions))
-;;   (add-to-list it 'org-extra-emphasis-strip-zws-maybe it))
-
-(provide 'org-extra-emphasis)
-
-;;; org-extra-emphasis.el ends here
dots/.config/emacs/old/lisp/org-focus.el
@@ -1,49 +0,0 @@
-;; From http://www.howardism.org/Technical/Emacs/focused-work.html
-;; Write something a bit similar, but better ?
-
-(defvar vde/focus-timer nil "A timer reference for the vde/focus functions")
-
-(defun vde/focus-countdown-timer (minutes fun)
-  (let ((the-future (* minutes 60)))
-    (run-at-time the-future nil fun)))
-
-(defun vde/focus-begin ()
-  "Start a concerted, focused effort, ala Pomodoro Technique.
-We first clock into the current org-mode header (or last one),
-start some music to indicate we are working, and set a timer.
-
-Call `ha-focus-break' when finished."
-  (interactive)
-  (vde/focus-countdown-timer 25 'vde/focus-break)
-  (vde/focus--command "playerctl play-pause")
-  (vde/focus--command "notify-send 'Let's focus.'")
-  (vde/focus--command "swaync-client -d")
-  (if (eq major-mode 'org-mode)
-      (org-clock-in)
-    (org-clock-in-last)))
-
-(defun vde/focus-break ()
-  "Stop the focused time by stopping the music.
-This also starts another break timer, that calls
-`ha-focus-break-over' when finished."
-  (interactive)
-  (vde/focus-countdown-timer 5 'vde/focus-break-over)
-  (vde/focus--command "swaync-client -d")
-  (vde/focus--command "notify-send 'Let's take a break.'")
-  (vde/focus--command "playerctl play-pause")
-  (org-clock-out)
-  (message "Time to take a break."))
-
-(defun vde/focus-break-over ()
-  "Message me to know that the break time is over. Notice that
-this doesn't start anything automatically, as I may have simply
-wandered off."
-  (vde/focus--command "notify-send 'Break is over.'"))
-
-(defun vde/focus--command (command)
-  "Runs COMMAND by passing to the `command' command asynchronously."
-  (async-start-process "focus-os" "zsh" 'vde/focus--command-callback "-c" command))
-
-(defun vde/focus--command-callback (proc)
-  "Asynchronously called when the `osascript' process finishes."
-  (message "Finished calling command."))
dots/.config/emacs/old/lisp/org-func.el
@@ -1,193 +0,0 @@
-;;; org-func.el --- -*- lexical-binding: t -*-
-;;
-
-;; https://endlessparentheses.com/updating-org-mode-include-statements-on-the-fly.html
-;;;###autoload
-(defun save-and-update-includes ()
-  "Update the line numbers of #+INCLUDE:s in current buffer.
-Only looks at INCLUDEs that have either :range-begin or :range-end.
-This function does nothing if not in `org-mode', so you can safely
-add it to `before-save-hook'."
-  (interactive)
-  (when (derived-mode-p 'org-mode)
-    (save-excursion
-      (goto-char (point-min))
-      (while (search-forward-regexp
-              "^\\s-*#\\+INCLUDE: *\"\\([^\"]+\\)\".*:range-\\(begin\\|end\\)"
-              nil 'noerror)
-        (let* ((file (expand-file-name (match-string-no-properties 1)))
-               lines begin end)
-          (forward-line 0)
-          (when (looking-at "^.*:range-begin *\"\\([^\"]+\\)\"")
-            (setq begin (match-string-no-properties 1)))
-          (when (looking-at "^.*:range-end *\"\\([^\"]+\\)\"")
-            (setq end (match-string-no-properties 1)))
-          (setq lines (decide-line-range file begin end))
-          (when lines
-            (if (looking-at ".*:lines *\"\\([-0-9]+\\)\"")
-                (replace-match lines :fixedcase :literal nil 1)
-              (goto-char (line-end-position))
-              (insert " :lines \"" lines "\""))))))))
-
-(defun decide-line-range (file begin end)
-  "Visit FILE and decide which lines to include.
-BEGIN and END are regexps which define the line range to use."
-  (let (l r)
-    (save-match-data
-      (with-temp-buffer
-        (insert-file-contents file)
-        (goto-char (point-min))
-        (if (null begin)
-            (setq l "")
-          (search-forward-regexp begin)
-          (setq l (line-number-at-pos (match-beginning 0))))
-        (if (null end)
-            (setq r "")
-          (search-forward-regexp end)
-          (setq r (1+ (line-number-at-pos (match-end 0)))))
-        (format "%s-%s" (+ l 1) (- r 1)))))) ;; Exclude wrapper
-
-(defun vde/get-outline-path (element)
-  "Return the outline path (as a list of titles) for ELEMENT, which is a headline."
-  (let (path)
-    (while (and element (eq (org-element-type element) 'headline))
-      (let ((title (org-element-property :title element)))
-        (when title
-          (push title path)))
-      (setq element (org-element-property :parent element)))
-    (reverse path)))
-
-;;;###autoload
-(defun vde/org-clock-in-any-heading ()
-  "Clock into any Org heading from `org-agenda-files' that is not DONE or CANCELED."
-  (interactive)
-  (let (headings)
-    (dolist (file org-agenda-files)
-      (when (file-exists-p file)
-        (with-current-buffer (find-file-noselect file)
-          (org-map-entries (lambda ()
-                              (let* ((element (org-element-context))
-                                     (todo (org-element-property :todo-keyword element)))
-                                (when (not (member todo '("DONE" "CANCELED")))
-                                  (let* ((path (vde/get-outline-path element)))
-                                    (push (list :path path
-                                                :file (buffer-file-name)
-                                                :position (point))
-                                          headings)))))
-                           t 'file))))
-    (let* (candidates)
-      (dolist (h headings)
-        (let* ((path (plist-get h :path))
-               (path-str (mapconcat 'identity path " > "))
-               (file (plist-get h :file))
-               (candidate (format "%s : %s" path-str (file-name-nondirectory file)))
-               (data (list file (plist-get h :position))))
-          (push (cons candidate data) candidates)))
-      (let* ((selected-candidate (completing-read "Select heading: " candidates))
-             (matching (cl-find-if (lambda (c) (string= (car c) selected-candidate)) candidates)))
-        (when matching
-          (let* ((data (cdr matching))
-                 (file (car data))
-                 (pos (cadr data)))
-            (find-file file)
-            (goto-char pos)
-            (org-clock-in)))))))
-
-;;;###autoload
-(defun vde/org-next-visible-heading-or-link (&optional arg)
-  "Move to the next visible heading or link, whichever comes first.
-With prefix ARG and the point on a heading(link): jump over subsequent
-headings(links) to the next link(heading), respectively.  This is useful
-to skip over a long series of consecutive headings(links)."
-  (interactive "P")
-  (let ((next-heading (save-excursion
-                        (org-next-visible-heading 1)
-                        (when (org-at-heading-p) (point))))
-        (next-link (save-excursion
-                     (when (vde/org-next-visible-link) (point)))))
-    (when arg
-      (if (and (org-at-heading-p) next-link)
-          (setq next-heading nil)
-        (if (and (looking-at org-link-any-re) next-heading)
-            (setq next-link nil))))
-    (cond
-     ((and next-heading next-link) (goto-char (min next-heading next-link)))
-     (next-heading (goto-char next-heading))
-     (next-link (goto-char next-link)))))
-
-;;;###autoload
-(defun vde/org-previous-visible-heading-or-link (&optional arg)
-  "Move to the previous visible heading or link, whichever comes first.
-With prefix ARG and the point on a heading(link): jump over subsequent
-headings(links) to the previous link(heading), respectively.  This is useful
-to skip over a long series of consecutive headings(links)."
-  (interactive "P")
-  (let ((prev-heading (save-excursion
-                        (org-previous-visible-heading 1)
-                        (when (org-at-heading-p) (point))))
-        (prev-link (save-excursion
-                     (when (vde/org-next-visible-link t) (point)))))
-    (when arg
-      (if (and (org-at-heading-p) prev-link)
-          (setq prev-heading nil)
-        (if (and (looking-at org-link-any-re) prev-heading)
-            (setq prev-link nil))))
-    (cond
-     ((and prev-heading prev-link) (goto-char (max prev-heading prev-link)))
-     (prev-heading (goto-char prev-heading))
-     (prev-link (goto-char prev-link)))))
-
-;; Adapted from org-next-link to only consider visible links
-;;;###autoload
-(defun vde/org-next-visible-link (&optional search-backward)
-  "Move forward to the next visible link.
-When SEARCH-BACKWARD is non-nil, move backward."
-  (interactive)
-  (let ((pos (point))
-        (search-fun (if search-backward #'re-search-backward
-                      #'re-search-forward)))
-    ;; Tweak initial position: make sure we do not match current link.
-    (cond
-     ((and (not search-backward) (looking-at org-link-any-re))
-      (goto-char (match-end 0)))
-     (search-backward
-      (pcase (org-in-regexp org-link-any-re nil t)
-        (`(,beg . ,_) (goto-char beg)))))
-    (catch :found
-      (while (funcall search-fun org-link-any-re nil t)
-        (let ((folded (org-invisible-p nil t)))
-          (when (or (not folded) (eq folded 'org-link))
-            (let ((context (save-excursion
-                             (unless search-backward (forward-char -1))
-                             (org-element-context))))
-              (pcase (org-element-lineage context '(link) t)
-                (link
-                 (goto-char (org-element-property :begin link))
-                 (throw :found t)))))))
-      (goto-char pos)
-      ;; No further link found
-      nil)))
-
-;;;###autoload
-(defun vde/org-shifttab (&optional arg)
-  "Move to the previous visible heading or link.
-If already at a heading, move first to its beginning.  When inside a table,
-move to the previous field."
-  (interactive "P")
-  (cond
-   ((org-at-table-p) (call-interactively #'org-table-previous-field))
-   ((and (not (bolp)) (org-at-heading-p)) (beginning-of-line))
-   (t (call-interactively #'vde/org-previous-visible-heading-or-link))))
-
-;;;###autoload
-(defun vde/org-tab (&optional arg)
-  "Move to the next visible heading or link.
-When inside a table, re-align the table and move to the next field."
-  (interactive)
-  (cond
-   ((org-at-table-p) (org-table-justify-field-maybe)
-    (call-interactively #'org-table-next-field))
-   (t (call-interactively #'vde/org-next-visible-heading-or-link))))
-
-(provide 'org-func)
-;;; org-func.el ends here
dots/.config/emacs/old/lisp/org-menu.el
@@ -1,989 +0,0 @@
-;;; org-menu.el --- A discoverable menu for org-mode using transient -*- lexical-binding: t -*-
-;;
-;; Copyright 2021  Jan Rehders
-;;
-;; Author: Jan Rehders <nospam@sheijk.net>
-;; Version: 0.1alpha
-;; Package-Requires: ((emacs "26.1") (transient "0.1"))
-;; URL: https://github.com/sheijk/org-menu
-;;
-;; 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:
-;;
-;; Usage:
-;;
-;; Add this to your ~/.emacs to bind the menu to `C-c m':
-;;
-;; (with-eval-after-load 'org
-;;   (require 'org-menu) ;; not needed if installing by package manager
-;;   (define-key org-mode-map (kbd "C-c m") #'org-menu))
-;;
-;; The menu should be pretty self-explanatory.  It is context dependent and
-;; offers different commands for headlines, tables, timestamps, etc.
-;; The task menu provides entry points for task that work from anywhere.
-
-;;; Code:
-
-(require 'org)
-(require 'transient)
-(require 'org-capture)
-(require 'org-timer)
-(require 'cl-lib)
-
-(defgroup org-menu nil
-  "Options for `org-menu'."
-  :group 'org)
-
-(defcustom org-menu-use-q-for-quit t
-  "Whether to add a q binding to quit to all menus.
-
-Use this if you prefer to be consistent with magit.  It will also
-change some other bindings to use Q instead of q."
-  :type 'boolean)
-
-(defcustom org-menu-global-toc-depth 10
-  "The number of heading levels to show when displaying the global content."
-  :type 'natnum)
-
-(defcustom org-menu-expand-snippet-function #'org-menu-expand-snippet-default
-  "The function used to expand a snippet.
-
-See `org-menu-expand-snippet-default' for a list of snippet ids
-which need to be supported.  `org-menu-expand-snippet-yasnippet'
-shows how to invoke snippets."
-  :type 'function)
-
-(defun org-menu-show-columns-view-options-p ()
-  "Return whether `org-columns' mode is active."
-  (bound-and-true-p org-columns-overlays))
-
-(defun org-menu-show-heading-options-p ()
-  "Whether to show commands operating on headings."
-  (unless (org-menu-show-columns-view-options-p)
-    (org-at-heading-p)))
-
-(defun org-menu-show-table-options-p ()
-  "Whether to show commands operating on tables."
-  (unless (org-menu-show-columns-view-options-p)
-    (org-at-table-p)))
-
-(defun org-menu-show-list-options-p ()
-  "Whether to show commands operating on lists."
-  (unless (org-menu-show-columns-view-options-p)
-    (org-at-item-p)))
-
-(defun org-menu-show-text-options-p ()
-  "Whether to show commands operating on text."
-  (not (or (org-menu-show-columns-view-options-p)
-           (org-at-heading-p)
-           (org-at-table-p)
-           (org-in-item-p)
-           (org-in-src-block-p))))
-
-(defun org-menu-show-src-options-p ()
-  "Whether to show commands operating on src blocks."
-  (unless (org-menu-show-columns-view-options-p)
-    (org-in-src-block-p)))
-
-(defun org-menu-show-link-options-p ()
-  "Whether to show commands operating on links.
-
-Conditions have been adapted from `org-insert-link'"
-  (unless (org-menu-show-columns-view-options-p)
-    (or
-     ;; Use variable from org-compat to support Emacs 26
-     (org-in-regexp (symbol-value 'org-bracket-link-regexp) 1)
-     (when (boundp 'org-link-angle-re)
-       (org-in-regexp org-link-angle-re))
-     (when (boundp 'org-link-plain-re)
-       (org-in-regexp org-link-plain-re)))))
-
-(defun org-menu-show-timestamp-options-p ()
-  "Whether to show commands operating on timestamps."
-  (unless (org-menu-show-columns-view-options-p)
-    (org-at-timestamp-p 'lax)))
-
-(defun org-menu-show-footnote-options-p ()
-  "Whether to show commands operating on footnotes."
-  (unless (org-menu-show-columns-view-options-p)
-    (or (org-footnote-at-definition-p)
-        (org-footnote-at-reference-p))))
-
-(defun org-menu-heading-navigate-items (check-for-heading &optional cycle-function)
-  "Items to navigate headings.
-
-These will be added to most sub menus.  If `CHECK-FOR-HEADING' is
-true the items will only be added if on a heading.  `CYCLE-FUNCTION' is the
-function to be used to cycle visibility of current element."
-  (setq cycle-function (or cycle-function #'org-cycle))
-  `(["Navigate"
-     :pad-keys t
-     ,@(and check-for-heading '(:if org-menu-show-heading-options-p))
-     ("p" "prev" org-previous-visible-heading :transient t)
-     ("n" "next" org-next-visible-heading :transient t)
-     ("c" "cycle" ,cycle-function :transient t)
-     ("u" "parent" outline-up-heading :transient t)
-     ("M-p" "prev (same level)" org-backward-heading-same-level :transient t)
-     ("M-n" "next (same level)" org-forward-heading-same-level :transient t)
-     ("M-w" "store link" org-store-link :transient t :if-not region-active-p)
-     ("C-_" "undo" undo :transient t)]))
-
-(defun org-menu-expand-snippet-default (snippet-id)
-  "Insert a fixed text for each `SNIPPET-ID'."
-  (pcase snippet-id
-    ('block (insert "#+BEGIN:\n#+END:\n"))
-    ('option (insert "#+"))
-    ('subscript (insert "a_b"))
-    ('superscript (insert "a^b"))
-    ('plot
-     (insert
-      "#+plot: type:2d file:\"plot.svg\"
-| A |  B |
-|---+----|
-| 1 | 10 |
-| 2 |  8 |
-| 3 |  9 |
-
-#+attr_org: :width 400px
-[[file:plot.svg]]
-"))
-    (_ (error "Unknown snippet type %s" snippet-id))))
-
-(autoload 'yas-expand-snippet "yasnippet")
-(autoload 'yas-expand-from-trigger-key "yasnippet")
-
-(defun org-menu-expand-snippet-yasnippet (snippet-id)
-  "Expand a yasnippet for each `SNIPPET-ID'."
-  (unless (require 'yasnippet nil 'noerror)
-    (error "Yasnippet not installed, could not expand %s" snippet-id))
-  (pcase snippet-id
-    ('block
-     (insert "beg")
-     (yas-expand-from-trigger-key))
-    ('option
-     (insert "opt")
-     (yas-expand-from-trigger-key))
-    ('subscript
-     (yas-expand-snippet "${1:text}_{${2:sub}}"))
-    ('superscript
-     (yas-expand-snippet "${1:text}^{${2:super}}"))
-    ('plot
-     (yas-expand-snippet
-      "#+plot: type:${1:2d} file:\"${2:plot.svg}\"
-| A |  B |
-|---+----|
-| 1 | 10 |
-| 2 |  8 |
-| 3 |  9 |
-
-#+attr_org: :width ${3:400px}
-[[file:$2]]
-"))
-    (_
-     (error "Unknown snippet type %s" snippet-id))))
-
-;; If yasnippet gets loaded it will be used automatically
-(with-eval-after-load 'yasnippet
-  (unless (equal org-menu-expand-snippet-function #'org-menu-expand-snippet-default)
-    (setq org-menu-expand-snippet-function #'org-menu-expand-snippet-yasnippet)))
-
-(defun org-menu-expand-snippet (snippet-id)
-  "Will expand the given snippet named `SNIPPET-ID' with `ARGS'."
-  (funcall org-menu-expand-snippet-function snippet-id))
-
-(defun org-menu-show-headline-content ()
-  "Will show the complete content of the current headline and it's children."
-  (interactive)
-  (save-excursion
-    (outline-hide-subtree)
-    (with-no-warnings
-      (org-show-children 4))
-    (org-goto-first-child)
-    (org-reveal '(4))))
-
-;;;###autoload (autoload 'org-menu-visibility "org-menu" nil t)
-(transient-define-prefix org-menu-visibility ()
-  "A menu to control visibility of `org-mode' items."
-  ["Visibility"
-   ["Heading"
-    ("a" "all" org-show-subtree :if-not org-at-block-p :transient t)
-    ("a" "all" org-hide-block-toggle :if org-at-block-p :transient t)
-    ("c" "cycle" org-cycle :transient t)
-    ("t" "content" org-menu-show-headline-content :if-not org-at-block-p :transient t)
-    ("h" "hide" outline-hide-subtree :if-not org-at-block-p :transient t)
-    ("h" "hide" org-hide-block-toggle :if org-at-block-p :transient t)
-    ("r" "reveal" (lambda () (interactive) (org-reveal t)) :if-not org-at-block-p :transient t)]
-   ["Global"
-    :pad-keys t
-    ("C" "cycle global" org-global-cycle :transient t)
-    ("go" "overview" org-overview)
-    ("gt" "content" (lambda () (interactive) (org-content org-menu-global-toc-depth)))
-    ("ga" "all" org-show-all)
-    ("gd" "default" (lambda () (interactive) (org-set-startup-visibility)))]
-   ["Narrow"
-    :pad-keys t
-    ("nn" "toggle" org-toggle-narrow-to-subtree)
-    ("nb" "to block" org-narrow-to-block :if org-at-block-p)
-    ("ns" "to sub tree" org-narrow-to-subtree)
-    ("ne" "to element" org-narrow-to-element)
-    ("w" "widen" widen)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(transient-define-prefix org-menu-visibility-columns ()
-  "A menu to control visibility of `org-mode' items in `org-columns' mode."
-  ["Visibility"
-   ["Columns view"
-    :if org-menu-show-columns-view-options-p
-    ("t" "content" org-columns-content :transient t)
-    ("o" "overview" org-overview :transient t)
-    ("g" "refresh" org-columns-redo :transient t)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-eval-src-items ()
-  "Return the items to evaluate a source block."
-  (list
-   ["Source"
-    :if org-menu-show-src-options-p
-    ("e" "run block" org-babel-execute-src-block)
-    ("c" "check headers" org-babel-check-src-block)
-    ("k" "clear results" org-babel-remove-result-one-or-many)
-    ("'" "edit" org-edit-special)]))
-
-;;;###autoload (autoload 'org-menu-eval "org-menu" nil t)
-(transient-define-prefix org-menu-eval ()
-  "A menu to evaluate buffers, tables, etc. in `org-mode'."
-  ["dummy"])
-
-(defun org-menu-run-gnuplot ()
-  "Will call `org-plot/gnuplot' and update inline images."
-  (interactive)
-  (org-plot/gnuplot)
-  (when org-inline-image-overlays
-    (org-redisplay-inline-images)))
-
-(transient-insert-suffix 'org-menu-eval (list 0)
-  `["Evaluation"
-    ["Table"
-     :if org-at-table-p
-     ("e" "table" (lambda () (interactive) (org-table-recalculate 'iterate)))
-     ("1" "one iteration" (lambda () (interactive) (org-table-recalculate t)))
-     ("l" "line" (lambda () (interactive) (org-table-recalculate nil)))
-     ("f" "format" org-table-align :if org-at-table-p)]
-    ,@(org-menu-eval-src-items)
-    ["Heading"
-     :if-not org-in-src-block-p
-     ("c" "update checkbox count" org-update-checkbox-count)]
-    ["Plot"
-     ("p" "gnuplot" org-menu-run-gnuplot)]
-    ["Export"
-     ("t" "tangle source files" org-babel-tangle)
-     ("x" "export" org-export-dispatch)]
-    ["Quit"
-     :if-non-nil org-menu-use-q-for-quit
-     ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-insert-block (str)
-  "Insert an org mode block of type `STR'."
-  (interactive)
-  (insert (format "#+begin_%s\n#+end_%s\n" str str)))
-
-(defun org-menu-insert-horizontal-rule ()
-  "Insert a horizontal rule."
-  (interactive)
-  (insert "-----"))
-
-;;;###autoload (autoload 'org-menu-insert-blocks "org-menu" nil t)
-(transient-define-prefix org-menu-insert-blocks ()
-  "A menu to insert new blocks in `org-mode'."
-  [["Insert block"
-    ("s" "source" (lambda () (interactive) (org-menu-insert-block "src")))
-    ("e" "example" (lambda () (interactive) (org-menu-insert-block "example")))
-    ("v" "verbatim" (lambda () (interactive) (org-menu-insert-block "verbatim")))
-    ("a" "ascii" (lambda () (interactive) (org-menu-insert-block "ascii")))
-    ("q" "quote" (lambda () (interactive) (org-menu-insert-block "quote")) :if-nil org-menu-use-q-for-quit)
-    ("Q" "quote" (lambda () (interactive) (org-menu-insert-block "quote")) :if-non-nil org-menu-use-q-for-quit)
-    ("d" "dynamic block" org-dynamic-block-insert-dblock)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-;;;###autoload (autoload 'org-menu-insert-heading "org-menu" nil t)
-(transient-define-prefix org-menu-insert-heading ()
-  "A menu to insert new headings in `org-mode'."
-  [["Heading"
-    ("h" "heading" org-insert-heading)
-    ("H" "heading (after)" org-insert-heading-after-current)
-    ("T" "todo" org-insert-todo-heading)]
-   ["Items"
-    ("d" "drawer" org-insert-drawer)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-;;;###autoload (autoload 'org-menu-insert-template "org-menu" nil t)
-(transient-define-prefix org-menu-insert-template ()
-  "A menu to insert new templates in `org-mode'."
-  [["Templates"
-    ("S" "structure template" org-insert-structure-template)
-    ("B" "blocks" (lambda () (interactive) (org-menu-expand-snippet 'block)))
-    ("O" "options" (lambda () (interactive) (org-menu-expand-snippet 'option)))]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-;;;###autoload (autoload 'org-menu-insert-timestamp "org-menu" nil t)
-(transient-define-prefix org-menu-insert-timestamp ()
-  "A menu to insert timestamps in Org Mode."
-  [["Active"
-    ("." "Time stamp" org-time-stamp)
-    ("t" "Today" (lambda () (interactive) (org-insert-time-stamp (current-time) nil nil)))
-    ("n" "Today + time" (lambda () (interactive) (org-insert-time-stamp (current-time) t nil)))]
-   ["Inactive"
-    ("!" "Time stamp (i)" org-time-stamp-inactive)
-    ("T" "Today (i)" (lambda () (interactive) (org-insert-time-stamp (current-time) nil t)))
-    ("N" "Today + time (i)" (lambda () (interactive) (org-insert-time-stamp (current-time) t t)))]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-table-insert-row-below ()
-  "Insert a new table column below point."
-  (interactive)
-  (org-table-insert-row '4))
-
-(defun org-menu-table-insert-column-left ()
-  "Insert a new column to the left of point."
-  (interactive)
-  (org-table-insert-column)
-  (org-table-move-column-right))
-
-;;;###autoload (autoload 'org-menu-insert-table "org-menu" nil t)
-(transient-define-prefix org-menu-insert-table ()
-  "A menu to insert table items in `org-mode'."
-  [["Table"
-    ("t" "table" org-table-create-or-convert-from-region :if-not org-at-table-p)
-    ("i" "import" org-table-import :if-not org-at-table-p)]
-   ["Rows/columns"
-    :if org-at-table-p
-    ("r" "row above" org-table-insert-row :transient t)
-    ("R" "row below" org-menu-table-insert-row-below :transient t)
-    ("c" "column left" org-table-insert-column :transient t)
-    ("C" "column right" org-menu-table-insert-column-left :transient t)
-    ("-" "horiz. line" org-table-insert-hline :transient t)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-insert-superscript ()
-  "Insert a text with superscript."
-  (interactive)
-  (org-menu-expand-snippet 'superscript))
-
-(defun org-menu-insert-subscript ()
-  "Insert a text with subscript."
-  (interactive)
-  (org-menu-expand-snippet 'subscript))
-
-(defun org-menu-parse-formatting (format-char)
-  "Will return the bounds of the format markup `FORMAT-CHAR'."
-  (let ((original-point (point))
-        start end)
-    (ignore-errors
-      (save-excursion
-        (save-restriction
-          (save-match-data
-            (org-narrow-to-element)
-            (goto-char (search-backward (format "%c" format-char)))
-            (setq start (point))
-            (goto-char original-point)
-            (goto-char (search-forward (format "%c" format-char)))
-            (setq end (point))
-            (cons start end)))))))
-
-(defun org-menu-toggle-format (format-char)
-  "Will either remove `FORMAT-CHAR' or add it around region/point."
-  (let ((range (org-menu-parse-formatting format-char))
-        (format-string (format "%c" format-char)))
-    (if (null range)
-        (org-menu-insert-text format-string format-string t)
-      (goto-char (cdr range))
-      (delete-char -1)
-      (goto-char (car range))
-      (delete-char 1))))
-
-;;;###autoload (autoload 'org-menu-insert-list "org-menu" nil t)
-(transient-define-prefix org-menu-insert-list ()
-  "A menu to insert lists."
-  [["List"
-    ("-" "item" (lambda () (interactive) (insert "- ")))
-    ("+" "+" (lambda () (interactive) (insert "+ ")))
-    ("*" "*" (lambda () (interactive) (insert "* ")))
-    ("." "1." (lambda () (interactive) (insert "1. ")))
-    (")" "1)" (lambda () (interactive) (insert "1) ")))]
-   ["Todo"
-    ("t" "todo" (lambda () (interactive) (insert "- [ ] ")))
-    ("d" "done" (lambda () (interactive) (insert "- [X] ")))
-    ("p" "partial" (lambda () (interactive) (insert "- [-] ")))]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-insert-plot ()
-  "Insert a small example plot for `gnu-plot'."
-  (interactive)
-  (beginning-of-line 1)
-  (org-menu-expand-snippet 'plot))
-
-(defun org-menu-insert-option-line-smart (line)
-  "Insert `LINE'.  If inside a block move to right before it."
-  (beginning-of-line 1)
-  (insert line "\n"))
-
-(defun org-menu-insert-name (name)
-  "Insert a #+NAME for the next element."
-  (interactive "MName? ")
-  (org-menu-insert-option-line-smart (format "#+NAME: %s" name)))
-
-(defun org-menu-insert-caption (caption)
-  "Insert a #+CAPTION for the next element."
-  (interactive "MCaption? ")
-  (org-menu-insert-option-line-smart (format "#+CAPTION: %s" caption)))
-
-(defun org-menu-insert-startup-setting (setting)
-  "Insert a buffer `SETTING'."
-  (interactive (list (completing-read "Startup setting? "
-                                (mapcar 'car org-startup-options))))
-  (org-menu-insert-option-line-smart (format "#+STARTUP: %s" setting)))
-
-(defun org-menu-insert-buffer-setting (setting)
-  "Insert a buffer `SETTING'."
-  (interactive (list (completing-read "Buffer setting? " org-options-keywords)))
-  (insert (format "#+%s " setting)))
-
-(defun org-menu-insert-footnote-definition (name definition)
-  "Insert a definition for a footnote.
-
-Named `NAME' using `DEFINITION'."
-  (interactive "MName? \nMDefinition? ")
-  (org-menu-insert-option-line-smart (format "[fn:%s] %s" name definition)))
-
-(defun org-menu-insert-footnote-inline (name definition)
-  "Insert a definition for an inline footnote.
-
-Named `NAME' with `DEFINITION'."
-  (interactive "MName? \nMDefinition? ")
-  (insert (format "[fn:%s: %s]" name definition)))
-
-;;;###autoload (autoload 'org-menu-insert "org-menu" nil t)
-(transient-define-prefix org-menu-insert ()
-  "A menu to insert new items in `org-mode'."
-  ["Insert"
-   ["Element"
-    ("." "time" org-menu-insert-timestamp)
-    ("l" "link (new)" org-insert-link)
-    ("L" "link (stored)" org-insert-last-stored-link :transient t)
-    ("T" "templates" org-menu-insert-template)]
-   ["Structure"
-    ("h" "heading" org-menu-insert-heading)
-    ("-" "list" org-menu-insert-list)
-    ("H" "hor. rule" org-menu-insert-horizontal-rule)]
-   ["Block/table"
-    ("b" "block" org-menu-insert-blocks)
-    ("t" "table" org-menu-insert-table)
-    ("p" "plot" org-menu-insert-plot)]
-   ["Format"
-    ("^" "superscript" org-menu-insert-superscript)
-    ("_" "subscript" org-menu-insert-subscript)]
-   ["Footnotes"
-    ("fd" "define" org-menu-insert-footnote-definition)
-    ("fi" "inline" org-menu-insert-footnote-inline)]
-   ["Options"
-    ("n" "name" org-menu-insert-name)
-    ("c" "caption" org-menu-insert-caption)
-    ("s" "startup option" org-menu-insert-startup-setting)
-    ("o" "buffer option" org-menu-insert-buffer-setting)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-comment-line ()
-  "Toggle line comment w/o moving cursor."
-  (interactive)
-  (save-excursion (comment-line 1)))
-
-(defun org-menu-fix-timestamp ()
-  "Fix the timestamp at `(point)'."
-  (interactive)
-  (org-timestamp-change 0 'day))
-
-(defun org-menu-insert-text (left right &optional surround-whitespace)
-  "Will insert left|right and put the curser at |.
-
-If region is active it will be surrounded by `LEFT' and `RIGHT' and
-the point will be at end of region.  Will add spaces before/after text if
-`SURROUND-WHITESPACE' is true and it's needed."
-  (let ((start (point))
-        (end (point)))
-    (when (region-active-p)
-      (setq start (region-beginning)
-            end (region-end))
-      (deactivate-mark))
-    (when (> start end)
-      (cl-psetq start end
-                end start))
-
-    (goto-char start)
-    (when (and surround-whitespace
-               (not (bolp))
-               (not (looking-back " +" nil)))
-      (insert " "))
-    (insert left)
-
-    (forward-char (- end start))
-
-    (save-excursion
-      (insert right)
-      (when (and surround-whitespace
-                 (not (eolp))
-                 (not (looking-at " +")))
-        (insert " ")))))
-
-;;;###autoload (autoload 'org-menu-goto "org-menu" nil t)
-(transient-define-prefix org-menu-goto ()
-  "Menu to go to different places by name."
-  [["Go to"
-    ("h" "heading" imenu)
-    ("s" "source block" org-babel-goto-named-src-block)
-    ("r" "result block" org-babel-goto-named-result)
-    ("." "calendar" org-goto-calendar :if org-menu-show-timestamp-options-p)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-toggle-zwspace ()
-  "Will remove zero-width space before/after point or insert it if none found."
-  (interactive)
-  (let ((zww (string ?\N{ZERO WIDTH SPACE})))
-    (save-excursion
-      (skip-chars-backward zww)
-      (if (looking-at (rx (+ (literal zww))))
-      (replace-match "")
-    (insert zww)))))
-
-(defun org-menu-text-format-items (check-for-table)
-  "Items to format text.
-
-Will add an ':if org-menu-show-text-options-p' criteria if
-`CHECK-FOR-TABLE' is true."
-  (list
-   `["Navigate"
-     ,@(when check-for-table '(:if org-menu-show-text-options-p))
-     :pad-keys t
-     ("p" "up" previous-line :transient t)
-     ("n" "down" next-line :transient t)
-     ("b" "left" backward-word :transient t)
-     ("f" "right" forward-word :transient t)
-     ("u" "parent" org-up-element :transient t)
-     ("M-w" "store link" org-store-link :transient t :if-not region-active-p)
-     ("C-_" "undo" undo :transient t)
-     ("SPC" "mark" set-mark-command :transient t)
-     ("C-x C-x" "exchange" exchange-point-and-mark :transient t)]
-   `["Formatting"
-     ,@(when check-for-table '(:if org-menu-show-text-options-p))
-     :pad-keys t
-     ("*" "Bold" (lambda nil (interactive) (org-menu-toggle-format ?*)) :transient t)
-     ("/" "italic" (lambda nil (interactive) (org-menu-toggle-format ?/)) :transient t)
-     ("_" "underline" (lambda nil (interactive) (org-menu-toggle-format ?_)) :transient t)
-     ("+" "strikethrough" (lambda nil (interactive) (org-menu-toggle-format ?+)) :transient t)
-     ("S-SPC" "zero-width space" org-menu-toggle-zwspace :transient t)]
-   `["Source"
-     ,@(when check-for-table '(:if org-menu-show-text-options-p))
-     ("~" "code" (lambda nil (interactive) (org-menu-toggle-format ?~)) :transient t)
-     ("=" "verbatim" (lambda nil (interactive) (org-menu-toggle-format ?=)) :transient t)]))
-
-;;;###autoload (autoload 'org-menu-text-in-element "org-menu" nil t)
-(transient-define-prefix org-menu-text-in-element ()
-  "Add formatting for text inside other elements like lists and tables."
-  ["dummy"])
-
-(transient-insert-suffix 'org-menu-text-in-element (list 0)
-  `[,@(org-menu-text-format-items nil)
-    ["Quit"
-     :if-non-nil org-menu-use-q-for-quit
-     ("q" "quit" transient-quit-all)]])
-
-;;;###autoload (autoload 'org-menu-options "org-menu" nil t)
-(transient-define-prefix org-menu-options ()
-  "A menu to toggle options."
-  [["Display"
-    ("l" "show links" org-toggle-link-display)
-    ("i" "inline images" org-toggle-inline-images)
-    ("p" "pretty entities" org-toggle-pretty-entities)
-    ("I" "indent by level" org-indent-mode)
-    ("t" "timestamp overlay" org-toggle-time-stamp-overlays)
-    ("n" "numbered headings" org-num-mode)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-toggle-has-checkbox ()
-  "Toggle whether the current list item has a checkbox."
-  (interactive)
-  (save-excursion
-    (back-to-indentation)
-    (if (not (looking-at "- "))
-        (message "Not at list item")
-      (end-of-line 1)
-      (org-ctrl-c-ctrl-c '(4)))))
-
-(defun org-menu-is-timer-running ()
-  "Return whether a timer is currently running."
-  (and org-timer-start-time
-       (not org-timer-countdown-timer)
-       (not org-timer-pause-time)))
-
-(defun org-menu-is-timer-paused ()
-  "Return whether a timer has been started and is paused."
-  (and org-timer-start-time
-       (not org-timer-countdown-timer)
-       org-timer-pause-time))
-
-;;;###autoload (autoload 'org-menu-clock "org-menu" nil t)
-(transient-define-prefix org-menu-clock ()
-  "Time management using org-modes clock."
-  [["Clock"
-    :pad-keys t
-    ("<tab>" "in" org-clock-in :if-not org-clock-is-active)
-    ("TAB" "in" org-clock-in :if-not org-clock-is-active)
-    ("o" "out" org-clock-out :if org-clock-is-active)
-    ("j" "goto" org-clock-goto :if org-clock-is-active)
-    ("q" "cancel" org-clock-cancel
-     :if (lambda () (and (not org-menu-use-q-for-quit)
-                         (org-clock-is-active))))
-    ("Q" "cancel" org-clock-cancel
-     :if (lambda () (and org-menu-use-q-for-quit
-                         (org-clock-is-active))))
-    ("d" "display" org-clock-display :if org-clock-is-active)
-    ("x" "in again" org-clock-in-last :if-not org-clock-is-active)
-    ("z" "resolve" org-resolve-clocks)]
-   ["Timer"
-    ("0" "start" org-timer-start :if-nil org-timer-start-time)
-    ("_" "stop" org-timer-stop :if-non-nil org-timer-start-time)
-    ("." "insert" org-timer :if-non-nil org-timer-start-time)
-    ("-" "... item" org-timer-item :if-non-nil org-timer-start-time)
-    ("," "pause" org-timer-pause-or-continue :if org-menu-is-timer-running)
-    ("," "continue" org-timer-pause-or-continue :if org-menu-is-timer-paused)
-    (";" "countdown" org-timer-set-timer :if-nil org-timer-start-time)]
-   ["Effort"
-    ("e" "set effort" org-set-effort)
-    ("E" "increase" org-inc-effort)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(defun org-menu-columns-globally ()
-  "Turn on `org-columns' globally."
-  (interactive)
-  (org-columns t))
-
-(transient-define-prefix org-menu-search-and-filter ()
-  "A menu to search and filter `org-mode' documents."
-  ["Search and filter"
-   ["Filter"
-    ("/" "only matching" org-sparse-tree)
-    ("q" "tags" org-tags-sparse-tree :if-nil org-menu-use-q-for-quit)
-    ("Q" "tags" org-tags-sparse-tree :if-non-nil org-menu-use-q-for-quit)
-    ("t" "todos" org-show-todo-tree)
-    ("d" "deadlines" org-check-deadlines)
-    ("r" "remove highlights" org-remove-occur-highlights :if-non-nil org-occur-highlights)]
-   ["Dates"
-    ("b" "before" org-check-before-date)
-    ("a" "after" org-check-after-date)
-    ("D" "range" org-check-dates-range)]
-   ["Views"
-    ("A" "agenda" org-agenda)
-    ("c" "columns" org-columns :if-nil org-columns-current-fmt)
-    ("c" "columns off" org-columns-quit :if-non-nil org-columns-current-fmt)
-    ("gc" "whole buffer" org-menu-columns-globally :if-nil org-columns-current-fmt)]
-   ["Quit"
-    :if-non-nil org-menu-use-q-for-quit
-    ("q" "quit" transient-quit-all)]])
-
-(transient-define-prefix org-menu-attachments ()
-  "A menu to manage attachments."
-  ["Attachments"
-   ["Add"
-    ("a" "file" org-attach-attach)
-    ("c" "copy" org-attach-attach-cp)
-    ("m" "move" org-attach-attach-mv)
-    ("l" "link" org-attach-attach-ln)
-    ("y" "symlink" org-attach-attach-lns)
-    ("u" "download" org-attach-url)
-    ("b" "buffer" org-attach-buffer)
-    ("n" "new" org-attach-new)]
-   ["Open"
-    ("o" "attachment" org-attach-open)
-    ("O" "in Emacs" org-attach-open-in-emacs)
-    ("f" "directory" org-attach-reveal)
-    ("F" "in Emacs" org-attach-reveal-in-emacs)]
-   ["Delete"
-    ("d" "delete" org-attach-delete-one)
-    ("D" "all" org-attach-delete-all)]
-   ["More"
-    ("s" "set directory" org-attach-set-directory)
-    ("S" "unset" org-attach-unset-directory)
-    ("z" "synchronize" org-attach-sync)]]
-  (interactive)
-  (require 'org-attach)
-  (transient-setup 'org-menu-attachments))
-
-(transient-define-prefix org-menu-archive ()
-  "A menu to archive items."
-  ["dummy"])
-
-(defun org-menu-force-cycle-archived ()
-  "Wrapper around deprecated `org-force-cycle-archived' to fix warning."
-  (interactive)
-  (with-no-warnings
-    (org-force-cycle-archived)))
-
-(transient-insert-suffix 'org-menu-archive (list 0)
-  `["Archive"
-    ,@(org-menu-heading-navigate-items nil #'org-menu-force-cycle-archived)
-    ["Archive to"
-     ("t" "tree" org-archive-subtree :transient t)
-     ("s" "sibling" org-archive-to-archive-sibling :transient t)
-     ("Q" "tag" org-toggle-archive-tag :transient t)]])
-
-(defun org-menu-insert-todo-heading-after-current ()
-  "Insert a new todo heading with same level as current, after subtree."
-  (interactive)
-  (org-insert-todo-heading '(16)))
-
-;;;###autoload (autoload 'org-menu "org-menu" nil t)
-(transient-define-prefix org-menu ()
-  "A discoverable menu to edit and view `org-mode' documents."
-  ["dummy"])
-
-(transient-insert-suffix 'org-menu (list 0)
-  `["Org mode"
-    ;; Items for headings
-    ,@(org-menu-heading-navigate-items t)
-
-    ["Move heading"
-     :if org-menu-show-heading-options-p
-     ("P" "up" org-metaup :transient t)
-     ("N" "down" org-metadown :transient t)
-     ("B" "left" org-shiftmetaleft :transient t)
-     ("F" "right" org-shiftmetaright :transient t)
-     ("b" "left (line)" org-metaleft :transient t)
-     ("f" "right (line)" org-metaright :transient t)
-     ("r" "refile" org-refile :transient t)]
-    ["Change heading"
-     :if org-menu-show-heading-options-p
-     ("*" "toggle" org-ctrl-c-star :if-not org-at-table-p :transient t)
-     ("t" "todo" org-todo :transient t)
-     ("q" "tags" org-set-tags-command :transient t :if-nil org-menu-use-q-for-quit)
-     ("Q" "tags" org-set-tags-command :transient t :if-non-nil org-menu-use-q-for-quit)
-     ("y" "property" org-set-property :transient t)
-     ("," "priority" org-priority :transient t)
-     ("A" "archive" org-menu-archive :transient t)
-     ("D" "deadline" org-deadline :transient t)
-     ("S" "schedule" org-schedule :transient t)
-     ("/" "comment" org-toggle-comment :transient t)
-     ("mn" "add note" org-add-note)]
-    ["Make new/delete"
-     :if org-menu-show-heading-options-p
-     :pad-keys t
-     ("mh" "make heading (before)" org-insert-heading)
-     ("mH" "make heading (after)" org-insert-heading-after-current)
-     ("mt" "make todo (before)" org-insert-todo-heading)
-     ("mT" "make todo (after)" org-menu-insert-todo-heading-after-current)
-     ("mc" "clone with time shift" org-clone-subtree-with-time-shift)
-     ("dh" "delete heading" org-cut-subtree :transient t)
-     ("dy" "delete property" org-delete-property :transient t)
-     ("a" "attachments" org-menu-attachments)
-     ("C-w" "cut tree" org-cut-special :transient t)
-     ("C-y" "yank tree" org-paste-special :transient t)]
-
-    ;; Items for tables
-    ["Navigate"
-     :if org-menu-show-table-options-p
-     :pad-keys t
-     ("p" "up" previous-line :transient t)
-     ("n" "down" next-line :transient t)
-     ("b" "left" org-table-previous-field :transient t)
-     ("f" "right" org-table-next-field :transient t)
-     ("u" "parent" outline-up-heading :transient t)
-     ("M-w" "store link" org-store-link :transient t :if-not region-active-p)
-     ("C-_" "undo" undo :transient t)]
-    ["Move r/c"
-     :if org-menu-show-table-options-p
-     ("P" "up" org-table-move-row-up :transient t)
-     ("N" "down" org-table-move-row-down :transient t)
-     ("B" "left" org-table-move-column-left :transient t)
-     ("F" "right" org-table-move-column-right :transient t)]
-    ["Field"
-     :if org-menu-show-table-options-p
-     :pad-keys t
-     ("'" "edit" org-table-edit-field)
-     ("SPC" "blank" org-table-blank-field :transient t)
-     ("RET" "from above" org-table-copy-down :transient t)
-     ("t" "text formatting" org-menu-text-in-element)]
-    ["Formulas"
-     :if org-menu-show-table-options-p
-     ("E" "edit all" org-table-edit-formulas :transient t)
-     ("=" "field" (lambda () (interactive) (org-table-eval-formula '(4))) :transient t)
-     ("+" "in place" (lambda () (interactive) (org-table-eval-formula '(16))))
-     ("c" "column" org-table-eval-formula :transient t)
-     ("h" "coordinates" org-table-toggle-coordinate-overlays :transient t)
-     ("D" "debug" org-table-toggle-formula-debugger :transient t)]
-    ["Table"
-     :if org-menu-show-table-options-p
-     :pad-keys t
-     ("dr" "delete row" org-shiftmetaup :transient t)
-     ("dc" "delete column" org-shiftmetaleft :transient t)
-     ("m" "make" org-menu-insert-table)
-     ,@(when (fboundp (function org-table-toggle-column-width))
-         ;; This will emit a warning during byte compilation. We can ignore it
-         (list '("S" "shrink column" org-table-toggle-column-width :transient t)))
-     ("r" "sort" org-table-sort-lines :transient t)
-     ("M-w" "copy rect" org-table-copy-region :transient t :if region-active-p)
-     ("C-w" "cut rect" org-table-cut-region :transient t :if region-active-p)
-     ("C-y" "yank rect" org-table-paste-rectangle :transient t)]
-
-    ;; Items for lists
-    ["Navigate"
-     :if org-menu-show-list-options-p
-     :pad-keys t
-     ("p" "prev" previous-line :transient t)
-     ("n" "next" next-line :transient t)
-     ("c" "cycle" org-cycle :transient t)
-     ("u" "parent" org-up-element :transient t)
-     ("M-p" "prev (same level)" org-backward-element :transient t)
-     ("M-n" "next (same level)" org-forward-element :transient t)
-     ("M-w" "store link" org-store-link :transient t :if-not region-active-p)
-     ("C-_" "undo" undo :transient t)]
-    ["Move list"
-     :if org-menu-show-list-options-p
-     ("P" "up" org-metaup :transient t)
-     ("N" "down" org-metadown :transient t)
-     ("B" "left" org-shiftmetaleft :transient t)
-     ("F" "right" org-shiftmetaright :transient t)
-     ("b" "left (line)" org-metaleft :transient t)
-     ("f" "right (line)" org-metaright :transient t)]
-    ["List"
-     :if org-menu-show-list-options-p
-     ("R" "repair" org-list-repair)
-     ("*" "turn into tree" org-list-make-subtree)
-     ("S" "sort" org-sort-list :transient t)
-     ("t" "text formatting" org-menu-text-in-element)]
-    ["Toggle"
-     :if org-menu-show-list-options-p
-     ("-" "list item" org-toggle-item :if-not org-at-table-p :transient t)
-     ("+" "list style" org-cycle-list-bullet :if-not org-at-table-p :transient t)
-     ("d" "done" org-toggle-checkbox :transient t)
-     ("h" "half-done"
-      (lambda () (interactive) (org-toggle-checkbox '(16)))
-      :transient t)
-     ("m" "checkbox" org-menu-toggle-has-checkbox :transient t)]
-
-    ;; Items for text
-    ,@(org-menu-text-format-items t)
-    ["Line"
-     :if org-menu-show-text-options-p
-     :pad-keys t
-     (":" "fixed width" org-toggle-fixed-width :transient t)
-     (";" "comment" org-menu-comment-line :transient t)
-     ("--" "list" org-toggle-item :transient t)
-     ("-*" "heading" org-ctrl-c-star :transient t)]
-
-    ;; Items for source blocks
-    ,@(org-menu-eval-src-items)
-
-    ["Link"
-     :if org-menu-show-link-options-p
-     ("e" "edit" org-insert-link :transient t)]
-
-    ["Timestamp"
-     :if org-menu-show-timestamp-options-p
-     ("." "type" org-toggle-timestamp-type :transient t)
-     ("e" "edit" org-time-stamp :transient t)
-     ("R" "repair" org-menu-fix-timestamp :transient t)]
-
-    ["Footnote"
-     :if org-menu-show-footnote-options-p
-     ("ed" "delete" (lambda () (interactive) (org-footnote-delete)))
-     ("es" "sort" (lambda () (interactive) (org-footnote-sort)))
-     ("er" "renumber" (lambda () (interactive) (org-footnote-renumber-fn:N)))
-     ("eS" "sort+renumber" (lambda () (interactive)
-                (org-footnote-renumber-fn:N)
-                (org-footnote-sort)))
-     ("en" "normalize" (lambda () (interactive) (org-footnote-normalize)))]
-
-    ;; Items for column view
-    ["Navigate"
-     :if org-menu-show-columns-view-options-p
-     :pad-keys t
-     ("p" "prev" org-columns-move-up :transient t)
-     ("n" "next" org-columns-move-down :transient t)
-     ("f" "forward" forward-char :transient t)
-     ("b" "backward" backward-char :transient t)
-     ("M-w" "store link" org-store-link :transient t :if-not region-active-p)
-     ("C-_" "undo" undo :transient t)]
-    ["Value"
-     :if org-menu-show-columns-view-options-p
-     :pad-keys t
-     ("e" "edit" org-columns-edit-value :transient t)
-     ("V" "show" org-columns-show-value :transient t)
-     ("M-n" "next" org-columns-next-allowed-value :transient t)
-     ("M-p" "previous" org-columns-previous-allowed-value :transient t)
-     ("a" "edit allowed" org-columns-edit-allowed :transient t)]
-    ["Column"
-     :if org-menu-show-columns-view-options-p
-     :pad-keys t
-     ("E" "edit column" org-columns-edit-attributes :transient t)
-     ("{" "narrow" org-columns-narrow :transient t)
-     ("}" "widen" org-columns-widen :transient t)
-     ("M-<right>" "move right" org-columns-move-right :transient t)
-     ("M-<left>" "move left" org-columns-move-left :transient t)
-     ("M-S-<right>" "new" org-columns-new :transient t)
-     ("M-S-<left>" "delete" org-columns-delete :transient t)]
-
-    ["Tasks"
-     ("v" "visibility" org-menu-visibility :if-not org-menu-show-columns-view-options-p)
-     ("v" "visibility" org-menu-visibility-columns :if org-menu-show-columns-view-options-p)
-     ("x" "evaluation" org-menu-eval)
-     ("i" "insert" org-menu-insert)
-     ("g" "go to" org-menu-goto)
-     ("s" "search" org-menu-search-and-filter)
-     ("o" "options" org-menu-options)
-     ("C" "clock (active)" org-menu-clock :if org-clock-is-active)
-     ("C" "clock" org-menu-clock :if-not org-clock-is-active)
-     ,@(when (fboundp #'org-capture-finalize)
-         (list '("C-c C-c" "confirm capture" org-capture-finalize :if-non-nil org-capture-mode)))
-     ,@(when (fboundp #'org-capture-kill)
-         (list '("C-c C-k" "abort capture" org-capture-kill :if-non-nil org-capture-mode)))
-     ""
-     ("q" "quit" transient-quit-all :if-non-nil org-menu-use-q-for-quit)]])
-
-(provide 'org-menu)
-;;; org-menu.el ends here
dots/.config/emacs/old/lisp/org-protocol-capture-html.el
@@ -1,280 +0,0 @@
-;;; org-protocol-capture-html.el --- Capture HTML with org-protocol
-
-;; URL: https://github.com/alphapapa/org-protocol-capture-html
-;; Version: 0.1-pre
-;; Package-Requires: ((emacs "24.4"))
-
-;;; Commentary:
-
-;; This package captures Web pages into Org-mode using Pandoc to
-;; process HTML.  It can also use eww's eww-readable functionality to
-;; get the main content of a page.
-
-;; These are the helper functions that run in Emacs.  To capture pages
-;; into Emacs, you can use either a browser bookmarklet or the
-;; org-protocol-capture-html.sh shell script.  See the README.org file
-;; for instructions.
-
-;;; License:
-
-;; This program 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 3 of the License, or
-;; (at your option) any later version.
-
-;; This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Code:
-
-;;;; Require
-
-(require 'org-protocol)
-(require 'cl-lib)
-(require 'subr-x)
-(require 's)
-
-;;;; Vars
-
-(defcustom org-protocol-capture-html-demote-times 1
-  "How many times to demote headings in captured pages.
-You may want to increase this if you use a sub-heading in your capture template."
-  :group 'org-protocol-capture-html :type 'integer)
-
-;;;; Test Pandoc
-
-(defconst org-protocol-capture-html-pandoc-no-wrap-option nil
-  ;; Set this so it won't be unbound
-  "Option to pass to Pandoc to disable wrapping.
-Pandoc >= 1.16 deprecates `--no-wrap' in favor of
-`--wrap=none'.")
-
-(defun org-protocol-capture-html--define-pandoc-wrap-const ()
-  "Set `org-protocol-capture-html-pandoc-no-wrap-option'."
-  (setq org-protocol-capture-html-pandoc-no-wrap-option
-        ;; Pandoc >= 1.16 deprecates the --no-wrap option, replacing it with
-        ;; --wrap=none.  Sending the wrong option causes output to STDERR,
-        ;; which `call-process-region' doesn't like.  So we test Pandoc to see
-        ;; which option to use.
-        (with-temp-buffer
-          (let* ((process (start-process "test-pandoc" (current-buffer) "pandoc" "--dump-args" "--no-wrap"))
-                 (limit 3)
-                 (checked 0))
-            (while (process-live-p process)
-              (if (= checked limit)
-                  (progn
-                    ;; Pandoc didn't exit in time.  Kill it and raise
-                    ;; an error.  This function will return `nil' and
-                    ;; `org-protocol-capture-html-pandoc-no-wrap-option'
-                    ;; will remain `nil', which will cause this
-                    ;; function to run again and set the const when a
-                    ;; capture is run.
-                    (set-process-query-on-exit-flag process nil)
-                    (error "Unable to test Pandoc!  Please report this bug! (include the output of \"pandoc --dump-args --no-wrap\")"))
-                (sleep-for 0.2)
-                (cl-incf checked)))
-            (if (and (zerop (process-exit-status process))
-                     (not (string-match "--no-wrap is deprecated" (buffer-string))))
-                "--no-wrap"
-              "--wrap=none")))))
-
-;;;; Direct-to-Pandoc
-
-(defun org-protocol-capture-html--with-pandoc (data)
-  "Process an org-protocol://capture-html:// URL using DATA.
-
-This function is basically a copy of `org-protocol-do-capture', but
-it passes the captured content (not the URL or title) through
-Pandoc, converting HTML to Org-mode."
-
-  ;; It would be nice to not basically duplicate
-  ;; `org-protocol-do-capture', but passing the data back to that
-  ;; function would require re-encoding the data into a URL string
-  ;; with Emacs after Pandoc converts it.  Since we've already split
-  ;; it up, we might as well go ahead and run the capture directly.
-
-  (unless org-protocol-capture-html-pandoc-no-wrap-option
-    (org-protocol-capture-html--define-pandoc-wrap-const))
-
-  (let* ((template (or (plist-get data :template)
-                       org-protocol-default-template-key))
-         (url (org-protocol-sanitize-uri (plist-get data :url)))
-         (type (if (string-match "^\\([a-z]+\\):" url)
-                   (match-string 1 url)))
-         (title (or (org-protocol-capture-html--nbsp-to-space (string-trim (plist-get data :title))) ""))
-         (content (or (org-protocol-capture-html--nbsp-to-space (string-trim (plist-get data :body))) ""))
-         (orglink (org-make-link-string
-                   url (if (string-match "[^[:space:]]" title) title url)))
-         (org-capture-link-is-already-stored t)) ; avoid call to org-store-link
-
-    (setq org-stored-links
-          (cons (list url title) org-stored-links))
-    (kill-new orglink)
-
-    (with-temp-buffer
-      (insert content)
-      (if (not (zerop (call-process-region
-                       (point-min) (point-max)
-                       "pandoc" t t nil "-f" "html" "-t" "org" org-protocol-capture-html-pandoc-no-wrap-option)))
-          (message "Pandoc failed: %s" (buffer-string))
-        (progn
-          ;; Pandoc succeeded
-          (org-store-link-props :type type
-                                :annotation orglink
-                                :link url
-                                :description title
-                                :orglink orglink
-                                :initial (buffer-string)))))
-    (org-protocol-capture-html--do-capture)
-    nil))
-
-(add-to-list 'org-protocol-protocol-alist
-             '("capture-html"
-               :protocol "capture-html"
-               :function org-protocol-capture-html--with-pandoc
-               :kill-client t))
-
-;;;; eww-readable
-
-(defvar url-http-end-of-headers)
-
-(eval-when-compile
-  ;; eww-readable only works on Emacs >=25.1, but I think it's better
-  ;; to check for the actual symbols.  I think using
-  ;; `eval-when-compile' is the right way to do this, but I'm not
-  ;; sure.
-  (when (and (require 'eww nil t)
-             (require 'dom nil t)
-             (fboundp 'eww-score-readability))
-
-    (defun org-protocol-capture-html--capture-eww-readable (data)
-      "Capture content of URL with eww-readable.."
-
-      (unless org-protocol-capture-html-pandoc-no-wrap-option
-        (org-protocol-capture-html--define-pandoc-wrap-const))
-
-      (let* ((template (or (plist-get data :template)
-                           org-protocol-default-template-key))
-             (url (org-protocol-sanitize-uri (plist-get data :url)))
-             (type (if (string-match "^\\([a-z]+\\):" url)
-                       (match-string 1 url)))
-             (html (org-protocol-capture-html--url-html url))
-             (result (org-protocol-capture-html--eww-readable html))
-             (title (cdr result))
-             (content (with-temp-buffer
-                        (insert (org-protocol-capture-html--nbsp-to-space (car result)))
-                        ;; Convert to Org with Pandoc
-                        (unless (= 0 (call-process-region (point-min) (point-max)
-                                                          "pandoc" t t nil "-f" "html" "-t" "org"
-                                                          org-protocol-capture-html-pandoc-no-wrap-option))
-                          (error "Pandoc failed"))
-                        (save-excursion
-                          ;; Remove DOS CR/LF line endings
-                          (goto-char (point-min))
-                          (while (search-forward (string ?\C-m) nil t)
-                            (replace-match "")))
-                        ;; Demote page headings in capture buffer to below the
-                        ;; top-level Org heading and "Article" 2nd-level heading
-                        (save-excursion
-                          (goto-char (point-min))
-                          (while (re-search-forward (rx bol (1+ "*") (1+ space)) nil t)
-                            (beginning-of-line)
-                            (insert "**")
-                            (end-of-line)))
-                        (buffer-string)))
-             (orglink (org-make-link-string
-                       url (if (s-present? title) title url)))
-             ;; Avoid call to org-store-link
-             (org-capture-link-is-already-stored t))
-
-        (setq org-stored-links
-              (cons (list url title) org-stored-links))
-        (kill-new orglink)
-
-        (org-store-link-props :type type
-                              :annotation orglink
-                              :link url
-                              :description title
-                              :orglink orglink
-                              :initial content)
-        (org-protocol-capture-html--do-capture)
-        nil))
-
-    (add-to-list 'org-protocol-protocol-alist
-                 '("capture-eww-readable"
-                   :protocol "capture-eww-readable"
-                   :function org-protocol-capture-html--capture-eww-readable
-                   :kill-client t))
-
-    (defun org-protocol-capture-html--url-html (url)
-      "Return HTML from URL as string."
-      (let* ((response-buffer (url-retrieve-synchronously url nil t))
-             (encoded-html (with-current-buffer response-buffer
-                             (pop-to-buffer response-buffer)
-                             ;; Skip HTTP headers, using marker provided by url-http
-                             (delete-region (point-min) (1+ url-http-end-of-headers))
-                             (buffer-string))))
-        (kill-buffer response-buffer)     ; Not sure if necessary to avoid leaking buffer
-        (with-temp-buffer
-          ;; For some reason, running `decode-coding-region' in the
-          ;; response buffer has no effect, so we have to do it in a
-          ;; temp buffer.
-          (insert encoded-html)
-          (condition-case nil
-              ;; Fix undecoded text
-              (decode-coding-region (point-min) (point-max) 'utf-8)
-            (coding-system-error nil))
-          (buffer-string))))
-
-    (defun org-protocol-capture-html--eww-readable (html)
-      "Return `eww-readable' part of HTML with title.
-Returns list (HTML . TITLE)."
-      ;; Based on `eww-readable'
-      (let* ((html
-              ;; Convert "&nbsp;" in HTML to plain spaces.
-              ;; `libxml-parse-html-region' turns them into
-              ;; underlines.  The closest I can find to an explanation
-              ;; is at <http://www.perlmonks.org/?node_id=825188>.
-              (org-protocol-capture-html--nbsp-to-space html))
-             (dom (with-temp-buffer
-                    (insert html)
-                    (libxml-parse-html-region (point-min) (point-max))))
-             (title (cl-caddr (car (dom-by-tag dom 'title)))))
-        (eww-score-readability dom)
-        (cons (with-temp-buffer
-                (shr-dom-print (eww-highest-readability dom))
-                (buffer-string))
-              title)))))
-
-;;;; Helper functions
-
-(defun org-protocol-capture-html--nbsp-to-space (s)
-  "Convert HTML non-breaking spaces to plain spaces in S."
-  ;; Not sure why sometimes these are in the HTML and Pandoc converts
-  ;; them to underlines instead of spaces, but this fixes it.
-  (replace-regexp-in-string (rx "&nbsp;") " " s t t))
-
-(with-no-warnings
-  ;; Ignore warning about the dynamically scoped `template' variable.
-  (defun org-protocol-capture-html--do-capture ()
-    "Call `org-capture' and demote page headings in capture buffer."
-    (raise-frame)
-    (funcall 'org-capture nil template)
-
-    ;; Demote page headings in capture buffer to below the
-    ;; top-level Org heading
-    (save-excursion
-      (goto-char (point-min))
-      (re-search-forward (rx bol "*" (1+ space)) nil t) ; Skip 1st heading
-      (while (re-search-forward (rx bol "*" (1+ space)) nil t)
-        (dotimes (n org-protocol-capture-html-demote-times)
-          (org-demote-subtree))))))
-
-(provide 'org-protocol-capture-html)
-
-;;; org-protocol-capture-html.el ends here
dots/.config/emacs/old/lisp/org-review.el
@@ -1,263 +0,0 @@
-;;; org-review.el --- Schedule reviews for Org entries
-;;
-;; Copyright (C) 2024 Alan Schmitt
-;;
-;; Author: Alan Schmitt <alan.schmitt@polytechnique.org>
-;; URL: https://github.com/brabalan/org-review
-;; Version: 0.3
-;; Keywords: calendar
-
-;; This file is not part of GNU Emacs.
-
-;; This program 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 3, or (at your option)
-;; any later version.
-;;
-;; This program 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. If not, see <http://www.gnu.org/licenses/>.
-;;
-;;; Commentary:
-;;
-;; This allows to schedule reviews of org entries.
-;;
-;; Entries will be scheduled for review if their NEXT_REVIEW or their
-;; LAST_REVIEW property is set. The next review date is the
-;; NEXT_REVIEW date, if it is present, otherwise it is computed from
-;; the LAST_REVIEW property and the REVIEW_DELAY period, such as
-;; "+1m". If REVIEW_DELAY is absent, a default period is used. Note
-;; that the LAST_REVIEW property is not considered as inherited, but
-;; REVIEW_DELAY is, allowing to set it for whole subtrees.
-;;
-;; Checking of review dates is done through an agenda view, using the
-;; `org-review-agenda-skip' skipping function. This function is based
-;; on `org-review-toreview-p', that returns `nil' if no review is
-;; necessary (no review planned or it happened recently), otherwise it
-;; returns the date the review was first necessary (NEXT_REVIEW, or
-;; LAST_REVIEW + REVIEW_DELAY, if it is in the past).
-;;
-;; To mark an entry as reviewed, use the function
-;; `org-review-insert-last-review' to set the LAST_REVIEW date to the
-;; current date. If `org-review-sets-next-date' is set (which is the
-;; default), this function also computes the date of the next review
-;; and inserts it as NEXT_REVIEW.
-;;
-;; Example use.
-;;
-;; 1 - To display the things to review in the agenda.
-;;
-;;   (setq org-agenda-custom-commands (quote ( ...
-;;        ("R" "Review projects" tags-todo "-CANCELLED/"
-;;         ((org-agenda-overriding-header "Reviews Scheduled")
-;;         (org-agenda-skip-function 'org-review-agenda-skip)
-;;         (org-agenda-cmp-user-defined 'org-review-compare)
-;;         (org-agenda-sorting-strategy '(user-defined-down)))) ... )))
-;;
-;; 2 - To set a key binding to review from the agenda
-;;
-;;   (add-hook 'org-agenda-mode-hook (lambda () (local-set-key (kbd "C-c
-;;        C-r") 'org-review-insert-last-review)))
-
-;;; Changes
-;;
-;; 2022-04-11: systematically insert name of week day in date
-;; 2016-08-18: better detection of org-agenda buffers
-;; 2014-05-08: added the ability to specify next review dates
-
-;; TODO
-;; - be able to specify a function to run when marking an item reviewed
-
-;;; Code:
-
-(require 'org)
-(require 'org-agenda)
-
-;;; User variables:
-
-(defgroup org-review nil
-  "Org review scheduling."
-  :tag "Org Review Schedule"
-  :group 'org)
-
-(defcustom org-review-last-timestamp-format 'naked
-  "Timestamp format for last review properties."
-  :type '(radio (const naked)
-                (const inactive)
-                (const active))
-  :group 'org-review)
-
-(defcustom org-review-next-timestamp-format 'naked
-  "Timestamp format for last review properties."
-  :type '(radio (const naked)
-                (const inactive)
-                (const active))
-  :group 'org-review)
-
-(defcustom org-review-last-property-name "LAST_REVIEW"
-  "The name of the property for the date of the last review."
-  :type 'string
-  :group 'org-review)
-
-(defcustom org-review-delay-property-name "REVIEW_DELAY"
-  "The name of the property for setting the delay before the next review."
-  :type 'string
-  :group 'org-review)
-
-(defcustom org-review-next-property-name "NEXT_REVIEW"
-  "The name of the property for setting the date of the next review."
-  :type 'string
-  :group 'org-review)
-
-(defcustom org-review-delay "+1m"
-  "Time span between the date of last review and the next one.
-The default value for this variable (\"+1m\") means that entries
-will be marked for review one month after their last review.
-
-If the review delay cannot be retrieved from the entry or the
-subtree above, this delay is used."
-  :type 'string
-  :group 'org-review)
-
-(defcustom org-review-sets-next-date t
-  "Indicates whether marking a project as reviewed automatically
-sets the next NEXT_REVIEW according to the current date and
-REVIEW_DELAY."
-  :type 'boolean
-  :group 'org-review)
-
-;;; Functions:
-
-(defun org-review-last-planned (last delay)
-  "Computes the next planned review, given the LAST review
-date (in string format) and the review DELAY (in string
-format)."
-  (let ((lt (org-read-date nil t last))
-        (ct (current-time)))
-    (time-add lt (time-subtract (org-read-date nil t delay) ct))))
-
-;;;###autoload
-(defun org-review-last-review-prop (&optional pos)
-  "Return the value of the last review property of the headline
-at position POS, or the current headline if POS is not given."
-  (org-entry-get (or pos (point)) org-review-last-property-name))
-
-;;;###autoload
-(defun org-review-next-review-prop (&optional pos)
-  "Return the value of the review date property of the headline
-at position POS, or the current headline if POS is not given."
-  (org-entry-get (or pos (point)) org-review-next-property-name))
-
-(defun org-review-review-delay-prop (&optional pos)
-  "Return the value of the review delay property of the headline
-at position POS, or the current headline if POS is not given,
-considering inherited properties."
-  (org-entry-get (or pos (point)) org-review-delay-property-name t))
-
-(defun org-review-toreview-p (&optional pos)
-  "Check if the entry at point should be marked for review.
-Return nil if the entry does not need to be reviewed. Otherwise
-return the date when the entry was first scheduled to be
-reviewed.
-
-If there is a next review date, consider it. Otherwise, if there
-is a last review date, use it to compute the date of the next
-review (adding the value of the review delay property, or
-`org-review-delay' if there is no review delay property). If
-there is no next review date and no last review date, return
-nil."
-  (let* ((lp (org-review-last-review-prop pos))
-	 (np (org-review-next-review-prop pos))
-	 (nextreview
-	  (cond
-	   (np (org-read-date nil t np))
-	   (lp (org-review-last-planned
-		lp
-		(or (org-review-review-delay-prop pos)
-		    org-review-delay)))
-	   (t nil))))
-    (and nextreview
-	 (time-less-p nextreview (current-time))
-	 nextreview)))
-
-(defun org-review-insert-date (propname fmt date)
-  "Insert the DATE under property PROPNAME, in the format
-specified by FMT."
-  (org-entry-put
-   (if (equal major-mode 'org-agenda-mode)
-       (or (org-get-at-bol 'org-marker)
-	   (org-agenda-error))
-     (point))
-   propname
-   (cond
-    ((eq fmt 'inactive)
-     (concat "[" date "]"))
-    ((eq fmt 'active)
-     (concat "<" date ">"))
-    (t date))))
-
-;;;###autoload
-(defun org-review-insert-last-review (&optional prompt)
-  "Insert the current date as last review. If prefix argument:
-prompt the user for the date. If `org-review-sets-next-date' is
-set to t, also insert a next review date."
-  (interactive "P")
-  (let ((ts (if prompt
-                (format-time-string (car org-time-stamp-formats) (org-read-date nil t))
-              (format-time-string (car org-time-stamp-formats)))))
-    (org-review-insert-date org-review-last-property-name
-			    org-review-last-timestamp-format
-			    ts)
-    (when org-review-sets-next-date
-      (org-review-insert-date
-       org-review-next-property-name
-       org-review-next-timestamp-format
-       (format-time-string
-        (car org-time-stamp-formats)
-        (org-review-last-planned
-         ts
-         (or (org-review-review-delay-prop
-              (if (equal major-mode 'org-agenda-mode)
-                  (or (org-get-at-bol 'org-marker)
-                      (org-agenda-error))
-                (point)))
-             org-review-delay)))))))
-
-;;;###autoload
-(defun org-review-insert-next-review ()
-  "Prompt the user for the date of the next review, and insert
-it as a property of the headline."
-  (interactive)
-  (let ((ts (format-time-string (car org-time-stamp-formats) (org-read-date nil t))))
-    (org-review-insert-date org-review-next-property-name
-			    org-review-next-timestamp-format
-			    ts)))
-
-;;;###autoload
-(defun org-review-agenda-skip ()
-  "To be used as an argument of `org-agenda-skip-function' to
-skip entries that are not scheduled to be reviewed. This function
-does not move the point; it returns nil if the entry is to be
-kept, and the position to continue the search otherwise."
-  (and (not (org-review-toreview-p))
-       (org-with-wide-buffer (or (outline-next-heading) (point-max)))))
-
-(defun org-review-compare (a b)
-  "Compares the date of scheduled review for the two agenda
-entries, to be used with `org-agenda-cmp-user-defined'. Returns
-+1 if A has been scheduled for longer and -1 otherwise."
-  (let* ((ma (or (get-text-property 0 'org-marker a)
-                 (get-text-property 0 'org-hd-marker a)))
-         (mb (or (get-text-property 0 'org-marker b)
-                 (get-text-property 0 'org-hd-marker b)))
-	 (ra (org-review-toreview-p ma))
-	 (rb (org-review-toreview-p mb)))
-    (if (time-less-p ra rb) 1 -1)))
-
-(provide 'org-review)
-
-;;; org-review.el ends here
dots/.config/emacs/old/lisp/ox-rss.el
@@ -1,414 +0,0 @@
-;;; ox-rss.el --- RSS 2.0 Back-End for Org Export Engine
-
-;; Copyright (C) 2013-2015  Bastien Guerry
-
-;; Author: Bastien Guerry <bzg@gnu.org>
-;; Keywords: org, wp, blog, feed, rss
-
-;; This file is not yet part of GNU Emacs.
-
-;; This program 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 3 of the License, or
-;; (at your option) any later version.
-
-;; This program 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.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This library implements a RSS 2.0 back-end for Org exporter, based on
-;; the `html' back-end.
-;;
-;; It requires Emacs 24.1 at least.
-;;
-;; It provides two commands for export, depending on the desired output:
-;; `org-rss-export-as-rss' (temporary buffer) and `org-rss-export-to-rss'
-;; (as a ".xml" file).
-;;
-;; This backend understands two new option keywords:
-;;
-;; #+RSS_EXTENSION: xml
-;; #+RSS_IMAGE_URL: http://myblog.org/mypicture.jpg
-;;
-;; It uses #+HTML_LINK_HOME: to set the base url of the feed.
-;;
-;; Exporting an Org file to RSS modifies each top-level entry by adding a
-;; PUBDATE property.  If `org-rss-use-entry-url-as-guid', it will also add
-;; an ID property, later used as the guid for the feed's item.
-;;
-;; The top-level headline is used as the title of each RSS item unless
-;; an RSS_TITLE property is set on the headline.
-;;
-;; You typically want to use it within a publishing project like this:
-;;
-;; (add-to-list
-;;  'org-publish-project-alist
-;;  '("homepage_rss"
-;;    :base-directory "~/myhomepage/"
-;;    :base-extension "org"
-;;    :rss-image-url "http://lumiere.ens.fr/~guerry/images/faces/15.png"
-;;    :html-link-home "http://lumiere.ens.fr/~guerry/"
-;;    :html-link-use-abs-url t
-;;    :rss-extension "xml"
-;;    :publishing-directory "/home/guerry/public_html/"
-;;    :publishing-function (org-rss-publish-to-rss)
-;;    :section-numbers nil
-;;    :exclude ".*"            ;; To exclude all files...
-;;    :include ("index.org")   ;; ... except index.org.
-;;    :table-of-contents nil))
-;;
-;; ... then rsync /home/guerry/public_html/ with your server.
-;;
-;; By default, the permalink for a blog entry points to the headline.
-;; You can specify a different one by using the :RSS_PERMALINK:
-;; property within an entry.
-
-;;; Code:
-
-(require 'ox-html)
-(declare-function url-encode-url "url-util" (url))
-
-;;; Variables and options
-
-(defgroup org-export-rss nil
-  "Options specific to RSS export back-end."
-  :tag "Org RSS"
-  :group 'org-export
-  :version "24.4"
-  :package-version '(Org . "8.0"))
-
-(defcustom org-rss-image-url "http://orgmode.org/img/org-mode-unicorn-logo.png"
-  "The URL of the an image for the RSS feed."
-  :group 'org-export-rss
-  :type 'string)
-
-(defcustom org-rss-extension "xml"
-  "File extension for the RSS 2.0 feed."
-  :group 'org-export-rss
-  :type 'string)
-
-(defcustom org-rss-categories 'from-tags
-  "Where to extract items category information from.
-The default is to extract categories from the tags of the
-headlines.  When set to another value, extract the category
-from the :CATEGORY: property of the entry."
-  :group 'org-export-rss
-  :type '(choice
-	  (const :tag "From tags" from-tags)
-	  (const :tag "From the category property" from-category)))
-
-(defcustom org-rss-use-entry-url-as-guid t
-  "Use the URL for the <guid> metatag?
-When nil, Org will create ids using `org-icalendar-create-uid'."
-  :group 'org-export-rss
-  :type 'boolean)
-
-;;; Define backend
-
-(org-export-define-derived-backend 'rss 'html
-  :menu-entry
-  '(?r "Export to RSS"
-       ((?R "As RSS buffer"
-	    (lambda (a s v b) (org-rss-export-as-rss a s v)))
-	(?r "As RSS file" (lambda (a s v b) (org-rss-export-to-rss a s v)))
-	(?o "As RSS file and open"
-	    (lambda (a s v b)
-	      (if a (org-rss-export-to-rss t s v)
-		(org-open-file (org-rss-export-to-rss nil s v)))))))
-  :options-alist
-  '((:description "DESCRIPTION" nil nil newline)
-    (:keywords "KEYWORDS" nil nil space)
-    (:with-toc nil nil nil) ;; Never include HTML's toc
-    (:rss-extension "RSS_EXTENSION" nil org-rss-extension)
-    (:rss-image-url "RSS_IMAGE_URL" nil org-rss-image-url)
-    (:rss-categories nil nil org-rss-categories))
-  :filters-alist '((:filter-final-output . org-rss-final-function))
-  :translate-alist '((headline . org-rss-headline)
-		     (comment . (lambda (&rest args) ""))
-		     (comment-block . (lambda (&rest args) ""))
-		     (timestamp . (lambda (&rest args) ""))
-		     (plain-text . org-rss-plain-text)
-		     (section . org-rss-section)
-		     (template . org-rss-template)))
-
-;;; Export functions
-
-;;;###autoload
-(defun org-rss-export-as-rss (&optional async subtreep visible-only)
-  "Export current buffer to a RSS buffer.
-
-If narrowing is active in the current buffer, only export its
-narrowed part.
-
-If a region is active, export that region.
-
-A non-nil optional argument ASYNC means the process should happen
-asynchronously.  The resulting buffer should be accessible
-through the `org-export-stack' interface.
-
-When optional argument SUBTREEP is non-nil, export the sub-tree
-at point, extracting information from the headline properties
-first.
-
-When optional argument VISIBLE-ONLY is non-nil, don't export
-contents of hidden elements.
-
-Export is done in a buffer named \"*Org RSS Export*\", which will
-be displayed when `org-export-show-temporary-export-buffer' is
-non-nil."
-  (interactive)
-  (let ((file (buffer-file-name (buffer-base-buffer))))
-    (org-icalendar-create-uid file 'warn-user)
-    (org-rss-add-pubdate-property))
-  (org-export-to-buffer 'rss "*Org RSS Export*"
-    async subtreep visible-only nil nil (lambda () (text-mode))))
-
-;;;###autoload
-(defun org-rss-export-to-rss (&optional async subtreep visible-only)
-  "Export current buffer to a RSS file.
-
-If narrowing is active in the current buffer, only export its
-narrowed part.
-
-If a region is active, export that region.
-
-A non-nil optional argument ASYNC means the process should happen
-asynchronously.  The resulting file should be accessible through
-the `org-export-stack' interface.
-
-When optional argument SUBTREEP is non-nil, export the sub-tree
-at point, extracting information from the headline properties
-first.
-
-When optional argument VISIBLE-ONLY is non-nil, don't export
-contents of hidden elements.
-
-Return output file's name."
-  (interactive)
-  (let ((file (buffer-file-name (buffer-base-buffer))))
-    (org-icalendar-create-uid file 'warn-user)
-    (org-rss-add-pubdate-property))
-  (let ((outfile (org-export-output-file-name
-		  (concat "." org-rss-extension) subtreep)))
-    (org-export-to-file 'rss outfile async subtreep visible-only)))
-
-;;;###autoload
-(defun org-rss-publish-to-rss (plist filename pub-dir)
-  "Publish an org file to RSS.
-
-FILENAME is the filename of the Org file to be published.  PLIST
-is the property list for the given project.  PUB-DIR is the
-publishing directory.
-
-Return output file name."
-  (let ((bf (get-file-buffer filename)))
-    (if bf
-	  (with-current-buffer bf
-	    (org-icalendar-create-uid filename 'warn-user)
-	    (org-rss-add-pubdate-property)
-	    (write-file filename))
-      (find-file filename)
-      (org-icalendar-create-uid filename 'warn-user)
-      (org-rss-add-pubdate-property)
-      (write-file filename) (kill-buffer)))
-  (org-publish-org-to
-   'rss filename (concat "." org-rss-extension) plist pub-dir))
-
-;;; Main transcoding functions
-
-(defun org-rss-headline (headline contents info)
-  "Transcode HEADLINE element into RSS format.
-CONTENTS is the headline contents.  INFO is a plist used as a
-communication channel."
-  (unless (or (org-element-property :footnote-section-p headline)
-	      ;; Only consider first-level headlines
-	      (> (org-export-get-relative-level headline info) 1))
-    (let* ((author (and (plist-get info :with-author)
-			(let ((auth (plist-get info :author)))
-			  (and auth (org-export-data auth info)))))
-	   (htmlext (plist-get info :html-extension))
-	   (hl-number (org-export-get-headline-number headline info))
-	   (hl-home (file-name-as-directory (plist-get info :html-link-home)))
-	   (hl-pdir (plist-get info :publishing-directory))
-	   (hl-perm (org-element-property :RSS_PERMALINK headline))
-	   (anchor (org-export-get-reference headline info))
-	   (category (org-rss-plain-text
-		      (or (org-element-property :CATEGORY headline) "") info))
-	   (pubdate0 (org-element-property :PUBDATE headline))
-	   (pubdate (let ((system-time-locale "C"))
-		      (if pubdate0
-			  (format-time-string
-			   "%a, %d %b %Y %H:%M:%S %z"
-			   (org-time-string-to-time pubdate0)))))
-	   (title (or (org-element-property :RSS_TITLE headline)
-		      (replace-regexp-in-string
-		       org-bracket-link-regexp
-		       (lambda (m) (or (match-string 3 m)
-				  (match-string 1 m)))
-		       (org-element-property :raw-value headline))))
-	   (publink
-	    (or (and hl-perm (concat (or hl-home hl-pdir) hl-perm))
-		(concat
-		 (or hl-home hl-pdir)
-		 (file-name-nondirectory
-		  (file-name-sans-extension
-		   (plist-get info :input-file))) "." htmlext "#" anchor)))
-	   (guid (if org-rss-use-entry-url-as-guid
-		     publink
-		   (org-rss-plain-text
-		    (or (org-element-property :ID headline)
-			(org-element-property :CUSTOM_ID headline)
-			publink)
-		    info))))
-      (if (not pubdate0) "" ;; Skip entries with no PUBDATE prop
-	(format
-	 (concat
-	  "<item>\n"
-	  "<title>%s</title>\n"
-	  "<link>%s</link>\n"
-	  "<author>%s</author>\n"
-	  "<guid isPermaLink=\"false\">%s</guid>\n"
-	  "<pubDate>%s</pubDate>\n"
-	  (org-rss-build-categories headline info) "\n"
-	  "<description><![CDATA[%s]]></description>\n"
-	  "</item>\n")
-	 title publink author guid pubdate contents)))))
-
-(defun org-rss-build-categories (headline info)
-  "Build categories for the RSS item."
-  (if (eq (plist-get info :rss-categories) 'from-tags)
-      (mapconcat
-       (lambda (c) (format "<category><![CDATA[%s]]></category>" c))
-       (org-element-property :tags headline)
-       "\n")
-    (let ((c (org-element-property :CATEGORY headline)))
-      (format "<category><![CDATA[%s]]></category>" c))))
-
-(defun org-rss-template (contents info)
-  "Return complete document string after RSS conversion.
-CONTENTS is the transcoded contents string.  INFO is a plist used
-as a communication channel."
-  (concat
-   (format "<?xml version=\"1.0\" encoding=\"%s\"?>"
-	   (symbol-name org-html-coding-system))
-   "\n<rss version=\"2.0\"
-	xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"
-	xmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"
-	xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
-	xmlns:atom=\"http://www.w3.org/2005/Atom\"
-	xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"
-	xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"
-	xmlns:georss=\"http://www.georss.org/georss\"
-        xmlns:geo=\"http://www.w3.org/2003/01/geo/wgs84_pos#\"
-        xmlns:media=\"http://search.yahoo.com/mrss/\">"
-   "<channel>"
-   (org-rss-build-channel-info info) "\n"
-   contents
-   "</channel>\n"
-   "</rss>"))
-
-(defun org-rss-build-channel-info (info)
-  "Build the RSS channel information."
-  (let* ((system-time-locale "C")
-	 (title (plist-get info :title))
-	 (email (org-export-data (plist-get info :email) info))
-	 (author (and (plist-get info :with-author)
-		      (let ((auth (plist-get info :author)))
-			(and auth (org-export-data auth info)))))
-	 (date (format-time-string "%a, %d %b %Y %H:%M:%S %z")) ;; RFC 882
-	 (description (org-export-data (plist-get info :description) info))
-	 (lang (plist-get info :language))
-	 (keywords (plist-get info :keywords))
-	 (rssext (plist-get info :rss-extension))
-	 (blogurl (or (plist-get info :html-link-home)
-		      (plist-get info :publishing-directory)))
-	 (image (url-encode-url (plist-get info :rss-image-url)))
-	 (ifile (plist-get info :input-file))
-	 (publink
-	  (concat (file-name-as-directory blogurl)
-		  (file-name-nondirectory
-		   (file-name-sans-extension ifile))
-		  "." rssext)))
-    (format
-     "\n<title>%s</title>
-<atom:link href=\"%s\" rel=\"self\" type=\"application/rss+xml\" />
-<link>%s</link>
-<description><![CDATA[%s]]></description>
-<language>%s</language>
-<pubDate>%s</pubDate>
-<lastBuildDate>%s</lastBuildDate>
-<generator>%s</generator>
-<webMaster>%s (%s)</webMaster>
-<image>
-<url>%s</url>
-<title>%s</title>
-<link>%s</link>
-</image>
-"
-     title publink blogurl description lang date date
-     (concat (format "Emacs %d.%d"
-		     emacs-major-version
-		     emacs-minor-version)
-	     " Org-mode " (org-version))
-     email author image title blogurl)))
-
-(defun org-rss-section (section contents info)
-  "Transcode SECTION element into RSS format.
-CONTENTS is the section contents.  INFO is a plist used as
-a communication channel."
-  contents)
-
-(defun org-rss-timestamp (timestamp contents info)
-  "Transcode a TIMESTAMP object from Org to RSS.
-CONTENTS is nil.  INFO is a plist holding contextual
-information."
-  (org-html-encode-plain-text
-   (org-timestamp-translate timestamp)))
-
-(defun org-rss-plain-text (contents info)
-  "Convert plain text into RSS encoded text."
-  (let (output)
-    (setq output (org-html-encode-plain-text contents)
-	  output (org-export-activate-smart-quotes
-		  output :html info))))
-
-;;; Filters
-
-(defun org-rss-final-function (contents backend info)
-  "Prettify the RSS output."
-  (with-temp-buffer
-    (xml-mode)
-    (insert contents)
-    (indent-region (point-min) (point-max))
-    (buffer-substring-no-properties (point-min) (point-max))))
-
-;;; Miscellaneous
-
-(defun org-rss-add-pubdate-property ()
-  "Set the PUBDATE property for top-level headlines."
-  (let (msg)
-    (org-map-entries
-     (lambda ()
-       (let* ((entry (org-element-at-point))
-	      (level (org-element-property :level entry)))
-	 (when (= level 1)
-	   (unless (org-entry-get (point) "PUBDATE")
-	     (setq msg t)
-	     (org-set-property
-	      "PUBDATE" (format-time-string
-			 (cdr org-time-stamp-formats)))))))
-     nil nil 'comment 'archive)
-    (when msg
-      (message "Property PUBDATE added to top-level entries in %s"
-	       (buffer-file-name))
-      (sit-for 2))))
-
-(provide 'ox-rss)
-
-;;; ox-rss.el ends here
dots/.config/emacs/old/lisp/paste-sbr.el
@@ -1,72 +0,0 @@
-;;; paste-sbr.el --- Paste to sbr.pm -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020 Vincent Demeester
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; Keywords: org link github
-;;
-;; This file is not part of GNU Emacs.
-
-;; This program 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 3.0, or
-;; (at your option) any later version.
-
-;; This program 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 this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; Take selection and share it to paste.sbr.pm
-
-;;; Code:
-
-(defvar htmlize-paste-it-target-directory
-  "desktop/sites/paste.sbr.pm")
-(defvar htmlize-paste-it-base-url
-  "https://paste.sbr.pm/")
-
-(defun htmlize-paste-it ()
-  "Htmlize region-or-buffer and copy to directory."
-  (interactive)
-  (let* ((start (if (region-active-p)
-                    (region-beginning) (point-min)))
-         (end (if (region-active-p)
-                  (region-end) (point-max)))
-
-         ;; We use a basename-hash.ext.html format
-         (basename (file-name-base (buffer-name)))
-         (extension (file-name-extension (buffer-name)))
-         (hash (sha1 (current-buffer) start end))
-         (file-name (concat basename
-                            "-" (substring hash 0 6)
-                            "." extension
-                            ".html"))
-
-         (new-file (expand-file-name (concat
-                                      htmlize-paste-it-target-directory
-                                      "/"
-                                      file-name) "~"))
-
-         (access-url (concat
-                      htmlize-paste-it-base-url
-                      file-name)))
-    ;; Region messes with clipboard, so deactivate it
-    (deactivate-mark)
-    (with-current-buffer (htmlize-region start end)
-      ;; Copy htmlized contents to target
-      (write-file new-file)
-      ;; Ensure target can be accessed by web server
-      (chmod new-file #o755))
-    ;; Put URL into clipboard
-    (kill-new access-url)))
-
-(provide 'paste-sbr)
-;;; paste-sbr.el ends here
dots/.config/emacs/old/lisp/portal.el
@@ -1,644 +0,0 @@
-;;; portal.el --- Run processes in portals
-;;
-;; Copyright (C) 2024 Chris Done
-;;
-;; 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.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Customizations
-
-(defgroup portal nil
-  "Portal group."
-  :group 'convenience)
-
-(defcustom portal-outputs-directory
-  "~/.local/share/portals/"
-  "Directory where to create output artifacts."
-  :type 'string :group 'portal)
-
-(defcustom portal-default-stdout-buffer-len
-  4096
-  "Default buffer length for the stdout preview."
-  :group 'portal :type 'number)
-
-(defcustom portal-default-stderr-buffer-len
-  4096
-  "Default buffer length for the stderr preview."
-  :group 'portal :type 'number)
-
-(defface portal-face
-  '((((class color) (background dark))
-     (:foreground "#fff" :bold t))
-    (((class color) (background light))
-     (:foreground "#000" :bold t)))
-  "Portal face."
-  :group 'portal)
-
-(defface portal-exited-stdout-face
-  '((t :foreground "#acac9e"))
-  "Portal exited stdout face."
-  :group 'portal)
-
-(defface portal-timestamp-face
-  '((t :foreground "#888888"))
-  "Portal exited stdout face."
-  :group 'portal)
-
-(defface portal-exited-stderr-face
-  '((t :foreground "#aa7070"))
-  "Portal exited stderr face."
-  :group 'portal)
-
-(defface portal-exit-success-face
-  '((t :foreground "#89b664"))
-  "Portal exit successful face."
-  :group 'portal)
-
-(defface portal-exit-failure-face
-  '((t :foreground "#ae6161"))
-  "Portal exit failure face."
-  :group 'portal)
-
-(defface portal-meta-face
-  '((t :foreground "#89b664"))
-  "Portal meta face."
-  :group 'portal)
-
-(defface portal-stdout-face
-  '((t :inherit 'default))
-  "Portal stdout face."
-  :group 'portal)
-
-(defface portal-stderr-face
-  '((t :foreground "#ae6161"))
-  "Portal stderr face."
-  :group 'portal)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Interactive commands
-
-(defun portal-insert-shell-command (command)
-  "Launch an asynchronous shell of COMMAND, make a portal associated
-with the current buffer and insert the portal into the current
-buffer."
-  (interactive "sCommand: ")
-  (portal-insert-command
-   (list shell-file-name shell-command-switch command)))
-
-(defun portal-open-stdout ()
-  "Open the stdout of the file at point."
-  (interactive)
-  (with-current-buffer (find-file-other-window (portal-file-name (portal-at-point) "stdout"))
-    (portal-ansi-colors-minor-mode)
-    (auto-revert-tail-mode)
-    (goto-char (point-max))
-    (push-mark (point-max))))
-
-(defun portal-open-stderr ()
-  "Open the stderr of the file at point."
-  (interactive)
-  (with-current-buffer (find-file-other-window (portal-file-name (portal-at-point) "stderr"))
-    (portal-ansi-colors-minor-mode)
-    (auto-revert-tail-mode)
-    (goto-char (point-max))
-    (push-mark (point-max))))
-
-(defun portal-interrupt ()
-  "Interrupt the process at point."
-  (interactive)
-  (let ((proc (get-process (portal-process-name (portal-at-point)))))
-    (when (process-live-p proc)
-      (interrupt-process proc))))
-
-(defun portal-rerun ()
-  "Re-run portal at point."
-  (interactive)
-  (portal-jump-to-portal)
-  (let* ((portal (portal-at-point))
-         (command (portal-read-json-file portal "command"))
-         (env (portal-read-json-file portal "env"))
-         (default-directory (portal-read-json-file portal "directory")))
-    (portal-interrupt)
-    (delete-region (line-beginning-position) (line-end-position))
-    (portal-wipe-summary)
-    (portal-insert-command (append command nil))
-    (portal-refresh-soon)))
-
-(defun portal-edit ()
-  "Edit and re-run portal at point."
-  (interactive)
-  (portal-jump-to-portal)
-  (portal-interrupt)
-  (let* ((portal (portal-at-point))
-         (command
-          (vector
-           shell-file-name
-           shell-command-switch
-           (read-from-minibuffer
-            "Edit command: "
-            (portal-as-shell-command (portal-read-json-file portal "command")))))
-         (env (portal-read-json-file portal "env"))
-         (default-directory (portal-read-json-file portal "directory")))
-    (delete-region (line-beginning-position) (line-end-position))
-    (portal-wipe-summary)
-    (portal-insert-command (append command nil))
-    (portal-refresh-soon)))
-
-(defun portal-clone ()
-  "Clone the portal at point."
-  (interactive)
-  (portal-jump-to-portal)
-  (let* ((portal (portal-at-point))
-         (command (portal-read-json-file portal "command"))
-         (env (portal-read-json-file portal "env"))
-         (default-directory (portal-read-json-file portal "directory")))
-    (save-excursion (insert "\n"))
-    (portal-insert-command (append  command nil))
-    (portal-refresh-soon)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Launching processes
-
-(defun portal-start (buffer portal stdout-path stderr-path program program-args)
-  "Run PROGRAM-PATH with ARGS, connect it to portal PORTAL in buffer
-BUFFER, and write the stdout to STDOUT-PATH and stderr to
-STDERR-PATH."
-  (let* ((stderr-pipe
-          (make-pipe-process
-           :name (portal-stderr-process-name portal)
-           :buffer buffer
-           :noquery t
-           :filter 'portal-process-filter
-           :sentinel 'portal-stderr-pipe-sentinel))
-         (main-process
-          (make-process
-           :name (portal-process-name portal)
-           :buffer buffer
-           :command (cons program program-args)
-           :noquery nil
-           :connection-type 'pipe
-           :sentinel 'portal-main-process-sentinel
-           :filter 'portal-process-filter
-           :stderr stderr-pipe)))
-
-    (process-put stderr-pipe :portal portal)
-    (process-put stderr-pipe :output-path stderr-path)
-    (process-put stderr-pipe :buffer "")
-    (process-put stderr-pipe :buffer-len portal-default-stderr-buffer-len)
-
-    (process-put main-process :portal portal)
-    (process-put main-process :output-path stdout-path)
-    (process-put main-process :buffer "")
-    (process-put main-process :buffer-len portal-default-stdout-buffer-len)
-
-    ;; Connect the two processes.
-    (process-put main-process :stderr-process stderr-pipe)
-
-    (portal-write-json-file portal "command" (apply #'vector (cons program program-args)))
-    (portal-write-json-file portal "env" (apply #'vector process-environment))
-    (portal-write-json-file portal "directory" default-directory)
-    (portal-write-json-file portal "status" (format "%S" (process-status main-process)))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Process filtering
-
-(defun portal-process-filter (process output)
-  (let ((filepath (process-get process :output-path)))
-    (when debug-on-error
-      (message "portal-process-filter: Writing to %s" filepath))
-    (portal-accumulate-buffer process output)
-    (with-temp-buffer
-      (insert output)
-      (write-region (point-min) (point-max) filepath :append :no-messages))))
-
-(defun portal-accumulate-buffer (process output)
-  "Accumulate some OUTPUT into PROCESS's preview buffer."
-  (process-put
-   process
-   :buffer (portal-shrink-preview
-            (process-get process :buffer-len)
-            (concat (process-get process :buffer) output))))
-
-(defun portal-shrink-preview (len string)
-  "Shrink a preview buffer STRING to the right length."
-  (if (> (length string) len)
-      (substring string (- len))
-    string))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Sentinels
-
-(defun portal-main-process-sentinel (process event)
-  "Handles the main process's status updates."
-  (when debug-on-error
-    (message "main-process-sentinel: %S: %S" process event))
-  (portal-write-json-file
-   (process-get process :portal)
-   "status" (format "%S" (process-exit-status process))))
-
-(defun portal-stderr-pipe-sentinel (process event)
-  "Handles the stderr pipe's status updates."
-  (when debug-on-error
-    (message "stderr-pipe-sentinel: %S: %S" process event)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; File/directory operations
-
-(defun portal-ensure-directory (portal)
-  "Create the stdout/stderr files for PORTAL in an appropriate
-location."
-  (let ((directory (concat (file-name-as-directory portal-outputs-directory) portal)))
-    (make-directory directory :including-parents)
-    directory))
-
-(defun portal-directory-exists-p (portal)
-  "Check PORTAL has a directory that exists."
-  (let ((directory (concat (file-name-as-directory portal-outputs-directory) portal)))
-    (file-exists-p directory)))
-
-(defun portal-file-exists-p (portal name)
-  "Check PORTAL has a file NAME that exists."
-  (let ((directory (concat (file-name-as-directory portal-outputs-directory) portal)))
-    (file-exists-p (concat (file-name-as-directory directory) name))))
-
-(defun portal-persist-file (portal name content)
-  "Persist CONTENT to disk with filename NAME."
-  (with-temp-buffer
-    (insert content)
-    (write-region
-     (point-min) (point-max)
-     (portal-file-name portal name)
-     nil ; no-append
-     :no-messages))
-  content)
-
-(defun portal-write-json-file (portal name expr)
-  "Print EXPR to disk with filename NAME."
-  (with-temp-buffer
-    (insert (json-serialize expr))
-    (write-region
-     (point-min) (point-max)
-     (portal-file-name portal name)
-     nil ; no-append
-     :no-messages))
-  expr)
-
-(defun portal-read-json-file (portal name)
-  "Read JSON content from file NAME for the given PORTAL."
-  (with-temp-buffer
-    (insert-file-contents (portal-file-name portal name))
-    (json-parse-string (buffer-string))))
-
-(defun portal-read-file (portal name)
-  "Read content from file NAME for the given PORTAL."
-  (with-temp-buffer
-    (let ((file (portal-file-name portal name)))
-      (when (file-exists-p file)
-        (insert-file-contents file)))
-    (buffer-string)))
-
-(defun portal-tail-file (portal n name)
-  "Tail last N lines of file NAME for the given PORTAL."
-  (with-temp-buffer
-    (let ((file (portal-file-name portal name)))
-      (if (file-exists-p file)
-          (portal-tail-n-lines n file)
-        ""))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Nano-IDs
-
-(defun portal-generate-nanoid ()
-  "Generate a Nano ID of the form `portal_NGMyMDVkZjZiYTVlZTVhM' using SHA-1."
-  (let* ((random-string (format "%s%s%S" (emacs-pid) (current-time-string) (random)))
-         (sha1-hash (secure-hash 'sha1 random-string))
-         (base64-encoded (base64-encode-string sha1-hash))
-         (nanoid (string-trim-right (substring base64-encoded 0 21))))
-    (concat "portal_" nanoid)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; A minor mode for applying ansi-term colors to a buffer
-
-(define-minor-mode portal-ansi-colors-minor-mode
-  "Apply ANSI colors for terminal outputs."
-  :init-value nil
-  :lighter "ANSI"
-  (ansi-color-apply-on-region (point-min) (point-max)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; A small minor mode that just sets up a timer that runs a thing in a
-;; given buffer every N seconds
-
-(defvar-local portal-alpha-timer
-    nil)
-
-(define-minor-mode portal-alpha-minor-mode
-  "TODO"
-  :init-value nil
-  :lighter "@"
-  (when portal-alpha-timer (cancel-timer portal-alpha-timer))
-  (when portal-alpha-minor-mode
-    (setq portal-alpha-timer
-          (run-with-timer 1 2 'portal-beta-refresh (current-buffer)))))
-
-(defun portal-refresh-soon ()
-  "Trigger a refresh within the blink of an eye, but no sooner, or
-later."
-  (run-with-timer 0.100 nil 'portal-beta-refresh (current-buffer)))
-
-(defun portal-beta-refresh (buffer)
-  "Refresh portal displays."
-  (when (buffer-live-p buffer)
-    (let ((window (get-buffer-window buffer)))
-      (when window
-        (with-current-buffer buffer
-          (let ((point (point)))
-            (save-excursion
-              (goto-char (point-min))
-              (while (and (re-search-forward portal-regexp nil t nil)
-                          (<= (point) (window-end window)))
-                (when (<= (window-start window) (point) (window-end window))
-                  (let* ((portal (match-string 0))
-                         (process (get-process (portal-process-name portal)))
-                         (summary (if (portal-directory-exists-p portal)
-                                      (portal-summary portal process)
-                                    "# Invalid portal."))
-                         (match-end (match-end 0))
-                         (old-summary (get-text-property (line-beginning-position) 'portal-summary)))
-                    (unless (and old-summary (string= summary old-summary))
-                      (put-text-property (line-beginning-position) (point)
-                                         'portal-summary
-                                         summary)
-                      (put-text-property (line-beginning-position) (point)
-                                         'portal
-                                         portal)
-                      (portal-wipe-summary)
-                      (insert "\n" summary))))))
-            (goto-char point)))))))
-
-(defun portal-wipe-summary ()
-  "Wipe the '# summary' lines that follow the portal."
-  (save-excursion
-    (when (looking-at "\n#")
-      (forward-line 1)
-      (let ((point (point)))
-        (or (search-forward-regexp "^[^#]" nil t 1)
-            (goto-char (point-max)))
-        (delete-matching-lines "^#" point (point))))))
-
-(defun portal-summary (portal process)
-  "Generate a summary of the portal."
-  (let* ((command (portal-read-json-file portal "command"))
-         (directory (portal-read-json-file portal "directory"))
-         (status (portal-read-json-file portal "status"))
-         (stdout (if process
-                     (portal-last-n-lines
-                      5
-                      (process-get process :buffer))
-                   (portal-tail-file portal 5 "stdout")))
-         (stderr (if process
-                     (portal-last-n-lines
-                      5
-                      (process-get (process-get process :stderr-process) :buffer))
-                   (portal-tail-file portal 5 "stderr")))
-         (started-time
-          (file-attribute-modification-time (file-attributes (portal-file-name portal "command"))))
-         (exited-time
-          (file-attribute-modification-time (file-attributes (portal-file-name portal "status")))))
-    (with-temp-buffer
-      (insert (propertize
-               (concat "# (" (if (string= status "run") "🌀" status) ") " (portal-as-shell-command command))
-               'face
-               (if (string= status "run")
-                   'portal-meta-face
-                 (if (string= status "0")
-                     'portal-exit-success-face
-                   'portal-exit-failure-face))))
-      (insert "\n"
-              (concat
-               (propertize (format-time-string "# Started: %Y-%m-%d %T" started-time)
-                           'face 'portal-timestamp-face)
-               (if (string= status "run")
-                   ""
-                 (propertize (concat
-                              (format-time-string ", exited: %Y-%m-%d %T" exited-time)
-                              " => "
-                              (portal-display-time-difference started-time exited-time))
-                             'face 'portal-timestamp-face))))
-      ;; Only show if it's different to the current directory,
-      ;; otherwise it's noise.
-      (unless (string= default-directory directory) (insert "\n# " directory))
-      (unless (= 0 (length (string-trim stdout)))
-        (insert "\n"
-                (propertize (portal-clean-output stdout)
-                            'face (if (string= status "run")
-                                      'portal-stdout-face
-                                    'portal-exited-stdout-face))))
-      (unless (= 0 (length (string-trim stderr)))
-        (insert "\n"
-                (propertize (portal-clean-output stderr)
-                            'face
-                            (if (string= status "run")
-                                'portal-stderr-face
-                              'portal-exited-stderr-face))))
-      (propertize (buffer-string)
-                  'portal portal))))
-
-(defun portal-display-time-difference (start-time end-time)
-  "Display the time difference between START-TIME and END-TIME in human-readable format.
-START-TIME and END-TIME should be Emacs Lisp time values as returned by `current-time'.
-The function will display the time in the most appropriate unit (from ns to days)."
-  (let* ((diff (float-time (time-subtract end-time start-time))))
-    (apply #'format
-           (cons "%.3f %s"
-                 (cond
-                  ((< diff 1e-6)
-                   (list (* diff 1e9) "ns"))
-                  ((< diff 1e-3)
-                   (list (* diff 1e6) "us"))
-                  ((< diff 1)
-                   (list (* diff 1e3) "ms"))
-                  ((< diff 60)
-                   (list diff "s"))
-                  ((< diff 3600)
-                   (list (/ diff 60) "mins"))
-                  ((< diff 86400)
-                   (list (/ diff 3600) "hours"))
-                  (t
-                   (list (/ diff 86400) "days")))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; String generation
-
-(defun portal-as-shell-command (command)
-  "If the vector COMMAND is a shell run, strip the prefix, else return the whole thing joined."
-  (if (and (= 3 (length command))
-           (string= (elt command 0) shell-file-name)
-           (string= (elt command 1) shell-command-switch))
-      (elt command 2)
-    (mapconcat 'shell-quote-argument command " ")))
-
-(defun portal-clean-output (output)
-  "Clean output for previewing, prefixed with #."
-  (portal-limit-lines-to-80-columns
-   (concat "# " (replace-regexp-in-string
-                 "\n" "\n# "
-                 (portal-no-empty-lines output)))))
-
-(defun portal-limit-lines-to-80-columns (string)
-  "Limit all lines in STRING to 80 columns."
-  (with-temp-buffer
-    (insert string)
-    (goto-char (point-min))
-    (while (not (eobp))
-      (move-to-column 80 t)
-      (delete-region (point) (line-end-position))
-      (forward-line))
-    (buffer-string)))
-
-(defun portal-process-name (portal)
-  (concat portal "-main-process"))
-
-(defun portal-stderr-process-name (portal)
-  (concat portal "-stderr-pipe"))
-
-(defun portal-file-name (portal name)
-  (concat (file-name-as-directory (portal-ensure-directory portal)) name))
-
-(defun portal-no-empty-lines (string)
-  "Drop empty lines from a string."
-  (replace-regexp-in-string
-   ;; Drop ANSI codes from terminal output
-   ;; <https://superuser.com/questions/380772/removing-ansi-color-codes-from-text-stream>
-   "\\(\x1B\\[[0-9;]*[A-Za-z]\\|[\x00-\x09\x0B-\x1F\x7F]\\|\n$\\|^\n\\)"
-   ""
-   string))
-
-(defun portal-last-n-lines (n string)
-  "Take last N lines from STRING."
-  (mapconcat #'identity (reverse (seq-take (reverse (split-string string "[\r\n]+" t)) n)) "\n"))
-
-(defun portal-tail-n-lines (n file-path)
-  "Tail the last N lines from FILE-PATH using tail, if possible. If
-not possible (due to lack of such tool), return nil."
-  (let ((this-buffer (current-buffer)))
-    (with-temp-buffer
-      (let ((out-buffer (current-buffer)))
-        (with-current-buffer this-buffer
-          (cl-case (call-process "tail" nil out-buffer nil "-n" (format "%d" n)
-                                 (expand-file-name file-path))
-            (0 (with-current-buffer out-buffer (buffer-string)))
-            (t "")))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Finding portals and gathering information for them
-
-(defconst portal-regexp "\\<portal_[A-Za-z0-9]\\{21\\}\\>"
-  "Match on a portal's unique ID.")
-
-(defun portal-at-point ()
-  "Return the portal at point."
-  (or (save-excursion
-        (goto-char (line-beginning-position))
-        (when (looking-at portal-regexp)
-          (buffer-substring (match-beginning 0) (match-end 0))))
-      (get-text-property (point) 'portal)
-      (error "Not at a portal.")))
-
-(defun portal-jump-to-portal ()
-  "If there's a portal at point or a summary of a portal at point,
-jump to the portal at the beginning of the line upwards within
-the same paragraph."
-  (let ((portal (portal-at-point)))
-    (goto-char
-     (save-excursion
-       (goto-char (line-end-position))
-       (re-search-backward
-        (concat "^" (regexp-quote portal))
-        (save-excursion (forward-paragraph -1))
-        nil
-        1)))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Notes
-
-;; Use this on a portals buffer to stop it constantly being saved:
-;
-;; (setq buffer-save-without-query t)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Major mode
-
-(defvar-keymap portal-mode-map
-  "M-!" 'portal-dwim-execute
-  "C-c C-c" 'portal-interrupt
-  "RET" 'portal-jump-to-thing-at-point
-  "M-p" 'portal-rerun
-  )
-
-(define-derived-mode portal-mode
-  fundamental-mode "Portals"
-  "Major mode for portals."
-  (setq buffer-save-without-query t)
-  (portal-alpha-minor-mode))
-
-(defun portal-insert-command (command)
-  "Launch an asynchronous proc of COMMAND, make a portal associated
-with the current buffer and insert the portal into the current
-buffer."
-  (let* ((portal (portal-generate-nanoid)))
-    (portal-start
-     (current-buffer)
-     portal
-     (portal-file-name portal "stdout")
-     (portal-file-name portal "stderr")
-     (car command)
-     (cdr command))
-    (insert portal)))
-
-(defun portal-dwim-execute ()
-  (interactive)
-  (call-interactively
-   (if (condition-case nil
-           (portal-at-point)
-         (error nil))
-       'portal-edit
-     'portal-shell-command)))
-
-(defun portal-shell-command (command)
-  "Run a shell command and insert it at point."
-  (interactive "sCommand: ")
-  (portal-insert-command
-   (list shell-file-name shell-command-switch command)))
-
-(defun portal-jump-to-thing-at-point ()
-  "Jump to the thing at point, i.e. an stdout/stderr output jumps to
-the file."
-  (interactive)
-  (let ((face (get-text-property (point) 'face)))
-    (cond
-     ((eq face 'portal-stderr-face)
-      (portal-open-stderr))
-     ((eq face 'portal-exited-stderr-face)
-      (portal-open-stderr))
-     ((eq face 'portal-stdout-face)
-      (portal-open-stdout))
-     ((eq face 'portal-exited-stdout-face)
-      (portal-open-stdout))
-     (t (call-interactively 'newline)))))
-
-(provide 'portal)
-
dots/.config/emacs/old/lisp/project-func.el
@@ -1,150 +0,0 @@
-;;; project-func.el --- -*- lexical-binding: t -*-
-;;; Commentary:
-;;; Code:
-(require 'project)
-(require 'vterm)
-(require 'json)
-(require 'vc)
-
-(defun in-git-repo-p ()
-  "Check if current directory is in a git repository."
-  (eq (vc-backend (or buffer-file-name default-directory))
-      'Git))
-
-(defun is-github-repo-p ()
-  "Check if current git repository has a GitHub remote."
-  (when (in-git-repo-p)
-    (string-match-p "github\\.com"
-                    (shell-command-to-string "git remote -v"))))
-
-(defun fetch-github-prs ()
-  "Fetch GitHub PRs synchronously."
-  (let* ((output (shell-command-to-string "gh pr list --limit=5000 --json number,title,author,url,baseRefName,labels"))
-         (prs (json-read-from-string output)))
-    prs))
-
-(defun format-pr-candidates (prs)
-  "Format PR data into candidates for completion."
-  (mapcar (lambda (pr)
-            (let-alist pr
-              (cons (format "#%d %s (by @%s) on %s" .number .title .author.login .baseRefName)
-                    .number)))
-          prs))
-
-;;;###autoload
-(defun checkout-github-pr ()
-  "Interactive function to select and checkout a GitHub PR."
-  (interactive)
-  (cond
-   ((not (in-git-repo-p))
-    (message "Not in a Git repository"))
-   ((not (is-github-repo-p))
-    (message "Not a GitHub repository"))
-   (t
-    (let* ((prs (fetch-github-prs))
-           (candidates (format-pr-candidates prs))
-           (selected (if candidates
-                         (cdr (assoc (completing-read "Checkout PR: " candidates)
-                                     candidates))
-                       nil)))
-      (if selected
-          (shell-command (format "gh pr checkout %d" selected))
-        (message "No pull requests found"))))))
-
-;;;###autoload
-(defun vde-project--project-current ()
-  "Return directory from `project-current' based on Emacs version."
-  (if (>= emacs-major-version 29)
-      (project-root (project-current))
-    (cdr (project-current))))
-
-;;;###autoload
-(defun vde-project--project-root-or-default-directory ()
-  "Return path to the project root *or* the default-directory."
-  (cond
-   ((and (featurep 'project) (project-current))
-    (project-root (project-current)))
-   (t default-directory)))
-
-;;;##autoload
-(defun vde/project-run-in-vterm (command &optional directory)
-  "Run the given `COMMAND' in a new vterm buffer in `project-root' or the
-given `DIRECTORY'.
-
-This is similar to `compile' but with vterm.
-One reason for this is to be able to run commands that needs a TTY."
-  (interactive "sCommand: ")
-  (let* ((cwd (or directory (vde-project--project-root-or-default-directory)))
-	 (default-directory cwd)
-	 (buffer-name (format "*vterm %s: %s*" cwd command))
-         (buffer (get-buffer buffer-name))
-         (vterm-kill-buffer-on-exit nil)
-	 (vterm-shell (concat "bash -c '" command ";exit'")))
-    (when buffer
-      (kill-buffer buffer))
-    (let ((buffer (generate-new-buffer buffer-name)))
-      (pop-to-buffer buffer)
-      (with-current-buffer buffer
-        (vterm-mode)))))
-
-;;;###autoload
-(defun vde/open-readme ()
-  "Open a README file in the current project.
-It will search for README.org, README.md or README in that order"
-  (interactive)
-  (let* ((default-directory (vde-project--project-current)))
-    (cond ((file-exists-p (expand-file-name "README.org" default-directory))
-	   (find-file "README.org"))
-	  ((file-exists-p (expand-file-name "README.md" default-directory))
-	   (find-file "README.md"))
-	  ((file-exists-p (expand-file-name "README" default-directory))
-	   (find-file "README")))))
-
-;;;###autoload
-(defun vde/project-try-local (dir)
-  "Determine if DIR is a non-VC project."
-  (if-let ((root (if (listp vde/project-local-identifier)
-                     (seq-some (lambda (n)
-                                 (locate-dominating-file dir n))
-                               vde/project-local-identifier)
-                   (locate-dominating-file dir vde/project-local-identifier))))
-      (cons 'local root)))
-
-;;;###autoload
-(defun vde/project-vterm (&optional command)
-  "Run `vterm' on project.
-If a buffer already exists for running a vterm shell in the project's root,
-switch to it. Otherwise, create a new vterm shell."
-  (interactive)
-  (let* ((default-directory (vde-project--project-current))
-         (default-project-vterm-name (project-prefixed-buffer-name "vterm"))
-         (vterm-buffer (get-buffer default-project-vterm-name)))
-    (if (and vterm-buffer (not current-prefix-arg))
-        (pop-to-buffer-same-window vterm-buffer)
-      (let* ((cd-cmd (concat " cd " (shell-quote-argument default-directory))))
-        (vterm default-project-vterm-name)
-        (with-current-buffer vterm-buffer
-          (vterm-send-string cd-cmd)
-          (vterm-send-return))))
-    (when command
-      (vterm-send-string command)
-      (vterm-send-return))))
-
-;;;###autoload
-(defun vde/project-eat ()
-  "Run Eat term in the current project's root directory.
-If a buffer already exists for running Eshell in the project's root,
-switch to it.  Otherwise, create a new Eshell buffer.
-With \\[universal-argument] prefix arg, create a new Eshell buffer even
-if one already exists."
-  (interactive)
-  (defvar eat-buffer-name)
-  (let* ((default-directory (project-root (project-current t)))
-	 (eat-buffer-name (project-prefixed-buffer-name "eat"))
-	 (eat-buffer (get-buffer eat-buffer-name)))
-    (if (and eat-buffer (not current-prefix-arg))
-	(pop-to-buffer eat-buffer (bound-and-true-p display-comint-buffer-action))
-      (eat shell-file-name))))
-
-(provide 'project-func)
-;;; project-func.el ends here
dots/.config/emacs/old/lisp/project-headerline.el
@@ -1,920 +0,0 @@
-;;; project-headerline.el --- Customizable project headerline -*- lexical-binding: t -*-
-
-;; Copyright (C) 2025 Victor Gaydov and contributors
-;; Copyright (C) 2020 emacs-lsp maintainers
-
-;; Author: Victor Gaydov <victor@enise.org>
-;; Created: 03 Feb 2025
-;; URL: https://github.com/gavv/project-headerline
-;; Version: 0.4
-;; Package-Requires: ((emacs "28.2") (f "0.21.0") (s "1.13.0") (all-the-icons "5.0.0"))
-;; Keywords: convenience
-
-;;; License:
-
-;; This program 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 3 of the License, or
-;; (at your option) any later version.
-
-;; This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
-
-;;; Notice:
-
-;; Several functions were ported from lsp-headerline.el, so the copyrights
-;; includes one from that module.
-
-;;; Commentary:
-
-;; project-headerline implements a minor mode that shows a headerline with
-;; current project name, and the path to current buffer from the project root.
-
-;; It is inspired by lsp-headerline, but it doesn't show symbol and diagnostic
-;; information, has no dependency on lsp, and can be used for buffers of any kind.
-
-;; Please refer to README.org and docstrings for further details.
-
-;;; Code:
-
-(require 'dired-aux)
-(require 'project)
-(require 'seq)
-(require 'vc)
-
-(require 'projectile nil 'noerror)
-(require 'magit nil 'noerror)
-(require 'all-the-icons nil 'noerror)
-
-(require 'f)
-(require 's)
-
-(defgroup project-headerline nil
-  "Customizable project headerline."
-  :prefix "project-headerline-"
-  :group 'convenience
-  :link '(url-link "https://github.com/gavv/project-headerline"))
-
-(defface project-headerline-project-name
-  '((t :inherit font-lock-string-face :weight bold))
-  "Face used for \\='project-name segment."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline)
-
-(defface project-headerline-path-in-project
-  '((t :inherit font-lock-keyword-face))
-  "Face used for \\='path-in-project segment."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline)
-
-(defface project-headerline-buffer-name
-  '((t :inherit font-lock-builtin-face))
-  "Face used for \\='buffer-name segment."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline)
-
-(defface project-headerline-segment-separator
-  '((t :inherit shadow :height 0.8))
-  "Face used for separator between segments."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline)
-
-(defface project-headerline-path-separator
-  '((t :inherit shadow :height 0.8))
-  "Face used for between path components inside `path-in-project' segment."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline)
-
-(defface project-headerline-space
-  '((t :height 0.5))
-  "Face used for spaces around segment and path separators."
-  :package-version '(project-headerline . "0.2")
-  :group 'project-headerline)
-
-(defcustom project-headerline-display-segments
-  '(
-    ;; list of pre-defined symbols, each symbol corresponds to a segment
-    project-name
-    path-in-project
-    buffer-name
-    ;;
-    )
-  "Which segments to show and in what order.
-
-Must be a list of symbols, where each symbol represents a segment:
-
-  - `project-name' - name of project where current file belongs
-  - `path-in-project' - relative path from project root up to the current file
-  - `buffer-name' - file name or buffer name
-
-`path-in-project' segment is present only if buffer is file or directory.
-`buffer-name' segment displays file or directory name if buffer is visiting one,
-and uses function (buffer-name) otherwise."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(repeat
-          (choice (const :tag "Project name." project-name)
-                  (const :tag "Directories up to project." path-in-project)
-                  (const :tag "Buffer or file name." buffer-name)))
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-segment-separator nil
-  "String or icon to separate segments.
-
-Icon is actually also a string, but with special properties.
-For example, you can create one using `all-the-icons-material'.
-
-When separator is nil, `project-headerline-icon-function' is used
-to create it with default icon name."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(choice (const :tag "Default" nil)
-                 string)
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-path-separator nil
-  "String or icon to separate path components inside \\='path-in-project segment.
-
-Icon is actually also a string, but with special properties.
-For example, you can create one using `all-the-icons-material'.
-
-When separator is nil, `project-headerline-icon-function' is used
-to create it with default icon name."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(choice (const :tag "Default" nil)
-                 string)
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-path-ellipsis "..."
-  "String or icon used when \\='path-in-project' segment is truncated.
-
-If the segment is too long, a few leading path components are
-replaced with the value of this variable."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type 'string
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-detect-alist
-  `(
-    ;; detect using projectile, if installed
-    (projectile :allow-remote nil
-                :describe ,(lambda ()
-                             (when (and (featurep 'projectile)
-                                        (projectile-project-p))
-                               (list :name (projectile-project-name)
-                                     :path (projectile-project-root)))))
-    ;; detect using builtin project.el package
-    (project :allow-remote nil
-             :describe ,(lambda ()
-                          (when-let* ((project (project-current)))
-                            (list :name (f-base (project-root project))
-                                  :path (project-root project)))))
-    ;; detect using magit, if installed
-    (magit :allow-remote nil
-           :describe ,(lambda ()
-                        (when (featurep 'magit)
-                          (when-let* ((magit-root (magit-toplevel)))
-                            (list :name (f-filename magit-root)
-                                  :path (f-full magit-root))))))
-    ;; detect using builtin vc package
-    (vc :allow-remote nil
-        :describe ,(lambda ()
-                     (when-let* ((vc-root (vc-root-dir)))
-                       (list :name (f-filename vc-root)
-                             :path (f-full vc-root)))))
-    ;;
-    )
-  "Assoc list of project detection methods.
-
-Assoc list key is a symbol of your choice.
-Assoc list value is a plist with the following properties:
-  - `:allow-remote' - whether to use this method on remote files
-  - `:describe' - detection function
-
-`:allow-remote' is by default disabled for all methods because it
-may be very slow (depending on your connection).
-
-Detection function should take no arguments and return a plist:
-  - `:name' - project name
-  - `:path' - project path (tramp paths are allowed)
-
-Detection methods are tried one by one, until some of them
-returns non-nil.
-
-Used by default implementation of
-`project-headerline-describe-project-function'."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(alist :key-type symbol
-                :value-type (plist :options ((:allow-remote boolean)
-                                             (:describe function))))
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-fallback-alist
-  '(
-    ;; pseudo-project "~" for all orphan files under $HOME
-    ("~" . "~/")
-    ;; pseudo-project "/" for all other orphan files
-    ("/" . "/")
-    ;;
-    )
-  "Assoc list of fallback projects when normal detection fails.
-
-Assoc list key is project name.
-Assoc list value is project path.
-
-If no project was detected using `project-headerline-detect-alist',
-then `project-headerline-fallback-alist' is scanned.  A fallback
-project is selected if it's path is the parent of buffer's path.
-
-You can use it both for real projects with hard-coded paths
-\(e.g. if they're not identified by common methods), and for
-fallbacks for buffers that don't really belong to a project.
-
-By default, two `pseudo projects` are registered: `~' for any
-file inside home directory, and `/' for any file elsewhere
-on filesystem.  You can disable this by removing corresponding
-elements from the assoc list."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(alist :key-type (string :tag "Project Name")
-                :value-type (string :tag "Project Path"))
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-rename-alist
-  '(
-    ;; magit
-    ("^\\(magit\\):.*" . "\\1")
-    ("^\\(magit-[a-z]+\\):.*" . "\\1")
-    ;; compilation
-    ("^\\*compilation\\*<.*>" . "compilation")
-    ("^\\*compilation<.*>\\*" . "compilation")
-    ;;
-    )
-  "Assoc list of buffer rename rules.
-
-Assoc list key is a regular expression.
-Assoc list value is a replacement string that can use capture groups.
-
-Keys and values are passed to `replace-regexp-in-string' and FROM and
-TO arguments.  If any of the rule matches buffer, buffer name displayed
-in headerline is changed according to the replacement."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(alist :key-type (string :tag "Buffer Name Regexp")
-                :value-type (string :tag "Buffer Name Replacement"))
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-describe-project-function
-  #'project-headerline-describe-project
-  "Function that returns properties of current project.
-
-Takes no arguments and returns plist:
-  - `:name' - project name
-  - `:path' - project directory path
-
-Default implementation uses the following algorithm:
-  - if `project-headerline-current-project' is set, uses it
-  - tries rules from `project-headerline-detect-alist'
-  - tries paths from `project-headerline-fallback-alist'"
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type 'function
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-describe-buffer-function
-  #'project-headerline-describe-buffer
-  "Function that returns properties of current buffer.
-
-Takes no arguments and returns plist:
-  - `:type' - kind of buffer, one of the symbols: `file', `dir', `other'
-  - `:dir' - path to buffer's directory
-  - `:name' - name of buffer
-
-For `file' buffers, `:dir' is path to directory containing the file.
-For `dir' buffers, `:dir' is path to directory itself.
-For `other' buffers, `:dir' is path to a directory associated with
-the buffer, typically `default-directory' inside that buffer.
-
-Default implementation reports `dir' for Dired buffers, `file' for
-buffers with non-empty variable `buffer-file-name', and `other' for
-the rest.  It also applies buffer renaming rules according to variable
-`project-headerline-rename-alist'."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type 'function
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-format-function
-  #'project-headerline-format
-  "Function to format headerline from project and buffer properties.
-
-Takes two arguments:
-  - `project' - plist from `project-headerline-describe-project-function'
-  - `buffer' - plist from `project-headerline-describe-buffer-function'
-
-Returns propertized string with headerline contents.
-
-Default implementation formats headerline according to variables
-`project-headerline-display-segments', `project-headerline-segment-separator',
-`project-headerline-path-separator' (or `project-headerline-icon-function'),
-and applies corresponding faces."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type 'function
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-icon-function
-  #'project-headerline-icon
-  "Function to create icon from name.
-
-Takes two arguments:
-  - `icon-name' - string name of the icon
-  - `icon-face' - face to apply to the icon
-
-Returns propertized string with the icon.
-If icon is not available, returns nil.  In this case fallback
-character will be used instead of the icon.
-
-Default implementation uses `all-the-icons-material' when it's
-available, or returns nil otherwise."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type 'function
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-width-function
-  #'project-headerline-width
-  "Function to return maximum headerline width.
-Takes no arguments and returns number of characters."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type 'function
-  :initialize 'custom-initialize-default
-  :set 'project-headerline--set-variable)
-
-(defcustom project-headerline-mode-list
-  '(prog-mode
-    conf-mode
-    text-mode
-    dired-mode)
-  "Modes in which to enable `project-headerline-mode' automatically.
-
-When `global-project-headerline-mode' is enabled, it enables headerline
-in buffer if its major mode is derived from one of these modes.
-
-Note that minibuffer and hidden buffers are always excluded."
-  :package-version '(project-headerline . "0.1")
-  :group 'project-headerline
-  :type '(repeat symbol))
-
-(defvar-local project-headerline-current-project nil
-  "Overwrite current project path.
-
-If this variable is set, it is used instead of `project-headerline-detect-alist'
-and `project-headerline-fallback-alist' and defines project name and path.
-
-It can be either a string or a list:
-
- - If it's a string, it should be a path to project directory.  Project name
-   is set to the directory name.
-
- - If it's a list, it should be a plist with project properties, in the same
-   format as returned by `project-headerline-describe-project-function'.
-
-It's convenient to set this from local variables, e.g. in `.dir-locals.el'
-in the project root.")
-
-;; Forward-declate mode variable.
-(defvar project-headerline-mode)
-
-(defun project-headerline--set-variable (symbol value)
-  "Setter for defcustom.
-Assigns value to variable and invokes `project-headerline-reset'."
-  (set-default-toplevel-value symbol value)
-  (project-headerline-reset))
-
-(defvar-local project-headerline--cache nil)
-
-(defmacro project-headerline--cached (key form)
-  "Cached evaluation of form.
-If there is cached value for KEY, return it.
-Otherwise, evaluate FORM, store in cache, and return it."
-  `(let ((cache project-headerline--cache))
-     (unless cache
-       (setq cache (make-hash-table :test 'eq))
-       (setq-local project-headerline--cache cache))
-     (or (gethash ,key cache)
-         (puthash ,key ,form cache))))
-
-(defmacro project-headerline--call (func-or-cons &rest args)
-  "Call user function.
-On error, display warning and return nil."
-  (let ((func (if (consp func-or-cons)
-                  (car func-or-cons)
-                func-or-cons))
-        (name (if (consp func-or-cons)
-                  (cdr func-or-cons)
-                (symbol-name func-or-cons))))
-    `(condition-case err
-         (funcall ,func ,@args)
-       (error
-        (warn "Caught error from %s: %s" ,name
-              (error-message-string err))
-        nil))))
-
-(defun project-headerline-describe-project ()
-  "Get current project properties.
-Default implementation of `project-headerline-describe-project-function',
-see its docstring for details."
-  (or (project-headerline--project-from-variable)
-      (project-headerline--project-from-detect-alist)
-      (project-headerline--project-from-fallback-alist)))
-
-(defun project-headerline--project-from-variable ()
-  "Get project from `project-headerline-current-project'."
-  (when project-headerline-current-project
-    (cond ((stringp project-headerline-current-project)
-           (list :name (f-filename project-headerline-current-project)
-                 :path (f-full project-headerline-current-project)))
-          ((plistp project-headerline-current-project)
-           project-headerline-current-project)
-          (t
-           (warn "Invalid project-headerline-current-project")
-           nil))))
-
-(defun project-headerline--project-from-detect-alist ()
-  "Get project from `project-headerline-detect-alist'."
-  (seq-some (lambda (method)
-              (let ((allow-remote (plist-get (cdr method) :allow-remote))
-                    (describe-fn (plist-get (cdr method) :describe)))
-                (when (and (or allow-remote
-                               (not (file-remote-p default-directory)))
-                           describe-fn)
-                  (project-headerline--call
-                   (describe-fn . "project-headerline-detect-alist :describe")))))
-            project-headerline-detect-alist))
-
-(defun project-headerline--project-from-fallback-alist ()
-  "Get project from `project-headerline-fallback-alist'."
-  (let* ((directory (project-headerline--buffer-dir))
-         (server (file-remote-p directory)))
-    (when directory
-      (seq-some (lambda (proj)
-                  (let ((proj-name (car proj))
-                        (proj-path (cdr proj)))
-                    (if server
-                        (when (s-prefix-p (expand-file-name (s-concat server proj-path))
-                                          (expand-file-name directory))
-                          (list :name (s-concat server proj-name)
-                                :path (expand-file-name (s-concat server proj-path))))
-                      (when (s-prefix-p (f-full proj-path)
-                                        (f-full directory))
-                        (list :name proj-name
-                              :path (f-full proj-path))))))
-                project-headerline-fallback-alist))))
-
-(defun project-headerline-describe-buffer ()
-  "Get current buffer properties.
-Default implementation of `project-headerline-describe-buffer-function',
-see its docstring for details."
-  (let ((type (project-headerline--buffer-type))
-        (dir (project-headerline--buffer-dir))
-        (name (project-headerline--buffer-name)))
-    (setq name
-          (or (seq-some (lambda (rule)
-                          (let ((from (car rule))
-                                (to (cdr rule)))
-                            (when (string-match from name)
-                              (replace-regexp-in-string from to name))))
-                        project-headerline-rename-alist)
-              name))
-    (list :type type
-          :dir dir
-          :name name)))
-
-(defun project-headerline--buffer-type ()
-  "Detect current buffer's type."
-  (cond
-   ;; dired
-   ((derived-mode-p 'dired-mode)
-    'dir)
-   ;; special
-   ((derived-mode-p 'special-mode)
-    'other)
-   ;; file
-   (buffer-file-name
-    'file)
-   ;; very special
-   (t
-    'other)))
-
-(defun project-headerline--buffer-dir ()
-  "Detect current buffer's directory.
-Returns path with trailing slash or nil."
-  (cond
-   ;; dired
-   ((and (derived-mode-p 'dired-mode)
-         (bound-and-true-p dired-subdir-alist))
-    (f-full (dired-current-directory)))
-   ;; file
-   (buffer-file-name
-    (f-slash (f-parent (f-full buffer-file-name))))
-   ;; cwd
-   (default-directory
-    (f-full default-directory))))
-
-(defun project-headerline--buffer-name ()
-  "Detect current buffer's name.
-For files and directories, returns base name.
-Otherwise returns buffer name."
-  (cond
-   ;; dired
-   ((and (derived-mode-p 'dired-mode)
-         (bound-and-true-p dired-subdir-alist))
-    (f-filename (dired-current-directory)))
-   ;; file
-   (buffer-file-name
-    (f-filename buffer-file-name))
-   ;; other
-   (t
-    (buffer-name))))
-
-;; Forward-declare to ensure they are not byte-compiled as lexical.
-(defvar all-the-icons-scale-factor)
-(defvar all-the-icons-default-adjust)
-
-(defun project-headerline-icon (icon-name icon-face)
-  "Format propertized icon string from icon name and face.
-Default implementation of `project-headerline-icon-function',
-see its docstring for details."
-  (when (functionp 'all-the-icons-material)
-    (let ((all-the-icons-scale-factor 1.0)
-          (all-the-icons-default-adjust -0.15))
-      (when-let* ((icon (all-the-icons-material icon-name :face icon-face))
-                  (space (propertize " " 'font-lock-face 'project-headerline-space)))
-        (s-concat
-         space icon space)))))
-
-(defun project-headerline-width ()
-  "Return maximum number of characters in headerline.
-Default implementation of `project-headerline-width-function',
-see its docstring for details."
-  (window-width))
-
-(defun project-headerline--separator (key default-icon default-char)
-  "Make propertized icon string."
-  (project-headerline--cached
-   key
-   (let ((var-name (intern (format "project-headerline-%s-separator" key)))
-         (face-name (intern (format "project-headerline-%s-separator" key))))
-     (or
-      ;; user variable
-      (symbol-value var-name)
-      ;; default icon
-      (project-headerline--call project-headerline-icon-function
-                                default-icon face-name)
-      ;; default char
-      (let ((char (propertize default-char 'font-lock-face face-name))
-            (space (propertize " " 'font-lock-face 'project-headerline-space)))
-        (s-concat space char space))))))
-
-(defun project-headerline--path-components (root-path path)
-  "Split path from ROOT-PATH to CURR-PATH into components."
-  (let (path-components)
-    (while (and path
-                (or (not root-path)
-                    (not (f-same-p root-path path))))
-      (push (f-filename path) path-components)
-      (setq path (f-parent path)))
-    path-components))
-
-(defun project-headerline-format (project buffer)
-  "Format headerline string for project and buffer.
-Default implementation of `project-headerline-format-function',
-see its docstring for details."
-  (let* ((separator
-          (project-headerline--separator 'segment "chevron_right" ">"))
-         (margin
-          (- (or (car (window-margins)) 0)))
-         (max-width (project-headerline--call
-                     project-headerline-width-function))
-         (max-path (- max-width
-                      (seq-reduce
-                       '+ (seq-map (lambda (segment)
-                                     (if (eq segment 'path-in-project)
-                                         0
-                                       (let ((str (project-headerline--format-segment
-                                                   segment project buffer 0)))
-                                         (unless (s-blank-p str)
-                                           (+ (length separator)
-                                              (length str))))))
-                                   project-headerline-display-segments)
-                       (length separator))))
-         (segments (seq-map
-                    (lambda (segment)
-                      (project-headerline--format-segment
-                       segment project buffer max-path))
-                    project-headerline-display-segments))
-         (headerline (s-join separator
-                             (append '("")
-                                     (seq-remove 's-blank-p
-                                                 segments)))))
-    (put-text-property 0 1 'display `(space :align-to ,margin)
-                       headerline)
-    headerline))
-
-(defun project-headerline--format-segment (segment project buffer max-path)
-  "Build segment with given name."
-  (pcase segment
-    (`project-name
-     (project-headerline--format-project-name
-      project buffer))
-    (`path-in-project
-     (project-headerline--format-path-in-project
-      project buffer max-path))
-    (`buffer-name
-     (project-headerline--format-buffer-name
-      project buffer))))
-
-(defun project-headerline--format-project-name (project buffer)
-  "Build \\='project segment."
-  (ignore buffer)
-  (let ((project-name (plist-get project :name)))
-    (when (s-present-p project-name)
-      (propertize project-name
-                  'font-lock-face 'project-headerline-project-name))))
-
-(defun project-headerline--format-path-in-project (project buffer max-path)
-  "Build \\='path-in-project segment."
-  (let* ((project-path (plist-get project :path))
-         (buffer-type (plist-get buffer :type))
-         (buffer-dir (plist-get buffer :dir))
-         (path-in-project (cond
-                           ;; directory
-                           ((eq buffer-type 'dir)
-                            (if (and (seq-contains-p project-headerline-display-segments
-                                                     'buffer-name)
-                                     (not (f-same-p project-path
-                                                    buffer-dir)))
-                                (f-parent buffer-dir)
-                              buffer-dir))
-                           ;; file or other
-                           (t buffer-dir)))
-         (components (project-headerline--path-components project-path
-                                                          path-in-project))
-         (separator
-          (project-headerline--separator 'path "chevron_right" ">")))
-    (when components
-      (let ((max-components (length components))
-            result)
-        (while (or (not result)
-                   (and (> (length result) max-path 2)
-                        (> max-components 0)))
-          (setq result
-                (s-join separator
-                        (seq-map (lambda (seg)
-                                   (propertize
-                                    seg 'font-lock-face 'project-headerline-path-in-project))
-                                 (if (= max-components (length components))
-                                     components
-                                   (append (list project-headerline-path-ellipsis)
-                                           (seq-drop components
-                                                     (- (length components)
-                                                        max-components)))))))
-          (setq max-components (1- max-components)))
-        result))))
-
-(defun project-headerline--format-buffer-name (project buffer)
-  "Build \\='buffer segment."
-  (let* ((project-path (plist-get project :path))
-         (buffer-type (plist-get buffer :type))
-         (buffer-dir (plist-get buffer :dir))
-         (buffer-name (plist-get buffer :name))
-         (display-name (cond
-                        ;; project root
-                        ((and (eq buffer-type 'dir)
-                              (f-same-p project-path buffer-dir))
-                         ".")
-                        ;; anything else
-                        (t
-                         buffer-name))))
-    (when (s-present-p display-name)
-      (propertize display-name
-                  'font-lock-face 'project-headerline-buffer-name))))
-
-(defun project-headerline--compose ()
-  "Build propertized headerline string."
-  (project-headerline--cached
-   'headerline
-   (or
-    (when-let* ((project (project-headerline--call
-                          project-headerline-describe-project-function))
-                (buffer (project-headerline--call
-                         project-headerline-describe-buffer-function)))
-      (project-headerline--call
-       project-headerline-format-function project buffer))
-    "")))
-
-(defun project-headerline--composer-match (elem func)
-  "Match `header-line-format' element by composer function."
-  (when-let* ((form (car-safe (cdr-safe elem))))
-    (and (eq (car form) :eval)
-         (eq (caadr form) func))))
-
-(defun project-headerline--composer-append (func &rest args)
-  "Add composer function to the head of `header-line-format'."
-  (when (and header-line-format
-             (not (listp header-line-format)))
-    (setq header-line-format
-          (list header-line-format)))
-  (unless (seq-find (lambda (elem)
-                      (project-headerline--composer-match elem func))
-                    header-line-format)
-    (setq header-line-format
-          (append header-line-format
-                  `((t (:eval (,func ,@args))))))))
-
-(defun project-headerline--composer-prepend (func &rest args)
-  "Add composer function to the tail of `header-line-format'."
-  (when (and header-line-format
-             (not (listp header-line-format)))
-    (setq header-line-format
-          (list header-line-format)))
-  (unless (seq-find (lambda (elem)
-                      (project-headerline--composer-match elem func))
-                    header-line-format)
-    (setq header-line-format
-          (append `((t (:eval (,func ,@args))))
-                  header-line-format))))
-
-(defun project-headerline--composer-remove (func)
-  "Remove composer function from `header-line-format'."
-  (when (listp header-line-format)
-    (setq header-line-format
-          (seq-remove (lambda (elem)
-                        (project-headerline--composer-match elem func))
-                      header-line-format))))
-
-(defun project-headerline--magit-compose (text)
-  "Build magit headerline.
-If `project-headerline-mode' is off, produces same result as original
-`magit-set-header-line-format'.  Otherwise, produces right-aligned
-headerline that can be use together with `project-headerline'."
-  (project-headerline--cached
-   'magit-headerline
-   (s-concat
-    (propertize " " 'display
-                (if project-headerline-mode
-                    (let* ((margin (or (cdr (window-margins)) 0))
-                           (offset (- (length text)
-                                      margin)))
-                      `(space :align-to (- right-margin ,offset)))
-                  '(space :align-to 0)))
-    text)))
-
-(defun project-headerline--magit-advice (orig-fn &rest args)
-  "Wraps magit headrline builder to support `project-headerline' in magit buffers.
-If you don't use project-headerline with magit, no visible changes are made."
-  ;; safety check: don't follow advice if signature doesn't
-  ;; match what it used to be
-  (if (and (eq 1 (length args))
-           (stringp (car args)))
-      (project-headerline--composer-append 'project-headerline--magit-compose
-                                           (car args))
-    (apply orig-fn args)))
-
-(defun project-headerline--rename-file-advice (orig-fn &rest args)
-  "Wraps `rename-file' to update headerline on name change."
-  (unwind-protect
-      (apply orig-fn args)
-    (let ((from (car args))
-          (to (cadr args)))
-      (project-headerline--reset-paths from to))))
-
-(defun project-headerline--add-name-to-file-advice (orig-fn &rest args)
-  "Wraps `add-name-to-file' to update headerline on name change."
-  (unwind-protect
-      (apply orig-fn args)
-    (let ((from (car args))
-          (to (cadr args)))
-      (project-headerline--reset-paths from to))))
-
-(defun project-headerline--rename-buffer-advice (orig-fn &rest args)
-  "Wraps `rename-buffer' to update headerline on name change."
-  (unwind-protect
-      (apply orig-fn args)
-    (project-headerline--reset-buffer)))
-
-(defun project-headerline--enable-maybe ()
-  "Enable `project-headerline-mode' in current buffer, if needed.
-Headerline is enabled if buffer major mode is derived from one of the modes
-in `project-headerline-mode-list'.
-Never enables in minibuffer and hidden buffers."
-  (when (and (not (minibufferp))
-             (not (string-match "^ " (buffer-name)))
-             (seq-some #'derived-mode-p project-headerline-mode-list)
-             (not project-headerline-mode))
-    (project-headerline-mode 1)))
-
-(defun project-headerline--register-advices ()
-  "Register all advices, if not registered yet."
-  (when (featurep 'magit)
-    (advice-add 'magit-set-header-line-format
-                :around #'project-headerline--magit-advice))
-  (advice-add 'rename-file
-              :around #'project-headerline--rename-file-advice)
-  (advice-add 'add-name-to-file
-              :around #'project-headerline--add-name-to-file-advice)
-  (advice-add 'rename-buffer
-              :around #'project-headerline--rename-buffer-advice))
-
-(defun project-headerline--register-hooks ()
-  "Register all hooks."
-  (add-hook 'window-configuration-change-hook
-            #'project-headerline--reset-buffer nil :local)
-  (add-hook 'after-revert-hook
-            #'project-headerline--reset-buffer nil :local)
-  (add-hook 'after-set-visited-file-name-hook
-            #'project-headerline--reset-buffer nil :local))
-
-(defun project-headerline--unregister-hooks ()
-  "Unregister all hooks."
-  (remove-hook 'window-configuration-change-hook
-               #'project-headerline--reset-buffer :local)
-  (remove-hook 'after-revert-hook
-               #'project-headerline--reset-buffer :local)
-  (remove-hook 'after-set-visited-file-name-hook
-               #'project-headerline--reset-buffer :local))
-
-(defun project-headerline--reset-buffer (&optional buffer)
-  "Refresh headerline in given BUFFER (or current)."
-  (with-current-buffer (or buffer (current-buffer))
-    (when (bound-and-true-p project-headerline--cache)
-      (setq-local project-headerline--cache nil))
-    (when project-headerline-mode
-      (force-mode-line-update))))
-
-(defun project-headerline--reset-paths (&rest paths)
-  "Refresh headerline in buffers visiting any of PATHS."
-  (dolist (buffer (buffer-list))
-    (when-let* ((buffer-path (buffer-file-name buffer)))
-      (dolist (path paths)
-        (when (and path (f-same-p buffer-path path))
-          (project-headerline--reset-buffer buffer))))))
-
-;;;###autoload
-(defun project-headerline-reset (&optional buffer)
-  "Forcibly refresh headerline in all buffers.
-If BUFFER is given, refresh only that buffer."
-  (interactive)
-  (if buffer
-      (project-headerline--reset-buffer buffer)
-    (dolist (buffer (buffer-list))
-      (project-headerline--reset-buffer buffer))))
-
-;;;###autoload
-(define-minor-mode project-headerline-mode
-  "Customizable project headerline."
-  :group 'project-headerline
-  :init-value nil
-  :lighter nil
-  (if project-headerline-mode
-      ;; enable mode
-      (progn
-        (project-headerline--composer-prepend 'project-headerline--compose)
-        (project-headerline--register-advices)
-        (project-headerline--register-hooks)
-        (force-mode-line-update))
-    ;; disable mode
-    (project-headerline--unregister-hooks)
-    (project-headerline--composer-remove 'project-headerline--compose)
-    (project-headerline--reset-buffer)
-    (force-mode-line-update)))
-
-;;;###autoload
-(define-globalized-minor-mode global-project-headerline-mode
-  project-headerline-mode
-  project-headerline--enable-maybe
-  :group 'project-headerline)
-
-(provide 'project-headerline)
-;;; project-headerline.el ends here
dots/.config/emacs/old/lisp/project-x.el
@@ -1,217 +0,0 @@
-;;; project-x.el --- Extra convenience features for project.el -*- lexical-binding: t -*-
-
-;; Copyright (C) 2021  Karthik Chikmagalur
-
-;; Author: Karthik Chikmagalur <karthik.chikmagalur@gmail.com>
-;; URL: https://github.com/karthink/project-x
-;; Version: 0.1.5
-;; Package-Requires: ((emacs "27.1"))
-
-;; This file is NOT part of GNU Emacs.
-
-;; 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 3, or (at your option)
-;; any later version.
-;;
-;; This program 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.
-;;
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-;;
-;;; Commentary:
-;;
-;; project-x provides some convenience features for project.el:
-;; - Recognize any directory with a `.project' file as a project.
-;; - Save and restore project files and window configurations across sessions
-;;
-;; COMMANDS:
-;;
-;; project-x-window-state-save : Save the window configuration of currently open project buffers
-;; project-x-window-state-load : Load a previously saved project window configuration
-;;
-;; CUSTOMIZATION:
-;;
-;; `project-x-window-list-file': File to store project window configurations
-;; `project-x-local-identifier': String matched against file names to decide if a
-;; directory is a project
-;; `project-x-save-interval': Interval in seconds between autosaves of the
-;; current project.
-;;
-;; by Karthik Chikmagalur
-;; <karthik.chikmagalur@gmail.com>
-
-;;; Code:
-
-(require 'project)
-(eval-when-compile (require 'subr-x))
-(eval-when-compile (require 'seq))
-(defvar project-prefix-map)
-(defvar project-switch-commands)
-(declare-function project-prompt-project-dir "project")
-(declare-function project--buffer-list "project")
-(declare-function project-buffers "project")
-
-(defgroup project-x nil
-  "Convenience features for the Project library."
-  :group 'project)
-
-;; Persistent project sessions
-;; -------------------------------------
-(defcustom project-x-window-list-file
-  (locate-user-emacs-file "project-window-list")
-  "File in which to save project window configurations by default."
-  :type 'file
-  :group 'project-x)
-
-(defcustom project-x-save-interval nil
-  "Saves the current project state with this interval.
-
-When set to nil auto-save is disabled."
-  :type '(choice (const :tag "Disabled" nil)
-                 integer)
-  :group 'project-x)
-
-(defvar project-x-window-alist nil
-  "Alist of window configurations associated with known projects.")
-
-(defvar project-x-save-timer nil
-  "Timer for auto-saving project state.")
-
-(defun project-x--window-state-write (&optional file)
-  "Write project window states to `project-x-window-list-file'.
-If FILE is specified, write to it instead."
-  (when project-x-window-alist
-    (require 'pp)
-    (unless file (make-directory (file-name-directory project-x-window-list-file) t))
-    (with-temp-file (or file project-x-window-list-file)
-      (insert ";;; -*- lisp-data -*-\n")
-      (let ((print-level nil) (print-length nil))
-        (pp project-x-window-alist (current-buffer))))
-    (message (format "Wrote project window state to %s" project-x-window-list-file))))
-
-(defun project-x--window-state-read (&optional file)
-  "Read project window states from `project-x-window-list-file'.
-If FILE is specified, read from it instead."
-  (and (or file
-           (file-exists-p project-x-window-list-file))
-       (with-temp-buffer
-         (insert-file-contents (or file project-x-window-list-file))
-         (condition-case nil
-             (if-let ((win-state-alist (read (current-buffer))))
-                 (setq project-x-window-alist win-state-alist)
-               (message (format "Could not read %s" project-x-window-list-file)))
-           (error (message (format "Could not read %s" project-x-window-list-file)))))))
-
-(defun project-x-window-state-save (&optional arg)
-  "Save current window state of project.
-With optional prefix argument ARG, query for project."
-  (interactive "P")
-  (when-let* ((dir (cond (arg (project-prompt-project-dir))
-                         ((project-current)
-                          (project-root (project-current)))))
-              (default-directory dir))
-    (unless project-x-window-alist (project-x--window-state-read))
-    (let ((file-list))
-      ;; Collect file-list of all the open project buffers
-      (dolist (buf
-               (funcall (if (fboundp 'project--buffers-list)
-                            #'project--buffers-list
-                          #'project-buffers)
-                        (project-current))
-               file-list)
-        (if-let ((file-name (or (buffer-file-name buf)
-                                (with-current-buffer buf
-                                  (and (derived-mode-p 'dired-mode)
-                                       dired-directory)))))
-            (push file-name file-list)))
-      (setf (alist-get dir project-x-window-alist nil nil 'equal)
-            (list (cons 'files file-list)
-                  (cons 'windows (window-state-get nil t)))))
-    (message (format "Saved project state for %s" dir))))
-
-(defun project-x-window-state-load (dir)
-  "Load the saved window state for project with directory DIR.
-If DIR is unspecified query the user for a project instead."
-  (interactive (list (project-prompt-project-dir)))
-  (unless project-x-window-alist (project-x--window-state-read))
-  (if-let* ((project-x-window-alist)
-            (project-state (alist-get dir project-x-window-alist
-                                      nil nil 'equal)))
-      (let ((file-list (alist-get 'files project-state))
-            (window-config (alist-get 'windows project-state)))
-        (dolist (file-name file-list nil)
-          (find-file file-name))
-        (window-state-put window-config nil 'safe)
-        (message (format "Restored project state for %s" dir)))
-    (message (format "No saved window state for project %s" dir))))
-
-(defun project-x-windows ()
-  "Restore the last saved window state of the chosen project."
-  (interactive)
-  (project-x-window-state-load (project-root (project-current))))
-
-;; Recognize directories as projects by defining a new project backend `local'
-;; -------------------------------------
-(defcustom project-x-local-identifier ".project"
-  "Filename(s) that identifies a directory as a project.
-
-You can specify a single filename or a list of names."
-  :type '(choice (string :tag "Single file")
-                 (repeat (string :tag "Filename")))
-  :group 'project-x)
-
-(cl-defmethod project-root ((project (head local)))
-  "Return root directory of current PROJECT."
-  (cdr project))
-
-(defun project-x-try-local (dir)
-  "Determine if DIR is a non-VC project.
-DIR must include a .project file to be considered a project."
-  (if-let ((root (if (listp project-x-local-identifier)
-                     (seq-some (lambda (n)
-                                 (locate-dominating-file dir n))
-                               project-x-local-identifier)
-                   (locate-dominating-file dir project-x-local-identifier))))
-      (cons 'local root)))
-
-;;;###autoload
-(define-minor-mode project-x-mode
-  "Minor mode to enable extra convenience features for project.el.
-When enabled, save and load project window states.
-Recognize any directory that contains (or whose parent
-contains) a special file as a project."
-  :global t
-  :version "0.10"
-  :lighter ""
-  :group 'project-x
-  (if project-x-mode
-      ;;Turning the mode ON
-      (progn
-        (add-hook 'project-find-functions 'project-x-try-local 90)
-        (add-hook 'kill-emacs-hook 'project-x--window-state-write)
-        (project-x--window-state-read)
-        (define-key project-prefix-map (kbd "w") 'project-x-window-state-save)
-        (define-key project-prefix-map (kbd "j") 'project-x-window-state-load)
-        (if (listp project-switch-commands)
-            (add-to-list 'project-switch-commands
-                         '(?j "Restore windows" project-x-windows) t)
-          (message "`project-switch-commands` is not a list, not adding 'restore windows' command"))
-        (when project-x-save-interval
-          (setq project-x-save-timer
-                (run-with-timer 0 (max project-x-save-interval 5)
-                                #'project-x-window-state-save))))
-    (remove-hook 'project-find-functions 'project-x-try-local 90)
-    (remove-hook 'kill-emacs-hook 'project-x--window-state-write)
-    (define-key project-prefix-map (kbd "w") nil)
-    (define-key project-prefix-map (kbd "j") nil)
-    (when (listp project-switch-commands)
-      (delete '(?j "Restore windows" project-x-windows) project-switch-commands))
-    (when (timerp project-x-save-timer)
-      (cancel-timer project-x-save-timer))))
-
-(provide 'project-x)
-;;; project-x.el ends here
dots/.config/emacs/old/lisp/vde-buffers.el
@@ -1,11 +0,0 @@
-;;; vde-buffers.el --- -*- lexical-binding: t; -*-
-;; Commentary:
-;;; Helper function related to buffers
-;; Code:
-
-;;;###autoload
-(defun vde/buffer-has-project-p (buffer action)
-  (with-current-buffer buffer (project-current nil)))
-
-(provide 'vde-buffers)
-;;; vde-buffers.el ends here
dots/.config/emacs/old/lisp/vde-simple.el
@@ -1,24 +0,0 @@
-;;; vde-simple --- Common functions for my configuration -*- lexical-binding: t -*-
-
-;; Copyright (C) 2025 Vincent Demeester
-;; Author: Vincent Demeester <vincent@sbr.pm>
-
-;; This file is NOT part of GNU Emacs.
-;;; Commentary:
-;;
-;; Simple and useful function for a lot of things.
-;;
-;;; Code:
-
-(defvar vde-simple-override-mode-map (make-sparse-keymap)
-  "Key map of `vde-simple-override-mode'.
-Enable that mode to have its key bindings to take effect over those of the major mode.")
-
-(define-minor-mode vde-simple-override-mode
-  "Enable the `vde-simple-override-mode-map'."
-  :init-value nil
-  :global t
-  :keymap vde-simple-override-mode-map)
-
-(provide 'vde-simple)
-;;; vde-simple.el ends here
dots/.config/emacs/old/lisp/vde-windows.el
@@ -1,35 +0,0 @@
-;;; vde-windows.el --- -*- lexical-binding: t; -*-
-;; Commentary:
-;;; Helper function related to window management
-;; Code:
-
-;;;###autoload
-(defun vde/split-window-below (&optional arg)
-  "Split window below from the parent or from the roo with ARG."
-  (interactive "P")
-  (split-window (if arg (frame-root-window)
-		 (window-parent (selected-window)))
-	       nil 'below nil))
-
-;;;###autoload
-(defun vde/split-window-right (&optional arg)
-  "Split window right from the parent or from the roo with ARG."
-  (interactive "P")
-  (split-window (if arg (frame-root-window)
-		 (window-parent (selected-window)))
-		nil 'right nil))
-
-;;;###autoload
-(defun vde/toggle-window-dedication ()
-  "Toggles window dedication in the selected window."
-  (interactive)
-  (set-window-dedicated-p (selected-window)
-			  (not (window-dedicated-p (selected-window)))))
-
-;;;###autoload
-(defun make-display-buffer-matcher-function (major-modes)
-  (lambda (buffer-name action)
-    (with-current-buffer buffer-name (apply #'derived-mode-p major-modes))))
-
-(provide 'vde-windows)
-;;; vde-windows.el ends here
dots/.config/emacs/old/transient/history.el
@@ -1,1 +0,0 @@
-nil
\ No newline at end of file
dots/.config/emacs/old/early-init.el
@@ -1,95 +0,0 @@
-;;; early-init.el --- Early init configuration file -*- lexical-binding: t; -*-
-
-;; Copyright (c) 2020-2023  Vincent Demeester <vincent@sbr.pm>
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; URL: https://git.sr.ht/~vdemeester/home
-;; Version: 0.1.0
-;; Package-Requires: ((emacs "29.1"))
-
-;; This file is NOT part of GNU Emacs.
-
-;; 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 3 of the License, 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 this file.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Prior to Emacs 27, the `init.el' was supposed to handle the
-;; initialisation of the package manager, by means of calling
-;; `package-initialize'.  Starting with Emacs 27, the default
-;; behaviour is to start the package manager before loading the init
-;; file.
-;;
-
-;; See my dotfiles: https://git.sr.ht/~vdemeester/home
-
-;;; Code:
-
-;; Do not initialize installed packages
-(setopt package-enable-at-startup nil
-	package-archives nil
-	package-quickstart nil)
-(setopt use-package-ensure-function 'ignore)
-
-;; Do not resize the frame at this early stage
-(setopt frame-inhibit-implied-resize t
-	frame-resize-pixelwise t
-	frame-title-format '("%b")) ;; do not add "GNU Emacs at …"
-
-;; Disable GUI elements
-(push '(menu-bar-lines . 0) default-frame-alist)
-(push '(tool-bar-lines . 0) default-frame-alist)
-(push '(vertical-scroll-bars) default-frame-alist)
-(menu-bar-mode -1)
-(tool-bar-mode -1)
-(scroll-bar-mode -1)
-(horizontal-scroll-bar-mode -1)
-
-(setopt use-dialog-box nil   ;; never use dialog-box (no mouse)
-	use-file-dialog nil  ;; never use file dialog (gtk)
-	use-short-answers t  ;; replace defalias yes-or-no-p
-	read-answer-short t) ;; accepts single-character answer, similar to above
-
-(setopt inhibit-startup-message t
-	inhibit-startup-screen t
-	inhibit-startup-echo-area-message user-login-name ; read the docstring
-	inhibit-startup-buffer-menu t)
-
-(setq gc-cons-threshold most-positive-fixnum
-      gc-cons-percentage 0.5)
-
-(defvar vde--file-name-handler-alist file-name-handler-alist)
-(defvar vde--vc-handled-backends vc-handled-backends)
-(setq file-name-handler-alist nil
-      vc-handled-backends nil)
-
-
-;; Ignore X resources; its settings would be redundant with the other settings
-;; in this file and can conflict with later config (particularly where the
-;; cursor color is concerned).
-(advice-add #'x-apply-session-resources :override #'ignore)
-(setopt inhibit-x-resources t)
-
-;;
-(when (getenv-internal "DEBUG")
-  (setq init-file-debug t
-	debug-on-error t))
-
-;; - Resetting garbage collection and file-name-handler values.
-(add-hook 'after-init-hook
-          `(lambda ()
-             (setq gc-cons-threshold 67108864 ; 64mb
-                   gc-cons-percentage 0.1
-                   file-name-handler-alist vde--file-name-handler-alist
-		   vc-handled-backends vde--vc-handled-backends)
-             (garbage-collect)) t)
dots/.config/emacs/old/init.el
@@ -1,297 +0,0 @@
-;;; init.el --- init configuration file -*- lexical-binding: t; -*-
-
-;; Copyright (c) 2020-2023  Vincent Demeester <vincent@sbr.pm>
-
-;; Author: Vincent Demeester <vincent@sbr.pm>
-;; URL: https://git.sr.ht/~vdemeester/home
-;; Version: 0.1.0
-;; Package-Requires: ((emacs "29.1"))
-
-;; This file is NOT part of GNU Emacs.
-
-;; 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 3 of the License, 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 this file.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; See my dotfiles: https://git.sr.ht/~vdemeester/home
-
-;;; Code:
-
-
-(defconst emacs-start-time (current-time))
-
-(let ((minver 29))
-  (unless (>= emacs-major-version minver)
-    (error "Your Emacs is too old -- this configuration requires v%s or higher" minver)))
-
-(setq inhibit-default-init t)           ; Disable the site default settings
-
-(setq confirm-kill-emacs #'y-or-n-p)
-(setq initial-major-mode 'fundamental-mode
-      initial-scratch-message nil)
-
-;; Might not work as well on Windows but meh, I don't use it.
-(prefer-coding-system 'utf-8)
-(set-default-coding-systems 'utf-8)
-(set-language-environment 'utf-8)
-(set-selection-coding-system 'utf-8)
-(set-terminal-coding-system 'utf-8)
-
-(setq custom-file (locate-user-emacs-file "custom.el"))
-(setq
-   custom-buffer-done-kill nil          ; Kill when existing
-   custom-buffer-verbose-help nil       ; Remove redundant help text
-   custom-unlispify-tag-names nil       ; Show me the real variable name
-   custom-unlispify-menu-entries nil)
-;; Create the custom-file if it doesn't exists
-(unless (file-exists-p custom-file)
-  (write-region "" nil custom-file))
-(load custom-file :no-error-if-file-is-missing)
-
-(setq echo-keystrokes 0.1) ;; display command keystrokes quickly
-
-(global-unset-key (kbd "C-z"))
-(global-unset-key (kbd "C-x C-z"))
-(global-unset-key (kbd "C-h h"))
-
-;; Disable owerwrite-mode, iconify-frame and diary
-(mapc
- (lambda (command)
-   (put command 'disabled t))
- '(overwrite-mode iconify-frame diary))
-;; And enable those commands (disabled by default)
-(mapc
- (lambda (command)
-   (put command 'disabled nil))
- '(list-timers narrow-to-region narrow-to-page upcase-region downcase-region))
-
-(defun prot/keyboard-quit-dwim ()
-  "Do-What-I-Mean behaviour for a general `keyboard-quit'.
-
-The generic `keyboard-quit' does not do the expected thing when
-the minibuffer is open.  Whereas we want it to close the
-minibuffer, even without explicitly focusing it.
-
-The DWIM behaviour of this command is as follows:
-
-- When the region is active, disable it.
-- When a minibuffer is open, but not focused, close the minibuffer.
-- When the Completions buffer is selected, close it.
-- In every other case use the regular `keyboard-quit'."
-  (interactive)
-  (cond
-   ((region-active-p)
-    (keyboard-quit))
-   ((derived-mode-p 'completion-list-mode)
-    (delete-completion-window))
-   ((> (minibuffer-depth) 0)
-    (abort-recursive-edit))
-   (t
-    (keyboard-quit))))
-
-(define-key global-map (kbd "C-g") #'prot/keyboard-quit-dwim)
-
-(add-to-list 'load-path (concat user-emacs-directory "/lisp/"))
-(add-to-list 'load-path (concat user-emacs-directory "/lisp/aider.el"))
-(add-to-list 'load-path (concat user-emacs-directory "/lisp/auto-side-windows"))
-(add-to-list 'load-path (concat user-emacs-directory "/lisp/consult-mu"))
-(add-to-list 'load-path (concat user-emacs-directory "/lisp/consult-mu/extras"))
-(add-to-list 'load-path (concat user-emacs-directory "/config/"))
-
-(unless noninteractive
-  (defconst font-height 130
-    "Default font-height to use.")
-  ;; 2024-10-05: Switching from Ubuntu Mono to Cascadia Mono
-  ;; 2024-96-06: Switching from Cascadia Mono to JetBrains Mono
-  (defconst font-family-mono "JetBrains Mono"
-    "Default monospace font-family to use.")
-  (defconst font-family-sans "Ubuntu Sans"
-    "Default sans font-family to use.")
-  ;; Middle/Near East: שלום, السّلام عليكم
-  (when (member "Noto Sans Arabic" (font-family-list))
-    (set-fontset-font t 'arabic "Noto Sans Arabic"))
-  (when (member "Noto Sans Hebrew" (font-family-list))
-    (set-fontset-font t 'arabic "Noto Sans Hebrew"))
-  ;; Africa: ሠላም
-  (when (member "Noto Sans Ethiopic" (font-family-list))
-    (set-fontset-font t 'ethiopic "Noto Sans Ethiopic"))
-
-  ;; If font-family-mono or font-family-sans are not available, use the default Emacs face
-  (set-face-attribute 'default nil
-		      :family font-family-mono
-		      :height font-height
-		      :weight 'regular)
-  (set-face-attribute 'fixed-pitch nil
-		      :family font-family-mono
-		      :weight 'medium
-		      :height font-height)
-  (set-face-attribute 'variable-pitch nil
-		      :family font-family-sans
-		      :weight 'regular)
-
-  (set-fontset-font t 'symbol "Apple Color Emoji")
-  (set-fontset-font t 'symbol "Noto Color Emoji" nil 'append)
-  (set-fontset-font t 'symbol "Segoe UI Emoji" nil 'append)
-  (set-fontset-font t 'symbol "Symbola" nil 'append)
-
-  (defvar contrib/after-load-theme-hook nil
-    "Hook run after a color theme is loaded using `load-theme'.")
-
-  (defun contrib/run-after-load-theme-hook (&rest _)
-    "Run `contrib/after-load-theme-hook'."
-    (run-hooks 'contrib/after-load-theme-hook))
-
-  (advice-add #'load-theme :after #'contrib/run-after-load-theme-hook)
-
-  (require 'modus-themes)
-  (setq modus-themes-to-toggle '(modus-operandi modus-vivendi)
-	modus-themes-slanted-constructs nil
-	modus-themes-italic-constructs nil
-	modus-themes-bold-constructs nil
-	modus-themes-mixed-fonts t
-	modus-themes-subtle-diffs t
-	modus-themes-fringes 'subtle ; {nil,'subtle,'intense}
-	modus-themes-headings '((0 . (variable-pitch semilight 1.5))
-				(1 . (regular 1.4))
-				(2 . (regular 1.3))
-				(3 . (regular 1.2))
-				(agenda-structure . (variable-pitch light 2.2))
-				(agenda-date . (variable-pitch regular 1.3))
-				(t . (regular 1.15)))
-	modus-themes-intense-paren-match t
-	modus-themes-completions '(opinionated) ; {nil,'moderate,'opinionated}
-	modus-themes-diffs 'desaturated ; {nil,'desaturated,'fg-only}
-	modus-themes-org-blocks 'gray-background
-	modus-themes-paren-match '(subtle-bold)
-	modus-themes-variable-pitch-headings nil
-	modus-themes-rainbow-headings t
-	modus-themes-section-headings nil
-	modus-themes-scale-headings t
-	)
-
-  (defun my-update-active-mode-line-colors ()
-    (set-face-attribute
-     'mode-line nil
-     :foreground (modus-themes-get-color-value 'fg-mode-line-active)
-     :background (modus-themes-get-color-value 'bg-blue-nuanced)))
-  (add-hook 'modus-themes-after-load-theme-hook #'my-update-active-mode-line-colors)
-  (define-key global-map (kbd "C-<f5>") #'modus-themes-toggle)
-
-  (load-theme 'modus-operandi :no-confirm)
-  (my-update-active-mode-line-colors))
-
-(setq load-prefer-newer t)              ; Always load newer compiled files
-(setq ad-redefinition-action 'accept)   ; Silence advice redefinition warnings
-
-;; Init `delight'
-;; (unless (package-installed-p 'delight)
-;;   (package-refresh-contents)
-;;   (package-install 'delight))
-
-;; Configure `use-package' prior to loading it.
-(eval-and-compile
-  (setq use-package-always-ensure nil)
-  (setq use-package-always-defer nil)
-  (setq use-package-always-demand nil)
-  (setq use-package-expand-minimally nil)
-  (setq use-package-enable-imenu-support t)
-  (setq use-package-compute-statistics t))
-
-;; (unless (package-installed-p 'use-package)
-;;   (package-refresh-contents)
-;;   (package-install 'use-package))
-
-(eval-when-compile
-  (require 'use-package))
-
-(setenv "SSH_AUTH_SOCK" "/run/user/1000/yubikey-agent/yubikey-agent.sock")
-;; (setenv "SSH_AUTH_SOCK" "/run/user/1000/gnupg/S.gpg-agent.ssh")
-
-(defconst vde/custom-file (locate-user-emacs-file "custom.el")
-  "File used to store settings from Customization UI.")
-
-;; Remove built-in org-mode
-(require 'cl-seq)
-(setq load-path
-      (cl-remove-if
-       (lambda (x)
-         (string-match-p "org$" x))
-       load-path))
-
-;; 2024-07-12: I wonder if I should be explicit instead, as using
-;; `require' explicitly. The benefit would be that I decide the order
-;; they load instead of relying on file-system.
-;; (vde/el-load-dir (concat user-emacs-directory "/config/"))
-(require 'init-func)
-(require 'org-func)
-(require 'project-func)
-
-;; Make native compilation silent and prune its cache.
-(when (native-comp-available-p)
-  (setq native-comp-async-report-warnings-errors 'silent) ; Emacs 28 with native compilation
-  (setq native-compile-prune-cache t)
-  (setq native-comp-jit-compilation t)
-  (setq native-comp-async-query-on-exit t)) ; Emacs 29
-
-(setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local))
-
-;; Refactor this completely. Reduce to the minimum.
-(unless noninteractive
-  (require '00-clean) ;; Maybe refactor no-littering
-  (require 'config-keybindings)
-  (require 'config-editing)
-  (require 'config-files)
-  (require 'config-misc)
-  (require 'config-appearance)
-  (require 'config-buffers)
-  (require 'config-compile)
-  (require 'config-completion)
-  (require 'config-dired)
-  (require 'config-mouse)
-  (require 'config-navigating)
-  (require 'config-org)
-  (require 'config-programming)
-  (require 'config-projects)
-  (require 'config-search)
-  (require 'config-shells)
-  (require 'config-vcs)
-  (require 'config-web)
-  (require 'config-windows)
-  (require 'config-llm)
-  (require 'programming-config)
-  (require 'programming-containers)
-  (require 'programming-cue)
-  (require 'programming-elisp)
-  (require 'programming-eglot)
-  (require 'programming-go)
-  (require 'programming-js)
-  (require 'programming-nix)
-  (require 'programming-treesitter)
-  (require 'programming-web)
-  (require 'config-mu4e))
-
-(if (file-exists-p (downcase (concat user-emacs-directory "/hosts/" (vde/short-hostname) ".el")))
-    (load-file (downcase (concat user-emacs-directory "/hosts/" (vde/short-hostname) ".el"))))
-
-(let ((elapsed (float-time (time-subtract (current-time)
-                                          emacs-start-time))))
-  (message "Loading %s...done (%.3fs)" load-file-name elapsed))
-
-(add-hook 'after-init-hook
-          `(lambda ()
-             (let ((elapsed
-                    (float-time
-                     (time-subtract (current-time) emacs-start-time))))
-               (message "Loading %s...done (%.3fs) [after-init]"
-                        ,load-file-name elapsed))) t)
dots/.config/emacs/old/nano.el
@@ -1,255 +0,0 @@
-;; nano-emacs.el --- NANO Emacs (minimal version)     -*- lexical-binding: t -*-
-
-;; Copyright (c) 2025  Nicolas P. Rougier
-;; Released under the GNU General Public License 3.0
-;; Author: Nicolas P. Rougier <nicolas.rougier@inria.fr>
-;; URL: https://github.com/rougier/nano-emacs
-
-;; This is NANO Emacs in 256 lines, without any dependency 
-;; Usage (command line):  emacs -Q -l nano.el -[light|dark]
-
-;; --- Speed benchmarking -----------------------------------------------------
-(setq init-start-time (current-time))
-
-;; --- Typography stack -------------------------------------------------------
-(set-face-attribute 'default nil
-                    :height 140 :weight 'light :family "Roboto Mono")
-(set-face-attribute 'bold nil :weight 'regular)
-(set-face-attribute 'bold-italic nil :weight 'regular)
-(set-display-table-slot standard-display-table 'truncation (make-glyph-code ?…))
-(set-display-table-slot standard-display-table 'wrap (make-glyph-code ?–))
-
-;; --- Frame / windows layout & behavior --------------------------------------
-(setq default-frame-alist
-      '((height . 44) (width  . 81) (left-fringe . 0) (right-fringe . 0)
-        (internal-border-width . 32) (vertical-scroll-bars . nil)
-        (bottom-divider-width . 0) (right-divider-width . 0)
-        (undecorated-round . t)))
-(modify-frame-parameters nil default-frame-alist)
-(setq-default pop-up-windows nil)
-
-;; --- Activate / Deactivate modes --------------------------------------------
-(tool-bar-mode -1) (menu-bar-mode -1) (blink-cursor-mode -1)
-(global-hl-line-mode 1) (icomplete-vertical-mode 1)
-(pixel-scroll-precision-mode 1)
-
-;; --- Minimal NANO (not a real) theme ----------------------------------------
-(defface nano-default '((t)) "")   (defface nano-default-i '((t)) "")
-(defface nano-highlight '((t)) "") (defface nano-highlight-i '((t)) "")
-(defface nano-subtle '((t)) "")    (defface nano-subtle-i '((t)) "")
-(defface nano-faded '((t)) "")     (defface nano-faded-i '((t)) "")
-(defface nano-salient '((t)) "")   (defface nano-salient-i '((t)) "")
-(defface nano-popout '((t)) "")    (defface nano-popout-i '((t)) "")
-(defface nano-strong '((t)) "")    (defface nano-strong-i '((t)) "")
-(defface nano-critical '((t)) "")  (defface nano-critical-i '((t)) "")
-
-(defun nano-set-face (name &optional foreground background weight)
-  "Set NAME and NAME-i faces with given FOREGROUND, BACKGROUND and WEIGHT"
-
-  (apply #'set-face-attribute `(,name nil
-                                ,@(when foreground `(:foreground ,foreground))
-                                ,@(when background `(:background ,background))
-                                ,@(when weight `(:weight ,weight))))
-  (apply #'set-face-attribute `(,(intern (concat (symbol-name name) "-i")) nil
-                                :foreground ,(face-background 'nano-default)
-                                ,@(when foreground `(:background ,foreground))
-                                :weight regular)))
-
-(defun nano-link-face (sources faces &optional attributes)
-  "Make FACES to inherit from SOURCES faces and unspecify ATTRIBUTES."
-
-  (let ((attributes (or attributes
-                        '( :foreground :background :family :weight
-                           :height :slant :overline :underline :box))))
-    (dolist (face (seq-filter #'facep faces))
-      (dolist (attribute attributes)
-        (set-face-attribute face nil attribute 'unspecified))
-      (set-face-attribute face nil :inherit sources))))
-
-(defun nano-install-theme ()
-  "Install THEME"
-
-  (set-face-attribute 'default nil
-                      :foreground (face-foreground 'nano-default)
-                      :background (face-background 'nano-default))
-  (dolist (item '((nano-default .  (variable-pitch variable-pitch-text
-                                    fixed-pitch fixed-pitch-serif))
-                  (nano-highlight . (hl-line highlight))
-                  (nano-subtle .    (match region
-                                     lazy-highlight widget-field))
-                  (nano-faded .     (shadow
-                                     font-lock-comment-face
-                                     font-lock-doc-face
-                                     icomplete-section
-                                     completions-annotations))
-                  (nano-popout .    (warning
-                                     font-lock-string-face))
-                  (nano-salient .   (success link
-                                     help-argument-name
-                                     custom-visibility
-                                     font-lock-type-face
-                                     font-lock-keyword-face
-                                     font-lock-builtin-face
-                                     completions-common-part))
-                  (nano-strong .    (font-lock-function-name-face
-                                     font-lock-variable-name-face
-                                     icomplete-first-match
-                                     minibuffer-prompt))
-                  (nano-critical .  (error
-                                     completions-first-difference))
-                  (nano-faded-i .   (help-key-binding))
-                  (nano-default-i . (custom-button-mouse
-                                     isearch))
-                  (nano-critical-i . (isearch-fail))
-                  ((nano-subtle nano-strong) . (custom-button
-                                                icomplete-selected-match))
-                  ((nano-faded-i nano-strong) . (show-paren-match))))
-    (nano-link-face (car item) (cdr item)))
-
-  ;; Mode & header lines 
-  (set-face-attribute 'header-line nil
-                      :background 'unspecified
-                      :underline nil
-                      :box `( :line-width 1
-                              :color ,(face-background 'nano-default))
-                      :inherit 'nano-subtle)
-  (set-face-attribute 'mode-line nil
-                      :background (face-background 'default)
-                      :underline (face-foreground 'nano-faded)
-                      :height 40 :overline nil :box nil)
-  (set-face-attribute 'mode-line-inactive nil
-                      :background (face-background 'default)
-                      :underline (face-foreground 'nano-faded)
-                      :height 40 :overline nil :box nil))
-
-(defun nano-light (&rest args)
-  "NANO light theme (based on material colors)"
-
-  (interactive)
-  (nano-set-face 'nano-default "#37474F" "#FFFFFF") ;; Blue Grey / L800
-  (nano-set-face 'nano-strong "#000000" nil 'regular) ;; Black
-  (nano-set-face 'nano-highlight nil "#FAFAFA") ;; Very Light Grey
-  (nano-set-face 'nano-subtle nil "#ECEFF1") ;; Blue Grey / L50
-  (nano-set-face 'nano-faded "#90A4AE") ;; Blue Grey / L300
-  (nano-set-face 'nano-salient "#673AB7") ;; Deep Purple / L500
-  (nano-set-face 'nano-popout "#FFAB91") ;; Deep Orange / L200
-  (nano-set-face 'nano-critical "#FF6F00") ;; Amber / L900
-  (nano-install-theme))
-  
-(defun nano-dark (&rest args)
-  "NANO dark theme (based on nord colors)"
-
-  (interactive)
-  (nano-set-face 'nano-default "#ECEFF4" "#2E3440") ;; Snow Storm 3 
-  (nano-set-face 'nano-strong "#ECEFF4" nil 'regular) ;; Polar Night 0
-  (nano-set-face 'nano-highlight nil "#3B4252")  ;; Polar Night 1
-  (nano-set-face 'nano-subtle nil "#434C5E") ;; Polar Night 2 
-  (nano-set-face 'nano-faded "#677691") ;; 
-  (nano-set-face 'nano-salient "#81A1C1")  ;; Frost 2
-  (nano-set-face 'nano-popout "#D08770") ;; Aurora 1
-  (nano-set-face 'nano-critical "#EBCB8B") ;; Aurora 2
-  (nano-install-theme))
-
-;; --- Command line theme chooser ---------------------------------------------
-(add-to-list 'command-switch-alist '("-dark"  . nano-dark))
-(add-to-list 'command-switch-alist '("-light" . nano-light))
-(if (member "-dark" command-line-args) (nano-dark) (nano-light))
-
-;; --- Minibuffer completion --------------------------------------------------
-(setq tab-always-indent 'complete
-      icomplete-delay-completions-threshold 0
-      icomplete-compute-delay 0
-      icomplete-show-matches-on-no-input t
-      icomplete-hide-common-prefix nil
-      icomplete-prospects-height 9
-      icomplete-separator " . "
-      icomplete-with-completion-tables t
-      icomplete-in-buffer t
-      icomplete-max-delay-chars 0
-      icomplete-scroll t
-      resize-mini-windows 'grow-only
-      icomplete-matches-format nil)
-(bind-key "TAB" #'icomplete-force-complete icomplete-minibuffer-map)
-(bind-key "RET" #'icomplete-force-complete-and-exit icomplete-minibuffer-map)
-
-;; --- Minimal key bindings ---------------------------------------------------
-(defun nano-quit ()
-  "Quit minibuffer from anywhere (code from Protesilaos Stavrou)"
-
-  (interactive)
-  (cond ((region-active-p) (keyboard-quit))
-        ((derived-mode-p 'completion-list-mode) (delete-completion-window))
-        ((> (minibuffer-depth) 0) (abort-recursive-edit))
-        (t (keyboard-quit))))
-
-(defun nano-kill ()
-  "Delete frame or kill emacs if there is only one frame left"
-
-  (interactive)
-  (condition-case nil
-      (delete-frame)
-    (error (save-buffers-kill-terminal))))
-
-(bind-key "C-x k" #'kill-current-buffer)
-(bind-key "C-x C-c" #'nano-kill)
-(bind-key "C-x C-r" #'recentf-open)
-(bind-key "C-g" #'nano-quit)
-(bind-key "M-n" #'make-frame)
-(bind-key "C-z"  nil) ;; No suspend frame
-(bind-key "C-<wheel-up>" nil) ;; No text resize via mouse scroll
-(bind-key "C-<wheel-down>" nil) ;; No text resize via mouse scroll
-
-;; --- Sane settings ----------------------------------------------------------
-(set-default-coding-systems 'utf-8)
-(setq-default indent-tabs-mode nil
-              ring-bell-function 'ignore
-              select-enable-clipboard t)
-
-;; --- OSX Specific -----------------------------------------------------------
-(when (eq system-type 'darwin)
-  (select-frame-set-input-focus (selected-frame))
-  (setq mac-option-modifier nil
-        ns-function-modifier 'super
-        mac-right-command-modifier 'hyper
-        mac-right-option-modifier 'alt
-        mac-command-modifier 'meta))
-
-;; --- Header & mode lines ----------------------------------------------------
-(setq-default mode-line-format "")
-(setq-default header-line-format
-  '(:eval
-    (let ((prefix (cond (buffer-read-only     '("RO" . nano-default-i))
-                        ((buffer-modified-p)  '("**" . nano-critical-i))
-                        (t                    '("RW" . nano-faded-i))))
-          (mode (concat "(" (downcase (cond ((consp mode-name) (car mode-name))
-                                            ((stringp mode-name) mode-name)
-                                            (t "unknow")))
-                        " mode)"))
-          (coords (format-mode-line "%c:%l ")))
-      (list
-       (propertize " " 'face (cdr prefix)  'display '(raise -0.25))
-       (propertize (car prefix) 'face (cdr prefix))
-       (propertize " " 'face (cdr prefix) 'display '(raise +0.25))
-       (propertize (format-mode-line " %b ") 'face 'nano-strong)
-       (propertize mode 'face 'header-line)
-       (propertize " " 'display `(space :align-to (- right ,(length coords))))
-       (propertize coords 'face 'nano-faded)))))
-
-;; --- Minibuffer setup -------------------------------------------------------
-(defun nano-minibuffer--setup ()
-  (set-window-margins nil 3 0)
-  (let ((inhibit-read-only t))
-    (add-text-properties (point-min) (+ (point-min) 1)
-      `(display ((margin left-margin)
-                 ,(format "# %s" (substring (minibuffer-prompt) 0 1))))))
-  (setq truncate-lines t))
-(add-hook 'minibuffer-setup-hook #'nano-minibuffer--setup)
-
-;; --- Speed benchmarking -----------------------------------------------------
-(let ((init-time (float-time (time-subtract (current-time) init-start-time)))
-      (total-time (string-to-number (emacs-init-time "%f"))))
-  (message (concat
-    (propertize "Startup time: " 'face 'bold)
-    (format "%.2fs " init-time)
-    (propertize (format "(+ %.2fs system time)"
-                        (- total-time init-time)) 'face 'shadow))))
dots/.config/emacs/old/prot-init.el
@@ -1,170 +0,0 @@
-;; From https://protesilaos.com/codelog/2024-11-28-basic-emacs-configuration/
-;; For inspiration
-(setq custom-file (locate-user-emacs-file "custom.el"))
-(load custom-file :no-error-if-file-is-missing)
-
-;;; Set up the package manager
-
-(require 'package)
-(package-initialize)
-
-(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
-
-(when (< emacs-major-version 29)
-  (unless (package-installed-p 'use-package)
-    (unless package-archive-contents
-      (package-refresh-contents))
-    (package-install 'use-package)))
-
-(add-to-list 'display-buffer-alist
-             '("\\`\\*\\(Warnings\\|Compile-Log\\)\\*\\'"
-               (display-buffer-no-window)
-               (allow-no-window . t)))
-
-;;; Basic behaviour
-
-(use-package delsel
-  :ensure nil
-  :hook (after-init . delete-selection-mode))
-
-(defun prot/keyboard-quit-dwim ()
-  "Do-What-I-Mean behaviour for a general `keyboard-quit'.
-
-The generic `keyboard-quit' does not do the expected thing when
-the minibuffer is open.  Whereas we want it to close the
-minibuffer, even without explicitly focusing it.
-
-The DWIM behaviour of this command is as follows:
-
-- When the region is active, disable it.
-- When a minibuffer is open, but not focused, close the minibuffer.
-- When the Completions buffer is selected, close it.
-- In every other case use the regular `keyboard-quit'."
-  (interactive)
-  (cond
-   ((region-active-p)
-    (keyboard-quit))
-   ((derived-mode-p 'completion-list-mode)
-    (delete-completion-window))
-   ((> (minibuffer-depth) 0)
-    (abort-recursive-edit))
-   (t
-    (keyboard-quit))))
-
-(define-key global-map (kbd "C-g") #'prot/keyboard-quit-dwim)
-
-;;; Tweak the looks of Emacs
-
-;; Those three belong in the early-init.el, but I am putting them here
-;; for convenience.  If the early-init.el exists in the same directory
-;; as the init.el, then Emacs will read+evaluate it before moving to
-;; the init.el.
-(menu-bar-mode 1)
-(scroll-bar-mode 1)
-(tool-bar-mode -1)
-
-(let ((mono-spaced-font "Monospace")
-      (proportionately-spaced-font "Sans"))
-  (set-face-attribute 'default nil :family mono-spaced-font :height 100)
-  (set-face-attribute 'fixed-pitch nil :family mono-spaced-font :height 1.0)
-  (set-face-attribute 'variable-pitch nil :family proportionately-spaced-font :height 1.0))
-
-(use-package modus-themes
-  :ensure t
-  :config
-  (load-theme 'modus-vivendi-tinted :no-confirm-loading))
-
-;; Remember to do M-x and run `nerd-icons-install-fonts' to get the
-;; font files.  Then restart Emacs to see the effect.
-(use-package nerd-icons
-  :ensure t)
-
-(use-package nerd-icons-completion
-  :ensure t
-  :after marginalia
-  :config
-  (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))
-
-(use-package nerd-icons-corfu
-  :ensure t
-  :after corfu
-  :config
-  (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
-
-(use-package nerd-icons-dired
-  :ensure t
-  :hook
-  (dired-mode . nerd-icons-dired-mode))
-
-;;; Configure the minibuffer and completions
-
-(use-package vertico
-  :ensure t
-  :hook (after-init . vertico-mode))
-
-(use-package marginalia
-  :ensure t
-  :hook (after-init . marginalia-mode))
-
-(use-package orderless
-  :ensure t
-  :config
-  (setq completion-styles '(orderless basic))
-  (setq completion-category-defaults nil)
-  (setq completion-category-overrides nil))
-
-(use-package savehist
-  :ensure nil ; it is built-in
-  :hook (after-init . savehist-mode))
-
-(use-package corfu
-  :ensure t
-  :hook (after-init . global-corfu-mode)
-  :bind (:map corfu-map ("<tab>" . corfu-complete))
-  :config
-  (setq tab-always-indent 'complete)
-  (setq corfu-preview-current nil)
-  (setq corfu-min-width 20)
-
-  (setq corfu-popupinfo-delay '(1.25 . 0.5))
-  (corfu-popupinfo-mode 1) ; shows documentation after `corfu-popupinfo-delay'
-
-  ;; Sort by input history (no need to modify `corfu-sort-function').
-  (with-eval-after-load 'savehist
-    (corfu-history-mode 1)
-    (add-to-list 'savehist-additional-variables 'corfu-history)))
-
-;;; The file manager (Dired)
-
-(use-package dired
-  :ensure nil
-  :commands (dired)
-  :hook
-  ((dired-mode . dired-hide-details-mode)
-   (dired-mode . hl-line-mode))
-  :config
-  (setq dired-recursive-copies 'always)
-  (setq dired-recursive-deletes 'always)
-  (setq delete-by-moving-to-trash t)
-  (setq dired-dwim-target t))
-
-(use-package dired-subtree
-  :ensure t
-  :after dired
-  :bind
-  ( :map dired-mode-map
-    ("<tab>" . dired-subtree-toggle)
-    ("TAB" . dired-subtree-toggle)
-    ("<backtab>" . dired-subtree-remove)
-    ("S-TAB" . dired-subtree-remove))
-  :config
-  (setq dired-subtree-use-backgrounds nil))
-
-(use-package trashed
-  :ensure t
-  :commands (trashed)
-  :config
-  (setq trashed-action-confirmer 'y-or-n-p)
-  (setq trashed-use-header-line t)
-  (setq trashed-sort-key '("Date deleted" . t))
-  (setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
dots/.config/emacs/old/templates
@@ -1,156 +0,0 @@
-;; ~/.config/emacs/templates
-
-fundamental-mode ;; Available everywhere
-
-(today (format-time-string "%Y-%m-%d"))
-
-prog-mode
-
-(fixme (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "FIXME ")
-(todo (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "TODO ")
-(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
-(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
-
-lisp-mode emacs-lisp-mode ;; Specify multiple modes
-
-(lambda "(lambda (" p ")" n> r> ")")
-
-emacs-lisp-mode
-
-(autoload ";;;###autoload")
-(pt "(point)")
-(var "(defvar " p "\n  \"" p "\")")
-(local "(defvar-local " p "\n  \"" p "\")")
-(const "(defconst " p "\n  \"" p "\")")
-(custom "(defcustom " p "\n  \"" p "\"" n> ":type '" p ")")
-(face "(defface " p " '((t :inherit " p "))\n  \"" p "\")")
-(group "(defgroup " p " nil\n  \"" p "\"" n> ":group '" p n> ":prefix \"" p "-\")")
-(macro "(defmacro " p " (" p ")\n  \"" p "\"" n> r> ")")
-(alias "(defalias '" p " '" p ")")
-(fun "(defun " p " (" p ")\n  \"" p "\"" n> r> ")")
-(iflet "(if-let (" p ")" n> r> ")")
-(whenlet "(when-let (" p ")" n> r> ")")
-(whilelet "(while-let (" p ")" n> r> ")")
-(andlet "(and-let* (" p ")" n> r> ")")
-(cond "(cond" n "(" q "))" >)
-(pcase "(pcase " (p "scrutinee") n "(" q "))" >)
-(let "(let (" p ")" n> r> ")")
-(lett "(let* (" p ")" n> r> ")")
-(pcaselet "(pcase-let (" p ")" n> r> ")")
-(pcaselett "(pcase-let* (" p ")" n> r> ")")
-(rec "(letrec (" p ")" n> r> ")")
-(dotimes "(dotimes (" p ")" n> r> ")")
-(dolist "(dolist (" p ")" n> r> ")")
-(loop "(cl-loop for " p " in " p " do" n> r> ")")
-(command "(defun " p " (" p ")\n  \"" p "\"" n> "(interactive" p ")" n> r> ")")
-(advice "(defun " (p "adv" name) " (&rest app)" n> p n> "(apply app))" n>
-        "(advice-add #'" (p "fun") " " (p ":around") " #'" (s name) ")")
-(header ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
-        " -- " p " -*- lexical-binding: t -*-" n
-        ";;; Commentary:" n ";;; Code:" n n)
-(provide "(provide '" (file-name-base (or (buffer-file-name) (buffer-name))) ")" n
-         ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name)))
-         " ends here" n)
-(package ";;; " (file-name-base (or (buffer-file-name) (buffer-name))) " --- " p " -*- lexical-binding: t -*-"
-   n n
-   ";; Copyright (C) " (format-time-string "%Y") " Vincent Demeester" n
-   ";; Author: Vincent Demeester <vincent@sbr.pm>" n n
-   ";; This file is NOT part of GNU Emacs." n
-   ";;; Commentary:" n p n
-   ";;; Code:" n p n
-   "(provide '" (file-name-base (or (buffer-file-name) (buffer-name))) ")" n
-   ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name))) " ends here" n)
-
-eshell-mode
-
-(for "for " (p "i") " in " p " { " q " }")
-(while "while { " p " } { " q " }")
-(until "until { " p " } { " q " }")
-(if "if { " p " } { " q " }")
-(ife "if { " p " } { " p " } { " q " }")
-(unl "unless { " p " } { " q " }")
-(unle "unless { " p " } { " p " } { " q " }")
-
-text-mode
-
-(box "┌─" (make-string (length str) ?─) "─┐" n
-     "│ " (s str)                       " │" n
-     "└─" (make-string (length str) ?─) "─┘" n)
-(abox "+-" (make-string (length str) ?-) "-+" n
-      "| " (s str)                       " |" n
-      "+-" (make-string (length str) ?-) "-+" n)
-(cut "--8<---------------cut here---------------start------------->8---" n r n
-     "--8<---------------cut here---------------end--------------->8---" n)
-(rot13 (p "plain text" text) n "----" n (rot13 text))
-(calc (p "taylor(sin(x),x=0,3)" formula) n "----" n (format "%s" (calc-eval formula)))
-
-org-mode
-
-(caption "#+caption: ")
-(drawer ":" p ":" n r ":end:")
-(begin "#+begin_" (s name) n> r> n "#+end_" name)
-(quote "#+begin_quote" n> r> n "#+end_quote")
-(sidenote "#+begin_sidenote" n> r> n "#+end_sidenote")
-(marginnote "#+begin_marginnote" n> r> n "#+end_marginnote")
-(example "#+begin_example" n> r> n "#+end_example")
-(center "#+begin_center" n> r> n "#+end_center")
-(ascii "#+begin_export ascii" n> r> n "#+end_export")
-(html "#+begin_export html" n> r> n "#+end_export")
-(latex "#+begin_export latex" n> r> n "#+end_export")
-(comment "#+begin_comment" n> r> n "#+end_comment")
-(verse "#+begin_verse" n> r> n "#+end_verse")
-(src "#+begin_src " q n r n "#+end_src")
-(gnuplot "#+begin_src gnuplot :var data=" (p "table") " :file " (p "plot.png") n r n "#+end_src" :post (org-edit-src-code))
-(elisp "#+begin_src emacs-lisp" n r n "#+end_src" :post (org-edit-src-code))
-(inlsrc "src_" p "{" q "}")
-(title "#+title: " p n "#+author: Daniel Mendler" n "#+language: en")
-(category "#+category: " (vde/org-category-from-buffer))
-(call & "#+call: " (p "name" name) "(" (s var) "=\"" (s value) "\")")
-(/ "[/]" (org-update-statistics-cookies nil))
-(tsm p " :: " (with-temp-buffer (org-insert-time-stamp (current-time) t t)))
-(pdeadline "#+PROJECT_DEADLINE: " (org-read-date))
-(ppath "#+PROJECT_PATHS: (" p " . " q ")")
-(backlinks "#+BEGIN: denote-backlinks :sort-by-component nil :reverse-sort nil :id-only nil" n> "#+END:")
-
-bash-ts-mode bash-mode
-
-(! & "#!/usr/bin/env bash" n "set -euxfo pipefail" n q)
-(setf "set -euxfo pipefail")
-(varu "${" p ":-" p "}")
-(var "${" p "}")
-(getargs "while getopts \"h" p ":\" o; do"
- n> "case \"${o}\" in"
- n> ""p")"
- n> "s=${OPTARG}" q
- n> ";;"
- n> "h)"
- n> "help"
- n> "exit 0"
- n> ";;"
- n> "*)"
- n> "echo \"Invalid option\"; help; exit 1;"
- n> "help"
- n> "exit 1"
- n> ";;"
- n> "esac"
- n> "done"
- n> "shift $((OPTIND-1))")
-(whiche "command -v " (s bin) " >/dev/null 2>&1 || { echo \"need " bin " in path\"; exit 1; }")
-(tmpf "TMP=$(mktemp /tmp/.mm.XXXXXX)"
- n> "clean() { rm -f ${TMP}; }"
- n> "trap clean EXIT"
- n> q)
-
-go-ts-mode go-mode
-
-(fpln "fmt.Println(" p ")")
-(fpf "fmt.Printf(" p ", " p ")")
-(main "package main" n n "import (" n> "\"fmt\"" n ")" n n "func main() {" n> q n "}")
-(testcase "tests := []struct {" n> "name string" n> p "}{" n> "}" n> "for _, tt := range tests {" n> "t.Run(tt.name, func(t *testing.T) {" n> q n> "})" n> "}")
-(testfunc "func Test" (s name) "(t *testing.T) {" n> q n "}")
-
-
-;; Local Variables:
-;; mode: lisp-data
-;; outline-regexp: "[a-z]"
-;; End: