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? --- lisp/+emacs.el | 6 +++--- lisp/+ispell.el | 34 ++++++++++++++++++++++------------ lisp/+jabber.el | 3 +++ 3 files changed, 28 insertions(+), 15 deletions(-) (limited to 'lisp') 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