summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--attic/elisp/misc.el50
-rw-r--r--custom/jao-custom-browse.el1
-rw-r--r--custom/jao-custom-exwm.el8
-rw-r--r--custom/jao-custom-gnus.el87
-rw-r--r--custom/jao-custom-programming.el120
-rw-r--r--custom/jao-custom-x11.el2
-rw-r--r--init.el21
-rw-r--r--lib/doc/jao-mac.el2
-rw-r--r--lib/doc/jao-org-focus.el9
-rw-r--r--lib/doc/jao-pdf.el3
10 files changed, 178 insertions, 125 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el
index 5021465..6c295d7 100644
--- a/attic/elisp/misc.el
+++ b/attic/elisp/misc.el
@@ -1297,3 +1297,53 @@ It should be the title of the web page as returned by `rdrview'"
(add-to-list 'auto-mode-alist '("inbox\\.org\\'" . jao-org-inbox-mode))
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda))
+
+;;; Gnus notify
+
+(defun jao-gnus--notify-strs ()
+ (let* ((all (jao-gnus--unread-counts))
+ (counts (cdr all))
+ (labels (seq-keep (lambda (args)
+ (apply 'jao-gnus--unread-label counts args))
+ jao-gnus-tracked-groups)))
+ (jao-when-darwin (jao-gnus--xbar-echo labels))
+ labels))
+
+(defvar jao-gnus-tracked-groups
+ (let ((feeds (thread-first
+ (directory-files mail-source-directory nil "feeds\\.[^e]")
+ (seq-difference
+ '("feeds.trove" "feeds.emacs" "feeds.emacs-devel")))))
+ `(("nnml:jao\\.bigml" "B" jao-themes-f00)
+ ("nnml:jao\\.\\(inbox\\|trove\\)" "I" jao-themes-f01)
+ ("nnml:jao.write" "W" jao-themes-warning)
+ ("nnml:jao.[^ithwb]" "J" jao-themes-dimm)
+ ("nnml:jao.hacking" "H" jao-themes-dimm)
+ ;; (,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm)
+ ;; ("feeds\\.emacs" "E" jao-themes-dimm)
+ ("nnml:feeds\\." "F" jao-themes-dimm)
+ ("nnml:local" "l" jao-themes-dimm)
+ ("nnrss:.*" "R" jao-themes-dimm)
+ ("^\\(gwene\\|gmane\\)\\." "N" jao-themes-dimm))))
+
+(defun jao-gnus--unread-counts ()
+ (seq-reduce (lambda (r g)
+ (let ((n (gnus-group-unread (car g))))
+ (if (and (numberp n) (> n 0))
+ (cons (+ n (car r))
+ (cons (cons (car g) n) (cdr r)))
+ r)))
+ gnus-newsrc-alist
+ '(0)))
+
+(defun jao-gnus-unread-count ()
+ (seq-reduce (lambda (c g) (+ c (or (gnus-group-unread (car g)) 0)))
+ gnus-newsrc-alist
+ 0))
+
+(defun jao-gnus--unread-label (counts rx label face)
+ (let ((n (seq-reduce (lambda (n c)
+ (if (string-match-p rx (car c)) (+ n (cdr c)) n))
+ counts
+ 0)))
+ (when (> n 0) `(:propertize ,(format "%s%d " label n) face ,face))))
diff --git a/custom/jao-custom-browse.el b/custom/jao-custom-browse.el
index ebe023d..99b7fda 100644
--- a/custom/jao-custom-browse.el
+++ b/custom/jao-custom-browse.el
@@ -4,7 +4,6 @@
(require 'jao-url)
;;; variables
-(defvar jao-browse-doc-use-emacs t)
(defvar jao-browse-url-function nil)
(defvar jao-browse-url-external-function nil)
diff --git a/custom/jao-custom-exwm.el b/custom/jao-custom-exwm.el
index 291b78d..5e4a354 100644
--- a/custom/jao-custom-exwm.el
+++ b/custom/jao-custom-exwm.el
@@ -366,7 +366,7 @@
(defun jao-exwm-pdf-enable-zathura ()
(interactive)
(add-hook 'kill-emacs-query-functions #'jao-exwm-pdf-zathura-close-all t)
- (setq jao-browse-doc-use-emacs nil)
+ (setq jao-pdf-open-in-emacs nil)
(setq jao-org-open-pdf-fun #'jao-zathura-open-doc)
(setq jao-org-links-pdf-store-fun #'jao-exwm-org-store-zathura-link)
(setq jao-open-doc-fun #'jao-zathura-open-doc))
@@ -374,7 +374,7 @@
(defun jao-exwm-pdf-disable-zathura ()
(interactive)
(remove-hook 'kill-emacs-query-functions #'jao-exwm-pdf-zathura-close-all)
- (setq jao-browse-doc-use-emacs t)
+ (setq jao-pdf-open-in-emacs t)
(setq jao-org-open-pdf-fun #'jao-find-or-open)
(setq jao-org-links-pdf-store-fun nil)
(setq jao-open-doc-fun #'jao-find-or-open))
@@ -385,7 +385,7 @@
(defun jao-exwm-zathura-goto-pdf ()
(interactive)
- (if jao-browse-doc-use-emacs
+ (if jao-pdf-open-in-emacs
(jao-org-goto-pdf)
(when-let (pdf (jao-exwm-org-to-pdf-file))
(jao-zathura-open-doc pdf))))
@@ -393,7 +393,7 @@
(with-eval-after-load "org"
(define-key org-mode-map (kbd "C-c o") #'jao-exwm-zathura-goto-pdf))
-(when (not jao-browse-doc-use-emacs)
+(when (not jao-pdf-open-in-emacs)
(jao-exwm-pdf-enable-zathura))
(defun jao-exwm-select-pdf ()
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 597ef85..7483e39 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -87,8 +87,7 @@
,side-bar)))))
(defun jao-gnus-use-two-panes ()
- (let ((wide-len jao-gnus-wide-width)
- (groups-len jao-gnus-groups-width)
+ (let ((groups-len jao-gnus-groups-width)
(summary-len (- jao-gnus-wide-width jao-gnus-groups-width))
(msg-edit '(horizontal 1.0
(message 1.0 point)
@@ -123,9 +122,7 @@
(gnus-add-configuration `(reply-yank ,msg-edit))
(gnus-add-configuration
- `(reply (horizontal 1.0
- (message ,(- wide-len 100) point)
- (article 1.0))))))
+ `(reply (horizontal 1.0 (message 0.5 point) (article 1.0))))))
(if jao-gnus-use-three-panes
(jao-gnus-use-three-panes)
@@ -659,10 +656,12 @@
(defun jao-gnus-add-demon ()
(interactive)
+ (message "Adding scan demon for Gnus...")
(gnus-demon-add-handler 'jao-gnus--scan 5 1))
(defun jao-gnus-remove-demon ()
(interactive)
+ (message "Removing scan demon for Gnus...")
(gnus-demon-remove-handler 'jao-gnus--scan))
(jao-gnus-add-demon)
@@ -675,64 +674,34 @@
;;; add-ons
;;;; notifications
;;;;; minibuffer
-(defvar jao-gnus-tracked-groups
- (let ((feeds (thread-first
- (directory-files mail-source-directory nil "feeds\\.[^e]")
- (seq-difference
- '("feeds.trove" "feeds.emacs" "feeds.emacs-devel")))))
- `(("nnml:jao\\.bigml" "B" jao-themes-f00)
- ("nnml:jao\\.\\(inbox\\|trove\\)" "I" jao-themes-f01)
- ("nnml:jao.write" "W" jao-themes-warning)
- ("nnml:jao.[^ithwb]" "J" jao-themes-dimm)
- ("nnml:jao.hacking" "H" jao-themes-dimm)
- ;; (,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm)
- ;; ("feeds\\.emacs" "E" jao-themes-dimm)
- ("nnml:feeds\\." "F" jao-themes-dimm)
- ("nnml:local" "l" jao-themes-dimm)
- ("nnrss:.*" "R" jao-themes-dimm)
- ("^\\(gwene\\|gmane\\)\\." "N" jao-themes-dimm))))
-
-(defun jao-gnus--unread-counts ()
- (seq-reduce (lambda (r g)
- (let ((n (gnus-group-unread (car g))))
- (if (and (numberp n) (> n 0))
- (cons (+ n (car r))
- (cons (cons (car g) n) (cdr r)))
- r)))
- gnus-newsrc-alist
- '(0)))
-
-(defun jao-gnus-unread-count ()
- (seq-reduce (lambda (c g) (+ c (or (gnus-group-unread (car g)) 0)))
- gnus-newsrc-alist
- 0))
-
-(defun jao-gnus--unread-label (counts rx label face)
- (let ((n (seq-reduce (lambda (n c)
- (if (string-match-p rx (car c)) (+ n (cdr c)) n))
- counts
- 0)))
- (when (> n 0) `(:propertize ,(format "%s%d " label n) face ,face))))
-
(defvar jao-gnus--notify-strs ())
-(defun jao-gnus--xbar-echo (labels)
- (jao-shell-exec
- (let* ((ls (mapconcat (lambda (x) (plist-get x :propertize)) labels " "))
- (m (when ls (format "%s | color=#8b3626 | size=11" ls))))
- (format "echo '%s' >/tmp/xbar" (or m " ")))))
-
-(defun jao-gnus--notify-strs ()
- (let* ((all (jao-gnus--unread-counts))
- (counts (cdr all))
- (labels (seq-keep (lambda (args)
- (apply 'jao-gnus--unread-label counts args))
- jao-gnus-tracked-groups)))
- (jao-when-darwin (jao-gnus--xbar-echo labels))
- labels))
+(defun jao-gnus--xbar-echo ()
+ (let* ((total (cdr (assoc "Gnus" gnus-topic-unreads)))
+ (jao (cdr (assoc "jao" gnus-topic-unreads)))
+ (str (concat (when (> total 0) (format "%d" total))
+ " "
+ (when (> jao 0) (format "J%d" jao)))))
+ (jao-shell-exec
+ (format "echo '%s | color=#8b3626 | size=11' >/tmp/xbar" str))))
+
+(defvar jao-gnus-group-notifications
+ '(("Gnus" "" jao-themes-dimm)
+ ("jao" "J" jao-themes-warning)
+ ("news" "N" jao-themes-dimm)
+ ("prog" "P" jao-themes-dimm)
+ ("sci" "S" jao-themes-dimm)))
+
+(defun jao-gnus--notify-group-str (p)
+ (let* ((n (cdr p))
+ (f (cdr (assoc (car p) jao-gnus-group-notifications))))
+ (when (and f (> n 0))
+ `(:propertize ,(format "%s%d " (car f) n) face ,(cadr f)))))
(defun jao-gnus--notify ()
- (setq jao-gnus--notify-strs (jao-gnus--notify-strs))
+ (setq jao-gnus--notify-strs
+ (seq-keep 'jao-gnus--notify-group-str gnus-topic-unreads))
+ (jao-when-darwin (jao-gnus--xbar-echo))
(jao-minibuffer-refresh))
(with-eval-after-load "jao-minibuffer"
diff --git a/custom/jao-custom-programming.el b/custom/jao-custom-programming.el
index 61e51ea..ed62b32 100644
--- a/custom/jao-custom-programming.el
+++ b/custom/jao-custom-programming.el
@@ -1,6 +1,6 @@
;; -*- lexical-binding: t -*-
-;;; Programming
+;;; Tools
;;;; automatic modes
(add-to-list 'auto-mode-alist '("\\.mix\\'" . hexl-mode))
(add-to-list 'auto-mode-alist '("\\.m4\\'" . m4-mode))
@@ -33,6 +33,8 @@
;;;; eglot
(use-package eglot
+ :config
+ (add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))
:bind (:map eglot-mode-map (("C-h ." . jao-eldoc-toggle))))
;;;; paredit and parens
@@ -58,45 +60,6 @@
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-keep-variants nil)
-;;;; compilation
-;;;;; compilation mode options
-(require 'compile)
-(setq compilation-scroll-output t)
-(setq compilation-error-regexp-alist
- (remove 'omake compilation-error-regexp-alist))
-;; (add-hook 'compilation-mode-hook #'visual-line-mode)
-
-;;;;; mode line (no "Compiling"!)
-(require 'compile)
-(diminish 'compilation-minor-mode " ‡")
-(when (< emacs-major-version 27)
- (setcdr (assq 'compilation-in-progress minor-mode-alist) '(" ‡")))
-(when (> emacs-major-version 26)
- (setcdr (assq 'compilation-in-progress mode-line-modes) '("‡ ")))
-
-;;;;; colorizing compilation buffer
-(setq compilation-message-face 'default)
-(require 'ansi-color)
-(defun endless/colorize-compilation ()
- "Colorize from `compilation-filter-start' to `point'."
- (let ((inhibit-read-only t))
- (ansi-color-apply-on-region
- compilation-filter-start (point))))
-
-(add-hook 'compilation-filter-hook #'endless/colorize-compilation)
-
-;;;;; compilation commands
-(use-package jao-compilation
- :commands jao-compilation-setup
- :bind (("C-c C" . compile)
- ("C-c c" . jao-compile)))
-(jao-compilation-setup)
-
-;;;;; next error
-(setq next-error-find-buffer-function
- #'next-error-buffer-on-selected-frame
- next-error-verbose t)
-
;;;; flymake
(use-package flymake
:ensure t
@@ -114,9 +77,6 @@
:bind (:map flymake-mode-map (("M-m" . jao-transient-flymake))))
-;;;; workarounds
-(setq c-type-finder-time-slot nil)
-
;;;; outline minor mode
(use-package outline
:init (setq outline-minor-mode-use-buttons nil
@@ -161,6 +121,61 @@
(add-hook 'find-function-after-hook #'jao-outline-minor-expand-all)
+
+
+;;; Build tools
+;;;; compilation
+;;;;; compilation mode options
+(require 'compile)
+(setq compilation-scroll-output t)
+(setq compilation-error-regexp-alist
+ (remove 'omake compilation-error-regexp-alist))
+;; (add-hook 'compilation-mode-hook #'visual-line-mode)
+
+;;;;; mode line (no "Compiling"!)
+(require 'compile)
+(diminish 'compilation-minor-mode " ‡")
+(when (< emacs-major-version 27)
+ (setcdr (assq 'compilation-in-progress minor-mode-alist) '(" ‡")))
+(when (> emacs-major-version 26)
+ (setcdr (assq 'compilation-in-progress mode-line-modes) '("‡ ")))
+
+;;;;; colorizing compilation buffer
+(setq compilation-message-face 'default)
+(require 'ansi-color)
+(defun endless/colorize-compilation ()
+ "Colorize from `compilation-filter-start' to `point'."
+ (let ((inhibit-read-only t))
+ (ansi-color-apply-on-region
+ compilation-filter-start (point))))
+
+(add-hook 'compilation-filter-hook #'endless/colorize-compilation)
+
+;;;;; compilation commands
+(use-package jao-compilation
+ :commands jao-compilation-setup
+ :bind (("C-c C" . compile)
+ ("C-c c" . jao-compile)))
+(jao-compilation-setup)
+
+;;;;; next error
+(setq next-error-find-buffer-function
+ #'next-error-buffer-on-selected-frame
+ next-error-verbose t)
+
+
+;;;; cmake
+(use-package cmake-mode :ensure t)
+
+(use-package eldoc-cmake
+ :ensure t
+ :after cmake-mode
+ :hook ((cmake-mode . eldoc-cmake-enable)))
+
+(use-package project-cmake :ensure t)
+
+
+
;;; Programming languages
;;;; Elisp
(add-hook 'emacs-lisp-mode-hook #'jao-outline-minor-mode)
@@ -236,6 +251,25 @@
("M-," . pop-tag-mark)
("C-c <" . lc-show-package-summary))))
+;;;; Rust
+
+(use-package rust-mode
+ :ensure t
+ :init
+ (setq rust-mode-treesitter-derive t))
+
+(use-package rustic
+ :ensure t
+ :after (rust-mode)
+ :config
+ (setq rustic-format-on-save nil
+ rustic-lsp-client 'eglot)
+ :custom
+ (rustic-cargo-use-last-stored-arguments t)
+ (rustic-analyzer-command '("rustup" "run" "stable" "rust-analyzer")))
+
+
+
;;;; Clojure
(use-package clojure-mode
:ensure t
diff --git a/custom/jao-custom-x11.el b/custom/jao-custom-x11.el
index 57681d5..3311668 100644
--- a/custom/jao-custom-x11.el
+++ b/custom/jao-custom-x11.el
@@ -33,7 +33,7 @@
;;; xmonad
(defun jao-xmonad-enable ()
- (setq jao-browse-doc-use-emacs (display-graphic-p))
+ (setq jao-pdf-open-in-emacs (display-graphic-p))
(setq jao-mode-line-in-minibuffer nil)
(display-battery-mode -1)
(jao-trisect)
diff --git a/init.el b/init.el
index 7a72d32..0454fd4 100644
--- a/init.el
+++ b/init.el
@@ -443,7 +443,7 @@
(t jao-theme-term-light))))
(load-theme theme t)
(modify-all-frames-parameters `((font . ,jao-themes-default-face)))))
-(modify-all-frames-parameters `((font . "RobotoMono Nerd Font-10")))
+
(jao-themes-setup)
;;; Help system
@@ -589,12 +589,9 @@
battery-mode-line-format " 🔋%b%p% ")
(with-eval-after-load "jao-minibuffer"
- (if jao-mode-line-in-minibuffer
- (display-battery-mode 1)
- (jao-when-linux
- (jao-minibuffer-add-variable 'battery-mode-line-string 80))))
- :config
- (jao-when-darwin (display-battery-mode 1)))
+ (jao-when-linux
+ (display-battery-mode 1)
+ (jao-minibuffer-add-variable 'battery-mode-line-string 80))))
;;; Notifications
;;;; jao-notify
@@ -1812,6 +1809,12 @@
(defun jao-open-nnw () (interactive) (jao-mac-open "-a NetNewsWire"))
(defun jao-open-safari () (interactive) (jao-mac-open "-a Safari"))
(defun jao-open-telegram () (interactive) (jao-mac-open "-a Telegram"))
+
+ (defun jao-open-skim-doc-in-emacs ()
+ (interactive)
+ (let ((jao-pdf-open-in-emacs t))
+ (jao-skim-open-current-doc)))
+
(global-set-key (kbd "s-f") #'jao-open-safari)
;; (global-set-key (kbd "s-n") #'jao-open-nnw)
(global-set-key (kbd "s-t") #'jao-open-telegram)
@@ -1835,7 +1838,7 @@
["External"
("xn" "browse NNW article" jao-nnw-browse-current-article)
("xs" "browse safary article" jao-safari-internal-browse)
- ("xk" "open skim doc" jao-skim-open-current-doc)
+ ("xk" "open skim doc" jao-open-skim-doc-in-emacs)
("xe" "choose an emoji" ns-do-show-character-palette)]
["Blog"
("bn" "create post" jao-org-static-blog-create-new-post)
@@ -1880,7 +1883,7 @@
("m" "proton bridge" run-proton-bridge)]
["Chats"
("i" "irc" jao-chats-irc)
- ("M" "mastodon" jao-mastodon)
+ ;; ("M" "mastodon" jao-mastodon)
("T" "telegram rooster" jao-telega)]
["Window system" :if jao-window-system-p
("w" "set wallpaper" jao-set-wallpaper)
diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el
index 96da735..cb16752 100644
--- a/lib/doc/jao-mac.el
+++ b/lib/doc/jao-mac.el
@@ -196,7 +196,7 @@
(defun jao-devon-open (file &optional page height)
(let ((url (jao-devon-find-url file)))
(if (string-empty-p (or url ""))
- (let ((jao-browse-doc-use-emacs t))
+ (let ((jao-pdf-open-in-emacs t))
(jao-find-or-open file page height))
(let* ((p (if page (format "?page=%s" (- page 1)) ""))
(u (format "%s%s" url p)))
diff --git a/lib/doc/jao-org-focus.el b/lib/doc/jao-org-focus.el
index 13f1201..e9d6ed2 100644
--- a/lib/doc/jao-org-focus.el
+++ b/lib/doc/jao-org-focus.el
@@ -18,16 +18,12 @@
;; 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:
-
-;; Miscellanous utilities for working with org files
-
(require 'org)
-;;; focus on subtree
(defvar-local jao-org-focus--parent nil)
(defvar-local jao-org-focus--section nil)
+;;; focus on subtree
(defun jao-org-focus ()
"Pop creatingly to an indirect buffer focused on the encloing subtree.
@@ -46,6 +42,7 @@ When invoked on an indirect buffer, pops back to its base."
(if-let* ((b (get-buffer bname)))
(pop-to-buffer b)
(clone-indirect-buffer bname t)
+ (org-focus-mode -1)
(org-focus-child-mode)
(setq jao-org-focus--parent parent
jao-org-focus--section title)
@@ -117,4 +114,4 @@ With arg, offer to switch to all children, regardless of their parent."
:keymap org-focus-mode-map)
(provide 'jao-org-focus)
-;;; jao-org.el ends here
+;;; jao-org-focus.el ends here
diff --git a/lib/doc/jao-pdf.el b/lib/doc/jao-pdf.el
index fc332ab..162cd9a 100644
--- a/lib/doc/jao-pdf.el
+++ b/lib/doc/jao-pdf.el
@@ -125,9 +125,10 @@
(user-error "Skim is not viewing any docs!"))))
;;; Open doc functions
+(defvar jao-pdf-open-in-emacs t)
(defun jao-find-or-open (file &optional page height)
- (cond ((and jao-browse-doc-use-emacs window-system)
+ (cond ((and jao-pdf-open-in-emacs window-system)
(let* ((buffs (buffer-list))
(b (catch 'done
(while buffs