From 1e5c351253784ca3bd05c9e0db1e9dc53ab9a1e1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 27 Jan 2022 19:26:33 -0600 Subject: Whose birthday is it? --- init.el | 62 +++++++++++++++++++++++++++++++++++++++++++++++---------- lisp/+emacs.el | 6 +++--- lisp/+ispell.el | 34 ++++++++++++++++++++----------- lisp/+jabber.el | 3 +++ 4 files changed, 79 insertions(+), 26 deletions(-) diff --git a/init.el b/init.el index 526f2dd..d2c41dd 100644 --- a/init.el +++ b/init.el @@ -402,7 +402,9 @@ (setup ispell (:also-load +ispell) - (put 'ispell-buffer-session-localwords 'safe-local-variable #'+ispell-safe-local-p)) + (put 'ispell-buffer-session-localwords + 'safe-local-variable #'+ispell-safe-local-p) + (add-hook 'user-save-hook #'+ispell-move-buffer-words-to-dir-locals-hook)) (setup kmacro (:also-load +kmacro) @@ -1093,7 +1095,8 @@ See also `crux-reopen-as-root-mode'." (setup (:straight electric-cursor) (:option electric-cursor-alist '((overwrite-mode . hbar) - (god-local-mode . box))) + (god-local-mode . box) + (t . bar))) (electric-cursor-mode +1)) (setup (:straight elfeed) @@ -1164,10 +1167,35 @@ See also `crux-reopen-as-root-mode'." (setup (:straight emms) ;; TODO: Definitely need to do more customization here - (:option emms-source-file-default-directory "~/var/music/") + (:option emms-source-file-default-directory "~/var/music/" + emms-player-mpv-update-metadata t + emms-player-mpv-ipc-method 'file) (require 'emms-setup) (emms-all) - (emms-default-players)) + (emms-default-players) + ;; Streaming + (require 'emms-streams) + (:option emms-streams-file (sync/ "emacs/streams.emms")) + ;; Mode line + (:option emms-mode-line-icon-enabled-p t + emms-mode-line-format "%s" + emms-mode-line-mode-line-function ;#'emms-mode-line-icon-function + (defun +emms-mode-line-truncate () + (let ((current-trunc (concat "[ " + (+string-truncate + (emms-mode-line-playlist-current) + 24) + " ] "))) + (if emms-mode-line-icon-enabled-p + (concat " " + emms-mode-line-icon-before-format + (emms-propertize "🎵:" 'display + (emms-mode-line-icon-generate + emms-mode-line-icon-color)) + current-trunc) + current-trunc)))) + (emms-mode-line-mode +1) + (emms-playing-time-mode -1)) (setup (:straight epithet) (dolist (hook '(Info-selection-hook @@ -1223,15 +1251,17 @@ See also `crux-reopen-as-root-mode'." :repo "duckwork/filldent.el")) (:+key "M-q" #'filldent-dwim)) -(setup (:straight flyspell-correct) +(setup (:straight (flyspell-correct + :fork (:host github :repo "duckwork/flyspell-correct" + :branch "metadata-category"))) (:load-after flyspell) (:also-load +flyspell-correct) (:option flyspell-correct--cr-key ";") (:bind-into flyspell "C-;" #'flyspell-correct-wrapper "" #'+flyspell-correct-buffer) - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'flyspell-correct-wrapper vertico-multiform-commands) nil))) + (+with-ensure-after-init ; vertico-multiform + (setf (alist-get 'flyspell vertico-multiform-categories) nil))) (setup (:straight-when (forge :host github :repo "magit/forge") @@ -1358,9 +1388,9 @@ See also `crux-reopen-as-root-mode'." :host nil))) (:also-load +jabber) (:option jabber-account-list '(("acdw@hmm.st")) - jabber-groupchat-buffer-format "%n" - jabber-chat-buffer-format "%n" - jabber-muc-private-buffer-format "%n (%g)" + jabber-groupchat-buffer-format "xmpp:%n" + jabber-chat-buffer-format "xmpp:%n" + jabber-muc-private-buffer-format "xmpp:%n(%g)" jabber-activity-show-p #'ignore) (dolist (mode '(jabber-chat-mode jabber-browse-mode @@ -1725,7 +1755,10 @@ See also `crux-reopen-as-root-mode'." (completion-at-point flat) (indent-for-tab-command flat) (consult-buffer flat) - (insert-char)) + (insert-char) + (flyspell-correct-wrapper) + (+flyspell-correct-buffer) + (flyspell-correct-move)) ;; This is applied /after/ the above, so default is at the end of ;; this alist. vertico-multiform-categories '((file buffer grid) @@ -1824,3 +1857,10 @@ See also `crux-reopen-as-root-mode'." (:require +zzz-to-char) (:option zzz-to-char-reach (+bytes 1 :kib)) (:global "M-z" #'+zzz-to-char)) + +(setup (:straight org-download) + (:option org-download-method 'attach + org-download-backend (cond ((executable-find "curl") 'curl) + ((executable-find "wget") 'wget) + (:else 'url-retrieve))) + (add-hook 'dired-mode-hook 'org-download-enable)) diff --git a/lisp/+emacs.el b/lisp/+emacs.el index 1679886..b40e9c4 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el @@ -92,9 +92,9 @@ Do this only if the buffer is not visiting a file." native-comp-deferred-compilation nil read-answer-short t read-buffer-completion-ignore-case t - read-extended-command-predicate (when (fboundp - 'command-completion-default-include-p) - 'command-completion-default-include-p) + ;; read-extended-command-predicate (when (fboundp + ;; 'command-completion-default-include-p) + ;; 'command-completion-default-include-p) recenter-positions '(top middle bottom) regexp-search-ring-max 100 regexp-search-ring-max 200 diff --git a/lisp/+ispell.el b/lisp/+ispell.el index e35b2f1..c3ee417 100644 --- a/lisp/+ispell.el +++ b/lisp/+ispell.el @@ -49,26 +49,31 @@ before the LISTS." (push string words)))))) words)) -(defun +ispell-move-buffer-words-to-dir-locals () - (interactive) +;;;###autoload +(defun +ispell-move-buffer-words-to-dir-locals (&optional arg) + "Move the current buffer-local words to .dir-locals.el. +This function prompts the user to save .dir-locals.el, unless +prefix ARG is non-nil; then it just saves them." + (interactive "P") (unless (buffer-file-name) (user-error "Buffer not attached to file")) (hack-dir-local-variables) - (let ((words (+ispell-buffer-local-words-list)) - (dir-local-words (+ispell-append-removing-duplicates - (alist-get 'ispell-buffer-session-localwords - dir-local-variables-alist) - (alist-get 'ispell-buffer-session-localwords - file-local-variables-alist)))) + (when-let ((new-words (+ispell-append-removing-duplicates + :test #'string= + ispell-buffer-session-localwords + (alist-get 'ispell-buffer-session-localwords + dir-local-variables-alist) + (alist-get 'ispell-buffer-session-localwords + file-local-variables-alist) + (+ispell-buffer-local-words-list)))) (save-excursion (add-dir-local-variable major-mode 'ispell-buffer-session-localwords (setq ispell-buffer-session-localwords - (+ispell-append-removing-duplicates - :test #'string= - dir-local-words ispell-buffer-session-localwords words))) - (when (y-or-n-p "Save .dir-locals.el?") + new-words)) + (when (or arg + (y-or-n-p "Save .dir-locals.el?")) (save-buffer)) (bury-buffer)) (or ispell-buffer-local-name @@ -78,5 +83,10 @@ before the LISTS." (while (search-forward ispell-words-keyword nil t) (delete-region (point-at-bol) (1+ (point-at-eol))))))) +;;;###autoload +(defun +ispell-move-buffer-words-to-dir-locals-hook () + "Convenience function for binding to a hook." + (+ispell-move-buffer-words-to-dir-locals t)) + (provide '+ispell) ;;; +ispell.el ends here diff --git a/lisp/+jabber.el b/lisp/+jabber.el index 69bc8c9..a0fdea7 100644 --- a/lisp/+jabber.el +++ b/lisp/+jabber.el @@ -25,5 +25,8 @@ This does the same as `jabber-activity-show-p', but for the (when (funcall +jabber-tracking-show-p group) (tracking-add-buffer buffer 'jabber-activity-face))) +;;; TODO: Hiding presence messages: +;; https://paste.sr.ht/~hdasch/f0ad09fbcd08e940a4fda71c2f40abc1c4efd45f + (provide '+jabber) ;;; +jabber.el ends here -- cgit 1.4.1-21-gabe81