summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--custom/jao-custom-completion.el5
-rw-r--r--custom/jao-custom-exwm.el5
-rw-r--r--custom/jao-custom-gnus.el49
-rw-r--r--init.el114
-rw-r--r--lib/doc/jao-org-notes.el11
-rw-r--r--lib/eos/jao-afio.el4
-rw-r--r--lib/eos/jao-dirmon.el4
-rw-r--r--lib/eos/jao-minibuffer.el6
-rw-r--r--lib/media/jao-mpris.el32
-rw-r--r--lib/net/jao-notmuch-gnus.el26
-rw-r--r--lib/net/randomsig.el9
-rw-r--r--lib/themes/jao-themes.el3
12 files changed, 185 insertions, 83 deletions
diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el
index 9524e23..490fd65 100644
--- a/custom/jao-custom-completion.el
+++ b/custom/jao-custom-completion.el
@@ -87,7 +87,7 @@
(funcall fun lines)
(move-overlay vertico--candidates-ov (point-min) (point-min))
(overlay-put vertico--candidates-ov 'after-string (apply #'concat lines))
- (vertico--resize-window (length lines))))
+ (vertico--resize)))
(advice-add 'vertico--display-candidates :around #'jao-vertico--display))
@@ -126,8 +126,7 @@
("M-g e" . consult-error)
("M-s m" . consult-multi-occur)
("M-y" . consult-yank-pop)
- ("C-s" . isearch-forward)
- ("<help> a" . consult-apropos))
+ ("C-s" . isearch-forward))
:custom ((consult-preview-key (kbd "`")))
diff --git a/custom/jao-custom-exwm.el b/custom/jao-custom-exwm.el
index e5c67f8..3cb3fc9 100644
--- a/custom/jao-custom-exwm.el
+++ b/custom/jao-custom-exwm.el
@@ -194,7 +194,9 @@
(defun jao-exwm-switch-to-next-x ()
(interactive)
- (let ((bfs (seq-filter (lambda (b) (buffer-local-value 'exwm-class-name b))
+ (let ((bfs (seq-filter (lambda (b)
+ (with-current-buffer b
+ (derived-mode-p 'exwm-mode)))
(buffer-list (window-frame)))))
(when (car bfs) (switch-to-buffer (car (reverse bfs))))))
@@ -530,6 +532,7 @@
([f9] . jao-bright-show)))
;; (customize-set-variable 'exwm-input-global-keys exwm-input-global-keys)
+(exwm-wm-mode)
;;; .
(provide 'jao-custom-exwm)
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 70823ef..ce77285 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -212,8 +212,10 @@
(when jao-gnus-use-nnml
(add-to-list
'gnus-secondary-select-methods
- `(nnml "" (gnus-search-engine gnus-search-recoll
- (remove-prefix ,(jao-gnus-dir "Mail/"))))))
+ ;; `(nnml "" (gnus-search-engine gnus-search-recoll
+ ;; (remove-prefix ,(jao-gnus-dir "Mail/"))))
+ `(nnml "" (gnus-search-engine gnus-search-notmuch
+ (remove-prefix "/home/jao/var/mail/gnus")))))
(when jao-gnus-use-nnml
(dolist (p jao-gnus-nnml-group-params)
@@ -447,13 +449,19 @@
(use-package org-capture
:config
(add-to-list 'org-capture-templates
+ '("x" "arXiv" entry (file "notes/physics/arxiv.org")
+ "* %(jao-gnus-subject)\n\n %i\n\n %(jao-gnus-org-url)"
+ :immediate-finish t)
+ t)
+ (add-to-list 'org-capture-templates
'("X" "arXiv" entry (file "notes/physics/arxiv.org")
- "* %:subject\n\n(jao-gnus-org-paragraph \"%i\")"
+ "* %(jao-gnus-subject)\n\n%(jao-gnus-org-paragraph \"%i\")"
:immediate-finish t)
t)
(org-capture-upgrade-templates org-capture-templates))
(defvar jao-gnus-org-url nil)
+(defun jao-gnus-org-url () jao-gnus-org-url)
(defun jao-gnus-org-paragraph (x)
(with-temp-buffer
(insert " " (string-trim (or x "")) "\n ")
@@ -462,22 +470,27 @@
(goto-char (point-max))
(open-rectangle 0 (point))
(concat (buffer-string) "\n " (or jao-gnus-org-url ""))))
+(defvar jao-gnus-subject nil)
+(defun jao-gnus-subject () jao-gnus-subject)
(defun jao-gnus-arXiv-capture ()
(interactive)
(unless (derived-mode-p '(gnus-summary-mode)) (gnus-article-show-summary))
- (setq jao-subject (gnus-summary-article-subject))
+ (setq jao-gnus-subject (gnus-summary-article-subject))
(gnus-summary-select-article-buffer)
(gnus-article-goto-part 0)
- (setq-local transient-mark-mode 'lambda)
- (set-mark (point))
- (forward-paragraph)
- (save-excursion
- (when (re-search-forward "^Link" nil t)
- (beginning-of-line)
- (setq jao-gnus-org-url (org-eww-url-below-point))))
- (org-capture nil "X")
- (set-mark (point))
+ (let ((transient-mark-mode t))
+ (set-mark (point))
+ (forward-paragraph)
+ (or (and (save-excursion
+ (when (re-search-forward "^Link" nil t)
+ (beginning-of-line)
+ (setq jao-gnus-org-url (org-eww-url-below-point))))
+ (org-capture nil "X"))
+ (and (save-excursion
+ (when (re-search-forward "^URL: " nil t)
+ (setq jao-gnus-org-url (thing-at-point-url-at-point))))
+ (org-capture nil "x"))))
(gnus-article-show-summary))
;;; article
@@ -558,7 +571,7 @@
(save-excursion
(goto-char (point-min))
(when (or (search-forward-regexp "^Via: h" nil t)
- (search-forward-regexp "^URL: h" nil t)
+ (search-forward-regexp "^URL:[\n ]h" nil t)
(and (search-forward-regexp "^Link$" nil t)
(not (beginning-of-line))))
(cond (external (jao-browse-with-external-browser))
@@ -580,7 +593,7 @@
(gnus-summary-select-article-buffer)
(save-excursion
(goto-char (point-min))
- (let ((offset (or (and (search-forward-regexp "^Enclosure: " nil t) 2)
+ (let ((offset (or (and (search-forward-regexp "^Enclosure: ?" nil t) 2)
(and (search-forward-regexp "^Enclosure$" nil t) -2))))
(when offset (forward-char offset))
(if-let ((url (jao-url-around-point)))
@@ -633,13 +646,14 @@
(seq-difference '("feeds.trove")))))
`(("nnml:bigml\\.inbox" "B" jao-themes-f00)
("nnml:bigml\\.alba" "A" jao-themes-f00)
+ ("nnml:bigml\\.ryou" "R" jao-themes-f00)
("nnml:bigml\\.bugs" "b" jao-themes-error)
("nnml:bigml\\.support" "S" default)
+ ("nnml:bigml\\.[^aibsr]" "W" jao-themes-dimm)
("nnml:jao\\.\\(inbox\\|trove\\)" "I" jao-themes-f01)
- ("nnml:bigml\\.[^aibs]" "W" jao-themes-dimm)
("nnml:jao.hacking" "H" jao-themes-dimm)
("nnml:jao.write" "W" jao-themes-warning)
- ("nnml:jao.[^isthw]" "J" jao-themes-dimm)
+ ("nnml:jao.[^ithw]" "J" jao-themes-dimm)
(,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm)
("feeds\\.e" "E" jao-themes-dimm)
("nnml:local" "l" jao-themes-dimm)
@@ -689,6 +703,7 @@
(jao-gnus--notify)))
(add-hook 'gnus-summary-exit-hook #'jao-gnus--on-summary-exit)
+(add-hook 'gnus-exit-group-hook #'jao-gnus--notify)
;;;; open mail file in gnus
(defun jao-gnus-file-to-group (file &optional maildir newsdir m-server n-server)
diff --git a/init.el b/init.el
index 4f54b41..c83a3b1 100644
--- a/init.el
+++ b/init.el
@@ -279,7 +279,9 @@
(setq auth-sources '("~/.emacs.d/authinfo.gpg" "~/.netrc"))
(use-package epa-file
- :init (setq epa-file-cache-passphrase-for-symmetric-encryption t)
+ :init (setq epa-file-cache-passphrase-for-symmetric-encryption t
+ epa-file-encrypt-to "A247C4780736A6156BC8DA748C081D34D321D881"
+ plstore-encrypt-to epa-file-encrypt-to)
:config (epa-file-enable))
(require 'epa-file)
@@ -910,6 +912,7 @@
;;;; projects
(use-package project :demand t)
(global-set-key "\C-xp" 'jao-prev-window)
+(use-package list-projects :ensure t)
;;;; buffer quit function (the triple ESC)
(setq buffer-quit-function (lambda () t))
@@ -930,6 +933,42 @@
scroll-step 1
redisplay-skip-fontification-on-input nil))
+(use-package ultra-scroll
+ ;:load-path "~/code/emacs/ultra-scroll" ; if you git clone'd instead of using vc
+ :vc (:url "https://github.com/jdtsmith/ultra-scroll") ; For Emacs>=30
+ :init
+ (setq scroll-conservatively 3 ; or whatever value you prefer, since v0.4
+ scroll-margin 0) ; important: scroll-margin>0 not yet supported
+ :config
+ (ultra-scroll-mode 1))
+
+;;;; show diffs when running C-x s
+(add-to-list 'save-some-buffers-action-alist
+ `("d"
+ ,(lambda (buffer)
+ (diff-buffer-with-file (buffer-file-name buffer)))
+ "show diff between the buffer and its file"))
+
+;;;; copy buffer file name
+;; https://stackoverflow.com/questions/18812938/copy-full-file-path-into-copy-paste-clipboard
+(defun copy-buffer-file-name-as-kill (choice)
+ "Copy the buffer-file-name to the kill-ring"
+ (interactive "cCopy Buffer Name (F) Full, (D) Directory, (N) Name")
+ (let ((new-kill-string)
+ (name (if (eq major-mode 'dired-mode)
+ (dired-get-filename)
+ (or (buffer-file-name) ""))))
+ (cond ((eq choice ?f)
+ (setq new-kill-string name))
+ ((eq choice ?d)
+ (setq new-kill-string (file-name-directory name)))
+ ((eq choice ?n)
+ (setq new-kill-string (file-name-nondirectory name)))
+ (t (message "Quit")))
+ (when new-kill-string
+ (message "%s copied" new-kill-string)
+ (kill-new new-kill-string))))
+
;;; Windows
;;;; splitting and switch
(setq split-height-threshold 80
@@ -1286,9 +1325,10 @@
(defun jao-maybe-view-video (url &rest _ignored)
(interactive)
- (if (y-or-n-p "View video (y) or web page (n)? ")
- (jao-view-video url)
- (funcall jao-browse-url-function url)))
+ (let ((w (read-char "View video (v) or web page (w)? ")))
+ (cond ((eq w ?v) (jao-view-video url))
+ ((eq w ?w) (funcall jao-browse-url-function url))
+ (t (message "Aborted")))))
;;;; web browsers
(defun jao-www--buffer-p (b)
@@ -1529,9 +1569,9 @@
:hook ((doc-view-mode . jao-doc-session-mark))
:bind (:map doc-view-mode-map
("j" . doc-view-next-line-or-next-page)
- ("J" . doc-view-scroll-up-or-next-page)
+ ("J" . doc-view-search-next-match)
("k" . doc-view-previous-line-or-previous-page)
- ("K" . doc-view-scroll-down-or-previous-page)
+ ("K" . doc-view-search-previous-match)
("z" . jao-open-with-zathura)))
(use-package jao-doc-session :demand t)
@@ -1870,10 +1910,10 @@
;;;; other git packages
(use-package git-timemachine :ensure t)
-(use-package consult-git-log-grep
- :ensure t
- :custom (consult-git-log-grep-open-function #'magit-show-commit)
- :bind (("C-c K" . consult-git-grep)))
+;; (use-package consult-git-log-grep
+;; :ensure t
+;; :custom (consult-git-log-grep-open-function #'magit-show-commit)
+;; :bind (("C-c K" . consult-git-grep)))
;; git config --local git-link.remote / git-link.branch
(use-package git-link :ensure t)
@@ -2078,7 +2118,7 @@
(add-hook 'emacs-lisp-mode-hook #'jao-outline-minor-mode)
(use-package edit-list :ensure t)
-(use-package package-lint :ensure t)
+;; (use-package package-lint :ensure t)
;; (use-package tree-inspector :ensure t)
(defun elisp-disassemble (function)
@@ -2388,6 +2428,11 @@
:config
(venv-initialize-eshell)
(jao-compilation-env "VIRTUAL_ENV"))
+;;;; Javascript
+
+(use-package typescript-mode
+ :ensure t
+ :custom ((typescript-indent-level 2)))
;;; Text/data formats
;;;; json
@@ -2481,7 +2526,13 @@
lui-track-behavior 'before-tracking-next-buffer)
:config
- (defsubst jao-circe-nick-no () (length (circe-channel-nicks)))
+ (defsubst jao-circe-nick-no ()
+ (if (derived-mode-p 'circe-query-mode)
+ 2
+ (length (circe-channel-nicks))))
+
+ (defsubst jao-circe-netowrk ()
+ (or (plist-get lui-logging-format-arguments :network) ""))
(define-minor-mode jao-circe-user-number-mode ""
:lighter (:eval (format " [%s]" (jao-circe-nick-no))))
@@ -2489,10 +2540,13 @@
(defun jao-circe-channel-hook ()
(when jao-mode-line-in-minibuffer
(setq header-line-format
- '(" %b" (:eval (format " - %s nicks" (jao-circe-nick-no))))))
+ '(" %b" (:eval (format "@%s - %s nicks"
+ (jao-circe-netowrk)
+ (jao-circe-nick-no))))))
(jao-circe-user-number-mode 1))
(add-hook 'circe-channel-mode-hook #'jao-circe-channel-hook)
+ (add-hook 'circe-query-mode-hook #'jao-circe-channel-hook)
(defun circe-command-RECOVER (&rest _ignore)
"Recover nick"
@@ -2525,11 +2579,13 @@
(list "Bitlbee" :host "127.0.0.1" :nick u
:channels jao-bitlbee-channels :lagmon-disabled t
:nickserv-password u :user p))
- (list "localslack" :host "127.0.0.1" :nick "jao"
+ (list "bigml" :host "127.0.0.1" :nick "jao"
:channels jao-slack-channels :port 9007
:lagmon-disabled t)
(list "recoveryou" :host "127.0.0.1" :nick "jao"
- :port 9008 :lagmon-disabled t)))
+ :port 9008 :lagmon-disabled t)
+ (list "grio" :host "127.0.0.1" :nick "jao"
+ :port 9009 :lagmon-disabled t)))
(jao-shorten-modes 'circe-channel-mode
'circe-server-mode
@@ -2612,8 +2668,11 @@
:init
(setq mastodon-instance-url "https://fosstodon.org"
mastodon-active-user "jao@gnu.org"
+ mastodon-group-notifications t
+ mastodon-images-in-notifs t
mastodon-tl-position-after-update nil
- mastodon-toot-display-orig-in-reply-buffer t)
+ mastodon-toot-display-orig-in-reply-buffer t
+ mastodon-media--hide-sensitive-media nil)
:config
;; (defun jao-mastodon--setup ()
;; (setq-local scroll-margin 12))
@@ -2715,15 +2774,13 @@
(jao-with-auth "matrix.org" u p (ement-connect :user-id u :password p))))
(when (and (fboundp 'mastodon) (or p (y-or-n-p "Connect to mastodon? ")))
(mastodon))
- (when (or p (y-or-n-p "Connect to libera? "))
- (unless (get-buffer "irc.libera.chat:6697")
- (circe "Libera Chat")))
- (when (or p (y-or-n-p "Connect to localslack? "))
- (unless (get-buffer "127.0.0.1:9007")
- (circe "localslack")))
- (when (or p (y-or-n-p "Connect to recoveryou? "))
- (unless (get-buffer "127.0.0.1:9008")
- (circe "recoveryou"))))
+ (dolist (c '(("Libera Chat" . "irc.libera.chat:6697")
+ ("bigml" . "127.0.0.1:9007")
+ ("recoveryou" . "127.0.0.1:9008")
+ ("grio" . "127.0.0.1:9009")))
+ (unless (get-buffer (cdr c))
+ (when (or p (y-or-n-p (format "Connect to %s? " (car c))))
+ (circe (car c))))))
(defun jao-all-chats ()
(interactive)
@@ -3280,7 +3337,8 @@
("do" "open doc" jao-open-doc)
("dr" "search docs with recoll" jao-recoll-consult-docs)]
["Monitors"
- ("p" "htop" jao-term-htop)
+ ("p" "list projects" list-projects)
+ ;; ("p" "htop" jao-term-htop)
("P" "pasytray" jao-toggle-pasystray-applet)
("x" "restart i3bar" jao-river-restart-i3bar :if jao-river-enabled-p)
("x" "restart xmobar" jao-xmobar-restart :if jao-exwm-enabled-p)
@@ -3308,7 +3366,9 @@
["Helpers"
("a" "aptitude" jao-term-aptitude)
("l" "packages" jao-list-packages)
- ("r" "reveal" jao-reveal)
+ ;; ("r" "reveal" jao-reveal)
+ ("r" "translate" reverso)
+ ("f" "copy buffer file name" copy-buffer-file-name-as-kill)
("k" (lambda () (concat "keyboard" (when (jao-kb-toggled-p) "*")))
jao-kb-toggle :if jao-x11-p)]])
diff --git a/lib/doc/jao-org-notes.el b/lib/doc/jao-org-notes.el
index 43b8c09..d3f18b8 100644
--- a/lib/doc/jao-org-notes.el
+++ b/lib/doc/jao-org-notes.el
@@ -1,6 +1,6 @@
;;; jao-org-notes.el --- A simple system for org note taking -*- lexical-binding: t; -*-
-;; Copyright (C) 2020, 2021, 2022, 2024 jao
+;; Copyright (C) 2020, 2021, 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: tools
@@ -74,11 +74,12 @@
(defun jao-org-notes--consult-rg (prompt &optional cat no-req cmd initial)
(let ((default-directory (expand-file-name (or cat "") jao-org-notes-dir)))
(consult--read
- (consult--async-command #'jao-org-notes--rg-title-or-tags
- (consult--async-transform jao-org-notes--matches))
+ (consult--async-pipeline
+ (consult--process-collection #'jao-org-notes--rg-title-or-tags)
+ (consult--async-transform #'jao-org-notes--matches))
:prompt prompt
- :initial (consult--async-split-initial (or initial ""))
- :add-history (concat (consult--async-split-initial (thing-at-point 'symbol)))
+ :initial (or initial "")
+ :add-history (thing-at-point 'symbol)
:require-match (not no-req)
:category 'jao-org-notes-lookup
:group 'jao-org-notes--consult-group
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index b588989..10e9115 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -1,6 +1,6 @@
;;; jao-afio.el --- workspaces in just one frame -*- lexical-binding: t; -*-
-;; Copyright (C) 2020, 2021, 2022, 2024 jao
+;; Copyright (C) 2020, 2021, 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: frames
@@ -228,7 +228,7 @@
(defun jao-afio-goto-scratch (&optional one-win)
(interactive "P")
- (jao-afio--goto-frame ?s nil)
+ (jao-afio--goto-frame ?s one-win)
(when one-win (delete-other-windows)))
(defun jao-afio-goto-chats (&optional reset)
diff --git a/lib/eos/jao-dirmon.el b/lib/eos/jao-dirmon.el
index 0edb3a3..117da85 100644
--- a/lib/eos/jao-dirmon.el
+++ b/lib/eos/jao-dirmon.el
@@ -1,6 +1,6 @@
;;; jao-dirmon.el --- little utility to monitor disk usage -*- lexical-binding: t; -*-
-;; Copyright (C) 2022, 2024 jao
+;; Copyright (C) 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: tools
@@ -71,7 +71,7 @@
(dolist (c current)
(let ((d (- (cdr c) (alist-get (car c) old 0 nil #'string=))))
(when (> (abs d) jao-dirmon-threshold)
- (push c high))))
+ (push (cons (car c) d) high))))
(setq jao-dirmon-last-delta high)
(jao-dirmon--show-deltas old current jao-dirmon-last-delta)
jao-dirmon-last-delta))
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index 42cef74..6cd5b24 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -1,6 +1,6 @@
;;; jao-minibuffer.el --- using the minibuffer to report status -*- lexical-binding: t; -*-
-;; Copyright (C) 2020, 2021, 2022, 2024 jao
+;; Copyright (C) 2020, 2021, 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: extensions
@@ -40,7 +40,7 @@
(defun jao-minibuffer--trim (s w)
(if (< (string-width (or s "")) w)
(format (format "%%%ds" (if jao-minibuffer-align-right w (- w))) s)
- (substring s 0 (min w (length s)))))
+ (substring s 0 (min w (string-width s)))))
(defun jao-minibuffer--width ()
(cond ((numberp jao-minibuffer-frame-width) jao-minibuffer-frame-width)
@@ -97,7 +97,7 @@
info))
(sep (if msg " - " ""))
(pref (when info
- (let ((len (+ (length info) (length sep))))
+ (let ((len (+ (string-width info) (string-width sep))))
(format (format "\n%%%ds" len) ""))))
(msg (if (and msg pref)
(replace-regexp-in-string "\n" pref msg)
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el
index 3bb2636..80d0675 100644
--- a/lib/media/jao-mpris.el
+++ b/lib/media/jao-mpris.el
@@ -1,6 +1,6 @@
;;; jao-mpris.el --- mpris players control -*- lexical-binding: t; -*-
-;; Copyright (C) 2020, 2021, 2022, 2024 jao
+;; Copyright (C) 2020, 2021, 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: multimedia
@@ -158,25 +158,25 @@
(defun jao-mpris--handler (iname properties &rest _args)
(let ((inhibit-message t))
- (message "Received properties: %S from %s" properties iname))
- (when-let (md (caadr (assoc "Metadata" properties)))
- (let ((tno (caadr (assoc "xesam:trackNumber" md)))
- (tlt (caadr (assoc "xesam:title" md)))
- (art (caadr (assoc "xesam:artist" md)))
- (alb (caadr (assoc "xesam:album" md)))
- (len (caadr (assoc "mpris:length" md))))
- (if (string= (or tlt "") "TIDAL")
- (jao-mpris-reset)
+ (message "Received properties: %S from %s" properties iname)
+ (when-let (md (caadr (assoc "Metadata" properties)))
+ (let ((tno (caadr (assoc "xesam:trackNumber" md)))
+ (tlt (caadr (assoc "xesam:title" md)))
+ (art (caadr (assoc "xesam:artist" md)))
+ (alb (caadr (assoc "xesam:album" md)))
+ (len (caadr (assoc "mpris:length" md))))
(jao-mpris--set-current 'track tno)
(jao-mpris--set-current 'title tlt)
(jao-mpris--set-current 'artist art)
(jao-mpris--set-current 'album alb)
- (jao-mpris--set-current 'length len))))
- (when-let (st (caadr (assoc "PlaybackStatus" properties)))
- (jao-mpris--set-current 'status st)
- (when (string= st "Stopped")
- (dolist (k '(track title artist album length))
- (jao-mpris--del-current k))))
+ (jao-mpris--set-current 'length len)))
+ (when-let (st (caadr (assoc "PlaybackStatus" properties)))
+ (jao-mpris--set-current 'status st)
+ (when (string= st "Stopped")
+ (dolist (k '(track title artist album length))
+ (jao-mpris--del-current k))))
+ ;; (message "Current is: %S" jao-mpris--current)
+ )
(jao-mpris--track jao-mpris--current))
;;;###autoload
diff --git a/lib/net/jao-notmuch-gnus.el b/lib/net/jao-notmuch-gnus.el
index f5cc3b2..5cd42fa 100644
--- a/lib/net/jao-notmuch-gnus.el
+++ b/lib/net/jao-notmuch-gnus.el
@@ -1,6 +1,6 @@
;;; jao-notmuch-gnus.el --- notmuch-gnus interoperability -*- lexical-binding: t; -*-
-;; Copyright (C) 2022, 2024 jao
+;; Copyright (C) 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: mail
@@ -52,7 +52,7 @@
"Interactively add or remove tags to the current message."
(interactive)
(let* ((id (or id (jao-notmuch-gnus-message-id)))
- (current (unless tags (jao-notmuch-gnus-message-tags id)))
+ (current (or tags (jao-notmuch-gnus-message-tags id)))
(prompt (format "Change tags %s" (string-join current "/")))
(tags (or tags (notmuch-read-tag-changes current prompt))))
(notmuch-tag (concat "id:" id) tags)
@@ -65,6 +65,11 @@
(when-let (id (jao-notmuch-gnus-message-id))
(message "%s" (string-join (jao-notmuch-gnus-message-tags id) " "))))
+(jao-transient-major-mode+ gnus-summary
+ ["Tags"
+ ("s" "show message tags" jao-notmuch-gnus-show-tags)
+ ("t" "tag message" jao-notmuch-gnus-tag-message)])
+
(defun jao-notmuch-gnus-toggle-tags (tags &optional id current)
"Toggle the given TAGS list for the current Gnus message."
(let* ((id (or id (jao-notmuch-gnus-message-id)))
@@ -76,9 +81,9 @@
(message "New tags: %s" (jao-notmuch-gnus-message-tags id))))
(defun jao-notmuch-gnus-tag-mark ()
- "Remove the new tag for an article when it's marked as seen by Gnus."
+ "Remove the new and unread tags for an article when it's marked as seen by Gnus."
(when-let (id (jao-notmuch-gnus-message-id t))
- (jao-notmuch-gnus-tag-message id '("-new") t)))
+ (jao-notmuch-gnus-tag-message id '("-new" "-unread") t)))
(add-hook 'gnus-mark-article-hook #'jao-notmuch-gnus-tag-mark)
@@ -223,6 +228,19 @@ Example:
(consult-customize jao-gnus-consult-notmuch :preview-key 'any))
+;;; tags and flags
+
+(defun jao-notmuch-gnus-flag-current (&rest _)
+ (jao-notmuch-gnus-tag-message nil '("+flagged") t))
+
+(defun jao-notmuch-gnus-unflag-current (&rest _)
+ (jao-notmuch-gnus-tag-message nil '("-flagged") t))
+
+(advice-add 'gnus-summary-tick-article-forward
+ :before #'jao-notmuch-gnus-flag-current)
+(advice-add 'gnus-summary-mark-as-read-forward
+ :before #'jao-notmuch-gnus-unflag-current)
+
;;; .
(provide 'jao-notmuch-gnus)
;;; jao-notmuch-gnus.el ends here
diff --git a/lib/net/randomsig.el b/lib/net/randomsig.el
index cb37694..05b95ab 100644
--- a/lib/net/randomsig.el
+++ b/lib/net/randomsig.el
@@ -1,6 +1,6 @@
;;; randomsig.el --- insert a randomly selected signature
-;; Copyright (C) 2001, 2002, 2013, 2020, 2021 Hans-Jürgen Ficker
+;; Copyright (C) 2001, 2002, 2013, 2020, 2021, 2024 Hans-Jürgen Ficker
;; Emacs Lisp Archive Entry
;; Author: Hans-Juergen Ficker <hj@backmes.de>
@@ -277,8 +277,11 @@ You probably want to have a newline at the end of it."
(defun randomsig-prompt (&optional prompt)
;; Prompt for a signature file.
(let ((files (randomsig-files-to-list randomsig-files)))
- (completing-read (if prompt prompt "signature: ")
- (mapcar 'list files) nil t nil randomsig-history (car files))))
+ (if (cdr files)
+ (completing-read (if prompt prompt "signature: ")
+ (mapcar 'list files) nil t nil
+ randomsig-history (car files))
+ (car files))))
(defun randomsig-read-signatures-to-buffer (buffer-name &optional files)
;; read the signatures into the signature buffer
diff --git a/lib/themes/jao-themes.el b/lib/themes/jao-themes.el
index 58d32a0..f529842 100644
--- a/lib/themes/jao-themes.el
+++ b/lib/themes/jao-themes.el
@@ -597,7 +597,10 @@
(font-lock-type-face (p type))
(font-lock-variable-name-face (p variable-name))
(font-lock-warning-face (p warning))
+ (forge-pullreq-merged (p dimm))
(forge-pullreq-open (c nil nil))
+ (forge-pullreq-rejected (~ forge-pullreq-merged) st)
+ (forge-topic-pending (c nil nil))
(forge-topic-label bx)
(fringe (p dimm))
(fuel-font-lock-debug-error (p error) nul)