From 58e163e03be262dd2ac7c8239e638cf880a38e09 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Jul 2022 16:47:51 -0500 Subject: apodsf8u --- init.el | 118 ++++++++++++++++++++++++++++---------------------------- lisp/+org.el | 36 +++++++++++++++++ machines/bob.el | 12 +++--- 3 files changed, 101 insertions(+), 65 deletions(-) diff --git a/init.el b/init.el index 49c4ab4..b057344 100644 --- a/init.el +++ b/init.el @@ -39,7 +39,8 @@ ;; ones that might not belong in a separate file. (:also-load +lisp) (:option truncate-string-ellipsis "…" - ring-bell-function 'ignore) + ring-bell-function 'ignore + read-file-name-completion-ignore-case t) ;; Bindings (:global "C-x C-k" #'kill-current-buffer "C-x 4 n" #'clone-buffer @@ -212,7 +213,8 @@ (defvar +invidious-host ;; TODO: Add variables for other transformations and what-not. ;; ... or enable trying multiple servers - "invidious.snopyta.org" + ;; "yewtu.be" + "youtube.com" "Host for invidious instance.") ;; Set up external browsing URLs. (add-to-list '+custom-variable-allowlist @@ -517,20 +519,20 @@ (:option finger-X.500-host-regexps '(".") ; only send username ) (with-eval-after-load 'transient - (transient-define-prefix net-utils () - "Networking utilities" - ["Actions" - ("p" "Ping" ping) - ("i" "Ifconfig" ifconfig) - ("w" "Iwconfig" iwconfig) - ("n" "Netstat" netstat) - ("a" "Arp" arp) - ("r" "Route" route) - ("h" "Nslookup host" nslookup-host) - ("d" "Dig" dig) - ("s" "Smb Client" smbclient) - ("t" "Traceroute" traceroute)]) - (:+key "C-z M-n" #'net-utils))) + (transient-define-prefix net-utils () + "Networking utilities" + ["Actions" + ("p" "Ping" ping) + ("i" "Ifconfig" ifconfig) + ("w" "Iwconfig" iwconfig) + ("n" "Netstat" netstat) + ("a" "Arp" arp) + ("r" "Route" route) + ("h" "Nslookup host" nslookup-host) + ("d" "Dig" dig) + ("s" "Smb Client" smbclient) + ("t" "Traceroute" traceroute)]) + (:+key "C-z M-n" #'net-utils))) (setup notmuch (:load-from "~/usr/share/emacs/site-lisp/") @@ -670,10 +672,9 @@ org-startup-with-inline-images t org-tags-column -77 ;; (- (- fill-column 1 (length org-ellipsis))) org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" - "|" "DONE(d!)") + "|" "DONE(d!)" "ASSIGNED(a!)") (sequence "|" "CANCELED(k@)") - (sequence "MEETING(m)") - (sequence "ASSIGNED(a@/!)" "REVIEW(r)" "|" "DONE(d!)")) + (sequence "MEETING(m)")) org-use-speed-commands t org-emphasis-alist '(("*" org-bold) ("/" org-italic) @@ -854,14 +855,18 @@ ;; from there. (+org-capture-templates-setf "s" `("SSH Config" plain (file "~/.ssh/config") - ,(concat "\n\nHost %^{Host: }" - "\nHostname %\\1" - "\nUser %^{User:|" (user-login-name) "}" - "\nIdentityFile %?" - "\nIdentitiesOnly yes" - "\nPubkeyAuthentication yes" - "\nPort %^{Port: |22}") - :unnarrowed t)) + ,(concat "\n\nHost %^{Host}" + "\n Hostname %\\1" + "\n User %^{User|%(user-login-name)}" + "\n IdentityFile %(read-file-name \"IdentityFile: \" \"~/.ssh/\")" + "\n IdentitiesOnly yes" + "\n PubkeyAuthentication yes" + "\n Port %^{Port|22}") + )) + (+org-capture-templates-setf "r" + `("Radio station" plain (file "~/.config/radio/stations") + ,(concat "%^{URL} %^{Description} %^{Tags [space delimited]}") + :immediate-finish t)) (+org-capture-sort)) (setup org-id @@ -916,8 +921,8 @@ (:option shell-command-prompt-show-cwd t) (:local-set +modeline-position-function (lambda () (string-replace (getenv "HOME") - "~" - default-directory))) + "~" + default-directory))) (:hook #'form-feed-mode)) (setup shr @@ -1006,7 +1011,7 @@ (+ace-window-display-mode +1)) (setup (:straight (actually-selected-window :host github - :repo "duckwork/actually-selected-window.el")) + :repo "duckwork/actually-selected-window.el")) (actually-selected-window-mode +1)) (setup (:straight adaptive-wrap) @@ -1338,7 +1343,7 @@ (add-hook 'kill-emacs-hook #'+circe-quit-all@kill-emacs)) (setup (:straight (clean-kill-ring :host github - :repo "NicholasBHubbard/clean-kill-ring.el")) + :repo "NicholasBHubbard/clean-kill-ring.el")) (:require) (:option clean-kill-ring-prevent-duplicates t) (clean-kill-ring-mode +1)) @@ -1491,8 +1496,8 @@ "i" #'dired-subtree-toggle)) (setup (:straight (discord :host github - :repo "davep/discord.el" - :fork (:repo "duckwork/discord.el")))) + :repo "davep/discord.el" + :fork (:repo "duckwork/discord.el")))) (setup (:straight dumb-jump) (add-hook 'xref-backend-functions #'dumb-jump-xref-activate)) @@ -1514,6 +1519,10 @@ (setup (:straight editorconfig) (:with-mode conf-mode (:file-match (rx ".editorconfig" eos))) + (dolist (m '(emacs-lisp-mode + lisp-mode + scheme-mode)) + (add-to-list 'editorconfig-exclude-modes m)) (editorconfig-mode +1)) (setup (:straight electric-cursor) @@ -1626,7 +1635,7 @@ (:+key "C-," #'embrace-commander)) (setup (:straight (ement :host github - :repo "alphapapa/ement.el") + :repo "alphapapa/ement.el") ;; `plz' is a requirement, but isn't on an elpa. (setup (:straight (plz :host github :repo "alphapapa/plz.el")) @@ -1683,11 +1692,11 @@ "C--" #'+er/contract-or-negative-argument)) (setup (:straight (filldent :host nil - :repo "https://codeberg.org/acdw/filldent.el")) + :repo "https://codeberg.org/acdw/filldent.el")) (:+key "M-q" #'filldent-unfill-toggle)) (setup (:straight (flymake-collection :host github - :repo "mohkale/flymake-collection")) + :repo "mohkale/flymake-collection")) (+ensure-after-init #'flymake-collection-hook-setup)) (setup (:straight (flyspell-correct @@ -1728,7 +1737,7 @@ (global-form-feed-mode +1)) (setup (:straight (frowny :host nil - :repo "https://codeberg.org/acdw/frowny.el")) + :repo "https://codeberg.org/acdw/frowny.el")) (:option frowny-eyes (rx (any ":=") (opt "'") (? "-"))) (global-frowny-mode +1)) @@ -1774,7 +1783,7 @@ (info-lookup-setup-mode 'symbol 'emacs-lisp-mode)))) (setup (:straight (hippie-completing-read :host nil - :repo "https://codeberg.org/acdw/hippie-completing-read.el")) + :repo "https://codeberg.org/acdw/hippie-completing-read.el")) (:+key "M-/" #'hippie-completing-read)) (setup (:straight hungry-delete) @@ -1879,9 +1888,9 @@ ('dark 1.0))) (+mapc-some-buffers #'+jabber-colors-update (lambda () (derived-mode-p 'jabber-chat-mode - 'jabber-roster-mode - 'jabber-activity-mode - 'jabber-browse-mode))))) + 'jabber-roster-mode + 'jabber-activity-mode + 'jabber-browse-mode))))) (dolist (mode '(jabber-chat-mode jabber-browse-mode jabber-roster-mode @@ -1906,7 +1915,7 @@ (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) (setup (:straight (keepassxc-shim :host nil - :repo "https://codeberg.org/acdw/keepassxc-shim.el")) + :repo "https://codeberg.org/acdw/keepassxc-shim.el")) (keepassxc-shim-activate)) (setup (:straight keychain-environment @@ -1993,7 +2002,6 @@ mastodon-tl--show-avatars t mastodon-tl--enable-proportional-fonts nil) (:hook #'mastodon-async-mode - #'visual-fill-column-mode #'variable-pitch-mode #'hl-line-mode #'lin-mode)) @@ -2049,6 +2057,7 @@ :foreground unspecified))) `(font-lock-comment-face ((,class :inherit variable-pitch + :slant italic :foreground ,fg-comment-yellow))) `(font-lock-comment-delimiter-face ((,class :inherit fixed-pitch @@ -2196,20 +2205,6 @@ (require 'org-taskwise) (define-key org-mode-map (kbd "C-x n t") #'org-taskwise-narrow-to-task))) -(setup (:straight org-visibility) - (:load-after org user-save) - (:option org-visibility-state-file (.etc "org-visibility") - org-visibility-include-regexps '("\\.org\\'")) - (with-eval-after-load 'org-visibility - ;; I have to add these hooks myself since I don't want it triggering on - ;; /every/ save, but just when I `user-save'. - (add-hook 'user-save-hook #'org-visibility-save-noerror :append) - (add-hook 'kill-buffer-hook #'org-visibility-save-noerror :append) - (add-hook 'kill-emacs-hook #'org-visibility-save-all-buffers :append) - (add-hook 'find-file-hook #'org-visibility-load :append) - (add-hook 'first-change-hook #'org-visibility-dirty :append) - (add-hook 'org-cycle-hook #'org-visibility-dirty-org-cycle :append))) - (setup (:straight org-wc) (:load-after org simple-modeline) (:also-load +org-wc) @@ -2427,6 +2422,9 @@ :repo "https://codeberg.org/acdw/titlecase.el" :files ("*"))) (:require titlecase +titlecase) + (add-to-list 'titlecase-skip-words-regexps (rx word-boundary + (+ (any upper digit)) + word-boundary)) (:with-map +casing-map (:bind "t" #'titlecase-dwim "M-t" #'titlecase-dwim @@ -2476,9 +2474,9 @@ twtxt-following _twtxt-following)) (setup (:straight undo-fu) (:quit "Trying native undo functionality") - (:option undo-fu-allow-undo-in-region t) - (:global "C-/" #'undo-fu-only-undo - "C-?" #'undo-fu-only-redo)) + (:option undo-fu-allow-undo-in-region t) + (:global "C-/" #'undo-fu-only-undo + "C-?" #'undo-fu-only-redo)) (setup (:straight undo-fu-session) (:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" diff --git a/lisp/+org.el b/lisp/+org.el index 6b956ae..2557671 100644 --- a/lisp/+org.el +++ b/lisp/+org.el @@ -729,6 +729,42 @@ When called with a prefix ARG, will still unconditionally call ((org-at-table-p) #'org-table-wrap-region) (t #'org-return))))) + +;;; move org archives to a dedicated file +(defun +org-archive-monthwise (archive-file) + (if (file-exists-p archive-file) + (with-current-buffer (find-file-noselect archive-file) + (let ((dir (file-name-directory (file-truename archive-file))) + (prog (make-progress-reporter (format "Archiving from %s..." archive-file))) + (keep-going t)) + (goto-char (point-min)) + (while keep-going + (when-let* ((time (or (org-entry-get (point) "ARCHIVE_TIME") + (org-get-deadline-time (point)))) + (parsed-time (and time + (org-parse-time-string time))) + (refile-target (format "%s%02d-%02d.org" + dir + (decoded-time-year parsed-time) + (decoded-time-month parsed-time))) + (title-str (format "#+title: Archive for %02d-%02d (%s)\n\n" + (decoded-time-year parsed-time) + (decoded-time-month parsed-time) + (file-truename archive-file)))) + (unless (file-exists-p refile-target) + (with-current-buffer (find-file-noselect refile-target) + (insert title-str) + (save-buffer))) + (org-refile nil nil (list "" + refile-target + nil + 0))) + (progress-reporter-update prog) + (org-next-visible-heading 1) + (when (>= (point) (point-max)) + (setq keep-going nil))))) + (message "Archive file %s does not exist!" archive-file))) + ;;; el-patch diff --git a/machines/bob.el b/machines/bob.el index 40db7b0..5effc5b 100644 --- a/machines/bob.el +++ b/machines/bob.el @@ -9,14 +9,16 @@ (defun +bob-set-faces (&rest _) (let (;;(base-face "IBM Plex Mono") - (base-face "Iosevka Comfy Wide") + ;; (var-face "IBM Plex Sans") + ;; (base-face "Iosevka Comfy Wide") + ;; (var-face "Iosevka Comfy Duo") + (base-face "DejaVu Sans Mono") + (var-face "DejaVu Sans") (base-size 100) + (var-size 1.0) (italic-face nil) ;; (bold-face nil) - (mono-face nil) - ;; (var-face "IBM Plex Sans") - (var-face "Iosevka Comfy Duo") - (var-size 1.0)) + (mono-face nil)) (+set-faces `((default :family ,base-face -- cgit 1.4.1-21-gabe81