aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorKenichi Handa2005-03-09 00:36:22 +0000
committerKenichi Handa2005-03-09 00:36:22 +0000
commitca8d88cd7d73b571b1146c0d34d6fa6d35ba02ba (patch)
tree91646b5e994dbc4f0889626d9ec36384710d0e3e /lisp/textmodes
parent91199264e3bbe734bfc6cf87ed8be6cd8dbc84c6 (diff)
downloademacs-ca8d88cd7d73b571b1146c0d34d6fa6d35ba02ba.tar.gz
emacs-ca8d88cd7d73b571b1146c0d34d6fa6d35ba02ba.zip
(ispell-insert-word): New function.
(ispell-word): Use ispell-insert-word to isnert a new word. (ispell-process-line): Likewise (ispell-complete-word): Likewise.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/ispell.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2a84d584634..38f69bd2250 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1406,6 +1406,14 @@ This allows it to improve the suggestion list based on actual mispellings."
1406 (setq more-lines (= 0 (forward-line)))))))))))))) 1406 (setq more-lines (= 0 (forward-line))))))))))))))
1407 1407
1408 1408
1409;; Insert WORD while translating Latin characters to the equivalent
1410;; characters that is supported by buffer-file-coding-system.
1411
1412(defun ispell-insert-word (word)
1413 (let ((pos (point)))
1414 (insert word)
1415 (if (char-table-p translation-table-for-input)
1416 (translate-region pos (point) translation-table-for-input))))
1409 1417
1410;;;###autoload 1418;;;###autoload
1411(defun ispell-word (&optional following quietly continue) 1419(defun ispell-word (&optional following quietly continue)
@@ -1504,7 +1512,7 @@ quit spell session exited."
1504 (progn 1512 (progn
1505 (delete-region start end) 1513 (delete-region start end)
1506 (setq start (point)) 1514 (setq start (point))
1507 (insert new-word) 1515 (ispell-insert-word new-word)
1508 (setq end (point)))) 1516 (setq end (point))))
1509 (if (not (atom replace)) ;recheck spelling of replacement 1517 (if (not (atom replace)) ;recheck spelling of replacement
1510 (progn 1518 (progn
@@ -2883,7 +2891,7 @@ Returns the sum shift due to changes in word replacements."
2883 (delete-region (point) (+ word-len (point))) 2891 (delete-region (point) (+ word-len (point)))
2884 (if (not (listp replace)) 2892 (if (not (listp replace))
2885 (progn 2893 (progn
2886 (insert replace) ; insert dictionary word 2894 (ispell-insert-word replace) ; insert dictionary word
2887 (ispell-send-replacement (car poss) replace) 2895 (ispell-send-replacement (car poss) replace)
2888 (setq accept-list (cons replace accept-list))) 2896 (setq accept-list (cons replace accept-list)))
2889 (let ((replace-word (car replace))) 2897 (let ((replace-word (car replace)))
@@ -3052,7 +3060,7 @@ Standard ispell choices are then available."
3052 (setq word (if (atom replacement) replacement (car replacement)) 3060 (setq word (if (atom replacement) replacement (car replacement))
3053 cursor-location (+ (- (length word) (- end start)) 3061 cursor-location (+ (- (length word) (- end start))
3054 cursor-location)) 3062 cursor-location))
3055 (insert word) 3063 (ispell-insert-word word)
3056 (if (not (atom replacement)) ; recheck spelling of replacement. 3064 (if (not (atom replacement)) ; recheck spelling of replacement.
3057 (progn 3065 (progn
3058 (goto-char cursor-location) 3066 (goto-char cursor-location)