Mercurial > emacs
comparison lisp/textmodes/ispell.el @ 10697:d2fd1a6288b4
Personal dictionary save forced when called from menu,
Epoch compile support.
(ispell-skip-sgml): Added variable for skipping SGML tags & references.
(ispell-buffer-local-parsing): Hard wire set of ispell-skip-sgml-tags
to sgml-mode.
(ispell-pdict-save): Message improvement.
(ispell-command-loop): Properly adjust screen with different settings
of ispell-choices-win-default-height.
(check-ispell-version): Use fundamental-mode as default-major-mode.
(ispell-change-dictionary): Remove unnecessary process kills
(ispell-region): Fold sgml support in with tib checking.
(ispell-message): Skips checking of forwarded messages.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 08 Feb 1995 06:09:08 +0000 |
parents | 8a21a21c3163 |
children | e917a1df21ef |
comparison
equal
deleted
inserted
replaced
10696:5cf8a7a41664 | 10697:d2fd1a6288b4 |
---|---|
4 ;;; | 4 ;;; |
5 ;;; Copyright (C) 1994 Free Software Foundation, Inc. | 5 ;;; Copyright (C) 1994 Free Software Foundation, Inc. |
6 ;;; | 6 ;;; |
7 ;;; | 7 ;;; |
8 ;;; Authors : Ken Stevens <k.stevens@ieee.org> | 8 ;;; Authors : Ken Stevens <k.stevens@ieee.org> |
9 ;;; Last Modified On: Thu Dec 8 13:17:41 EST 1994 | 9 ;;; Last Modified On: Mon Feb 6 17:39:38 EST 1995 |
10 ;;; Update Revision : 2.34 | 10 ;;; Update Revision : 2.36 |
11 ;;; Syntax : emacs-lisp | 11 ;;; Syntax : emacs-lisp |
12 ;;; Status : Release with 3.1.12+ ispell. | 12 ;;; Status : Release with 3.1.12+ ispell. |
13 ;;; Version : International Ispell Version 3.1 by Geoff Kuenning. | 13 ;;; Version : International Ispell Version 3.1 by Geoff Kuenning. |
14 ;;; Bug Reports : ispell-el-bugs@itcorp.com | 14 ;;; Bug Reports : ispell-el-bugs@itcorp.com |
15 ;;; | 15 ;;; |
126 ;;; BUGS: | 126 ;;; BUGS: |
127 ;;; Highlighting in version 19 still doesn't work on tty's. | 127 ;;; Highlighting in version 19 still doesn't work on tty's. |
128 ;;; On some versions of emacs, growing the minibuffer fails. | 128 ;;; On some versions of emacs, growing the minibuffer fails. |
129 ;;; | 129 ;;; |
130 ;;; HISTORY | 130 ;;; HISTORY |
131 ;;; | |
132 ;;; Revision 2.36 1995/2/6 17:39:38 stevens | |
133 ;;; Properly adjust screen with different ispell-choices-win-default-height | |
134 ;;; settings. Skips SGML entity references. | |
135 ;;; | |
136 ;;; Revision 2.35 1995/1/13 14:16:46 stevens | |
137 ;;; Skips SGML tags, ispell-change-dictionary fix for add-hook, assure personal | |
138 ;;; dictionary is saved when called from the menu | |
131 ;;; | 139 ;;; |
132 ;;; Revision 2.34 1994/12/08 13:17:41 stevens | 140 ;;; Revision 2.34 1994/12/08 13:17:41 stevens |
133 ;;; Interaction corrected to function with all 3.1 ispell versions. | 141 ;;; Interaction corrected to function with all 3.1 ispell versions. |
134 ;;; | 142 ;;; |
135 ;;; Revision 2.33 1994/11/24 02:31:20 stevens | 143 ;;; Revision 2.33 1994/11/24 02:31:20 stevens |
558 (define-key ispell-menu-map [ispell-change-dictionary] | 566 (define-key ispell-menu-map [ispell-change-dictionary] |
559 '("Change Dictionary" . ispell-change-dictionary)) | 567 '("Change Dictionary" . ispell-change-dictionary)) |
560 (define-key ispell-menu-map [ispell-kill-ispell] | 568 (define-key ispell-menu-map [ispell-kill-ispell] |
561 '("Kill Process" . ispell-kill-ispell)) | 569 '("Kill Process" . ispell-kill-ispell)) |
562 (define-key ispell-menu-map [ispell-pdict-save] | 570 (define-key ispell-menu-map [ispell-pdict-save] |
563 '("Save Dictionary" . (lambda () (interactive) (ispell-pdict-save t)))) | 571 '("Save Dictionary" . (lambda () (interactive) (ispell-pdict-save t t)))) |
564 (define-key ispell-menu-map [ispell-complete-word] | 572 (define-key ispell-menu-map [ispell-complete-word] |
565 '("Complete Word" . ispell-complete-word)) | 573 '("Complete Word" . ispell-complete-word)) |
566 (define-key ispell-menu-map [ispell-complete-word-interior-frag] | 574 (define-key ispell-menu-map [ispell-complete-word-interior-frag] |
567 '("Complete Word Frag" . ispell-complete-word-interior-frag)))) | 575 '("Complete Word Frag" . ispell-complete-word-interior-frag)))) |
568 | 576 |
604 ["Continue Check" ispell-continue t] | 612 ["Continue Check" ispell-continue t] |
605 ["Complete Word Frag"ispell-complete-word-interior-frag t] | 613 ["Complete Word Frag"ispell-complete-word-interior-frag t] |
606 ["Complete Word" ispell-complete-word t] | 614 ["Complete Word" ispell-complete-word t] |
607 ["Kill Process" ispell-kill-ispell t] | 615 ["Kill Process" ispell-kill-ispell t] |
608 "-" | 616 "-" |
609 ["Save Dictionary" (ispell-pdict-save t) t] | 617 ["Save Dictionary" (ispell-pdict-save t t) t] |
610 ["Change Dictionary" ispell-change-dictionary t])) | 618 ["Change Dictionary" ispell-change-dictionary t])) |
611 name) | 619 name) |
612 (while dicts | 620 (while dicts |
613 (setq name (car (car dicts)) | 621 (setq name (car (car dicts)) |
614 dicts (cdr dicts)) | 622 dicts (cdr dicts)) |
718 `nroff-mode' to put the current buffer into the desired parsing mode. | 726 `nroff-mode' to put the current buffer into the desired parsing mode. |
719 | 727 |
720 Extended character mode can be changed for this buffer by placing | 728 Extended character mode can be changed for this buffer by placing |
721 a `~' followed by an extended-character mode -- such as `~.tex'.") | 729 a `~' followed by an extended-character mode -- such as `~.tex'.") |
722 | 730 |
731 (defvar ispell-skip-sgml nil | |
732 "Skips spell checking of SGML tags and entity references when non-nil. | |
733 This variable is set when major-mode is sgml-mode.") | |
734 | |
735 ;;;###autoload | |
723 (defvar ispell-local-pdict ispell-personal-dictionary | 736 (defvar ispell-local-pdict ispell-personal-dictionary |
724 "A buffer local variable containing the current personal dictionary. | 737 "A buffer local variable containing the current personal dictionary. |
725 If non-nil, the value must be a string, which is a file name. | 738 If non-nil, the value must be a string, which is a file name. |
726 | 739 |
727 If you specify a personal dictionary for the current buffer which is | 740 If you specify a personal dictionary for the current buffer which is |
758 | 771 |
759 ;;; ********************************************************************** | 772 ;;; ********************************************************************** |
760 ;;; ********************************************************************** | 773 ;;; ********************************************************************** |
761 | 774 |
762 | 775 |
763 (if (string-lessp "19" emacs-version) | 776 (and (string-lessp "19" emacs-version) |
764 (defalias 'ispell 'ispell-buffer)) | 777 (not (boundp 'epoch::version)) |
778 (defalias 'ispell 'ispell-buffer)) | |
765 | 779 |
766 ;;;###autoload (define-key global-map "\M-$" 'ispell-word) | 780 ;;;###autoload (define-key global-map "\M-$" 'ispell-word) |
767 | 781 |
768 ;;;###autoload | 782 ;;;###autoload |
769 (defun ispell-word (&optional following quietly continue) | 783 (defun ispell-word (&optional following quietly continue) |
919 (interactive (list ispell-silently-savep t)) | 933 (interactive (list ispell-silently-savep t)) |
920 (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p)) | 934 (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p)) |
921 (setq ispell-pdict-modified-p (car ispell-pdict-modified-p))) | 935 (setq ispell-pdict-modified-p (car ispell-pdict-modified-p))) |
922 (if (or ispell-pdict-modified-p force-save) | 936 (if (or ispell-pdict-modified-p force-save) |
923 (if (or no-query (y-or-n-p "Personal dictionary modified. Save? ")) | 937 (if (or no-query (y-or-n-p "Personal dictionary modified. Save? ")) |
924 (process-send-string ispell-process "#\n"))) | 938 (progn |
939 (process-send-string ispell-process "#\n") | |
940 (message "Personal dictionary saved.")))) | |
925 ;; unassert variable, even if not saved to avoid questioning. | 941 ;; unassert variable, even if not saved to avoid questioning. |
926 (setq ispell-pdict-modified-p nil)) | 942 (setq ispell-pdict-modified-p nil)) |
927 | 943 |
928 | 944 |
929 (defun ispell-command-loop (miss guess word start end) | 945 (defun ispell-command-loop (miss guess word start end) |
991 (if (not (pos-visible-in-window-p end)) | 1007 (if (not (pos-visible-in-window-p end)) |
992 (sit-for 0)) | 1008 (sit-for 0)) |
993 ;; Display choices for misspelled word. | 1009 ;; Display choices for misspelled word. |
994 (let ((choices-window (get-buffer-window ispell-choices-buffer))) | 1010 (let ((choices-window (get-buffer-window ispell-choices-buffer))) |
995 (if choices-window | 1011 (if choices-window |
996 (if (not (equal line (window-height choices-window))) | 1012 (if (= line (window-height choices-window)) |
997 ;; *Choices* window changed size. Adjust the choices window | 1013 (select-window choices-window) |
998 ;; without scrolling the spelled window when possible | 1014 ;; *Choices* window changed size. Adjust the choices window |
999 (let ((window-line (- line (window-height choices-window))) | 1015 ;; without scrolling the spelled window when possible |
1000 (visible (progn (forward-line -1) (point)))) | 1016 (let ((window-line (- line (window-height choices-window))) |
1001 (move-to-window-line 0) | 1017 (visible (progn (forward-line -1) (point)))) |
1002 (forward-line window-line) | 1018 (if (< line ispell-choices-win-default-height) |
1003 (set-window-start (selected-window) | 1019 (setq window-line (+ window-line |
1004 (if (> (point) visible) visible (point))) | 1020 (- ispell-choices-win-default-height |
1005 (goto-char end) | 1021 line)))) |
1006 (select-window (previous-window)) ; *Choices* window | 1022 (move-to-window-line 0) |
1007 (enlarge-window window-line)) | 1023 (forward-line window-line) |
1008 (select-window choices-window)) | 1024 (set-window-start (selected-window) |
1025 (if (> (point) visible) visible (point))) | |
1026 (goto-char end) | |
1027 (select-window (previous-window)) ; *Choices* window | |
1028 (enlarge-window window-line))) | |
1009 ;; Overlay *Choices* window when it isn't showing | 1029 ;; Overlay *Choices* window when it isn't showing |
1010 (ispell-overlay-window (max line ispell-choices-win-default-height))) | 1030 (ispell-overlay-window (max line ispell-choices-win-default-height))) |
1011 (switch-to-buffer ispell-choices-buffer) | 1031 (switch-to-buffer ispell-choices-buffer) |
1012 (goto-char (point-min))) | 1032 (goto-char (point-min))) |
1013 | 1033 |
1120 (insert "(" count ") " (car choices) " ") | 1140 (insert "(" count ") " (car choices) " ") |
1121 (setq choices (cdr choices) | 1141 (setq choices (cdr choices) |
1122 count (1+ count))) | 1142 count (1+ count))) |
1123 (setq count (- count ?0 skipped))) | 1143 (setq count (- count ?0 skipped))) |
1124 (select-window (previous-window)) | 1144 (select-window (previous-window)) |
1125 (if (/= new-line line) | 1145 (if (and (/= new-line line) |
1126 (progn | 1146 (> (max line new-line) |
1147 ispell-choices-win-default-height)) | |
1148 (let* ((minh ispell-choices-win-default-height) | |
1149 (gr-bl (if (< line minh) ; blanks | |
1150 (- minh line) | |
1151 0)) | |
1152 (shr-bl (if (< new-line minh) ; blanks | |
1153 (- minh new-line) | |
1154 0))) | |
1127 (if (> new-line line) | 1155 (if (> new-line line) |
1128 (enlarge-window (- new-line line)) | 1156 (enlarge-window (- new-line line gr-bl)) |
1129 (shrink-window (- line new-line))) | 1157 (shrink-window (- line new-line shr-bl))) |
1130 (setq line new-line))) | 1158 (setq line new-line))) |
1131 (select-window (next-window))))) | 1159 (select-window (next-window))))) |
1132 t) ; reselect from new choices | 1160 t) ; reselect from new choices |
1133 ((= char ?u) | 1161 ((= char ?u) |
1134 (process-send-string ispell-process | 1162 (process-send-string ispell-process |
1441 ;; email to prove it) so I think this is worthwhile. And the -v[ersion] | 1469 ;; email to prove it) so I think this is worthwhile. And the -v[ersion] |
1442 ;; option is the only way I can think of to do this that works with | 1470 ;; option is the only way I can think of to do this that works with |
1443 ;; all versions, since versions earlier than 3.0.09 didn't identify | 1471 ;; all versions, since versions earlier than 3.0.09 didn't identify |
1444 ;; themselves on startup. | 1472 ;; themselves on startup. |
1445 (save-excursion | 1473 (save-excursion |
1446 (set-buffer (get-buffer-create " *ispell-tmp*")) | 1474 (let ((case-fold-search t) |
1447 (erase-buffer) | 1475 ;; avoid bugs when syntax of `.' changes in various default modes |
1448 ;; Avoid obscure bugs caused by users who change the syntax of `.' in | 1476 (default-major-mode 'fundamental-mode) |
1449 ;; whatever default major mode the user uses, e.g. text mode. | 1477 status) |
1450 (fundamental-mode) | 1478 (set-buffer (get-buffer-create " *ispell-tmp*")) |
1451 (let ((status (call-process ispell-program-name nil t nil "-v")) | 1479 (erase-buffer) |
1452 (case-fold-search t)) | 1480 (setq status (call-process ispell-program-name nil t nil "-v")) |
1453 (goto-char (point-min)) | 1481 (goto-char (point-min)) |
1454 (if (not (memq status '(0 nil))) | 1482 (if (not (memq status '(0 nil))) |
1455 (error "%s exited with %s %s" ispell-program-name | 1483 (error "%s exited with %s %s" ispell-program-name |
1456 (if (stringp status) "signal" "code") status)) | 1484 (if (stringp status) "signal" "code") status)) |
1457 (if (not (re-search-forward | 1485 (if (not (re-search-forward |
1546 (setq ispell-process nil) | 1574 (setq ispell-process nil) |
1547 (message "Ispell process killed") | 1575 (message "Ispell process killed") |
1548 nil)) | 1576 nil)) |
1549 | 1577 |
1550 | 1578 |
1579 ;;; ispell-change-dictionary is set in some people's hooks. Maybe it should | |
1580 ;;; call ispell-init-process rather than wait for a spell checking command? | |
1581 | |
1551 ;;;###autoload | 1582 ;;;###autoload |
1552 (defun ispell-change-dictionary (dict &optional arg) | 1583 (defun ispell-change-dictionary (dict &optional arg) |
1553 "Change `ispell-dictionary' (q.v.) and kill old Ispell process. | 1584 "Change `ispell-dictionary' (q.v.) and kill old Ispell process. |
1554 A new one will be started as soon as necessary. | 1585 A new one will be started as soon as necessary. |
1555 | 1586 |
1565 ;; This relies on completing-read's bug of returning "" for no match | 1596 ;; This relies on completing-read's bug of returning "" for no match |
1566 (cond ((equal dict "") | 1597 (cond ((equal dict "") |
1567 (message "Using %s dictionary" | 1598 (message "Using %s dictionary" |
1568 (or ispell-local-dictionary ispell-dictionary "default"))) | 1599 (or ispell-local-dictionary ispell-dictionary "default"))) |
1569 ((and (equal dict ispell-dictionary) | 1600 ((and (equal dict ispell-dictionary) |
1570 (equal dict ispell-local-dictionary)) | 1601 (or (null ispell-local-dictionary) |
1602 (equal dict ispell-local-dictionary))) | |
1571 ;; Specified dictionary is the default already. No-op | 1603 ;; Specified dictionary is the default already. No-op |
1572 (message "No change, using %s dictionary" (or dict "default"))) | 1604 (and (interactive-p) |
1605 (message "No change, using %s dictionary" (or dict "default")))) | |
1573 (t ; reset dictionary! | 1606 (t ; reset dictionary! |
1574 (if (assoc dict ispell-dictionary-alist) | 1607 (if (assoc dict ispell-dictionary-alist) |
1575 (progn | 1608 (progn |
1576 (if (or arg (null dict)) ; set default dictionary | 1609 (if (or arg (null dict)) ; set default dictionary |
1577 (setq ispell-dictionary dict)) | 1610 (setq ispell-dictionary dict)) |
1605 (buffer-name) "region") | 1638 (buffer-name) "region") |
1606 (or ispell-dictionary "default")) | 1639 (or ispell-dictionary "default")) |
1607 ;; Returns cursor to original location. | 1640 ;; Returns cursor to original location. |
1608 (save-window-excursion | 1641 (save-window-excursion |
1609 (goto-char reg-start) | 1642 (goto-char reg-start) |
1610 (let ((transient-mark-mode nil)) | 1643 (let ((transient-mark-mode nil) |
1644 ref-type) | |
1611 (while (and (not ispell-quit) (< (point) reg-end)) | 1645 (while (and (not ispell-quit) (< (point) reg-end)) |
1612 (let ((start (point)) | 1646 (let ((start (point)) |
1613 (offset-change 0) | 1647 (offset-change 0) |
1614 (end (save-excursion (end-of-line) (min (point) reg-end))) | 1648 (end (save-excursion (end-of-line) (min (point) reg-end))) |
1615 (ispell-casechars (ispell-get-casechars)) | 1649 (ispell-casechars (ispell-get-casechars)) |
1640 (setq string | 1674 (setq string |
1641 (concat "^" (buffer-substring start limit) | 1675 (concat "^" (buffer-substring start limit) |
1642 "\n") | 1676 "\n") |
1643 offset-change (- offset-change ispell-offset))) | 1677 offset-change (- offset-change ispell-offset))) |
1644 (goto-char limit)))) | 1678 (goto-char limit)))) |
1645 ((and ispell-skip-tib ; SKIP TIB REFERENCES! | 1679 ((looking-at "[---#@*+!%~^]") ; SKIP SPECIAL ISPELL CHARACTERS |
1646 (re-search-forward ispell-tib-ref-beginning end t)) | 1680 (forward-char 1)) |
1647 (if (= (- (point) 2) start) ; tib ref is 2 chars. | 1681 ((or (and ispell-skip-tib ; SKIP TIB REFERENCES OR SGML MARKUP |
1648 ;; Skip to end of tib ref, not necessarily on this line. | 1682 (re-search-forward ispell-tib-ref-beginning end t) |
1649 ;; Return an error if tib ref not found | 1683 (setq ref-type 'tib)) |
1650 (if (not(re-search-forward ispell-tib-ref-end reg-end t)) | 1684 (and ispell-skip-sgml |
1685 (search-forward "[<&]" end t) | |
1686 (setq ref-type 'sgml))) | |
1687 (if (or (and (eq 'tib ref-type) ; tib tag is 2 chars. | |
1688 (= (- (point) 2) start)) | |
1689 (and (eq 'sgml ref-type) ; sgml skips 1 char. | |
1690 (= (- (point) 1) start))) | |
1691 ;; Skip to end of reference, not necessarily on this line | |
1692 ;; Return an error if tib/sgml reference not found | |
1693 (if (or | |
1694 (and | |
1695 (eq 'tib ref-type) | |
1696 (not | |
1697 (re-search-forward ispell-tib-ref-end reg-end t))) | |
1698 (and (eq 'sgml ref-type) | |
1699 (not (search-forward "[>;]" reg-end t)))) | |
1651 (progn | 1700 (progn |
1652 (ispell-pdict-save ispell-silently-savep) | 1701 (ispell-pdict-save ispell-silently-savep) |
1653 (ding) | 1702 (ding) |
1654 (message | 1703 (message |
1655 (concat | 1704 (concat |
1656 "Open tib reference--set `ispell-skip-tib'" | 1705 "Open tib or SGML command. Fix buffer or set " |
1657 " to nil to avoid this error")) | 1706 (if (eq 'tib ref-type) |
1707 "ispell-skip-tib" | |
1708 "ispell-skip-sgml") | |
1709 " to nil")) | |
1658 ;; keep cursor at error location | 1710 ;; keep cursor at error location |
1659 (setq ispell-quit (- (point) 2)))) | 1711 (setq ispell-quit (- (point) 2)))) |
1660 ;; tib ref starts later on line. Check spelling before tib. | 1712 ;; Check spelling between reference and start of the line. |
1661 (let ((limit (- (point) 2))) | 1713 (let ((limit (- (point) (if (eq 'tib ref-type) 2 1)))) |
1662 (goto-char start) | 1714 (goto-char start) |
1663 (if (or (re-search-forward ispell-casechars limit t) | 1715 (if (or (re-search-forward ispell-casechars limit t) |
1664 (re-search-forward "[][()$]" limit t)) | 1716 (re-search-forward "[][()$]" limit t)) |
1665 (setq string | 1717 (setq string |
1666 (concat "^" (buffer-substring start limit) | 1718 (concat "^" (buffer-substring start limit) |
1667 "\n") | 1719 "\n") |
1668 offset-change (- offset-change ispell-offset))) | 1720 offset-change (- offset-change ispell-offset))) |
1669 (goto-char limit)))) | 1721 (goto-char limit)))) |
1670 ((looking-at "[---#@*+!%~^]") ; SKIP SPECIAL ISPELL CHARACTERS | |
1671 (forward-char 1)) | |
1672 ((or (re-search-forward ispell-casechars end t) ; TEXT EXISTS | 1722 ((or (re-search-forward ispell-casechars end t) ; TEXT EXISTS |
1673 (re-search-forward "[][()$]" end t)) ; or MATH COMMANDS | 1723 (re-search-forward "[][()$]" end t)) ; or MATH COMMANDS |
1674 (setq string (concat "^" (buffer-substring start end) "\n") | 1724 (setq string (concat "^" (buffer-substring start end) "\n") |
1675 offset-change (- offset-change ispell-offset)) | 1725 offset-change (- offset-change ispell-offset)) |
1676 (goto-char end)) | 1726 (goto-char end)) |
2083 (while (< (point) limit) | 2133 (while (< (point) limit) |
2084 ;; Skip across text cited from other messages. | 2134 ;; Skip across text cited from other messages. |
2085 (while (and (looking-at cite-regexp-start) | 2135 (while (and (looking-at cite-regexp-start) |
2086 (< (point) limit) | 2136 (< (point) limit) |
2087 (zerop (forward-line 1)))) | 2137 (zerop (forward-line 1)))) |
2138 | |
2088 (if (< (point) limit) | 2139 (if (< (point) limit) |
2089 ;; Check the next batch of lines that *aren't* cited. | 2140 (let* ((start (point)) |
2090 (let ((end (save-excursion | 2141 ;; Check the next batch of lines that *aren't* cited. |
2091 (if (re-search-forward cite-regexp-end limit 'end) | 2142 (end-c (and (re-search-forward cite-regexp-end limit 'end) |
2092 (match-beginning 0) | 2143 (match-beginning 0))) |
2093 (marker-position limit))))) | 2144 ;; skip a forwarded message |
2094 (ispell-region (point) end) | 2145 (end-fwd (and (goto-char start) |
2095 (goto-char end)))) | 2146 (re-search-forward "---* Forwarded Message" |
2147 limit 'end))) | |
2148 (end (or (and end-c end-fwd (min end-c end-fwd)) | |
2149 end-c end-fwd | |
2150 ;; defalut to limit of text. | |
2151 (marker-position limit)))) | |
2152 (goto-char start) | |
2153 (ispell-region start end) | |
2154 (if (and end-fwd (= end end-fwd)) | |
2155 (progn | |
2156 (goto-char end) | |
2157 (search-forward "--- End of Forwarded Message" limit 'end)) | |
2158 (goto-char end))))) | |
2096 (set-marker limit nil)))) | 2159 (set-marker limit nil)))) |
2097 | 2160 |
2098 | 2161 |
2099 (defun ispell-non-empty-string (string) | 2162 (defun ispell-non-empty-string (string) |
2100 (if (or (not string) (string-equal string "")) | 2163 (if (or (not string) (string-equal string "")) |
2124 (if (or (and (eq ispell-parser 'use-mode-name) | 2187 (if (or (and (eq ispell-parser 'use-mode-name) |
2125 (string-match "[Tt][Ee][Xx]-mode" (symbol-name major-mode))) | 2188 (string-match "[Tt][Ee][Xx]-mode" (symbol-name major-mode))) |
2126 (eq ispell-parser 'tex)) | 2189 (eq ispell-parser 'tex)) |
2127 (process-send-string ispell-process "+\n") ; set ispell mode to tex | 2190 (process-send-string ispell-process "+\n") ; set ispell mode to tex |
2128 (process-send-string ispell-process "-\n")) ; set mode to normal (nroff) | 2191 (process-send-string ispell-process "-\n")) ; set mode to normal (nroff) |
2192 ;; Hard-wire test for SGML mode. | |
2193 (setq ispell-skip-sgml (eq 'sgml-mode major-mode)) | |
2129 ;; Set default extended character mode for given buffer, if any. | 2194 ;; Set default extended character mode for given buffer, if any. |
2130 (let ((extended-char-mode (ispell-get-extended-character-mode))) | 2195 (let ((extended-char-mode (ispell-get-extended-character-mode))) |
2131 (if extended-char-mode | 2196 (if extended-char-mode |
2132 (process-send-string ispell-process (concat extended-char-mode "\n")))) | 2197 (process-send-string ispell-process (concat extended-char-mode "\n")))) |
2133 ;; Set buffer-local parsing mode and extended character mode, if specified. | 2198 ;; Set buffer-local parsing mode and extended character mode, if specified. |
2247 (setq reg-end (+ 1 reg-end (length word)))) | 2312 (setq reg-end (+ 1 reg-end (length word)))) |
2248 (insert (concat " " word))))))) | 2313 (insert (concat " " word))))))) |
2249 reg-end) | 2314 reg-end) |
2250 | 2315 |
2251 | 2316 |
2252 (defconst ispell-version "2.34 -- Thu Dec 8 13:17:41 EST 1994") | 2317 (defconst ispell-version "2.36 -- Mon Feb 6 17:39:38 EST 1995") |
2253 | 2318 |
2254 (provide 'ispell) | 2319 (provide 'ispell) |
2255 | 2320 |
2256 | 2321 |
2257 ;;; LOCAL VARIABLES AND BUFFER-LOCAL VALUE EXAMPLES. | 2322 ;;; LOCAL VARIABLES AND BUFFER-LOCAL VALUE EXAMPLES. |