/[emacs]/emacs/lisp/textmodes/ispell.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/ispell.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.137.4.3 by monnier, Tue May 13 22:52:20 2003 UTC revision 1.137.4.4 by monnier, Tue May 13 22:52:37 2003 UTC
# Line 4  Line 4 
4    
5  ;; Author:           Ken Stevens <k.stevens@ieee.org>  ;; Author:           Ken Stevens <k.stevens@ieee.org>
6  ;; Maintainer:       Ken Stevens <k.stevens@ieee.org>  ;; Maintainer:       Ken Stevens <k.stevens@ieee.org>
7  ;; Stevens Mod Date: Wed Jul 11 18:43:57 PDT 2001  ;; Stevens Mod Date: Mon Jan  7 12:32:44 PST 2003
8  ;; Stevens Revision: 3.5  ;; Stevens Revision: 3.6
9  ;; Status          : Release with 3.1.12+ and 3.2.0+ ispell.  ;; Status          : Release with 3.1.12+ and 3.2.0+ ispell.
10  ;; Bug Reports     : ispell-el-bugs@itcorp.com  ;; Bug Reports     : ispell-el-bugs@itcorp.com
11  ;; Web Site        : http://kdstevens.com/~stevens/ispell-page.html  ;; Web Site        : http://kdstevens.com/~stevens/ispell-page.html
# Line 129  Line 129 
129    
130  ;; Modifications made in latest versions:  ;; Modifications made in latest versions:
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    
141  ;; Revision 3.5 2001/7/11 18:43:57      kss  ;; Revision 3.5 2001/7/11 18:43:57      kss
142  ;; Added fix for aspell to work in XEmacs (check-ispell-version).  ;; Added fix for aspell to work in XEmacs (check-ispell-version).
143  ;; Added Portuguese dictionary definition.  ;; Added Portuguese dictionary definition.
# Line 199  Line 208 
208          "Empty replacement for defcustom when not supplied."          "Empty replacement for defcustom when not supplied."
209          `(defvar ,symbol ,value ,doc))))          `(defvar ,symbol ,value ,doc))))
210    
211  (eval-when-compile  (if (fboundp 'defgroup)
212    (if (fboundp 'defgroup)      (defgroup ispell nil
213        (defgroup ispell nil        "User variables for emacs ispell interface."
214          "User variables for emacs ispell interface."        :group 'applications))
         :group 'applications)))  
215    
216  (if (not (fboundp 'buffer-substring-no-properties))  (if (not (fboundp 'buffer-substring-no-properties))
217      (defun buffer-substring-no-properties (start end)      (defun buffer-substring-no-properties (start end)
# Line 304  Must be greater than 1." Line 312  Must be greater than 1."
312          ((file-exists-p "/usr/dict/words") "/usr/dict/words")          ((file-exists-p "/usr/dict/words") "/usr/dict/words")
313          ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words")          ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words")
314          ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words")          ((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")
317          ((file-exists-p "/sys/dict") "/sys/dict")          ((file-exists-p "/sys/dict") "/sys/dict")
318          (t "/usr/dict/words"))          (t "/usr/dict/words"))
319    "*Alternate dictionary for spelling help."    "*Alternate dictionary for spelling help."
# Line 481  This is a local variable.  To change the Line 491  This is a local variable.  To change the
491  ;;;###autoload  ;;;###autoload
492  (defcustom ispell-local-dictionary-alist nil  (defcustom ispell-local-dictionary-alist nil
493    "*Contains local or customized dictionary definitions.    "*Contains local or customized dictionary definitions.
494  See `ispell-dictionary-alist'."  
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."
501    :type '(repeat (list (choice :tag "Dictionary"    :type '(repeat (list (choice :tag "Dictionary"
502                                 (string :tag "Dictionary name")                                 (string :tag "Dictionary name")
503                                 (const :tag "default" nil))                                 (const :tag "default" nil))
# Line 496  See `ispell-dictionary-alist'." Line 512  See `ispell-dictionary-alist'."
512                                 (const "~nroff") (const "~list")                                 (const "~nroff") (const "~list")
513                                 (const "~latin1") (const "~latin3")                                 (const "~latin1") (const "~latin3")
514                                 (const :tag "default" nil))                                 (const :tag "default" nil))
515                         (choice :tag "Character set"                         (choice :tag "Coding system"
516                                 (const iso-8859-1)                                 (const iso-8859-1)
517                                 (const iso-8859-2)                                 (const iso-8859-2)
518                                 (const koi8-r))))                                 (const koi8-r))))
# Line 516  See `ispell-dictionary-alist'." Line 532  See `ispell-dictionary-alist'."
532     ("brasileiro"                        ; Brazilian mode     ("brasileiro"                        ; Brazilian mode
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]"      "[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]"      "[^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]"
535      "[']" nil ("-d" "brasileiro") nil iso-8859-1)      "[']" nil nil nil iso-8859-1)
536     ("british"                           ; British version     ("british"                           ; British version
537      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "british") nil iso-8859-1)      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
538     ("castellano"                        ; Spanish mode     ("castellano"                        ; Spanish mode
539      "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"      "[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]"      "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
541      "[-]" nil ("-B" "-d" "castellano") "~tex" iso-8859-1)      "[-]" nil ("-B") "~tex" iso-8859-1)
542     ("castellano8"                       ; 8 bit Spanish mode     ("castellano8"                       ; 8 bit Spanish mode
543      "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"      "[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]"      "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
# Line 536  See `ispell-dictionary-alist'." Line 552  See `ispell-dictionary-alist'."
552   '(("czech"   '(("czech"
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]"      "[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]"      "[^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]"
555      "" nil ("-B" "-d" "czech") nil iso-8859-2)      "" nil ("-B") nil iso-8859-2)
556     ("dansk"                             ; Dansk.aff     ("dansk"                             ; Dansk.aff
557      "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"      "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
558      "[']" nil ("-C") nil iso-8859-1)      "[']" nil ("-C") nil iso-8859-1)
# Line 580  See `ispell-dictionary-alist'." Line 596  See `ispell-dictionary-alist'."
596     ("italiano"                         ; Italian.aff     ("italiano"                         ; Italian.aff
597      "[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"      "[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]"      "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
599      "[-]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)      "[-]" nil ("-B") "~tex" iso-8859-1)
600     ("nederlands"                        ; Nederlands.aff     ("nederlands"                        ; Nederlands.aff
601      "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"      "[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]"      "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
# Line 598  See `ispell-dictionary-alist'." Line 614  See `ispell-dictionary-alist'."
614   '(("norsk"                             ; 8 bit Norwegian mode   '(("norsk"                             ; 8 bit Norwegian mode
615      "[A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"      "[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]"      "[^A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
617      "[\"]" nil ("-d" "norsk") "~list" iso-8859-1)      "[\"]" nil nil "~list" iso-8859-1)
618     ("norsk7-tex"                        ; 7 bit Norwegian TeX mode     ("norsk7-tex"                        ; 7 bit Norwegian TeX mode
619      "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"      "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"
620      "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)      "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
621     ("polish"                            ; Polish mode     ("polish"                            ; Polish mode
622      "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"      "[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]"      "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
624      "" nil ( "-d" "polish") nil iso-8859-2)      "" nil nil nil iso-8859-2)
625     ("portugues"                         ; Portuguese mode     ("portugues"                         ; Portuguese mode
626      "[a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]"      "[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]"      "[^a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]"
628      "[']" t ("-C" "-d" "portugues") "~latin1" iso-8859-1)))      "[']" t ("-C") "~latin1" iso-8859-1)))
629    
630    
631  ;;; Sixth part of dictionary, shortened for loaddefs.el  ;;; Sixth part of dictionary, shortened for loaddefs.el
632  ;;;###autoload  ;;;###autoload
633  (setq  (setq
634   ispell-dictionary-alist-6   ispell-dictionary-alist-6
635   ;; include Russian iso character set too?   ;; include Russian iso coding system too?
636   ;;   "[']" t ("-d" "russian") "~latin1" iso-8859-1   ;;   "[']" t ("-d" "russian") "~latin1" iso-8859-1
637   '(("russian"                           ; Russian.aff (KOI8-R charset)   '(("russian"                           ; Russian.aff (KOI8-R charset)
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]"      "[\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]"      "[^\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]"
640      "" nil ("-d" "russian") nil koi8-r)      "" nil nil nil koi8-r)
641     ("slovak"                            ; Slovakian     ("slovak"                            ; Slovakian
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]"      "[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]"      "[^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]"
644      "" nil ("-B" "-d" "slovak") nil iso-8859-2)      "" nil ("-B") nil iso-8859-2)
645     ("svenska"                           ; Swedish mode     ("svenska"                           ; Swedish mode
646      "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"      "[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]"      "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
# Line 698  LANGUAGE.aff file \(e.g., english.aff\). Line 714  LANGUAGE.aff file \(e.g., english.aff\).
714                                 (const "~nroff") (const "~list")                                 (const "~nroff") (const "~list")
715                                 (const "~latin1") (const "~latin3")                                 (const "~latin1") (const "~latin3")
716                                 (const :tag "default" nil))                                 (const :tag "default" nil))
717                         (choice :tag "Character set"                         (choice :tag "Coding System"
718                                 (const iso-8859-1)                                 (const iso-8859-1)
719                                 (const iso-8859-2)                                 (const iso-8859-2)
720                                 (const koi8-r))))                                 (const koi8-r))))
# Line 727  LANGUAGE.aff file \(e.g., english.aff\). Line 743  LANGUAGE.aff file \(e.g., english.aff\).
743  (defvar ispell-offset -1  (defvar ispell-offset -1
744    "Offset that maps protocol differences between ispell 3.1 versions.")    "Offset that maps protocol differences between ispell 3.1 versions.")
745    
746  (defconst ispell-version "ispell.el 3.5 - 07/11/01")  (defconst ispell-version "ispell.el 3.6 - 01/07/2003")
747    
748    
749  ;;;###autoload  ;;;###autoload
# Line 847  and added as a submenu of the \"Edit\" m Line 863  and added as a submenu of the \"Edit\" m
863    "Non-nil means that the OS supports asynchronous processes.")    "Non-nil means that the OS supports asynchronous processes.")
864    
865  ;;;###autoload  ;;;###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
894  (if (and ispell-menu-map-needed  (if (and ispell-menu-map-needed
895           (or (not (fboundp 'byte-compiling-files-p))           (or (not (fboundp 'byte-compiling-files-p))
896               (not (byte-compiling-files-p))))               (not (byte-compiling-files-p))))
897      (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))      (let ((dicts (valid-dictionary-list)))
           ;; `ispell-library-path' intentionally not defined in autoload  
           (path (and (boundp 'ispell-library-path) ispell-library-path))  
           name load-dict)  
898        (setq ispell-menu-map (make-sparse-keymap "Spell"))        (setq ispell-menu-map (make-sparse-keymap "Spell"))
899        ;; add the dictionaries to the bottom of the list.        ;; add the dictionaries to the bottom of the list.
900        (while dicts        (while dicts
901          (setq name (car (car dicts))          (if (string-equal "default" (car dicts))
902                load-dict (car (cdr (member "-d" (nth 5 (car dicts)))))              (define-key ispell-menu-map (vector 'default)
903                dicts (cdr dicts))                (cons "Select Default Dict"
904          (cond ((not (stringp name))                      (cons "Dictionary for which Ispell was configured"
905                 (define-key ispell-menu-map (vector 'default)                            (list 'lambda () '(interactive)
906                   (cons "Select Default Dict"                                  (list
907                         (cons "Dictionary for which Ispell was configured"                                    'ispell-change-dictionary "default")))))
908                               (list 'lambda () '(interactive)            (define-key ispell-menu-map (vector (intern (car dicts)))
909                                     (list              (cons (concat "Select " (capitalize (car dicts)) " Dict")
910                                       'ispell-change-dictionary "default"))))))                    (list 'lambda () '(interactive)
911                ((or (not path)           ; load all if library dir not defined                          (list 'ispell-change-dictionary (car dicts))))))
912                     (file-exists-p (concat path "/" name ".hash"))          (setq dicts (cdr dicts)))))
                    (file-exists-p (concat path "/" name ".has"))  
                    (and load-dict  
                         (or (file-exists-p(concat path "/" load-dict ".hash"))  
                             (file-exists-p(concat path "/" load-dict ".has")))))  
                (define-key ispell-menu-map (vector (intern name))  
                  (cons (concat "Select " (capitalize name) " Dict")  
                        (list 'lambda () '(interactive)  
                              (list 'ispell-change-dictionary name)))))))))  
913    
914    
915  ;;; define commands in menu in opposite order you want them to appear.  ;;; define commands in menu in opposite order you want them to appear.
# Line 950  and added as a submenu of the \"Edit\" m Line 983  and added as a submenu of the \"Edit\" m
983  (if (and xemacsp  (if (and xemacsp
984           (not version18p)           (not version18p)
985           (featurep 'menubar)           (featurep 'menubar)
986           (null ispell-menu-xemacs)           ;;(null ispell-menu-xemacs)
987           (not (and (boundp 'infodock-version) infodock-version)))           (not (and (boundp 'infodock-version) infodock-version)))
988      (let ((dicts (cons (cons "default" nil) ispell-dictionary-alist))      (let ((dicts (valid-dictionary-list))
989            (current-menubar (or current-menubar default-menubar))            (current-menubar (or current-menubar default-menubar))
990            (menu            (menu
991             '(["Help"            (describe-function 'ispell-help) t]             '(["Help"            (describe-function 'ispell-help) t]
# Line 969  and added as a submenu of the \"Edit\" m Line 1002  and added as a submenu of the \"Edit\" m
1002               "-"               "-"
1003               ["Save Personal Dict"(ispell-pdict-save t t)       t]               ["Save Personal Dict"(ispell-pdict-save t t)       t]
1004               ["Change Dictionary" ispell-change-dictionary      t]               ["Change Dictionary" ispell-change-dictionary      t]
1005               ["Select Default"  (ispell-change-dictionary "default") t]))               ["Select Default"  (ispell-change-dictionary "default") t])))
           name load-dict)  
1006        (while dicts        (while dicts
1007          (setq name (car (car dicts))          (setq menu (append menu
1008                load-dict (car (cdr (member "-d" (nth 5 (car dicts)))))                             (list
1009                dicts (cdr dicts))                               (vector
1010          ;; Include if the dictionary is in the library, or path not defined.                                (concat "Select " (capitalize (car dicts)))
1011          (if (and (stringp name)                                (list 'ispell-change-dictionary (car dicts))
1012                   (or (not ispell-library-path)                                t)))
1013                       (file-exists-p (concat ispell-library-path "/"                dicts (cdr dicts)))
                                             name ".hash"))  
                      (file-exists-p (concat ispell-library-path "/"  
                                             name ".has"))  
                      (and load-dict  
                           (or (file-exists-p (concat ispell-library-path "/"  
                                                      load-dict ".hash"))  
                               (file-exists-p (concat ispell-library-path "/"  
                                                      load-dict ".has"))))))  
             (setq menu (append menu  
                                (list  
                                  (vector (concat "Select " (capitalize name))  
                                          (list 'ispell-change-dictionary name)  
                                          t))))))  
1014        (setq ispell-menu-xemacs menu)        (setq ispell-menu-xemacs menu)
1015        (if current-menubar        (if current-menubar
1016            (progn            (progn
# Line 1136  The last occurring definition in the buf Line 1155  The last occurring definition in the buf
1155       . "^---* End of [Ff]orwarded [Mm]essage")       . "^---* End of [Ff]orwarded [Mm]essage")
1156      ;; Matches e-mail addresses, file names, http addresses, etc.  The `-+'      ;; Matches e-mail addresses, file names, http addresses, etc.  The `-+'
1157      ;; pattern necessary for performance reasons when `-' part of word syntax.      ;; pattern necessary for performance reasons when `-' part of word syntax.
1158      ("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")      ("\\(--+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
1159        ;; above checks /.\w sequences
1160        ;;("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
1161      ;; This is a pretty complex regexp.  It can be simplified to the following:      ;; This is a pretty complex regexp.  It can be simplified to the following:
1162      ;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"      ;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
1163      ;; but some valid text will be skipped, e.g. "his/her".  This could be      ;; but some valid text will be skipped, e.g. "his/her".  This could be
# Line 1232  You can set this variable in hooks in yo Line 1253  You can set this variable in hooks in yo
1253  (defvar ispell-check-only nil  (defvar ispell-check-only nil
1254    "If non-nil, `ispell-word' does not try to correct the word.")    "If non-nil, `ispell-word' does not try to correct the word.")
1255    
1256  (defconst ispell-graphic-p  (defun ispell-mode-line-window-height-fudge ()
1257    (if (fboundp 'display-graphic-p)    "Return 1 if using a wide mode-line that covers text, otherwise 0."
1258        (display-graphic-p)    (if (and xemacsp window-system) 1 0))
     xemacsp)  
   "True if running on a `graphics capable' display.  
 These displays have thicker mode lines that can partially cover text.")  
   
 (if (fboundp 'mode-line-window-height-fudge)  
     (defalias 'ispell-mode-line-window-height-fudge  
       'mode-line-window-height-fudge)  
   (defun ispell-mode-line-window-height-fudge ()  
     "Return 1 if running on a `graphics capable' display, otherwise 0."  
     (if ispell-graphic-p 1 0)))  
1259    
1260    
1261  ;;; **********************************************************************  ;;; **********************************************************************
# Line 1910  SPC:   Accept word this time. Line 1921  SPC:   Accept word this time.
1921                       ;;This shouldn't be necessary: with-electric-help needs                       ;;This shouldn't be necessary: with-electric-help needs
1922                       ;; an optional argument telling it about the smallest                       ;; an optional argument telling it about the smallest
1923                       ;; acceptable window-height of the help buffer.                       ;; acceptable window-height of the help buffer.
1924                       (if (< (window-height) 15)                       ;(if (< (window-height) 15)
1925                           (enlarge-window (- 15 (window-height))))                       ;   (enlarge-window (- 15 (window-height))))
1926                       (princ "Selections are:                       (princ "Selections are:
1927    
1928  DIGIT: Replace the word with a digit offered in the *Choices* buffer.  DIGIT: Replace the word with a digit offered in the *Choices* buffer.
# Line 2227  Keeps argument list for future ispell in Line 2238  Keeps argument list for future ispell in
2238      (if ispell-local-dictionary      (if ispell-local-dictionary
2239          (setq ispell-dictionary ispell-local-dictionary))          (setq ispell-dictionary ispell-local-dictionary))
2240      (setq args (ispell-get-ispell-args))      (setq args (ispell-get-ispell-args))
2241      (if ispell-dictionary               ; use specified dictionary      (if (and ispell-dictionary          ; use specified dictionary
2242                 (not (member "-d" args)))  ; only define if not overriden
2243          (setq args          (setq args
2244                (append (list "-d" ispell-dictionary) args)))                (append (list "-d" ispell-dictionary) args)))
2245      (if ispell-personal-dictionary      ; use specified pers dict      (if ispell-personal-dictionary      ; use specified pers dict
# Line 2359  With prefix argument, set the default di Line 2371  With prefix argument, set the default di
2371    (interactive    (interactive
2372     (list (completing-read     (list (completing-read
2373            "Use new dictionary (RET for current, SPC to complete): "            "Use new dictionary (RET for current, SPC to complete): "
2374            (cons (cons "default" nil) ispell-dictionary-alist) nil t)            (mapcar (function (lambda (dict) (setf dict (cons dict nil))))
2375                      (valid-dictionary-list))
2376              nil t)
2377           current-prefix-arg))           current-prefix-arg))
2378    (if (equal dict "default") (setq dict nil))    (if (equal dict "default") (setq dict nil))
2379    ;; This relies on completing-read's bug of returning "" for no match    ;; This relies on completing-read's bug of returning "" for no match
# Line 2620  Must call after `ispell-buffer-local-par Line 2634  Must call after `ispell-buffer-local-par
2634  (defun ispell-ignore-fcc (start end)  (defun ispell-ignore-fcc (start end)
2635    "Deletes the Fcc: message header when large attachments are included.    "Deletes the Fcc: message header when large attachments are included.
2636  Return value `nil' if file with large attachments are saved.  Return value `nil' if file with large attachments are saved.
2637  This can be used to avoid multiple quesitons for multiple large attachments.  This can be used to avoid multiple questions for multiple large attachments.
2638  Returns point to starting location afterwards."  Returns point to starting location afterwards."
2639    (let ((result t))    (let ((result t))
2640      (if (and ispell-checking-message ispell-message-fcc-skip)      (if (and ispell-checking-message ispell-message-fcc-skip)
# Line 2766  Returns the sum shift due to changes in Line 2780  Returns the sum shift due to changes in
2780              ;; `query-replace' makes multiple corrections on the starting line.              ;; `query-replace' makes multiple corrections on the starting line.
2781              (if (/= (+ word-len (point))              (if (/= (+ word-len (point))
2782                      (progn                      (progn
2783                        ;; NB: Search can fail with Mule character sets that don't                        ;; NB: Search can fail with Mule coding systems that don't
2784                        ;;  display properly.  Ignore the error in this case?                        ;;  display properly.  Ignore the error in this case?
2785                        (search-forward (car poss) (+ word-len (point)) t)                        (search-forward (car poss) (+ word-len (point)) t)
2786                        (point)))                        (point)))
# Line 3079  Don't read buffer-local settings or word Line 3093  Don't read buffer-local settings or word
3093  ;;;                     Ispell Message  ;;;                     Ispell Message
3094  ;;; **********************************************************************  ;;; **********************************************************************
3095    
   
3096  (defvar ispell-message-text-end  (defvar ispell-message-text-end
3097    (mapconcat (function identity)    (mapconcat (function identity)
3098               '(               '(
# Line 3325  You can bind this to the key C-c i in GN Line 3338  You can bind this to the key C-c i in GN
3338                    (goto-char (point-min))                    (goto-char (point-min))
3339                    (re-search-forward "Content-[^ \t]*:" end-of-headers t)                    (re-search-forward "Content-[^ \t]*:" end-of-headers t)
3340                    (forward-line -1)     ; following fn starts one line above                    (forward-line -1)     ; following fn starts one line above
3341                    (ispell-mime-skip-part nil)))                    (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)))))
3345              (goto-char (max end-of-headers (point)))              (goto-char (max end-of-headers (point)))
3346              (forward-line 1)              (forward-line 1)
3347              (setq case-fold-search old-case-fold-search)              (setq case-fold-search old-case-fold-search)
# Line 3447  Both should not be used to define a buff Line 3463  Both should not be used to define a buff
3463          (ispell-kill-ispell t)          (ispell-kill-ispell t)
3464          (setq ispell-personal-dictionary ispell-local-pdict)))          (setq ispell-personal-dictionary ispell-local-pdict)))
3465    ;; Reload if new dictionary defined.    ;; Reload if new dictionary defined.
3466    (if (and ispell-local-dictionary    (if (not (equal ispell-local-dictionary ispell-dictionary))
            (not (equal ispell-local-dictionary ispell-dictionary)))  
3467        (ispell-change-dictionary ispell-local-dictionary)))        (ispell-change-dictionary ispell-local-dictionary)))
3468    
3469    

Legend:
Removed from v.1.137.4.3  
changed lines
  Added in v.1.137.4.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26