diff options
| author | Stefan Monnier | 2003-05-13 22:52:37 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-13 22:52:37 +0000 |
| commit | 7d49e53b2dffd9e29bff2dd78825e1d51bc5b697 (patch) | |
| tree | d813f22c405f1be6876f486eb91b1091c9f846f7 | |
| parent | d7b3bcdf00728a0793ce6f701f701fdce80a0710 (diff) | |
| download | emacs-other-branches/VENDOR.tar.gz emacs-other-branches/VENDOR.zip | |
Version 3.6other-branches/VENDOR
| -rw-r--r-- | lisp/textmodes/ispell.el | 203 |
1 files changed, 109 insertions, 94 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index cc22053f80d..6710a6669ab 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Ken Stevens <k.stevens@ieee.org> | 5 | ;; Author: Ken Stevens <k.stevens@ieee.org> |
| 6 | ;; Maintainer: Ken Stevens <k.stevens@ieee.org> | 6 | ;; Maintainer: Ken Stevens <k.stevens@ieee.org> |
| 7 | ;; Stevens Mod Date: Wed Jul 11 18:43:57 PDT 2001 | 7 | ;; Stevens Mod Date: Mon Jan 7 12:32:44 PST 2003 |
| 8 | ;; Stevens Revision: 3.5 | 8 | ;; Stevens Revision: 3.6 |
| 9 | ;; Status : Release with 3.1.12+ and 3.2.0+ ispell. | 9 | ;; Status : Release with 3.1.12+ and 3.2.0+ ispell. |
| 10 | ;; Bug Reports : ispell-el-bugs@itcorp.com | 10 | ;; Bug Reports : ispell-el-bugs@itcorp.com |
| 11 | ;; Web Site : http://kdstevens.com/~stevens/ispell-page.html | 11 | ;; Web Site : http://kdstevens.com/~stevens/ispell-page.html |
| @@ -129,6 +129,15 @@ | |||
| 129 | 129 | ||
| 130 | ;; Modifications made in latest versions: | 130 | ;; Modifications made in latest versions: |
| 131 | 131 | ||
| 132 | ;; Revision 3.6 2003/01/07 12:32:44 kss | ||
| 133 | ;; Removed extra -d LIB in dictionary defs. (Pavel Janik) | ||
| 134 | ;; Filtered process calls with duplicate dictionary entries. | ||
| 135 | ;; Fixed bug where message-text-end is inside a mime skipped region. | ||
| 136 | ;; Minor fixes to get ispell menus right in XEmacs | ||
| 137 | ;; Fixed skip regexp so it doesn't match stuff like `/.\w'. | ||
| 138 | ;; Detecting dictionary change not working. Fixed. kss | ||
| 139 | ;; function `ispell-change-dictionary' now only completes valid dicts. | ||
| 140 | |||
| 132 | ;; Revision 3.5 2001/7/11 18:43:57 kss | 141 | ;; Revision 3.5 2001/7/11 18:43:57 kss |
| 133 | ;; Added fix for aspell to work in XEmacs (check-ispell-version). | 142 | ;; Added fix for aspell to work in XEmacs (check-ispell-version). |
| 134 | ;; Added Portuguese dictionary definition. | 143 | ;; Added Portuguese dictionary definition. |
| @@ -199,11 +208,10 @@ | |||
| 199 | "Empty replacement for defcustom when not supplied." | 208 | "Empty replacement for defcustom when not supplied." |
| 200 | `(defvar ,symbol ,value ,doc)))) | 209 | `(defvar ,symbol ,value ,doc)))) |
| 201 | 210 | ||
| 202 | (eval-when-compile | 211 | (if (fboundp 'defgroup) |
| 203 | (if (fboundp 'defgroup) | 212 | (defgroup ispell nil |
| 204 | (defgroup ispell nil | 213 | "User variables for emacs ispell interface." |
| 205 | "User variables for emacs ispell interface." | 214 | :group 'applications)) |
| 206 | :group 'applications))) | ||
| 207 | 215 | ||
| 208 | (if (not (fboundp 'buffer-substring-no-properties)) | 216 | (if (not (fboundp 'buffer-substring-no-properties)) |
| 209 | (defun buffer-substring-no-properties (start end) | 217 | (defun buffer-substring-no-properties (start end) |
| @@ -304,6 +312,8 @@ Must be greater than 1." | |||
| 304 | ((file-exists-p "/usr/dict/words") "/usr/dict/words") | 312 | ((file-exists-p "/usr/dict/words") "/usr/dict/words") |
| 305 | ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words") | 313 | ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words") |
| 306 | ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words") | 314 | ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words") |
| 315 | ((file-exists-p "/usr/share/lib/dict/words") | ||
| 316 | "/usr/share/lib/dict/words") | ||
| 307 | ((file-exists-p "/sys/dict") "/sys/dict") | 317 | ((file-exists-p "/sys/dict") "/sys/dict") |
| 308 | (t "/usr/dict/words")) | 318 | (t "/usr/dict/words")) |
| 309 | "*Alternate dictionary for spelling help." | 319 | "*Alternate dictionary for spelling help." |
| @@ -481,7 +491,13 @@ This is a local variable. To change the default value use `set-default'." | |||
| 481 | ;;;###autoload | 491 | ;;;###autoload |
| 482 | (defcustom ispell-local-dictionary-alist nil | 492 | (defcustom ispell-local-dictionary-alist nil |
| 483 | "*Contains local or customized dictionary definitions. | 493 | "*Contains local or customized dictionary definitions. |
| 484 | See `ispell-dictionary-alist'." | 494 | |
| 495 | These will override the values in `ispell-dictionary-alist'. | ||
| 496 | |||
| 497 | Customization changes made to `ispell-dictionary-alist' will not operate | ||
| 498 | over emacs sessions. To make permanent changes to your dictionary | ||
| 499 | definitions, you will need to make your changes in this variable, save, | ||
| 500 | and then re-start emacs." | ||
| 485 | :type '(repeat (list (choice :tag "Dictionary" | 501 | :type '(repeat (list (choice :tag "Dictionary" |
| 486 | (string :tag "Dictionary name") | 502 | (string :tag "Dictionary name") |
| 487 | (const :tag "default" nil)) | 503 | (const :tag "default" nil)) |
| @@ -496,7 +512,7 @@ See `ispell-dictionary-alist'." | |||
| 496 | (const "~nroff") (const "~list") | 512 | (const "~nroff") (const "~list") |
| 497 | (const "~latin1") (const "~latin3") | 513 | (const "~latin1") (const "~latin3") |
| 498 | (const :tag "default" nil)) | 514 | (const :tag "default" nil)) |
| 499 | (choice :tag "Character set" | 515 | (choice :tag "Coding system" |
| 500 | (const iso-8859-1) | 516 | (const iso-8859-1) |
| 501 | (const iso-8859-2) | 517 | (const iso-8859-2) |
| 502 | (const koi8-r)))) | 518 | (const koi8-r)))) |
| @@ -516,13 +532,13 @@ See `ispell-dictionary-alist'." | |||
| 516 | ("brasileiro" ; Brazilian mode | 532 | ("brasileiro" ; Brazilian mode |
| 517 | "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]" | 533 | "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]" |
| 518 | "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]" | 534 | "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]" |
| 519 | "[']" nil ("-d" "brasileiro") nil iso-8859-1) | 535 | "[']" nil nil nil iso-8859-1) |
| 520 | ("british" ; British version | 536 | ("british" ; British version |
| 521 | "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "british") nil iso-8859-1) | 537 | "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1) |
| 522 | ("castellano" ; Spanish mode | 538 | ("castellano" ; Spanish mode |
| 523 | "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" | 539 | "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" |
| 524 | "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" | 540 | "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" |
| 525 | "[-]" nil ("-B" "-d" "castellano") "~tex" iso-8859-1) | 541 | "[-]" nil ("-B") "~tex" iso-8859-1) |
| 526 | ("castellano8" ; 8 bit Spanish mode | 542 | ("castellano8" ; 8 bit Spanish mode |
| 527 | "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" | 543 | "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" |
| 528 | "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" | 544 | "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]" |
| @@ -536,7 +552,7 @@ See `ispell-dictionary-alist'." | |||
| 536 | '(("czech" | 552 | '(("czech" |
| 537 | "[A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]" | 553 | "[A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]" |
| 538 | "[^A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]" | 554 | "[^A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]" |
| 539 | "" nil ("-B" "-d" "czech") nil iso-8859-2) | 555 | "" nil ("-B") nil iso-8859-2) |
| 540 | ("dansk" ; Dansk.aff | 556 | ("dansk" ; Dansk.aff |
| 541 | "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" | 557 | "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" |
| 542 | "[']" nil ("-C") nil iso-8859-1) | 558 | "[']" nil ("-C") nil iso-8859-1) |
| @@ -580,7 +596,7 @@ See `ispell-dictionary-alist'." | |||
| 580 | ("italiano" ; Italian.aff | 596 | ("italiano" ; Italian.aff |
| 581 | "[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]" | 597 | "[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]" |
| 582 | "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]" | 598 | "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]" |
| 583 | "[-]" nil ("-B" "-d" "italian") "~tex" iso-8859-1) | 599 | "[-]" nil ("-B") "~tex" iso-8859-1) |
| 584 | ("nederlands" ; Nederlands.aff | 600 | ("nederlands" ; Nederlands.aff |
| 585 | "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" | 601 | "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" |
| 586 | "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" | 602 | "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" |
| @@ -598,34 +614,34 @@ See `ispell-dictionary-alist'." | |||
| 598 | '(("norsk" ; 8 bit Norwegian mode | 614 | '(("norsk" ; 8 bit Norwegian mode |
| 599 | "[A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]" | 615 | "[A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]" |
| 600 | "[^A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]" | 616 | "[^A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]" |
| 601 | "[\"]" nil ("-d" "norsk") "~list" iso-8859-1) | 617 | "[\"]" nil nil "~list" iso-8859-1) |
| 602 | ("norsk7-tex" ; 7 bit Norwegian TeX mode | 618 | ("norsk7-tex" ; 7 bit Norwegian TeX mode |
| 603 | "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]" | 619 | "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]" |
| 604 | "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1) | 620 | "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1) |
| 605 | ("polish" ; Polish mode | 621 | ("polish" ; Polish mode |
| 606 | "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]" | 622 | "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]" |
| 607 | "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]" | 623 | "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]" |
| 608 | "" nil ( "-d" "polish") nil iso-8859-2) | 624 | "" nil nil nil iso-8859-2) |
| 609 | ("portugues" ; Portuguese mode | 625 | ("portugues" ; Portuguese mode |
| 610 | "[a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]" | 626 | "[a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]" |
| 611 | "[^a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]" | 627 | "[^a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]" |
| 612 | "[']" t ("-C" "-d" "portugues") "~latin1" iso-8859-1))) | 628 | "[']" t ("-C") "~latin1" iso-8859-1))) |
| 613 | 629 | ||
| 614 | 630 | ||
| 615 | ;;; Sixth part of dictionary, shortened for loaddefs.el | 631 | ;;; Sixth part of dictionary, shortened for loaddefs.el |
| 616 | ;;;###autoload | 632 | ;;;###autoload |
| 617 | (setq | 633 | (setq |
| 618 | ispell-dictionary-alist-6 | 634 | ispell-dictionary-alist-6 |
| 619 | ;; include Russian iso character set too? | 635 | ;; include Russian iso coding system too? |
| 620 | ;; "[']" t ("-d" "russian") "~latin1" iso-8859-1 | 636 | ;; "[']" t ("-d" "russian") "~latin1" iso-8859-1 |
| 621 | '(("russian" ; Russian.aff (KOI8-R charset) | 637 | '(("russian" ; Russian.aff (KOI8-R charset) |
| 622 | "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]" | 638 | "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]" |
| 623 | "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]" | 639 | "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]" |
| 624 | "" nil ("-d" "russian") nil koi8-r) | 640 | "" nil nil nil koi8-r) |
| 625 | ("slovak" ; Slovakian | 641 | ("slovak" ; Slovakian |
| 626 | "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" | 642 | "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" |
| 627 | "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" | 643 | "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" |
| 628 | "" nil ("-B" "-d" "slovak") nil iso-8859-2) | 644 | "" nil ("-B") nil iso-8859-2) |
| 629 | ("svenska" ; Swedish mode | 645 | ("svenska" ; Swedish mode |
| 630 | "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" | 646 | "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" |
| 631 | "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" | 647 | "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" |
| @@ -698,7 +714,7 @@ LANGUAGE.aff file \(e.g., english.aff\)." | |||
| 698 | (const "~nroff") (const "~list") | 714 | (const "~nroff") (const "~list") |
| 699 | (const "~latin1") (const "~latin3") | 715 | (const "~latin1") (const "~latin3") |
| 700 | (const :tag "default" nil)) | 716 | (const :tag "default" nil)) |
| 701 | (choice :tag "Character set" | 717 | (choice :tag "Coding System" |
| 702 | (const iso-8859-1) | 718 | (const iso-8859-1) |
| 703 | (const iso-8859-2) | 719 | (const iso-8859-2) |
| 704 | (const koi8-r)))) | 720 | (const koi8-r)))) |
| @@ -727,7 +743,7 @@ LANGUAGE.aff file \(e.g., english.aff\)." | |||
| 727 | (defvar ispell-offset -1 | 743 | (defvar ispell-offset -1 |
| 728 | "Offset that maps protocol differences between ispell 3.1 versions.") | 744 | "Offset that maps protocol differences between ispell 3.1 versions.") |
| 729 | 745 | ||
| 730 | (defconst ispell-version "ispell.el 3.5 - 07/11/01") | 746 | (defconst ispell-version "ispell.el 3.6 - 01/07/2003") |
| 731 | 747 | ||
| 732 | 748 | ||
| 733 | ;;;###autoload | 749 | ;;;###autoload |
| @@ -847,36 +863,53 @@ and added as a submenu of the \"Edit\" menu.") | |||
| 847 | "Non-nil means that the OS supports asynchronous processes.") | 863 | "Non-nil means that the OS supports asynchronous processes.") |
| 848 | 864 | ||
| 849 | ;;;###autoload | 865 | ;;;###autoload |
| 866 | (defun valid-dictionary-list () | ||
| 867 | "Returns a list of valid dictionaries. | ||
| 868 | The variable `ispell-library-path' defines the library location." | ||
| 869 | (let ((dicts ispell-dictionary-alist) | ||
| 870 | ;; `ispell-library-path' intentionally not defined in autoload | ||
| 871 | (path (and (boundp 'ispell-library-path) ispell-library-path)) | ||
| 872 | (dict-list (cons "default" nil)) | ||
| 873 | name load-dict) | ||
| 874 | (while dicts | ||
| 875 | (setq name (car (car dicts)) | ||
| 876 | load-dict (car (cdr (member "-d" (nth 5 (car dicts))))) | ||
| 877 | dicts (cdr dicts)) | ||
| 878 | ;; Include if the dictionary is in the library, or path not defined. | ||
| 879 | (if (and (stringp name) | ||
| 880 | (or (not path) | ||
| 881 | (file-exists-p (concat path "/" name ".hash")) | ||
| 882 | (file-exists-p (concat path "/" name ".has")) | ||
| 883 | (and load-dict | ||
| 884 | (or (file-exists-p (concat path "/" | ||
| 885 | load-dict ".hash")) | ||
| 886 | (file-exists-p (concat path "/" | ||
| 887 | load-dict ".has")))))) | ||
| 888 | (setq dict-list (cons name dict-list)))) | ||
| 889 | dict-list)) | ||
| 890 | |||
| 891 | |||
| 892 | |||
| 893 | ;;;###autoload | ||
| 850 | (if (and ispell-menu-map-needed | 894 | (if (and ispell-menu-map-needed |
| 851 | (or (not (fboundp 'byte-compiling-files-p)) | 895 | (or (not (fboundp 'byte-compiling-files-p)) |
| 852 | (not (byte-compiling-files-p)))) | 896 | (not (byte-compiling-files-p)))) |
| 853 | (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist))) | 897 | (let ((dicts (valid-dictionary-list))) |
| 854 | ;; `ispell-library-path' intentionally not defined in autoload | ||
| 855 | (path (and (boundp 'ispell-library-path) ispell-library-path)) | ||
| 856 | name load-dict) | ||
| 857 | (setq ispell-menu-map (make-sparse-keymap "Spell")) | 898 | (setq ispell-menu-map (make-sparse-keymap "Spell")) |
| 858 | ;; add the dictionaries to the bottom of the list. | 899 | ;; add the dictionaries to the bottom of the list. |
| 859 | (while dicts | 900 | (while dicts |
| 860 | (setq name (car (car dicts)) | 901 | (if (string-equal "default" (car dicts)) |
| 861 | load-dict (car (cdr (member "-d" (nth 5 (car dicts))))) | 902 | (define-key ispell-menu-map (vector 'default) |
| 862 | dicts (cdr dicts)) | 903 | (cons "Select Default Dict" |
| 863 | (cond ((not (stringp name)) | 904 | (cons "Dictionary for which Ispell was configured" |
| 864 | (define-key ispell-menu-map (vector 'default) | 905 | (list 'lambda () '(interactive) |
| 865 | (cons "Select Default Dict" | 906 | (list |
| 866 | (cons "Dictionary for which Ispell was configured" | 907 | 'ispell-change-dictionary "default"))))) |
| 867 | (list 'lambda () '(interactive) | 908 | (define-key ispell-menu-map (vector (intern (car dicts))) |
| 868 | (list | 909 | (cons (concat "Select " (capitalize (car dicts)) " Dict") |
| 869 | 'ispell-change-dictionary "default")))))) | 910 | (list 'lambda () '(interactive) |
| 870 | ((or (not path) ; load all if library dir not defined | 911 | (list 'ispell-change-dictionary (car dicts)))))) |
| 871 | (file-exists-p (concat path "/" name ".hash")) | 912 | (setq dicts (cdr dicts))))) |
| 872 | (file-exists-p (concat path "/" name ".has")) | ||
| 873 | (and load-dict | ||
| 874 | (or (file-exists-p(concat path "/" load-dict ".hash")) | ||
| 875 | (file-exists-p(concat path "/" load-dict ".has"))))) | ||
| 876 | (define-key ispell-menu-map (vector (intern name)) | ||
| 877 | (cons (concat "Select " (capitalize name) " Dict") | ||
| 878 | (list 'lambda () '(interactive) | ||
| 879 | (list 'ispell-change-dictionary name))))))))) | ||
| 880 | 913 | ||
| 881 | 914 | ||
| 882 | ;;; define commands in menu in opposite order you want them to appear. | 915 | ;;; define commands in menu in opposite order you want them to appear. |
| @@ -950,9 +983,9 @@ and added as a submenu of the \"Edit\" menu.") | |||
| 950 | (if (and xemacsp | 983 | (if (and xemacsp |
| 951 | (not version18p) | 984 | (not version18p) |
| 952 | (featurep 'menubar) | 985 | (featurep 'menubar) |
| 953 | (null ispell-menu-xemacs) | 986 | ;;(null ispell-menu-xemacs) |
| 954 | (not (and (boundp 'infodock-version) infodock-version))) | 987 | (not (and (boundp 'infodock-version) infodock-version))) |
| 955 | (let ((dicts (cons (cons "default" nil) ispell-dictionary-alist)) | 988 | (let ((dicts (valid-dictionary-list)) |
| 956 | (current-menubar (or current-menubar default-menubar)) | 989 | (current-menubar (or current-menubar default-menubar)) |
| 957 | (menu | 990 | (menu |
| 958 | '(["Help" (describe-function 'ispell-help) t] | 991 | '(["Help" (describe-function 'ispell-help) t] |
| @@ -969,29 +1002,15 @@ and added as a submenu of the \"Edit\" menu.") | |||
| 969 | "-" | 1002 | "-" |
| 970 | ["Save Personal Dict"(ispell-pdict-save t t) t] | 1003 | ["Save Personal Dict"(ispell-pdict-save t t) t] |
| 971 | ["Change Dictionary" ispell-change-dictionary t] | 1004 | ["Change Dictionary" ispell-change-dictionary t] |
| 972 | ["Select Default" (ispell-change-dictionary "default") t])) | 1005 | ["Select Default" (ispell-change-dictionary "default") t]))) |
| 973 | name load-dict) | ||
| 974 | (while dicts | 1006 | (while dicts |
| 975 | (setq name (car (car dicts)) | 1007 | (setq menu (append menu |
| 976 | load-dict (car (cdr (member "-d" (nth 5 (car dicts))))) | 1008 | (list |
| 977 | dicts (cdr dicts)) | 1009 | (vector |
| 978 | ;; Include if the dictionary is in the library, or path not defined. | 1010 | (concat "Select " (capitalize (car dicts))) |
| 979 | (if (and (stringp name) | 1011 | (list 'ispell-change-dictionary (car dicts)) |
| 980 | (or (not ispell-library-path) | 1012 | t))) |
| 981 | (file-exists-p (concat ispell-library-path "/" | 1013 | dicts (cdr dicts))) |
| 982 | name ".hash")) | ||
| 983 | (file-exists-p (concat ispell-library-path "/" | ||
| 984 | name ".has")) | ||
| 985 | (and load-dict | ||
| 986 | (or (file-exists-p (concat ispell-library-path "/" | ||
| 987 | load-dict ".hash")) | ||
| 988 | (file-exists-p (concat ispell-library-path "/" | ||
| 989 | load-dict ".has")))))) | ||
| 990 | (setq menu (append menu | ||
| 991 | (list | ||
| 992 | (vector (concat "Select " (capitalize name)) | ||
| 993 | (list 'ispell-change-dictionary name) | ||
| 994 | t)))))) | ||
| 995 | (setq ispell-menu-xemacs menu) | 1014 | (setq ispell-menu-xemacs menu) |
| 996 | (if current-menubar | 1015 | (if current-menubar |
| 997 | (progn | 1016 | (progn |
| @@ -1136,7 +1155,9 @@ The last occurring definition in the buffer will be used.") | |||
| 1136 | . "^---* End of [Ff]orwarded [Mm]essage") | 1155 | . "^---* End of [Ff]orwarded [Mm]essage") |
| 1137 | ;; Matches e-mail addresses, file names, http addresses, etc. The `-+' | 1156 | ;; Matches e-mail addresses, file names, http addresses, etc. The `-+' |
| 1138 | ;; pattern necessary for performance reasons when `-' part of word syntax. | 1157 | ;; pattern necessary for performance reasons when `-' part of word syntax. |
| 1139 | ("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)") | 1158 | ("\\(--+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)") |
| 1159 | ;; above checks /.\w sequences | ||
| 1160 | ;;("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)") | ||
| 1140 | ;; This is a pretty complex regexp. It can be simplified to the following: | 1161 | ;; This is a pretty complex regexp. It can be simplified to the following: |
| 1141 | ;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+" | 1162 | ;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+" |
| 1142 | ;; but some valid text will be skipped, e.g. "his/her". This could be | 1163 | ;; but some valid text will be skipped, e.g. "his/her". This could be |
| @@ -1232,19 +1253,9 @@ You can set this variable in hooks in your init file -- eg: | |||
| 1232 | (defvar ispell-check-only nil | 1253 | (defvar ispell-check-only nil |
| 1233 | "If non-nil, `ispell-word' does not try to correct the word.") | 1254 | "If non-nil, `ispell-word' does not try to correct the word.") |
| 1234 | 1255 | ||
| 1235 | (defconst ispell-graphic-p | 1256 | (defun ispell-mode-line-window-height-fudge () |
| 1236 | (if (fboundp 'display-graphic-p) | 1257 | "Return 1 if using a wide mode-line that covers text, otherwise 0." |
| 1237 | (display-graphic-p) | 1258 | (if (and xemacsp window-system) 1 0)) |
| 1238 | xemacsp) | ||
| 1239 | "True if running on a `graphics capable' display. | ||
| 1240 | These displays have thicker mode lines that can partially cover text.") | ||
| 1241 | |||
| 1242 | (if (fboundp 'mode-line-window-height-fudge) | ||
| 1243 | (defalias 'ispell-mode-line-window-height-fudge | ||
| 1244 | 'mode-line-window-height-fudge) | ||
| 1245 | (defun ispell-mode-line-window-height-fudge () | ||
| 1246 | "Return 1 if running on a `graphics capable' display, otherwise 0." | ||
| 1247 | (if ispell-graphic-p 1 0))) | ||
| 1248 | 1259 | ||
| 1249 | 1260 | ||
| 1250 | ;;; ********************************************************************** | 1261 | ;;; ********************************************************************** |
| @@ -1910,8 +1921,8 @@ SPC: Accept word this time. | |||
| 1910 | ;;This shouldn't be necessary: with-electric-help needs | 1921 | ;;This shouldn't be necessary: with-electric-help needs |
| 1911 | ;; an optional argument telling it about the smallest | 1922 | ;; an optional argument telling it about the smallest |
| 1912 | ;; acceptable window-height of the help buffer. | 1923 | ;; acceptable window-height of the help buffer. |
| 1913 | (if (< (window-height) 15) | 1924 | ;(if (< (window-height) 15) |
| 1914 | (enlarge-window (- 15 (window-height)))) | 1925 | ; (enlarge-window (- 15 (window-height)))) |
| 1915 | (princ "Selections are: | 1926 | (princ "Selections are: |
| 1916 | 1927 | ||
| 1917 | DIGIT: Replace the word with a digit offered in the *Choices* buffer. | 1928 | DIGIT: Replace the word with a digit offered in the *Choices* buffer. |
| @@ -2227,7 +2238,8 @@ Keeps argument list for future ispell invocations for no async support." | |||
| 2227 | (if ispell-local-dictionary | 2238 | (if ispell-local-dictionary |
| 2228 | (setq ispell-dictionary ispell-local-dictionary)) | 2239 | (setq ispell-dictionary ispell-local-dictionary)) |
| 2229 | (setq args (ispell-get-ispell-args)) | 2240 | (setq args (ispell-get-ispell-args)) |
| 2230 | (if ispell-dictionary ; use specified dictionary | 2241 | (if (and ispell-dictionary ; use specified dictionary |
| 2242 | (not (member "-d" args))) ; only define if not overriden | ||
| 2231 | (setq args | 2243 | (setq args |
| 2232 | (append (list "-d" ispell-dictionary) args))) | 2244 | (append (list "-d" ispell-dictionary) args))) |
| 2233 | (if ispell-personal-dictionary ; use specified pers dict | 2245 | (if ispell-personal-dictionary ; use specified pers dict |
| @@ -2359,7 +2371,9 @@ With prefix argument, set the default dictionary." | |||
| 2359 | (interactive | 2371 | (interactive |
| 2360 | (list (completing-read | 2372 | (list (completing-read |
| 2361 | "Use new dictionary (RET for current, SPC to complete): " | 2373 | "Use new dictionary (RET for current, SPC to complete): " |
| 2362 | (cons (cons "default" nil) ispell-dictionary-alist) nil t) | 2374 | (mapcar (function (lambda (dict) (setf dict (cons dict nil)))) |
| 2375 | (valid-dictionary-list)) | ||
| 2376 | nil t) | ||
| 2363 | current-prefix-arg)) | 2377 | current-prefix-arg)) |
| 2364 | (if (equal dict "default") (setq dict nil)) | 2378 | (if (equal dict "default") (setq dict nil)) |
| 2365 | ;; This relies on completing-read's bug of returning "" for no match | 2379 | ;; This relies on completing-read's bug of returning "" for no match |
| @@ -2620,7 +2634,7 @@ Must call after `ispell-buffer-local-parsing' due to dependence on mode." | |||
| 2620 | (defun ispell-ignore-fcc (start end) | 2634 | (defun ispell-ignore-fcc (start end) |
| 2621 | "Deletes the Fcc: message header when large attachments are included. | 2635 | "Deletes the Fcc: message header when large attachments are included. |
| 2622 | Return value `nil' if file with large attachments are saved. | 2636 | Return value `nil' if file with large attachments are saved. |
| 2623 | This can be used to avoid multiple quesitons for multiple large attachments. | 2637 | This can be used to avoid multiple questions for multiple large attachments. |
| 2624 | Returns point to starting location afterwards." | 2638 | Returns point to starting location afterwards." |
| 2625 | (let ((result t)) | 2639 | (let ((result t)) |
| 2626 | (if (and ispell-checking-message ispell-message-fcc-skip) | 2640 | (if (and ispell-checking-message ispell-message-fcc-skip) |
| @@ -2766,7 +2780,7 @@ Returns the sum shift due to changes in word replacements." | |||
| 2766 | ;; `query-replace' makes multiple corrections on the starting line. | 2780 | ;; `query-replace' makes multiple corrections on the starting line. |
| 2767 | (if (/= (+ word-len (point)) | 2781 | (if (/= (+ word-len (point)) |
| 2768 | (progn | 2782 | (progn |
| 2769 | ;; NB: Search can fail with Mule character sets that don't | 2783 | ;; NB: Search can fail with Mule coding systems that don't |
| 2770 | ;; display properly. Ignore the error in this case? | 2784 | ;; display properly. Ignore the error in this case? |
| 2771 | (search-forward (car poss) (+ word-len (point)) t) | 2785 | (search-forward (car poss) (+ word-len (point)) t) |
| 2772 | (point))) | 2786 | (point))) |
| @@ -3079,7 +3093,6 @@ Don't read buffer-local settings or word lists." | |||
| 3079 | ;;; Ispell Message | 3093 | ;;; Ispell Message |
| 3080 | ;;; ********************************************************************** | 3094 | ;;; ********************************************************************** |
| 3081 | 3095 | ||
| 3082 | |||
| 3083 | (defvar ispell-message-text-end | 3096 | (defvar ispell-message-text-end |
| 3084 | (mapconcat (function identity) | 3097 | (mapconcat (function identity) |
| 3085 | '( | 3098 | '( |
| @@ -3325,7 +3338,10 @@ You can bind this to the key C-c i in GNUS or mail by adding to | |||
| 3325 | (goto-char (point-min)) | 3338 | (goto-char (point-min)) |
| 3326 | (re-search-forward "Content-[^ \t]*:" end-of-headers t) | 3339 | (re-search-forward "Content-[^ \t]*:" end-of-headers t) |
| 3327 | (forward-line -1) ; following fn starts one line above | 3340 | (forward-line -1) ; following fn starts one line above |
| 3328 | (ispell-mime-skip-part nil))) | 3341 | (ispell-mime-skip-part nil) |
| 3342 | ;; if message-text-end region, limit may be less than point. | ||
| 3343 | (if (> (point) limit) | ||
| 3344 | (set-marker limit (point))))) | ||
| 3329 | (goto-char (max end-of-headers (point))) | 3345 | (goto-char (max end-of-headers (point))) |
| 3330 | (forward-line 1) | 3346 | (forward-line 1) |
| 3331 | (setq case-fold-search old-case-fold-search) | 3347 | (setq case-fold-search old-case-fold-search) |
| @@ -3447,8 +3463,7 @@ Both should not be used to define a buffer-local dictionary." | |||
| 3447 | (ispell-kill-ispell t) | 3463 | (ispell-kill-ispell t) |
| 3448 | (setq ispell-personal-dictionary ispell-local-pdict))) | 3464 | (setq ispell-personal-dictionary ispell-local-pdict))) |
| 3449 | ;; Reload if new dictionary defined. | 3465 | ;; Reload if new dictionary defined. |
| 3450 | (if (and ispell-local-dictionary | 3466 | (if (not (equal ispell-local-dictionary ispell-dictionary)) |
| 3451 | (not (equal ispell-local-dictionary ispell-dictionary))) | ||
| 3452 | (ispell-change-dictionary ispell-local-dictionary))) | 3467 | (ispell-change-dictionary ispell-local-dictionary))) |
| 3453 | 3468 | ||
| 3454 | 3469 | ||