aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-20 21:45:19 +0000
committerRichard M. Stallman1994-05-20 21:45:19 +0000
commit3ee3ac774f3be2cf4f2ec479046d40147b70334d (patch)
treeab7f9e5a8a56cb3dc30d10c49414c1476e38678f /lisp/textmodes
parentda0ac66a1d97bf23cd8447ed3989d61a4731d042 (diff)
downloademacs-3ee3ac774f3be2cf4f2ec479046d40147b70334d.tar.gz
emacs-3ee3ac774f3be2cf4f2ec479046d40147b70334d.zip
Lots of doc fixes and message syntax fixes.
(ispell-command-loop): For X, put point before the word being considered, and mention C-u M-$ in message.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/ispell.el104
1 files changed, 55 insertions, 49 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 429a097d367..082190f5bc5 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -635,16 +635,16 @@ If word not found in dictionary, display possible corrections in a window
635and let user select. 635and let user select.
636 With a prefix argument (or if CONTINUE is non-nil), 636 With a prefix argument (or if CONTINUE is non-nil),
637resume interrupted spell-checking of a buffer or region. 637resume interrupted spell-checking of a buffer or region.
638 If optional argument FOLLOWING is non-nil or if ispell-following-word 638 If optional argument FOLLOWING is non-nil or if `ispell-following-word'
639is non-nil when called interactively, then the following word 639is non-nil when called interactively, then the following word
640\(rather than preceding\) will be checked when the cursor is not over a word. 640\(rather than preceding\) is checked when the cursor is not over a word.
641 When the optional argument QUIETLY is non-nil or ispell-quietly is non-nil 641 When the optional argument QUIETLY is non-nil or `ispell-quietly' is non-nil
642when called interactively, non-corrective messages are suppressed. 642when called interactively, non-corrective messages are suppressed.
643 643
644 Word syntax described by ispell-dictionary-alist (which see). 644 Word syntax described by `ispell-dictionary-alist' (which see).
645 645
646This will check or reload the dictionary. Use \\[ispell-change-dictionary] 646This will check or reload the dictionary. Use \\[ispell-change-dictionary]
647or \\[ispell-region] to update the ispell process." 647or \\[ispell-region] to update the Ispell process."
648 (interactive (list nil nil current-prefix-arg)) 648 (interactive (list nil nil current-prefix-arg))
649 (if continue 649 (if continue
650 (ispell-continue) 650 (ispell-continue)
@@ -678,7 +678,7 @@ or \\[ispell-region] to update the ispell process."
678 (setq poss (ispell-parse-output (car ispell-filter)))) 678 (setq poss (ispell-parse-output (car ispell-filter))))
679 (cond ((eq poss t) 679 (cond ((eq poss t)
680 (or quietly 680 (or quietly
681 (message "%s is correct." (funcall ispell-format-word word)))) 681 (message "%s is correct" (funcall ispell-format-word word))))
682 ((stringp poss) 682 ((stringp poss)
683 (or quietly 683 (or quietly
684 (message "%s is correct because of root %s" 684 (message "%s is correct because of root %s"
@@ -718,13 +718,13 @@ or \\[ispell-region] to update the ispell process."
718 718
719(defun ispell-get-word (following &optional extra-otherchars) 719(defun ispell-get-word (following &optional extra-otherchars)
720 "Return the word for spell-checking according to ispell syntax. 720 "Return the word for spell-checking according to ispell syntax.
721 If optional argument FOLLOWING is non-nil or if ispell-following-word 721If optional argument FOLLOWING is non-nil or if `ispell-following-word'
722is non-nil when called interactively, then the following word 722is non-nil when called interactively, then the following word
723\(rather than preceeding\) will be checked when the cursor is not over a word. 723\(rather than preceeding\) is checked when the cursor is not over a word.
724 Optional second argument contains otherchars that can be included in word 724 Optional second argument contains otherchars that can be included in word
725many times. 725many times.
726 726
727 Word syntax described by ispell-dictionary-alist (which see)." 727 Word syntax described by `ispell-dictionary-alist' (which see)."
728 (let* ((ispell-casechars (ispell-get-casechars)) 728 (let* ((ispell-casechars (ispell-get-casechars))
729 (ispell-not-casechars (ispell-get-not-casechars)) 729 (ispell-not-casechars (ispell-get-not-casechars))
730 (ispell-otherchars (ispell-get-otherchars)) 730 (ispell-otherchars (ispell-get-otherchars))
@@ -781,7 +781,7 @@ many times.
781;;;###autoload 781;;;###autoload
782(defun ispell-pdict-save (&optional no-query force-save) 782(defun ispell-pdict-save (&optional no-query force-save)
783 "Check to see if the personal dictionary has been modified. 783 "Check to see if the personal dictionary has been modified.
784 If so, ask if it needs to be saved." 784If so, ask if it needs to be saved."
785 (interactive (list ispell-silently-savep t)) 785 (interactive (list ispell-silently-savep t))
786 (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p)) 786 (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p))
787 (setq ispell-pdict-modified-p (car ispell-pdict-modified-p))) 787 (setq ispell-pdict-modified-p (car ispell-pdict-modified-p)))
@@ -801,8 +801,8 @@ Returns nil to keep word.
801 list for new replacement word (will be rechecked). 801 list for new replacement word (will be rechecked).
802 Optional second argument means replace misspelling in 802 Optional second argument means replace misspelling in
803 the rest of the region. 803 the rest of the region.
804Global ispell-pdict-modified-p becomes a list where the only value 804Global `ispell-pdict-modified-p' becomes a list where the only value
805indicates whether the dictionary has been modified when option a or i is 805indicates whether the dictionary has been modified when option `a' or `i' is
806used." 806used."
807 (unwind-protect 807 (unwind-protect
808 (save-window-excursion 808 (save-window-excursion
@@ -835,7 +835,7 @@ used."
835 (setq line (1+ line)))) 835 (setq line (1+ line))))
836 (insert (car guess) " ") 836 (insert (car guess) " ")
837 (setq guess (cdr guess))) 837 (setq guess (cdr guess)))
838 (insert "\nUse option \"i\" if this is a correct composition from the derivative root.\n") 838 (insert "\nUse option `i' if this is a correct composition from the derivative root\n")
839 (setq line (+ line (if choices 3 2))))) 839 (setq line (+ line (if choices 3 2)))))
840 (while (and choices 840 (while (and choices
841 (< (if (> (+ 7 (current-column) (length (car choices)) 841 (< (if (> (+ 7 (current-column) (length (car choices))
@@ -915,11 +915,19 @@ used."
915 ((or (= char ??) (= char help-char) (= char ?\C-h)) 915 ((or (= char ??) (= char help-char) (= char ?\C-h))
916 (ispell-help) 916 (ispell-help)
917 t) 917 t)
918 ;; quit or quit and stay at this point. 918 ;; Quit and move point back.
919 ((or (= char ?x) (= char ?X)) ; quit. 919 ((= char ?x)
920 (ispell-pdict-save ispell-silently-savep) 920 (ispell-pdict-save ispell-silently-savep)
921 (message "exited ispell") 921 (message "Exited spell-checking")
922 (setq ispell-quit (if (= char ?X) (point) t)) 922 (setq ispell-quit t)
923 nil)
924 ;; Quit and preserve point.
925 ((= char ?X)
926 (ispell-pdict-save ispell-silently-savep)
927 (message
928 (substitute-command-keys
929 "Spell-checking suspended; use C-u \\[ispell-word] to resume"))
930 (setq ispell-quit (max (point-min) (- (point) (length word))))
923 nil) 931 nil)
924 ((= char ?q) 932 ((= char ?q)
925 (if (y-or-n-p "Really quit ignoring changes? ") 933 (if (y-or-n-p "Really quit ignoring changes? ")
@@ -996,7 +1004,7 @@ used."
996 1004
997;;;###autoload 1005;;;###autoload
998(defun ispell-help () 1006(defun ispell-help ()
999 "This gives a list of the options available when a misspelling is encountered. 1007 "Display a list of the options available when a misspelling is encountered.
1000 1008
1001Selections are: 1009Selections are:
1002 1010
@@ -1050,11 +1058,11 @@ DIGIT: Replace the word with a digit offered in the *Choices* buffer.
1050 1058
1051(defun lookup-words (word &optional lookup-dict) 1059(defun lookup-words (word &optional lookup-dict)
1052 "Look up word in word-list dictionary. 1060 "Look up word in word-list dictionary.
1053A '*' is used for wild cards. If no wild cards, 'look' is used if it exists. 1061A `*' is serves as a wild card. If no wild cards, `look' is used if it exists.
1054 Otherwise the variable ispell-grep-command contains the command used to 1062 Otherwise the variable `ispell-grep-command' contains the command used to
1055 search for the words (usually egrep). 1063 search for the words (usually egrep).
1056Optional second argument contains the dictionary to use, the default is 1064Optional second argument contains the dictionary to use; the default is
1057 ispell-alternate-dictionary." 1065 `ispell-alternate-dictionary'."
1058 ;; We don't use the filter for this function, rather the result is written 1066 ;; We don't use the filter for this function, rather the result is written
1059 ;; into a buffer. Hence there is no need to save the filter values. 1067 ;; into a buffer. Hence there is no need to save the filter values.
1060 (if (null lookup-dict) 1068 (if (null lookup-dict)
@@ -1146,10 +1154,9 @@ Optional second argument contains the dictionary to use, the default is
1146;;; This function destroys the mark location if it is in the word being 1154;;; This function destroys the mark location if it is in the word being
1147;;; highlighted. 1155;;; highlighted.
1148(defun highlight-spelling-error-generic (start end &optional highlight) 1156(defun highlight-spelling-error-generic (start end &optional highlight)
1149 "Highlight the word from START to END by deleting and reinserting it 1157 "Highlight the word from START to END with a kludge using `inverse-video'.
1150while toggling the variable \"inverse-video\". When the optional 1158When the optional third arg HIGHLIGHT is set, the word is highlighted;
1151third arg HIGHLIGHT is set, the word is highlighted otherwise it is 1159otherwise it is displayed normally."
1152displayed normally."
1153 (let ((modified (buffer-modified-p)) ; don't allow this fn to modify buffer 1160 (let ((modified (buffer-modified-p)) ; don't allow this fn to modify buffer
1154 (buffer-read-only nil) ; Allow highlighting read-only buffers. 1161 (buffer-read-only nil) ; Allow highlighting read-only buffers.
1155 (text (buffer-substring start end)) ; Save highlight region 1162 (text (buffer-substring start end)) ; Save highlight region
@@ -1167,8 +1174,8 @@ displayed normally."
1167 1174
1168 1175
1169(defun highlight-spelling-error-lucid (start end &optional highlight) 1176(defun highlight-spelling-error-lucid (start end &optional highlight)
1170 "Highlight the word from START to END using isearch-highlight. When 1177 "Highlight the word from START to END using `isearch-highlight'.
1171the optional third arg HIGHLIGHT is set, the word is highlighted 1178When the optional third arg HIGHLIGHT is set, the word is highlighted
1172otherwise it is displayed normally." 1179otherwise it is displayed normally."
1173 (if highlight 1180 (if highlight
1174 (isearch-highlight start end) 1181 (isearch-highlight start end)
@@ -1178,9 +1185,9 @@ otherwise it is displayed normally."
1178 1185
1179 1186
1180(defun highlight-spelling-error-overlay (start end &optional highlight) 1187(defun highlight-spelling-error-overlay (start end &optional highlight)
1181 "Highlight the word from START to END using overlays. When the 1188 "Highlight the word from START to END using overlays.
1182optional third arg HIGHLIGHT is set, the word is highlighted otherwise 1189When the optional third arg HIGHLIGHT is set, the word is highlighted
1183it is displayed normally. 1190otherwise it is displayed normally.
1184 The variable ispell-highlight-face selects the face that will be used 1191 The variable ispell-highlight-face selects the face that will be used
1185for highlighting." 1192for highlighting."
1186 (if highlight 1193 (if highlight
@@ -1201,10 +1208,9 @@ for highlighting."
1201 1208
1202 1209
1203(defun ispell-overlay-window (height) 1210(defun ispell-overlay-window (height)
1204 "Create a (usually small) window covering the top HEIGHT lines of the 1211 "Create a window covering the top HEIGHT lines of the current window.
1205current window. Ensure that the line above point is still visible but 1212Ensure that the line above point is still visible but otherwise avoid
1206otherwise avoid scrolling the current window. Should leave the old 1213scrolling the current window. Leave the old window selected."
1207window selected."
1208 (save-excursion 1214 (save-excursion
1209 (let ((oldot (save-excursion (forward-line -1) (point))) 1215 (let ((oldot (save-excursion (forward-line -1) (point)))
1210 (top (save-excursion (move-to-window-line height) (point)))) 1216 (top (save-excursion (move-to-window-line height) (point))))
@@ -1218,14 +1224,14 @@ window selected."
1218 1224
1219;;; Should we add a compound word match return value? 1225;;; Should we add a compound word match return value?
1220(defun ispell-parse-output (output) 1226(defun ispell-parse-output (output)
1221 "Parse the OUTPUT string of 'ispell' and return: 1227 "Parse the OUTPUT string of `ispell' and return:
12221: T for an exact match. 12281: T for an exact match.
12232: A string containing the root word for a match via suffix removal. 12292: A string containing the root word for a match via suffix removal.
12243: A list of possible correct spellings of the format: 12303: A list of possible correct spellings of the format:
1225 '(\"original-word\" offset miss-list guess-list) 1231 '(\"ORIGINAL-WORD\" OFFSET MISS-LIST GUESS-LIST)
1226 original-word is a string of the possibly misspelled word. 1232 ORIGINAL-WORD is a string of the possibly misspelled word.
1227 offset is an integer giving the line offset of the word. 1233 OFFSET is an integer giving the line offset of the word.
1228 miss-list and guess-list are possibly null lists of guesses and misses." 1234 MISS-LIST and GUESS-LIST are possibly null lists of guesses and misses."
1229 (cond 1235 (cond
1230 ((string= output "") t) ; for startup with pipes... 1236 ((string= output "") t) ; for startup with pipes...
1231 ((string= output "*") t) ; exact match 1237 ((string= output "*") t) ; exact match
@@ -1299,7 +1305,7 @@ window selected."
1299 1305
1300 1306
1301(defun ispell-init-process () 1307(defun ispell-init-process ()
1302 "Check status of 'ispell' process and start if necessary." 1308 "Check status of Ispell process and start if necessary."
1303 (if (and ispell-process 1309 (if (and ispell-process
1304 (eq (process-status ispell-process) 'run) 1310 (eq (process-status ispell-process) 'run)
1305 ;; If we're using a personal dictionary, assure 1311 ;; If we're using a personal dictionary, assure
@@ -1309,7 +1315,7 @@ window selected."
1309 (setq ispell-filter nil ispell-filter-continue nil) 1315 (setq ispell-filter nil ispell-filter-continue nil)
1310 ;; may need to restart to select new personal dictionary. 1316 ;; may need to restart to select new personal dictionary.
1311 (ispell-kill-ispell t) 1317 (ispell-kill-ispell t)
1312 (message "Starting new ispell process...") 1318 (message "Starting new Ispell process...")
1313 (sit-for 0) 1319 (sit-for 0)
1314 (check-ispell-version) 1320 (check-ispell-version)
1315 (setq ispell-process 1321 (setq ispell-process
@@ -1372,7 +1378,7 @@ With NO-ERROR, just return non-nil if there was no ispell running."
1372 (error "There is no ispell process running!")) 1378 (error "There is no ispell process running!"))
1373 (kill-process ispell-process) 1379 (kill-process ispell-process)
1374 (setq ispell-process nil) 1380 (setq ispell-process nil)
1375 (message "Killed ispell process.") 1381 (message "Ispell process killed")
1376 nil)) 1382 nil))
1377 1383
1378 1384
@@ -1407,7 +1413,7 @@ With prefix argument, set the default directory."
1407 (setq ispell-local-dictionary dict))) 1413 (setq ispell-local-dictionary dict)))
1408 (error "Illegal dictionary: %s" dict)) 1414 (error "Illegal dictionary: %s" dict))
1409 (ispell-kill-ispell t) 1415 (ispell-kill-ispell t)
1410 (message "(Next %sispell command will use %s dictionary)" 1416 (message "(Next %sIspell command will use %s dictionary)"
1411 (cond ((equal ispell-local-dictionary ispell-dictionary) 1417 (cond ((equal ispell-local-dictionary ispell-dictionary)
1412 "") 1418 "")
1413 (arg "global ") 1419 (arg "global ")
@@ -1428,7 +1434,7 @@ With prefix argument, set the default directory."
1428 (ispell-accept-buffer-local-defs) ; set up dictionary, local words, etc. 1434 (ispell-accept-buffer-local-defs) ; set up dictionary, local words, etc.
1429 (unwind-protect 1435 (unwind-protect
1430 (save-excursion 1436 (save-excursion
1431 (message "Spelling %s..." 1437 (message "Spell checking %s..."
1432 (if (and (= reg-start (point-min)) (= reg-end (point-max))) 1438 (if (and (= reg-start (point-min)) (= reg-end (point-max)))
1433 (buffer-name) "region")) 1439 (buffer-name) "region"))
1434 (sit-for 0) 1440 (sit-for 0)
@@ -1486,7 +1492,7 @@ With prefix argument, set the default directory."
1486 (progn 1492 (progn
1487 (ispell-pdict-save ispell-silently-savep) 1493 (ispell-pdict-save ispell-silently-savep)
1488 (ding) 1494 (ding)
1489 (message "Open tib reference. Set ispell-skip-tib to nil to avoid this error.") 1495 (message "Open tib reference--set `ispell-skip-tib' to nil to avoid this error")
1490 (setq ispell-quit (- (point) 2)))) ; leave dot at error loc. 1496 (setq ispell-quit (- (point) 2)))) ; leave dot at error loc.
1491 ;; tib ref starts later on line. Check spelling before tib. 1497 ;; tib ref starts later on line. Check spelling before tib.
1492 (let ((limit (- (point) 2))) 1498 (let ((limit (- (point) 2)))
@@ -1533,7 +1539,7 @@ With prefix argument, set the default directory."
1533 (search-forward (car poss) word-end t) 1539 (search-forward (car poss) word-end t)
1534 (point))) 1540 (point)))
1535 ;; This usually occurs due to filter pipe problems 1541 ;; This usually occurs due to filter pipe problems
1536 (error "***ispell misalignment: word \"%s\" point %d; please retry." 1542 (error "Ispell misalignment: word `%s' point %d; please retry"
1537 (car poss) word-start)) 1543 (car poss) word-start))
1538 (unwind-protect 1544 (unwind-protect
1539 (progn 1545 (progn
@@ -1597,7 +1603,7 @@ With prefix argument, set the default directory."
1597 offset-change (+ offset-change change) 1603 offset-change (+ offset-change change)
1598 end (+ end change))))) 1604 end (+ end change)))))
1599 (if (not ispell-quit) 1605 (if (not ispell-quit)
1600 (message "continuing spelling check...")) 1606 (message "Continuing spelling check..."))
1601 (sit-for 0))) 1607 (sit-for 0)))
1602 (setq ispell-filter (cdr ispell-filter))))) ; finished with line 1608 (setq ispell-filter (cdr ispell-filter))))) ; finished with line
1603 (goto-char end))))) 1609 (goto-char end)))))
@@ -1622,7 +1628,7 @@ With prefix argument, set the default directory."
1622 (set-marker ispell-region-end nil) 1628 (set-marker ispell-region-end nil)
1623 ;; Only save if successful exit. 1629 ;; Only save if successful exit.
1624 (ispell-pdict-save ispell-silently-savep) 1630 (ispell-pdict-save ispell-silently-savep)
1625 (message "Spell done.")))) 1631 (message "Spell-checking done"))))
1626 1632
1627 1633
1628 1634