Merge branch 'master' of github.com:SqrtMinusOne/dotfiles

This commit is contained in:
Pavel Korytov 2024-04-26 23:19:29 +03:00
commit 48e7e827e2
4 changed files with 70 additions and 29 deletions

View file

@ -786,7 +786,8 @@ Obeys `widen-automatically', which see."
:infix "g"
"g" #'counsel-mark-ring
"G" #'my/counsel-global-mark-ring
"C" #'my/mark-ring-clear)
"C" #'my/mark-ring-clear
"m" #'my/push-mark-no-activate)
(general-define-key
:keymaps 'global
@ -1241,7 +1242,9 @@ Obeys `widen-automatically', which see."
(when current-prefix-arg
(my/regenerate-desktop)))
(my/switch-theme 'ef-duo-light)
(if my/is-termux
(my/switch-theme 'modus-operandi-tinted)
(my/switch-theme 'ef-duo-light))
(with-eval-after-load 'transient
(my/use-colors
@ -1384,6 +1387,8 @@ Obeys `widen-automatically', which see."
(setq doom-modeline-persp-icon nil)
(setq doom-modeline-persp-name nil)
(setq doom-modeline-display-misc-in-all-mode-lines nil)
(when my/is-termux
(setopt doom-modeline-icon nil))
:config
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-irc nil)
@ -5072,11 +5077,13 @@ KEYS is a list of cons cells like (<label> . <time>)."
"\n"))
(setq my/org-config-files
'("/home/pavel/Emacs.org"
"/home/pavel/Desktop.org"
"/home/pavel/Console.org"
"/home/pavel/Guix.org"
"/home/pavel/Mail.org"))
(mapcar
#'expand-file-name
'("~/Emacs.org"
"~/Desktop.org"
"~/Console.org"
"~/Guix.org"
"~/Mail.org")))
(add-hook 'org-mode-hook
(lambda ()
@ -6605,7 +6612,7 @@ ENTRY is an instance of `elfeed-entry'."
(lambda (&key error-thrown &allow-other-keys)
(message "Error!: %S" error-thrown))))))
(unless (or my/is-termux my/remote-server)
(unless (or my/remote-server)
(let ((mail-file (expand-file-name "mail.el" user-emacs-directory)))
(if (file-exists-p mail-file)
(load-file mail-file)
@ -7534,7 +7541,7 @@ base toot."
(use-package telega
:straight t
:if (not (or my/remote-server my/is-termux))
:if (not (or my/remote-server))
:commands (telega)
:init
(my-leader-def "a l" (my/command-in-persp "telega" "telega" 3 (telega)))
@ -7566,8 +7573,10 @@ base toot."
(defun my/telega-server-build ()
(interactive)
(setq telega-server-libs-prefix
(string-trim
(shell-command-to-string "guix build tdlib")))
(if (executable-find "guix")
(string-trim
(shell-command-to-string "guix build tdlib"))
(expand-file-name "~/bin/td/build/res/usr/local")))
(telega-server-build "CC=gcc"))
(add-hook 'telega-load-hook #'telega-mode-line-mode)
@ -7585,6 +7594,7 @@ base toot."
"]"))
(defun my/telega-chat-setup ()
(interactive)
(set (make-local-variable 'company-backends)
(append (list 'telega-company-emoji
'telega-company-username
@ -7594,7 +7604,8 @@ base toot."
'(telega-company-botcmd))))
(company-mode 1)
(setopt visual-fill-column-width
(+ telega-chat-fill-column 4))
(+ telega-chat-fill-column
(if (display-graphic-p) 4 5)))
(setq-local split-width-threshold 1))
(add-hook 'telega-chat-mode-hook #'my/telega-chat-setup)

View file

@ -6,6 +6,10 @@
(let ((default-directory dir))
(normal-top-level-add-subdirs-to-load-path))))
(use-package notmuch
:straight t
:if my/is-termux)
(defun my/notmuch-toggle-trash ()
(interactive)
(evil-collection-notmuch-toggle-tag "trash" "search" #'ignore))
@ -69,6 +73,7 @@
(:name "pvkorytov (unread)" :query "tag:pvkorytov AND tag:unread" :key "vu")
(:name "pvkorytov (sent)" :query "tag:pvkorytov AND tag:sent" :key "vs")
(:name "pvkorytov (all mail)" :query "tag:pvkorytov" :key "va")))
(setq notmuch-show-empty-saved-searches t)
(general-define-key
:states '(normal visual)

View file

@ -1345,7 +1345,8 @@ Keybindings:
:infix "g"
"g" #'counsel-mark-ring
"G" #'my/counsel-global-mark-ring
"C" #'my/mark-ring-clear)
"C" #'my/mark-ring-clear
"m" #'my/push-mark-no-activate)
(general-define-key
:keymaps 'global
@ -1990,7 +1991,9 @@ The built-in =load-theme= does not deactivate the previous theme, so here's a fu
#+end_src
#+begin_src emacs-lisp
(my/switch-theme 'ef-duo-light)
(if my/is-termux
(my/switch-theme 'modus-operandi-tinted)
(my/switch-theme 'ef-duo-light))
#+end_src
**** Extending current theme
Colors that aren't set in themes.
@ -2189,6 +2192,8 @@ References:
(setq doom-modeline-persp-icon nil)
(setq doom-modeline-persp-name nil)
(setq doom-modeline-display-misc-in-all-mode-lines nil)
(when my/is-termux
(setopt doom-modeline-icon nil))
:config
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-irc nil)
@ -7043,11 +7048,13 @@ One note is that by default running these commands will require the user to conf
#+begin_src emacs-lisp
(setq my/org-config-files
'("/home/pavel/Emacs.org"
"/home/pavel/Desktop.org"
"/home/pavel/Console.org"
"/home/pavel/Guix.org"
"/home/pavel/Mail.org"))
(mapcar
#'expand-file-name
'("~/Emacs.org"
"~/Desktop.org"
"~/Console.org"
"~/Guix.org"
"~/Mail.org")))
(add-hook 'org-mode-hook
(lambda ()
@ -9195,7 +9202,7 @@ However, the quality of the output for Whisper is just so much better so I consi
My notmuch config now resides in [[file:Mail.org][Mail.org]].
#+begin_src emacs-lisp
(unless (or my/is-termux my/remote-server)
(unless (or my/remote-server)
(let ((mail-file (expand-file-name "mail.el" user-emacs-directory)))
(if (file-exists-p mail-file)
(load-file mail-file)
@ -10401,7 +10408,7 @@ Or you can load up Element for a moment to see what the mention was, if that's e
#+begin_src emacs-lisp
(use-package telega
:straight t
:if (not (or my/remote-server my/is-termux))
:if (not (or my/remote-server))
:commands (telega)
:init
(my-leader-def "a l" (my/command-in-persp "telega" "telega" 3 (telega)))
@ -10431,13 +10438,15 @@ Or you can load up Element for a moment to see what the mention was, if that's e
telega-webpage-mode 3 "telega"))
#+end_src
Building =telega-server= can create problems. It requires the latest version of =tdlib=, which isn't available anywhere, but I can inherit the Guix package definition.
Building =telega-server= can create problems. On Guix I can use the Guix package definition, on termux just build manually.
#+begin_src emacs-lisp
(defun my/telega-server-build ()
(interactive)
(setq telega-server-libs-prefix
(string-trim
(shell-command-to-string "guix build tdlib")))
(if (executable-find "guix")
(string-trim
(shell-command-to-string "guix build tdlib"))
(expand-file-name "~/bin/td/build/res/usr/local")))
(telega-server-build "CC=gcc"))
#+end_src
@ -10461,6 +10470,7 @@ Setting up the modeline. The default mode string doesn't look great with my othe
Configuring company backends for the chat buffer, as recommended in the manual:
#+begin_src emacs-lisp
(defun my/telega-chat-setup ()
(interactive)
(set (make-local-variable 'company-backends)
(append (list 'telega-company-emoji
'telega-company-username
@ -10470,7 +10480,8 @@ Configuring company backends for the chat buffer, as recommended in the manual:
'(telega-company-botcmd))))
(company-mode 1)
(setopt visual-fill-column-width
(+ telega-chat-fill-column 4))
(+ telega-chat-fill-column
(if (display-graphic-p) 4 5)))
(setq-local split-width-threshold 1))
(add-hook 'telega-chat-mode-hook #'my/telega-chat-setup)
#+end_src

View file

@ -127,10 +127,15 @@ Notmuch is an email indexer program, which handles labels in a way somewhat simi
Not much is going on here.
First, the database path.
#+begin_src conf-unix
First, the database path. It's different on desktop and termux.
#+NAME: get-maildir-path
#+begin_src emacs-lisp :tangle no
(expand-file-name "~/Mail")
#+end_src
#+begin_src conf-unix :noweb yes
[database]
path=/home/pavel/Mail
path=<<get-maildir-path()>>
#+end_src
My name and list of emails. It's not like it's a secret anyhow.
@ -146,7 +151,8 @@ A list of tags which will be added by =notmuch new= and directory names which wi
#+begin_src conf-unix
[new]
tags=new;
ignore=.osync_workdir;.mbsyncstate;.uidvalidity;.lock;/.*gmailieer\.json.*/
# ignore=.osync_workdir;.mbsyncstate;.uidvalidity;.lock;/.*gmailieer\.json.*/
ignore=/.*[.](json|lock|bak|osync_workdir|mbsyncstate|uidvalidity)$/
#+end_src
Exclude these tags from search by default.
@ -383,6 +389,13 @@ Then, the problem with my Guix setup is that Emacs by default doesn't see the el
(normal-top-level-add-subdirs-to-load-path))))
#+end_src
On termux the above doesn't work so...
#+begin_src emacs-lisp
(use-package notmuch
:straight t
:if my/is-termux)
#+end_src
Some functions to toggle tags:
#+begin_src emacs-lisp
(defun my/notmuch-toggle-trash ()
@ -487,6 +500,7 @@ The following formats the tables above to a proper syntax for =setq notmuch-save
(setq notmuch-saved-searches
'((:name "drafts" :query "tag:draft" :key "d")
<<format-notmuch-saved-searches()>>))
(setq notmuch-show-empty-saved-searches t)
#+end_src
#+begin_src emacs-lisp