From b3d8e5d5e0e9c54c0bdeae27ea5b204f924bb952 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:53:02 +0200 Subject: [PATCH 1/7] update elpaca --- ReadMe.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReadMe.org b/ReadMe.org index 835b9d8..ea713ba 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -75,8 +75,8 @@ Let's setup also additional frame settings that are nice to have. I am using the ~elpaca~ package manager, that needs to be bootstrapped because it is not included in ~emacs~. #+begin_src emacs-lisp :tangle "early-init.el" - (setq elpaca-core-date '(20250301)) - (defvar elpaca-installer-version 0.10) + (setq elpaca-core-date '(20250621)) + (defvar elpaca-installer-version 0.11) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) (defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) @@ -111,7 +111,7 @@ I am using the ~elpaca~ package manager, that needs to be bootstrapped because i (unless (require 'elpaca-autoloads nil t) (require 'elpaca) (elpaca-generate-autoloads "elpaca" repo) - (load "./elpaca-autoloads"))) + (let ((load-source-file-function nil)) (load "./elpaca-autoloads")))) (add-hook 'after-init-hook #'elpaca-process-queues) (elpaca `(,@elpaca-order)) (setq package-enable-at-startup nil) From de4c83b15ba220c353a06dcd15c755555d60d5c8 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:53:27 +0200 Subject: [PATCH 2/7] add long lines fix --- ReadMe.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ReadMe.org b/ReadMe.org index ea713ba..5dfc2ab 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -245,6 +245,17 @@ I use the ~doom-modeline~, it's nice and clean. (doom-modeline-mode 1)) #+end_src +** Long lines... + +... Are painful + +#+begin_src emacs-lisp :tangle "init.el" + (setq-default bidi-paragraph-direction 'left-to-right) + (setq bidi-inhibit-bpa t) + (global-so-long-mode 1) +#+end_src + + ** Nerd icons From e74da5c70a0406e2b9fdef45d12cde80dafc9c1d Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:54:14 +0200 Subject: [PATCH 3/7] some font improvements --- ReadMe.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ReadMe.org b/ReadMe.org index 5dfc2ab..519e6db 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -19,6 +19,7 @@ The ~early-init.el~ file is the first file loaded during ~emacs~ initialisation. I want to configure the frame size if I am in a non-tiling window manager, for this I define the ~with-desktop-session~ macro, inspired by [[https://protesilaos.com/emacs/dotemacs][Protesilaos Stavrou's emacs configuration]]. #+begin_src emacs-lisp :tangle "early-init.el" + ;;; -*- lexical-binding: t -*- (defvar luj/tiling-window-manager-regexp "hyprland\\|none\\+exwm" "Regular expression to tiling window managers. See definition of the `with-desktop-session' macro.") @@ -324,10 +325,14 @@ Nerd icons are a nice addition to the UI, I try to enable them wherever I can. :default-height 150) (presentation :inherit medium - :default-height 180) + :default-height 165) (jumbo :inherit medium :default-height 260) + (dell-docked + :inherit medium + :default-height 200) + (t :default-weight regular :default-slant normal From 19402826a18e44ac5089e9933ce35a4401ba5e37 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:54:25 +0200 Subject: [PATCH 4/7] save org agenda stuff when leaving --- ReadMe.org | 1 + 1 file changed, 1 insertion(+) diff --git a/ReadMe.org b/ReadMe.org index 519e6db..eab82ce 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -875,6 +875,7 @@ To add new tasks to my agenda, I first use a capture template to generally write "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t) ("h" "Habit" entry (file "~/dev/todos/inbox.org") "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))) + (advice-add 'org-agenda-quit :before 'org-save-all-org-buffers) #+end_src I will then refile the tasks in inbox to any of my agenda files sections. From 6772179cbc906e74312d025c858ef2c12fe44bd2 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:55:09 +0200 Subject: [PATCH 5/7] add sly --- ReadMe.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ReadMe.org b/ReadMe.org index eab82ce..3fae63f 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -1640,3 +1640,9 @@ Well, why not use it for PDF? Also integrate with /LaTeX/ etc. :ensure (:host github :repo "havarddj/typst-preview.el")) #+end_src +*** Lisp + +#+begin_src emacs-lisp :tangle "init.el" + (use-package sly + :ensure t) +#+end_src From 214d624b4aa4d82c0e120f88e62b44a36d5a381f Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:55:17 +0200 Subject: [PATCH 6/7] add vterm --- ReadMe.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReadMe.org b/ReadMe.org index 3fae63f..6f2f948 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -1419,6 +1419,8 @@ The compilation buffer is very useful to launch ephemeral processes. :config (add-hook 'eshell-load-hook #'eat-eshell-mode))) + (use-package vterm + :ensure t) (defun eat-meow-setup () (add-hook 'meow-normal-mode-hook 'eat-emacs-mode nil t) From 98063b3e149629fdb4aa1d0f2aa1223ee9083af0 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 23 Jul 2025 20:55:33 +0200 Subject: [PATCH 7/7] notmuch stuff --- ReadMe.org | 270 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 215 insertions(+), 55 deletions(-) diff --git a/ReadMe.org b/ReadMe.org index 6f2f948..b1a1295 100644 --- a/ReadMe.org +++ b/ReadMe.org @@ -1144,84 +1144,213 @@ I use ~notmuch~ to index and search through my large mail inboxes. #+begin_src emacs-lisp :tangle "init.el" - (use-package notmuch - :ensure t - :init - - (setq notmuch-search-oldest-first nil) - (setq notmuch-show-logo nil + (use-package notmuch + :ensure t + :init + (setq notmuch-search-oldest-first nil) + (setq notmuch-show-logo nil notmuch-column-control 1.0 notmuch-hello-auto-refresh t notmuch-hello-recent-searches-max 20 notmuch-hello-thousands-separator "" notmuch-hello-sections '(notmuch-hello-insert-saved-searches) notmuch-show-all-tags-list t) - (setq notmuch-show-empty-saved-searches t) - (setq notmuch-saved-searches - `(( :name "telecom/inbox" - :query "tag:inbox and tag:telecom and folder:telecom/INBOX" - :sort-order newest-first - :key ,(kbd "i")) - ( :name "telecom/CGT" - :query "tag:telecom and tag:inbox and tag:cgt" - :sort-order newest-first - :key ,(kbd "u")) - ( :name "telecom/all" - :query "tag:telecom and tag:inbox" - :sort-order newest-first - :key ,(kbd "o")) - ( :name "work/inbox" - :query "tag:work and folder:work/INBOX" - :sort-order newest-first - :key ,(kbd "p")) - ( :name "work/RB" - :query "tag:work and tag:inbox and tag:reproducible-builds" - :sort-order newest-first - :key ,(kbd "c")) + (setq notmuch-show-empty-saved-searches t) + (setq notmuch-saved-searches + `(( :name "telecom/inbox" + :query "tag:inbox and tag:telecom and folder:telecom/INBOX" + :sort-order newest-first + :key ,(kbd "t i")) + ( :name "telecom/CGT" + :query "tag:telecom and tag:inbox and tag:cgt" + :sort-order newest-first + :key ,(kbd "t c")) + ( :name "telecom/all" + :query "tag:telecom and tag:inbox" + :sort-order newest-first + :key ,(kbd "t a")) + ( :name "work/inbox" + :query "tag:work and tag:inbox and folder:work/INBOX" + :sort-order newest-first + :key ,(kbd "w i")) + ( :name "work/RB" + :query "tag:work and tag:inbox and tag:reproducible-builds" + :sort-order newest-first + :key ,(kbd "w r")) ( :name "work/bluehats" :query "tag:work and tag:inbox and tag:bluehats" :sort-order newest-first - :key ,(kbd "p")) + :key ,(kbd "w b")) ( :name "work/all" :query "tag:work and tag:inbox" :sort-order newest-first - :key ,(kbd "p")))) + :key ,(kbd "w a")) + ( :name "ens/inbox" + :query "tag:inbox and tag:ens" + :sort-order newest-first + :key ,(kbd "e i")) + ( :name "dgnum/inbox" + :query "tag:inbox and tag:dgnum and folder:dgnum/INBOX" + :sort-order newest-first + :key ,(kbd "d i")) + ( :name "dgnum/bureau" + :query "tag:inbox and tag:dgnum and tag:bureau" + :sort-order newest-first + :key ,(kbd "d b")) + ( :name "dgnum/federez" + :query "tag:inbox and tag:dgnum and tag:federez" + :sort-order newest-first + :key ,(kbd "d f")) + ( :name "dgnum/nixcon" + :query "tag:inbox and tag:dgnum and tag:nixcon" + :sort-order newest-first + :key ,(kbd "d n")) + ( :name "dgnum/fai" + :query "tag:inbox and tag:dgnum and tag:fai" + :sort-order newest-first + :key ,(kbd "d f")) + ( :name "dgnum/all" + :query "tag:inbox and tag:dgnum" + :sort-order newest-first + :key ,(kbd "d a")) + )) - (setq notmuch-search-result-format - '(("date" . "%12s ") - ("count" . "%-7s ") - ("authors" . "%-20s ") - ("subject" . "%-80s ") - ("tags" . "(%s)"))) - - (setq notmuch-tree-result-format - '(("date" . "%12s ") - ("authors" . "%-20s ") - ((("tree" . "%s") - ("subject" . "%s")) - . " %-80s ") - ("tags" . "(%s)"))) + (setq notmuch-archive-tags '("+archive" "-inbox" "-unread" "-junk") + notmuch-message-replied-tags '("+replied") + notmuch-message-deleted-tags '("+trash" "-inbox" "-unread" "-junk") + notmuch-message-forwarded-tags '("+forwarded") + notmuch-show-mark-read-tags '("-unread") + notmuch-draft-tags '("+draft") + notmuch-draft-folder "drafts" + notmuch-draft-save-plaintext 'ask) - (setq notmuch-search-oldest-first nil) - (add-to-list 'meow-mode-state-list '(notmuch-hello-mode . motion)) - (add-to-list 'meow-mode-state-list '(notmuch-search-mode . motion)) - (add-to-list 'meow-mode-state-list '(notmuch-tree-mode . motion)) - (add-to-list 'meow-mode-state-list '(notmuch-show-mode . motion)) + (setq notmuch-search-result-format + '(("date" . "%12s ") + ("count" . "%-7s ") + ("authors" . "%-20s ") + ("subject" . "%-80s ") + ("tags" . "(%s)"))) + + (setq notmuch-tree-result-format + '(("date" . "%12s ") + ("authors" . "%-20s ") + ((("tree" . "%s") + ("subject" . "%s")) + . " %-80s ") + ("tags" . "(%s)"))) - (setq mail-specify-envelope-from t) - (setq message-sendmail-envelope-from 'header) - (setq mail-envelope-from 'header)) + (setq notmuch-search-oldest-first nil) + (add-to-list 'meow-mode-state-list '(notmuch-hello-mode . motion)) + (add-to-list 'meow-mode-state-list '(notmuch-search-mode . motion)) + (add-to-list 'meow-mode-state-list '(notmuch-tree-mode . motion)) + (add-to-list 'meow-mode-state-list '(notmuch-show-mode . motion)) + + (setq mail-specify-envelope-from t) + (setq message-sendmail-envelope-from 'header) + (setq mail-envelope-from 'header)) + +#+end_src + +** Composition + +#+begin_src emacs-lisp :tangle "init.el" + (use-package notmuch + :ensure nil + :after notmuch + :defer t + :config + (setq notmuch-mua-compose-in 'current-window) + (setq notmuch-mua-hidden-headers nil) + (setq notmuch-always-prompt-for-sender t) + (setq notmuch-mua-cite-function 'message-cite-original-without-signature) + (setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never) + (setq notmuch-mua-user-agent-function nil) + (setq notmuch-maildir-use-notmuch-insert t) + (setq notmuch-crypto-process-mime t) + (setq notmuch-crypto-get-keys-asynchronously t) + (setq notmuch-mua-attachment-regexp ; see `notmuch-mua-send-hook' + (concat "\\b\\(attache\?ment\\|attached\\|attach\\|" + "pi[èe]ce\s+jointe?\\|" + "συνημμ[εέ]νο\\|επισυν[αά]πτω\\)\\b"))) +#+end_src + +** Reading messages + +#+begin_src emacs-lisp :tangle "init.el" + (use-package notmuch + :ensure nil + :after notmuch + :defer t + :config + (setq notmuch-show-relative-dates t) + (setq notmuch-show-all-multipart/alternative-parts nil) + (setq notmuch-show-indent-messages-width 0) + (setq notmuch-show-indent-multipart nil) + (setq notmuch-show-part-button-default-action 'notmuch-show-view-part) + (setq notmuch-wash-wrap-lines-length 120) + (setq notmuch-unthreaded-show-out nil) + (setq notmuch-message-headers '("To" "Cc" "Subject" "Date")) + (setq notmuch-message-headers-visible t)) +#+end_src + + +** Bindings + +#+begin_src emacs-lisp :tangle "init.el" + (use-package notmuch + :ensure nil + :after notmuch + :demand t + :hook + (notmuch-mua-send . notmuch-mua-attachment-check) + :config + (defun notmuch-tag-then-archive () + "First prompt for tags to add via notmuch-search-tag, then archive the thread." + (interactive) + (call-interactively 'notmuch-search-tag) + (notmuch-search-archive-thread)) + + (defun notmuch-search-message-delete () + (interactive) + "Delete message and select next message." + (notmuch-search-tag notmuch-message-deleted-tags) + (notmuch-search-next-thread)) + + (remove-hook 'notmuch-show-hook #'notmuch-show-turn-on-visual-line-mode) + (remove-hook 'notmuch-search-hook #'notmuch-hl-line-mode) ; Check my `lin' package + :bind + ( :map global-map + ("C-c m" . notmuch-jump-search) + ("C-x m" . notmuch-mua-new-mail) + :map notmuch-search-mode-map + ("A" . notmuch-tag-then-archive) + ("a" . notmuch-search-archive-thread) + ("D" . notmuch-search-message-delete) + ("/" . notmuch-search-filter) ; alias for l + ("r" . notmuch-search-reply-to-thread) ; easier to reply to all by default + ("R" . notmuch-search-reply-to-thread-sender) + :map notmuch-show-mode-map + ("a" . nil) + ("A" . nil) + ("r" . notmuch-show-reply) + ("R" . notmuch-show-reply-sender) + :map notmuch-hello-mode-map + ("C-" . nil))) +#+end_src + + + + +#+begin_src emacs-lisp :tangle "init.el" (use-package notmuch-addr :ensure t) (with-eval-after-load 'notmuch-address (notmuch-addr-setup)) - (setq sendmail-program "msmtp" send-mail-function 'smtpmail-send-it - message-sendmail-f-is-evil t message-sendmail-envelope-from 'header message-send-mail-function 'message-send-mail-with-sendmail) @@ -1301,7 +1430,33 @@ I want the number of unread messages in my ~notmuch-hello~ buffer. (advice-add 'notmuch-hello-insert-buttons :override #'luj/notmuch-hello-insert-buttons) #+end_src - +Let's add an indicator in the modeline, as well: + +#+begin_src emacs-lisp :tangle "init.el" + (use-package notmuch-indicator + :ensure t + :after notmuch + :config + (setq notmuch-indicator-args + '(( :terms "tag:unread and tag:inbox and tag:telecom and folder:telecom/INBOX" + :label "🔍 ") + ( :terms "tag:unread and tag:inbox and tag:work and folder:work/INBOX" + :label "🚧 ") + ( :terms "tag:unread and tag:inbox and tag:ens" + :label "🎓 ") + ( :terms "tag:unread and tag:inbox and tag:dgnum and folder:dgnum/INBOX" + :label "💾 ")) + + notmuch-indicator-refresh-count 60 + notmuch-indicator-hide-empty-counters t + notmuch-indicator-notmuch-config-file "/home/julien/.config/notmuch/default/config" + notmuch-indicator-force-refresh-commands '(notmuch-refresh-this-buffer)) + + (notmuch-indicator-mode 1)) + +#+end_src + + * Programming @@ -1513,6 +1668,10 @@ I don't like how I must open another buffer to get documentation, so let's go wi :after eglot :hook (python-mode . eglot-ensure)) + + (org-babel-do-load-languages + 'org-babel-load-languages + '((python . t))) #+end_src @@ -1642,6 +1801,7 @@ Well, why not use it for PDF? Also integrate with /LaTeX/ etc. :ensure (:host github :repo "havarddj/typst-preview.el")) #+end_src + *** Lisp #+begin_src emacs-lisp :tangle "init.el"