emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 47b3adf: Have ispell add new LocalWords lines after any such exis


From: Lars Ingebrigtsen
Subject: master 47b3adf: Have ispell add new LocalWords lines after any such existing lines
Date: Fri, 21 Aug 2020 08:18:08 -0400 (EDT)

branch: master
commit 47b3adf8bb29f89a2c3cbfd99ac3df52810ca211
Author: Kevin Ryde <user42_kevin@yahoo.com.au>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/textmodes/ispell.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b2ccbc8..8252da6 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."
     (let (line-okay search done found)
       (while (not done)
         (let ((case-fold-search nil))
-          (setq search (search-forward ispell-words-keyword nil 'move)
+          (setq search (search-forward ispell-words-keyword nil t)
              found (or found search)
              line-okay (< (+ (length word) 1 ; 1 for space after word..
                              (progn (end-of-line) (current-column)))
@@ -4199,8 +4199,10 @@ Both should not be used to define a buffer-local 
dictionary."
              (setq done t)
              (if (null search)
                  (progn
-                   (open-line 1)
-                   (unless found (newline))
+                   (if found (insert "\n")  ;; after an existing LocalWords
+                      (goto-char (point-max)) ;; no LocalWords, go to end of 
file
+                      (open-line 1)
+                      (newline))
                    (insert (if comment-start
                                 (concat
                                   (progn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]