about summary refs log tree commit diff stats
path: root/lisp/+ispell.el
diff options
context:
space:
mode:
authorCase Duckworth2022-03-11 20:04:05 -0600
committerCase Duckworth2022-03-11 20:04:05 -0600
commitf6512fe1bd9738e1c2c5c9a7ad92098b2f02fa34 (patch)
treec5cf0551e9e25e5238f474fd6ad44fbe6d155e56 /lisp/+ispell.el
parentAdd snippets (diff)
downloademacs-f6512fe1bd9738e1c2c5c9a7ad92098b2f02fa34.tar.gz
emacs-f6512fe1bd9738e1c2c5c9a7ad92098b2f02fa34.zip
Uh
Diffstat (limited to 'lisp/+ispell.el')
-rw-r--r--lisp/+ispell.el52
1 files changed, 28 insertions, 24 deletions
diff --git a/lisp/+ispell.el b/lisp/+ispell.el index c3ee417..697233f 100644 --- a/lisp/+ispell.el +++ b/lisp/+ispell.el
@@ -58,30 +58,34 @@ prefix ARG is non-nil; then it just saves them."
58 (unless (buffer-file-name) 58 (unless (buffer-file-name)
59 (user-error "Buffer not attached to file")) 59 (user-error "Buffer not attached to file"))
60 (hack-dir-local-variables) 60 (hack-dir-local-variables)
61 (when-let ((new-words (+ispell-append-removing-duplicates 61 (let ((print-level nil)
62 :test #'string= 62 (print-length nil))
63 ispell-buffer-session-localwords 63 (when-let ((new-words (cl-remove-if (lambda (el) (eq el '\.\.\.)) ; XXX: NO IDEA
64 (alist-get 'ispell-buffer-session-localwords 64 ; where this came from
65 dir-local-variables-alist) 65 (+ispell-append-removing-duplicates
66 (alist-get 'ispell-buffer-session-localwords 66 :test #'string=
67 file-local-variables-alist) 67 ispell-buffer-session-localwords
68 (+ispell-buffer-local-words-list)))) 68 (alist-get 'ispell-buffer-session-localwords
69 (save-excursion 69 dir-local-variables-alist)
70 (add-dir-local-variable 70 (alist-get 'ispell-buffer-session-localwords
71 major-mode 71 file-local-variables-alist)
72 'ispell-buffer-session-localwords 72 (+ispell-buffer-local-words-list)))))
73 (setq ispell-buffer-session-localwords 73 (save-excursion
74 new-words)) 74 (add-dir-local-variable
75 (when (or arg 75 major-mode
76 (y-or-n-p "Save .dir-locals.el?")) 76 'ispell-buffer-session-localwords
77 (save-buffer)) 77 (setq ispell-buffer-session-localwords
78 (bury-buffer)) 78 new-words))
79 (or ispell-buffer-local-name 79 (when (or arg
80 (setq ispell-buffer-local-name (buffer-name))) 80 (y-or-n-p "Save .dir-locals.el?"))
81 (save-excursion 81 (save-buffer))
82 (goto-char (point-min)) 82 (bury-buffer))
83 (while (search-forward ispell-words-keyword nil t) 83 (or ispell-buffer-local-name
84 (delete-region (point-at-bol) (1+ (point-at-eol))))))) 84 (setq ispell-buffer-local-name (buffer-name)))
85 (save-excursion
86 (goto-char (point-min))
87 (while (search-forward ispell-words-keyword nil t)
88 (delete-region (point-at-bol) (1+ (point-at-eol))))))))
85 89
86;;;###autoload 90;;;###autoload
87(defun +ispell-move-buffer-words-to-dir-locals-hook () 91(defun +ispell-move-buffer-words-to-dir-locals-hook ()