Mercurial > emacs
comparison lisp/textmodes/=ispell4.el @ 21088:ac1673121774
Customized.
author | Stephen Eglen <stephen@gnu.org> |
---|---|
date | Sat, 07 Mar 1998 18:19:38 +0000 |
parents | f5f5fa38faa7 |
children | 0308bce52ae4 |
comparison
equal
deleted
inserted
replaced
21087:c297faa167f5 | 21088:ac1673121774 |
---|---|
26 ;; This package provides a graceful interface to ispell, the GNU | 26 ;; This package provides a graceful interface to ispell, the GNU |
27 ;; spelling checker. | 27 ;; spelling checker. |
28 | 28 |
29 ;;; Code: | 29 ;;; Code: |
30 | 30 |
31 (defvar ispell-have-new-look t | 31 (defgroup ispell4 nil |
32 "Non-nil means use the `-r' option when running `look'.") | 32 "Interface to GNU ISPELL version 4." |
33 :prefix "ispell-" | |
34 :group 'applications) | |
35 | |
36 (defcustom ispell-have-new-look t | |
37 "Non-nil means use the `-r' option when running `look'." | |
38 :type 'boolean | |
39 :group 'ispell4) | |
33 | 40 |
34 (defvar ispell-enable-tex-parser nil | 41 (defvar ispell-enable-tex-parser nil |
35 "Non-nil enables experimental TeX parser in Ispell for TeX-mode buffers.") | 42 "Non-nil enables experimental TeX parser in Ispell for TeX-mode buffers.") |
36 | 43 |
37 (defvar ispell-process nil "The process running Ispell") | 44 (defvar ispell-process nil "The process running Ispell") |
38 (defvar ispell-next-message nil | 45 (defvar ispell-next-message nil |
39 "An integer: where in `*ispell*' buffer to find next message from Ispell.") | 46 "An integer: where in `*ispell*' buffer to find next message from Ispell.") |
40 | 47 |
41 (defvar ispell-command "ispell" | 48 (defcustom ispell-command "ispell" |
42 "Command for running Ispell.") | 49 "Command for running Ispell." |
43 (defvar ispell-command-options nil | 50 :type 'string |
51 :group 'ispell4) | |
52 | |
53 (defcustom ispell-command-options nil | |
44 "*String (or list of strings) to pass to Ispell as command arguments. | 54 "*String (or list of strings) to pass to Ispell as command arguments. |
45 You can specify your private dictionary via the -p <filename> option. | 55 You can specify your private dictionary via the -p <filename> option. |
46 The -S option is always passed to Ispell as the last parameter, | 56 The -S option is always passed to Ispell as the last parameter, |
47 and need not be mentioned here.") | 57 and need not be mentioned here." |
48 | 58 :type '(repeat string) |
49 (defvar ispell-look-command "look" | 59 :group 'ispell4) |
50 "*Command for running look.") | 60 |
61 (defcustom ispell-look-command "look" | |
62 "*Command for running look." | |
63 :type 'string | |
64 :group 'ispell4) | |
51 | 65 |
52 ;Each marker in this list points to the start of a word that | 66 ;Each marker in this list points to the start of a word that |
53 ;ispell thought was bad last time it did the :file command. | 67 ;ispell thought was bad last time it did the :file command. |
54 ;Notice that if the user accepts or inserts a word into his | 68 ;Notice that if the user accepts or inserts a word into his |
55 ;private dictionary, then some "good" words will be on the list. | 69 ;private dictionary, then some "good" words will be on the list. |
627 (Info-validate) | 641 (Info-validate) |
628 (if (get-buffer " *problems in info file*") | 642 (if (get-buffer " *problems in info file*") |
629 (kill-emacs 1)) | 643 (kill-emacs 1)) |
630 (write-region (point-min) (point-max) "ispell.info")) | 644 (write-region (point-min) (point-max) "ispell.info")) |
631 | 645 |
632 (defvar ispell-highlight t | 646 (defcustom ispell-highlight t |
633 "*Non-nil means to highlight ispell words.") | 647 "*Non-nil means to highlight ispell words." |
648 :type 'boolean | |
649 :group 'ispell4) | |
634 | 650 |
635 (defvar ispell-overlay nil) | 651 (defvar ispell-overlay nil) |
636 | 652 |
637 (defun ispell-dehighlight () | 653 (defun ispell-dehighlight () |
638 (and ispell-overlay | 654 (and ispell-overlay |
754 ;;; * Robust searches are done using a `look' with -r (regular expression) | 770 ;;; * Robust searches are done using a `look' with -r (regular expression) |
755 ;;; switch if ispell-have-new-look is t. | 771 ;;; switch if ispell-have-new-look is t. |
756 | 772 |
757 ;;;; User-defined variables. | 773 ;;;; User-defined variables. |
758 | 774 |
759 (defvar ispell-look-dictionary nil | 775 (defcustom ispell-look-dictionary nil |
760 "*If non-nil then spelling dictionary as string for `ispell-complete-word'. | 776 "*If non-nil then spelling dictionary as string for `ispell-complete-word'. |
761 Overrides default dictionary file such as \"/usr/dict/words\" or GNU look's | 777 Overrides default dictionary file such as \"/usr/dict/words\" or GNU look's |
762 \"${prefix}/lib/ispell/ispell.words\"") | 778 \"${prefix}/lib/ispell/ispell.words\"" |
763 | 779 :type '(choice (const nil) file) |
764 (defvar ispell-gnu-look-still-broken-p nil | 780 :group 'ispell4) |
781 | |
782 | |
783 (defcustom ispell-gnu-look-still-broken-p nil | |
765 "*t if GNU look -r can give different results with and without trailing `.*'. | 784 "*t if GNU look -r can give different results with and without trailing `.*'. |
766 Example: `look -dfr \"^ya\" foo' returns nothing, while `look -dfr \"^ya.*\" foo' | 785 Example: `look -dfr \"^ya\" foo' returns nothing, while `look -dfr \"^ya.*\" foo' |
767 returns `yacc', where `foo' is a dictionary file containing the three lines | 786 returns `yacc', where `foo' is a dictionary file containing the three lines |
768 | 787 |
769 y | 788 y |
770 y's | 789 y's |
771 yacc | 790 yacc |
772 | 791 |
773 Both commands should return `yacc'. If `ispell-complete-word' erroneously | 792 Both commands should return `yacc'. If `ispell-complete-word' erroneously |
774 states that no completions exist for a string, then setting this variable to t | 793 states that no completions exist for a string, then setting this variable to t |
775 will help find those completions.") | 794 will help find those completions." |
795 :type 'boolean | |
796 :group 'ispell4) | |
776 | 797 |
777 ;;;; Internal variables. | 798 ;;;; Internal variables. |
778 | 799 |
779 ;;; Possible completions for last word fragment. | 800 ;;; Possible completions for last word fragment. |
780 (defvar ispell-lookup-completions-alist nil) | 801 (defvar ispell-lookup-completions-alist nil) |
957 (defun ispell-non-empty-string (string) | 978 (defun ispell-non-empty-string (string) |
958 (if (or (not string) (string-equal string "")) | 979 (if (or (not string) (string-equal string "")) |
959 "\\'\\`" ; An unmatchable string if string is null. | 980 "\\'\\`" ; An unmatchable string if string is null. |
960 (regexp-quote string))) | 981 (regexp-quote string))) |
961 | 982 |
962 (defvar ispell-message-cite-regexp "^ \\|^\t" | 983 (defcustom ispell-message-cite-regexp "^ \\|^\t" |
963 "*Regular expression to match lines cited from one message into another.") | 984 "*Regular expression to match lines cited from one message into another." |
964 | 985 :type 'regexp |
965 (defvar ispell-message-text-end | 986 :group 'ispell4) |
987 | |
988 (defcustom ispell-message-text-end | |
966 (concat "^\\(" (mapconcat (function identity) | 989 (concat "^\\(" (mapconcat (function identity) |
967 '( | 990 '( |
968 ;; Matches postscript files. | 991 ;; Matches postscript files. |
969 "%!PS-Adobe-2.0" | 992 "%!PS-Adobe-2.0" |
970 ;; Matches uuencoded text | 993 ;; Matches uuencoded text |
977 "[-=]+\\s cut here") | 1000 "[-=]+\\s cut here") |
978 "\\|") | 1001 "\\|") |
979 "\\)") | 1002 "\\)") |
980 "*End of text which will be checked in ispell-message. | 1003 "*End of text which will be checked in ispell-message. |
981 If it is a string, limit at first occurrence of that regular expression. | 1004 If it is a string, limit at first occurrence of that regular expression. |
982 Otherwise, it must be a function which is called to get the limit.") | 1005 Otherwise, it must be a function which is called to get the limit." |
983 | 1006 :type '(choice string function) |
984 (defvar ispell-message-limit (* 100 80) | 1007 :group 'ispell4) |
985 "*Ispell-message will check no more than this number of characters.") | 1008 |
1009 (defcustom ispell-message-limit (* 100 80) | |
1010 "*Ispell-message will check no more than this number of characters." | |
1011 :type 'integer | |
1012 :group 'ispell4) | |
986 | 1013 |
987 ;;;autoload | 1014 ;;;autoload |
988 (defun ispell-message () | 1015 (defun ispell-message () |
989 "Check the spelling of a mail message or news post. | 1016 "Check the spelling of a mail message or news post. |
990 Don't check spelling of message headers (except subject) or included messages. | 1017 Don't check spelling of message headers (except subject) or included messages. |
1086 (save-excursion | 1113 (save-excursion |
1087 (setq continue (ispell-region (- start 1) (point)))))))))))) | 1114 (setq continue (ispell-region (- start 1) (point)))))))))))) |
1088 | 1115 |
1089 (provide 'ispell) | 1116 (provide 'ispell) |
1090 | 1117 |
1091 ;;; ispell.el ends here | 1118 ;;; ispell4.el ends here |