aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ryde2020-08-21 14:17:56 +0200
committerLars Ingebrigtsen2020-08-21 14:17:56 +0200
commit47b3adf8bb29f89a2c3cbfd99ac3df52810ca211 (patch)
treef2cac455ff2b05309eaedef84133ed3c3b33fbbb
parent3feef0428dad1e847d250d949248907ad31669dc (diff)
downloademacs-47b3adf8bb29f89a2c3cbfd99ac3df52810ca211.tar.gz
emacs-47b3adf8bb29f89a2c3cbfd99ac3df52810ca211.zip
Have ispell add new LocalWords lines after any such existing lines
* textmodes/ispell.el (ispell-add-per-file-word-list): Add new LocalWords line just after existing such lines. Good to keep words together or if deliberately placed somewhere special (bug#20486).
-rw-r--r--lisp/textmodes/ispell.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b2ccbc8da24..8252da604eb 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -4188,7 +4188,7 @@ Both should not be used to define a buffer-local dictionary."
4188 (let (line-okay search done found) 4188 (let (line-okay search done found)
4189 (while (not done) 4189 (while (not done)
4190 (let ((case-fold-search nil)) 4190 (let ((case-fold-search nil))
4191 (setq search (search-forward ispell-words-keyword nil 'move) 4191 (setq search (search-forward ispell-words-keyword nil t)
4192 found (or found search) 4192 found (or found search)
4193 line-okay (< (+ (length word) 1 ; 1 for space after word.. 4193 line-okay (< (+ (length word) 1 ; 1 for space after word..
4194 (progn (end-of-line) (current-column))) 4194 (progn (end-of-line) (current-column)))
@@ -4199,8 +4199,10 @@ Both should not be used to define a buffer-local dictionary."
4199 (setq done t) 4199 (setq done t)
4200 (if (null search) 4200 (if (null search)
4201 (progn 4201 (progn
4202 (open-line 1) 4202 (if found (insert "\n") ;; after an existing LocalWords
4203 (unless found (newline)) 4203 (goto-char (point-max)) ;; no LocalWords, go to end of file
4204 (open-line 1)
4205 (newline))
4204 (insert (if comment-start 4206 (insert (if comment-start
4205 (concat 4207 (concat
4206 (progn 4208 (progn