From 989171268461a0069ecd53a49e6098ce08638102 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 5 May 2023 09:58:21 -0500 Subject: changes --- lisp/acdw-chat.el | 96 ++++++++++++++++++++++++++++++--------------- lisp/acdw-mail.el | 87 +++++++++++++++++++++++++++++++++++------ lisp/acdw-org.el | 111 +++++++++++++++++++++++++++++++++++++++-------------- lisp/acdw-shell | 0 lisp/acdw-shell.el | 32 +++++++-------- lisp/acdw-web.el | 30 +++++++++++---- lisp/acdw.el | 7 ++++ 7 files changed, 269 insertions(+), 94 deletions(-) delete mode 100644 lisp/acdw-shell (limited to 'lisp') diff --git a/lisp/acdw-chat.el b/lisp/acdw-chat.el index 62dcf72..9294ffe 100644 --- a/lisp/acdw-chat.el +++ b/lisp/acdw-chat.el @@ -51,6 +51,16 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to nick 'popup)))) +(defalias 'jabber-irc-join 'jabber-biboumi-muc-connect) + +(defun jabber-connect-all* (&optional arg) + "Run `jabber-connect-all'. +With a prefix ARG, disconnect first." + (interactive "p") + (when arg + (jabber-disconnect)) + (jabber-connect-all)) + (defun jabber-group-yank-join-url () "Yank a url for joining the focused group." (interactive) @@ -62,7 +72,7 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to ;;; Packages (use-package jabber - :load-path "~/src/emacs/jabber/" + :load-path "~/src/jabber.el/" :custom-face (jabber-activity-face ((t :inherit jabber-chat-prompt-foreign :foreground unspecified @@ -85,37 +95,58 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to :bind-keymap ("C-c j" . jabber-global-keymap) :bind (("C-c C-SPC" . jabber-activity-switch-to)) :config - (setopt jabber-account-list '(("acdw@hmm.st")) - jabber-auto-reconnect t - jabber-biboumi-server "irc.hmm.st" - jabber-biboumi-irc-servers '("irc.libera.chat" - "irc.tilde.chat" - "tilde.town" - "m455.casa" - "irc.twitch.tv") - jabber-biboumi-default-nick "acdw" - jabber-last-read-marker (make-string fill-column ?.) - jabber-muc-decorate-presence-patterns - '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil) - ("Mode #.*" . jabber-muc-presence-dim) - ("." . jabber-muc-presence-dim)) - jabber-activity-make-strings #'jabber-activity-make-strings-shorten - jabber-rare-time-format " - - - - - - %H:%M %F" - jabber-muc-header-line-format - '(" " (:eval (replace-regexp-in-string "%" "%%" - (jabber-jid-displayname - jabber-group))) - " / " jabber-muc-topic) - ;; buffer name formats - jabber-chat-buffer-format "*xmpp* %n" - jabber-browse-buffer-format "*xmpp-browse* %n" - jabber-groupchat-buffer-format "*xmpp-muc* %n" - jabber-muc-private-buffer-format "*xmpp-muc-private* %n" - ;; "prompt" (speaker) formats - jabber-groupchat-prompt-format (format "%%>%dn . " jabber-prefix-width) - jabber-chat-local-prompt-format (format "%%>%dn . " jabber-prefix-width) - jabber-chat-foreign-prompt-format (format "%%>%dn . " jabber-prefix-width) - jabber-muc-private-foreign-prompt-format "\n%g/%n . ") + (setq jabber-account-list '(("acdw@hmm.st")) + jabber-auto-reconnect t + jabber-biboumi-server "irc.hmm.st" + jabber-biboumi-irc-servers '("irc.libera.chat" + "irc.oftc.net" + "irc.tilde.chat" + "tilde.town" + "m455.casa" + "irc.twitch.tv") + jabber-biboumi-default-nick "acdw" + jabber-last-read-marker (make-string fill-column ?.) + jabber-muc-decorate-presence-patterns + '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil) + ("Mode #.*" . jabber-muc-presence-dim) + ("." . jabber-muc-presence-dim)) + jabber-activity-make-strings #'jabber-activity-make-strings-shorten + jabber-rare-time-format " - - - - - - %H:%M %F" + jabber-chat-header-line-format + '("" (jabber-chat-buffer-show-avatar + (:eval + (let ((buddy (jabber-jid-symbol jabber-chatting-with))) + (jabber-propertize " " + 'display (get buddy 'avatar))))) + (:eval (replace-regexp-in-string "%" "%%" + (jabber-jid-displayname + jabber-chatting-with))) + "\t" (:eval (let ((buddy (jabber-jid-symbol jabber-chatting-with))) + (propertize + (or + (cdr (assoc (get buddy 'show) jabber-presence-strings)) + (get buddy 'show)) + 'face + (or (cdr (assoc (get buddy 'show) jabber-presence-faces)) + 'jabber-roster-user-online)))) + "\t" (:eval (jabber-fix-status (get (jabber-jid-symbol jabber-chatting-with) 'status))) + "\t" jabber-events-message + "\t" jabber-chatstates-message) + jabber-muc-header-line-format + '(" " (:eval (replace-regexp-in-string "%" "%%" + (jabber-jid-displayname + jabber-group))) + " / " jabber-muc-topic) + ;; buffer name formats + jabber-chat-buffer-format "*xmpp* %n" + jabber-browse-buffer-format "*xmpp-browse* %n" + jabber-groupchat-buffer-format "*xmpp-muc* %n" + jabber-muc-private-buffer-format "*xmpp-muc-private* %n" + ;; "prompt" (speaker) formats + jabber-groupchat-prompt-format (format "%%>%dn . " jabber-prefix-width) + jabber-chat-local-prompt-format (format "%%>%dn . " jabber-prefix-width) + jabber-chat-foreign-prompt-format (format "%%>%dn . " jabber-prefix-width) + jabber-muc-private-foreign-prompt-format "\n%g/%n . ") ;; jabber muc nick coloring ;; wgreenhous | I found 1.5 ok for saturation and 2.0 for value (modus) ;; (setopt jabber-muc-nick-value 1.0 @@ -131,6 +162,7 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to (map-keymap (lambda (key command) (define-key jabber-global-keymap (vector (+ key #x60)) command)) jabber-global-keymap) + (define-key jabber-global-keymap "c" #'jabber-connect-all*) (require 'jabber-httpupload nil t) (add-hook 'jabber-post-connect-hooks #'jabber-enable-carbons) (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo) diff --git a/lisp/acdw-mail.el b/lisp/acdw-mail.el index f8111e7..bf20c9b 100644 --- a/lisp/acdw-mail.el +++ b/lisp/acdw-mail.el @@ -146,7 +146,7 @@ the saved search as well." (notmuch-poll))) (lambda (_) (message "Polling mail (async)...done")))) - ;;(user-error "Feature `async' not found!") + (user-error "Feature `async' not found!") (notmuch-poll))) ;;; https://kitchingroup.cheme.cmu.edu/blog/2015/09/04/Checking-for-email-attachments-before-you-send-email/ @@ -172,28 +172,93 @@ the saved search as well." (error "No attachment. Aborting send.")))) ;;; Process ical attachments +;; https://www.reddit.com/r/emacs/comments/8s1ion/comment/e0x5kgd/ + +(defun ical2org (&optional replace output-buffer) + "Run ical2org on contents of this buffer. +If REPLACE (interactive prefix argument), replace contents of the +buffer. If no REPLACE nor OUTPUT-BUFFER, output goes to +minibuffer." + (interactive "P") + (shell-command-on-region (point-min) (point-max) + "ical2org.awk" + output-buffer + replace + "*ical2org errors*" + 'display-errors)) + +(defun ical2org-capture () + "Run `ical2org' on this buffer, then `org-capture' the result. +Leaves current buffer as-was afterwards." + (interactive) + (let ((buf (current-buffer)) + (ics (buffer-string))) + (ical2org 'replace buf) + (mark-whole-buffer) + (org-capture nil "a") + (mark-whole-buffer) + (delete-region (point-min) (point-max)) + (insert ics))) + +(defun notmuch-ics-refile (filename header) + "Refile the current ICS buffer to FILENAME, under HEADER." + (org-refile nil nil + (list header + filename + nil + (with-current-buffer (find-file-noselect filename) + (org-find-exact-headline-in-buffer header)))) + (notmuch-ics-kill)) + +(defun notmuch-ics-kill () + "Kill the current ICS buffer and delete its file." + (let ((kill-buffer-hook nil) + (kill-buffer-query-functions nil) + (file (buffer-file-name))) + (set-buffer-modified-p nil) + (kill-buffer-and-window) + (delete-file file))) + +(defun notmuch-ics-cancel () + "Cancel saving ICS buffer." + (interactive) + (notmuch-ics-kill)) + +(define-derived-mode notmuch-save-ics-mode org-mode + "Org-mode but with a different keymap.") (defun notmuch-save-ics () + ;; XXX: this is hacky as hell "Save a .ics file in a message." (interactive) (with-current-notmuch-show-message (notmuch-foreach-mime-part (lambda (part) - (message "%S" part) (when (and (listp part) (or (equal "application/ics" (caadr part)) ;; (equal "text/calendar" (caadr part)) )) - (save-window-excursion - (let* ((filename "/tmp/notmuch.ics") - (buf (find-file-noselect filename))) - (delete-file filename) - (kill-buffer (get-file-buffer filename)) - (mm-save-part-to-file part filename) - (icalendar-import-file filename diary-file) - (kill-buffer buf))))) + (let* ((filename (format "/dev/shm/notmuch-%s.ics" + (time-convert (current-time) 'integer)))) + (mm-save-part-to-file part filename) + (message "Converting ICS to org ...") + (with-current-buffer (find-file-other-window filename) + (ical2org 'replace (current-buffer)) + (deactivate-mark) + (let ((org-mode-hook nil)) + (notmuch-save-ics-mode)) + (local-set-key (kbd "C-c C-c") + (lambda () (interactive) + (notmuch-ics-refile (sync/ "org/diary.org") "Appointments"))) + (local-set-key (kbd "C-c C-k") #'notmuch-ics-cancel) + (setq-local header-line-format + (concat "ICAL buffer. " + "Finish: `C-c C-c'. " + "Abort: `C-c C-k'.")))))) (mm-dissect-buffer t t)))) +(add-hook 'notmuch-show-hook #'notmuch-save-ics) + ;;; Fixes @@ -338,7 +403,7 @@ the saved search as well." (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) (define-advice notmuch-bury-or-kill-this-buffer (:after (&rest _) poll-async) - (notmuch-async-poll)) + (call-process "swaymail")) (define-advice notmuch-address-selection-function (:override (prompt collection _) no-initial-input) diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index f961dda..2ec3339 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el @@ -137,19 +137,33 @@ itself. Other values of ARG will call `newline' with that ARG." ;;; Copy rich text to the keyboard + ;; Thanks to Oleh Krehel: ;; https://emacs.stackexchange.com/questions/54292/copy-results-of-org-export-directly-to-clipboard ;; So. Emacs can't do this itself because it doesn't support sending clipboard ;; or selection contents as text/html. We have to use xclip instead. +;; (defun org-to-html-to-clipboard (&rest org-export-args) +;; "Export current org buffer to HTML, then copy it to the clipboard. +;; ORG-EXPORT-ARGS are passed to `org-export-to-file'." +;; (let ((f (make-temp-file "org-html-export"))) +;; (apply #'org-export-to-file 'html f org-export-args) +;; (start-process "xclip" " *xclip*" +;; "xclip" "-verbose" "-i" f +;; "-t" "text/html" "-selection" "clipboard") +;; (message "HTML pasted to clipboard."))) + +;; Wayland version.. TODO: make it work for both (defun org-to-html-to-clipboard (&rest org-export-args) "Export current org buffer to HTML, then copy it to the clipboard. ORG-EXPORT-ARGS are passed to `org-export-to-file'." - (let ((f (make-temp-file "org-html-export"))) - (apply #'org-export-to-file 'html f org-export-args) - (start-process "xclip" " *xclip*" - "xclip" "-verbose" "-i" f - "-t" "text/html" "-selection" "clipboard") - (message "HTML pasted to clipboard."))) + (let ((buf (generate-new-buffer "*org-html-clipboard*" t))) + (apply #'org-export-to-buffer 'html buf org-export-args) + (with-current-buffer buf + (call-process-region (point-min) (point-max) + "wl-copy" nil nil nil + "-t" "text/html") + (kill-buffer-and-window)) + (message "HTML copied to clipboard."))) (defun org-subtree-to-html-to-clipboard () "Export current subtree to HTML." @@ -202,6 +216,33 @@ If LIST is non-nil, return the result as a list instead of a string." (unless (eq (char-after) ?:) ":")) (when (org-at-heading-p) (org-align-tags)))))) + +;;; Navigating headings + +(defun org-next-visible-heading-unfolding (arg) + (interactive "p") + (when (let ((pt (org-next-visible-heading arg))) + (and (buffer-narrowed-p) + (or (= (point) (point-min)) + (and pt + (= pt (point-max)))))) + (widen) + (org-next-visible-heading arg) + (org-narrow-to-subtree))) + +(defun org-previous-visible-heading-unfolding (arg) + (interactive "p") + (org-next-visible-heading-unfolding (- arg))) + +(defun org-up-heading-unfolding (arg) + (interactive "p") + (when (let ((pt (outline-up-heading arg))) + (and (buffer-narrowed-p) + (= (point) (point-min)))) + (widen) + (org-up-heading-unfolding arg) + (org-narrow-to-subtree))) + ;;; Misc. @@ -261,19 +302,20 @@ If LIST is non-nil, return the result as a list instead of a string." org-archive-mark-done t org-fold-catch-invisible-edits 'show-and-error org-clock-clocked-in-display 'mode-line - org-clock-string-limit 7 ; just the clock bit + org-clock-string-limit 0 org-clock-persist nil org-confirm-babel-evaluate nil org-cycle-separator-lines 0 org-deadline-warning-days 0 org-directory (sync/ "org/" t) org-ellipsis (or (bound-and-true-p truncate-string-ellipsis) "…") - org-emphasis-alist '(("*" org-bold) - ("/" org-italic) - ("_" org-underline) - ("=" org-verbatim) - ("~" org-code) - ("+" org-strikethrough)) + org-emphasis-alist + '(("*" org-bold) + ("/" org-italic) + ("_" org-underline) + ("=" org-verbatim) + ("~" org-code) + ("+" org-strikethrough)) org-fontify-done-headline t org-fontify-quote-and-verse-blocks t org-fontify-whole-heading-line t @@ -320,6 +362,9 @@ If LIST is non-nil, return the result as a list instead of a string." (keymap-set org-mode-map "S-" #'+org-table-copy-down|+org-return-dwim) (keymap-unset org-mode-map "C-'" t) (keymap-unset org-mode-map "C-," t) + (keymap-set org-mode-map "C-c C-n" #'org-next-visible-heading-unfolding) + (keymap-set org-mode-map "C-c C-p" #'org-previous-visible-heading-unfolding) + (keymap-set org-mode-map "C-c C-u" #'org-up-heading-unfolding) ;; Hooks (add-hook 'org-mode-hook (defun org-mode@setup () @@ -333,7 +378,8 @@ If LIST is non-nil, return the result as a list instead of a string." (add-hook 'before-save-hook (defun before-save@org-mode@before-save () (org-align-tags 'all) - (+org-hide-drawers-except-point)) + (+org-hide-drawers-except-point) + ) nil :local))) ;; Extra font-lock keywords (font-lock-add-keywords @@ -353,13 +399,15 @@ If LIST is non-nil, return the result as a list instead of a string." ("" . org-clock-in-or-out)) :config (setopt org-clock-clocked-in-display 'mode-line - global-mode-string - '((t jabber-activity-mode-string) - (:eval (when (org-clocking-p) org-mode-line-string)) - (display-time-mode display-time-string))) - (add-hook 'org-clock-in-hook (defun org-clock@remove-from-global-mode-string () - (setq global-mode-string - (delq 'org-mode-line-string global-mode-string))))) + ;; global-mode-string + ;; '((t jabber-activity-mode-string) + ;; (:eval (when (org-clocking-p) org-mode-line-string)) + ;; (display-time-mode display-time-string)) + ) + ;; (add-hook 'org-clock-in-hook (defun org-clock@remove-from-global-mode-string () + ;; (setq global-mode-string + ;; (delq 'org-mode-line-string global-mode-string)))) + ) (use-package org-agenda :bind (("C-c a" . org-agenda)) @@ -372,7 +420,7 @@ If LIST is non-nil, return the result as a list instead of a string." (800 1000 1200 1400 1600 1800 2000) " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") org-agenda-current-time-string "← now ───────────────" - org-agenda-include-diary t ; I use the org-diary features + org-agenda-include-diary nil ; I use the org-diary features org-agenda-todo-ignore-deadlines 'near org-agenda-todo-ignore-scheduled 'future org-agenda-include-deadlines t @@ -397,7 +445,8 @@ If LIST is non-nil, return the result as a list instead of a string." '("WAIT" "MCKENZIE" "RACHEL"))))) (stuck "" ((org-agenda-overriding-header "Waiting")))) ((org-agenda-files ',(list (progn (require 'chd) - (chd/ "inbox-chd.org")))))))) + (chd/ "inbox-chd.org")) + (sync/ "org/diary.org"))))))) ;; Speedup agenda generation ;; https://orgmode.org/manual/Speeding-Up-Your-Agendas.html ;; https://orgmode.org/worg/agenda-optimization.html @@ -409,7 +458,7 @@ If LIST is non-nil, return the result as a list instead of a string." (add-hook 'org-agenda-mode-hook #'truncate-lines-local-mode) (add-hook 'org-agenda-mode-hook #'hl-line-mode) (add-hook 'org-agenda-after-show-hook #'org-narrow-to-subtree) - (add-hook 'org-agenda-after-show-hook #'+org-hide-drawers-except-point) + ;; (add-hook 'org-agenda-after-show-hook #'+org-hide-drawers-except-point) (define-advice org-agenda-files (:filter-return (files) skip-regexp) "Filter some files from `org-agenda'." (when org-agenda-skip-file-regexp @@ -420,11 +469,17 @@ If LIST is non-nil, return the result as a list instead of a string." files))) files) (define-advice org-agenda (:around (orig &rest r) inhibit-hooks) - (let ((org-mode-hook nil)) + (dlet ((org-mode-hook nil)) + (apply orig r))) + (define-advice org-agenda-skip (:around (orig &rest r) fix-looking-at) + (dlet ((comment-start-skip "^\\s-*#\\(?: \\|$\\)")) (apply orig r))) + ;; (advice-remove 'org-agenda 'org-agenda@inhibit-hooks) (define-advice org-agenda-switch-to (:after (&rest _) do-hooks) (run-hooks 'org-mode-hook)) - (progress@around org-agenda-list "Building agenda")) + (progress@around org-agenda-list "Building agenda") + (with-eval-after-load 'org-agenda + (add-to-list 'org-agenda-files (sync/ "org/diary.org")))) (use-package org-capture :bind (("C-c c" . org-capture))) @@ -465,7 +520,7 @@ effect for exporting link types)." org-export-with-toc nil)) (use-package org-word-count - :load-path "~/src/emacs/org-word-count/" + :load-path "~/src/org-word-count.el/" :hook org-mode-hook) (use-package org-modern @@ -487,7 +542,7 @@ effect for exporting link types)." (use-package org-taskwise :after org - :load-path "~/src/emacs/org-taskwise/") + :load-path "~/src/org-taskwise.el/") (provide 'acdw-org) ;;; acdw-org.el ends here diff --git a/lisp/acdw-shell b/lisp/acdw-shell deleted file mode 100644 index e69de29..0000000 diff --git a/lisp/acdw-shell.el b/lisp/acdw-shell.el index 7c542aa..ce63bdc 100644 --- a/lisp/acdw-shell.el +++ b/lisp/acdw-shell.el @@ -52,8 +52,8 @@ (concat (if (= 0 eshell-last-command-status) "^_^ " ";_; ") - (abbreviate-file-name (eshell/pwd)) - (if (= (user-uid) 0) " # " " $ "))) + (abbreviate-file-name (eshell/pwd)) + (if (= (user-uid) 0) " # " " $ "))) ;;; Packages @@ -89,20 +89,20 @@ (require 'esh-module) (require 'em-smart) (require 'em-tramp) - (setopt eshell-destroy-buffer-when-process-dies t - eshell-error-if-no-glob t - eshell-hist-ignoredups t - eshell-kill-on-exit t - eshell-prefer-lisp-functions t - eshell-prefer-lisp-variables t - eshell-scroll-to-bottom-on-input 'this - eshell-banner-message "" - eshell-hist-ignoredups 'erase - eshell-history-size 512 - eshell-input-filter (lambda (input) - (or (eshell-input-filter-default input) - (eshell-input-filter-initial-space input))) - eshell-prompt-function #'acdw/eshell-prompt) + (setq eshell-destroy-buffer-when-process-dies t + eshell-error-if-no-glob t + eshell-hist-ignoredups t + eshell-kill-on-exit t + eshell-prefer-lisp-functions t + eshell-prefer-lisp-variables t + eshell-scroll-to-bottom-on-input 'this + eshell-banner-message "" + eshell-hist-ignoredups 'erase + eshell-history-size 512 + eshell-input-filter (lambda (input) + (or (eshell-input-filter-default input) + (eshell-input-filter-initial-space input))) + eshell-prompt-function #'acdw/eshell-prompt) (add-hook 'eshell-mode-hook (defun eshell-setup () (hungry-delete-mode -1) diff --git a/lisp/acdw-web.el b/lisp/acdw-web.el index 40e1a3d..3b78e4d 100644 --- a/lisp/acdw-web.el +++ b/lisp/acdw-web.el @@ -30,6 +30,7 @@ This is a good function to use in key positions in `browse-url-handlers'." (cl-loop for regexp in ',regexps if (string-match-p regexp url) return regexp))) + ;;; External URL handlers (cl-defmacro +browse-url-make-external-viewer-handler @@ -93,9 +94,8 @@ for some reason." "--cache-pause-initial=yes") :prompt "Video URL: ") -(+browse-url-make-external-viewer-handler mpv-image - :program (executable-find "mpv") - :args '("--image-display-duration=inf") +(+browse-url-make-external-viewer-handler miv + :program (executable-find "miv") :prompt "Image URL: ") ;;; External domains @@ -187,6 +187,17 @@ This function will also save `custom-file' with the updated value." (message "Saved %s" file) file))) +;;; Unfucking the internet + +(defun eww-archiveis-url (url) + "Run URL through archive.is and browse the result." + (interactive (list (plist-get eww-data :url))) + (letrec ((nonce (lambda () + (unwind-protect (eww-readable) + (remove-hook 'eww-after-render-hook nonce))))) + (add-hook 'eww-after-render-hook nonce) + (eww (format "https://archive.is/submit/?url=%s" url)))) + ;;; Packages @@ -240,7 +251,8 @@ This function will also save `custom-file' with the updated value." (define-key eww-mode-map "b" #'bookmark-set) (define-key eww-mode-map "B" #'bookmark-jump) (define-key eww-mode-map (kbd "M-n") nil) - (define-key eww-mode-map (kbd "M-p") nil)) + (define-key eww-mode-map (kbd "M-p") nil) + (define-key eww-mode-map (kbd "*") #'eww-archiveis-url)) (use-package browse-url :demand t @@ -248,6 +260,9 @@ This function will also save `custom-file' with the updated value." (put 'browse-url-browser-function 'safe-local-variable '+browse-url-browser-function-safe-p) (setopt browse-url-browser-function #'eww-browse-url + browse-url-secondary-browser-function #'browse-url-firefox + browse-url-firefox-program (executable-find "firefox") + browse-url-firefox-arguments '("--new-tab") ;; Dispatch browser based on URL browse-url-handlers `(;; Videos @@ -266,7 +281,7 @@ This function will also save `custom-file' with the updated value." (rx "." (or "jpeg" "jpg" "png" "pn" "bmp" "webp") eos)) - . +browse-url-with-mpv-image) + . +browse-url-with-miv) ;; Blobs (,(+browse-url-matches (rx "." (or ".tar.gz" ".pdf") eos)) . +browse-url-download) @@ -294,7 +309,8 @@ This function will also save `custom-file' with the updated value." browse-url-firefox-arguments '("--new-tab") browse-url-generic-program firefox browse-url-generic-args browse-url-firefox-arguments)) - (when-let ((chromium (choose-executable "chromium"))) + (when-let ((chromium (choose-executable "chromium" + "chromium-browser"))) (setopt browse-url-chromium-program chromium browse-url-generic-program chromium)) (when-let ((chrome (choose-executable "chrome" @@ -304,7 +320,7 @@ This function will also save `custom-file' with the updated value." (use-package browse-url-transform :after browse-url - :load-path "~/src/emacs/browse-url-transform/" + :load-path "~/src/browse-url-transform.el/" :config (setopt browse-url-transform-alist `(;; Privacy-respecting alternatives diff --git a/lisp/acdw.el b/lisp/acdw.el index 63291d3..b76b947 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -59,6 +59,13 @@ enables passing arguments to a calling function." ("—" "---")))) (replace-match replace nil nil))))) +(defun unsmartify-dwim () + "Unsmartify the current region or the entire buffer." + (interactive) + (if (region-active-p) + (unsmartify-region (region-beginning) (region-end)) + (unsmartify-region (point-min) (point-max)))) + (defun ++concat (func strings) "Concat STRINGS processed by FUNC. Each of STRINGS can be a bare string or a list. Strings are -- cgit 1.4.1-21-gabe81