diff options
Diffstat (limited to 'custom')
| -rw-r--r-- | custom/jao-custom-browse.el | 1 | ||||
| -rw-r--r-- | custom/jao-custom-exwm.el | 8 | ||||
| -rw-r--r-- | custom/jao-custom-gnus.el | 87 | ||||
| -rw-r--r-- | custom/jao-custom-programming.el | 120 | ||||
| -rw-r--r-- | custom/jao-custom-x11.el | 2 | 
5 files changed, 110 insertions, 108 deletions
| 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) | 
