diff options
| author | jao <jao@gnu.org> | 2026-09-07 10:58:37 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-09-07 10:58:37 +0100 |
| commit | 45c15fdd38c0b9dde8099813137b2ebdea3ca3bc (patch) | |
| tree | 0fb9d731ca7945d777f6ec33b492ea43217cbedc /lib | |
| parent | 10019bc241f0f9a30fb44371546b0d8f532892ed (diff) | |
| download | elibs-45c15fdd38c0b9dde8099813137b2ebdea3ca3bc.tar.gz elibs-45c15fdd38c0b9dde8099813137b2ebdea3ca3bc.tar.bz2 | |
misc fixes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/doc/jao-words.el | 2 | ||||
| -rw-r--r-- | lib/eos/jao-afio.el | 1 | ||||
| -rw-r--r-- | lib/eos/jao-tracking.el | 2 | ||||
| -rw-r--r-- | lib/media/jao-mpc.el | 4 | ||||
| -rw-r--r-- | lib/net/jao-notmuch.el | 5 | ||||
| -rw-r--r-- | lib/net/jao-proton-utils.el | 141 | ||||
| -rw-r--r-- | lib/themes/jao-themes.el | 8 |
7 files changed, 14 insertions, 149 deletions
diff --git a/lib/doc/jao-words.el b/lib/doc/jao-words.el index 328fecf..52e5093 100644 --- a/lib/doc/jao-words.el +++ b/lib/doc/jao-words.el @@ -28,7 +28,7 @@ (cl-loop with result = nil for elt in raw-word-list do (cl-incf (cdr (or (assoc elt result) - (first (push (cons elt 0) result))))) + (car (push (cons elt 0) result))))) finally return (sort result (lambda (a b) (string< (car a) (car b)))))) diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index f6f07a3..caacc8c 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -22,7 +22,6 @@ (require 'multisession) (require 'cl-lib) (require 'jao-doc-session) -(require 'jao-pdf) (defvar jao-afio-use-frames (not window-system)) (defvar jao-afio-frame-parameters nil) diff --git a/lib/eos/jao-tracking.el b/lib/eos/jao-tracking.el index 6ee04bd..4cf80c1 100644 --- a/lib/eos/jao-tracking.el +++ b/lib/eos/jao-tracking.el @@ -93,7 +93,7 @@ (defun jao-tracking-set-log (v) (when (fboundp 'x-change-window-property) (x-change-window-property "_EMACS_LOG" v nil nil nil nil 0)) - (if jao-wayland-enabled + (if (bound-and-true-p jao-wayland-enabled) (let ((inhibit-message t)) (shell-command (format "echo \"%s\" > %s" v jao-tracking--pipe))) (let* ((action (if (string-blank-p v) "remove" "add")) diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index cb47f17..f2286a2 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -79,10 +79,6 @@ (defsubst jao-mpc--queue-len (&optional port) (string-to-number (jao-mpc--cmd "status %length%" port))) -(defsubst jao--put-face (str face) - (put-text-property 0 (length str) 'face face str) - str) - (defun jao-mpc--current-timestr (playing-times &optional current) (let* ((current (or current (jao-mpc--current))) (time (alist-get 'totaltime current ""))) diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 40db88d..61233e6 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -346,12 +346,15 @@ (let ((tags (plist-get (notmuch-tree-get-message-properties) :orig-tags))) (jao-notmuch-tree--tag tags nil))) +(defvar jao-notmuch--shared-tags + '("new" "unread" "flagged" "signed" "sent" "attachment" "forwarded" "inbox" + "encrypted" "gmane" "gnus" "feeds" "rss" "mce" "trove" "prog" "emacs")) + (defun jao-notmuch-subtags (tag &rest excl) (let* ((cmd (concat "notmuch search --output=tags tag:" tag)) (ts (split-string (shell-command-to-string cmd)))) (seq-difference ts (append jao-notmuch--shared-tags (cons tag excl))))) - ;;; fcc (defvar jao-notmuch-tags-not-inherited '("attachment" "sent" "new" "trove" "flagged" "drivel" "replied")) diff --git a/lib/net/jao-proton-utils.el b/lib/net/jao-proton-utils.el deleted file mode 100644 index a8f13eb..0000000 --- a/lib/net/jao-proton-utils.el +++ /dev/null @@ -1,141 +0,0 @@ -;; jao-proton-utils.el -- simple interaction with Proton mail and vpn -*- lexical-binding: t; -*- - -;; Copyright (c) 2018, 2019, 2020, 2023, 2026 Jose Antonio Ortega Ruiz - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;; Author: Jose Antonio Ortega Ruiz <mail@jao.io> -;; Start date: Fri Dec 21, 2018 23:56 - -;;; Comentary: - -;; This is a very simple comint-derived mode to run the CLI version -;; of PM's Bridge within the comfort of emacs. - -;;; Code: - -(define-derived-mode proton-bridge-mode comint-mode "proton-bridge" - "A very simple comint-based mode to run ProtonMail's bridge" - (setq comint-prompt-read-only t) - (setq comint-prompt-regexp "^>>> ")) - -;;;###autoload -(defun run-proton-bridge () - "Run or switch to an existing bridge process, using its CLI" - (interactive) - (pop-to-buffer (make-comint "proton-bridge" "protonmail-bridge" nil "-c")) - (unless (eq major-mode 'proton-bridge-mode) - (proton-bridge-mode))) - -;;;###autoload -(defun proton-bridge-sendmail-setup () - "Configure message sending for local proton bridge." - (setq send-mail-function #'smtpmail-send-it) - (setq message-send-mail-function #'smtpmail-send-it) - (setq smtpmail-servers-requiring-authorization - (regexp-opt '("localhost" "127.0.0.1"))) - (setq smtpmail-auth-supported '(plain login)) - (setq smtpmail-smtp-user "mail@jao.io") - (setq smtpmail-smtp-server "localhost") - (setq smtpmail-smtp-service 1025)) - -(defvar jao-proton-vpn-font-lock-keywords '("\\[.+\\]")) - -(defvar proton-vpn-mode-map - (let ((map (make-keymap))) - (suppress-keymap map) - (define-key map [?q] 'bury-buffer) - (define-key map [?n] 'next-line) - (define-key map [?p] 'previous-line) - (define-key map [?g] 'proton-vpn-status) - (define-key map [?r] 'proton-vpn-reconnect) - (define-key map [?d] (lambda () - (interactive) - (when (y-or-n-p "Disconnect?") - (proton-vpn-disconnect)))) - (define-key map [?c] 'proton-vpn-connect) - map)) - - -;;;###autoload -(defun proton-vpn-mode () - "A very simple mode to show the output of ProtonVPN commands" - (interactive) - (kill-all-local-variables) - (buffer-disable-undo) - (use-local-map proton-vpn-mode-map) - (setq-local font-lock-defaults '(jao-proton-vpn-font-lock-keywords)) - (setq-local truncate-lines t) - (setq-local next-line-add-newlines nil) - (setq major-mode 'proton-vpn-mode) - (setq mode-name "proton-vpn") - (read-only-mode 1)) - -(defvar jao-proton-vpn--buffer "*pvpn*") - -(defun jao-proton-vpn--do (things) - (let ((b (pop-to-buffer (get-buffer-create jao-proton-vpn--buffer)))) - (let ((inhibit-read-only t) - (cmd (format "protonvpn-cli %s" things))) - (delete-region (point-min) (point-max)) - (message "Running: %s ...." cmd) - (shell-command cmd b) - (message "")) - (proton-vpn-mode))) - -;;;###autoload -(defun proton-vpn-status () - (interactive) - (jao-proton-vpn--do "s")) - -(defun proton-vpn--get-status () - (or (when-let* ((b (get-buffer jao-proton-vpn--buffer))) - (with-current-buffer b - (goto-char (point-min)) - (if (re-search-forward "^Status: *\\(.+\\)$" nil t) - (match-string-no-properties 1) - (when (re-search-forward "^Connected!$") - "Connected")))) - "Disconnected")) - -;;;###autoload -(defun proton-vpn-connect (cc) - (interactive "P") - (let ((cc (when cc (read-string "Country code: ")))) - (jao-proton-vpn--do (if cc (format "c --cc %s" cc) "c --sc")) - (proton-vpn-status))) - -(defun proton-vpn-reconnect () - (interactive) - (jao-proton-vpn--do "r")) - -(setenv "PVPN_WAIT" "300") - -;;;###autoload -(defun proton-vpn-maybe-reconnect () - (interactive) - (when (string= "Connected" (proton-vpn--get-status)) - (jao-proton-vpn--do "d") - (sit-for 5) - (jao-proton-vpn--do "r"))) - -;;;###autoload -(defun proton-vpn-disconnect () - (interactive) - (jao-proton-vpn--do "d")) - -(provide 'jao-proton-utils) -;;; jao-proton.el ends here diff --git a/lib/themes/jao-themes.el b/lib/themes/jao-themes.el index dc3eee5..1f5e09a 100644 --- a/lib/themes/jao-themes.el +++ b/lib/themes/jao-themes.el @@ -68,6 +68,10 @@ (defvar jao-themes--f11 '((c "cadetblue4"))) (defvar jao-themes--f12 '((c "darkslategrey"))) +(defgroup jao-themes-faces nil + "Faces for unified custom themes" + :group 'faces) + (defface jao-themes-hilite '((t :inherit default)) "") (defface jao-themes-italic '((t :inherit default)) "") (defface jao-themes-button '((t :inherit default)) "") @@ -118,6 +122,10 @@ (jao-themes--normalize-body (apply 'append (mapcar 'jao-themes--parse-face-sym f)))))) +(defsubst jao--put-face (str face) + (put-text-property 0 (length str) 'face face str) + str) + (defvar jao-themes--default-cidxs '("#000000" "#cd0000" "#00cd00" "#cdcd00" "#0000cd" "#cd00cd" "#00cdcd" "#e5e5e5" |
