[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el [lexbind] |
Date: |
Tue, 14 Oct 2003 19:30:34 -0400 |
Index: emacs/lisp/textmodes/ispell.el
diff -c emacs/lisp/textmodes/ispell.el:1.131.2.1
emacs/lisp/textmodes/ispell.el:1.131.2.2
*** emacs/lisp/textmodes/ispell.el:1.131.2.1 Fri Apr 4 01:20:37 2003
--- emacs/lisp/textmodes/ispell.el Tue Oct 14 19:30:21 2003
***************
*** 1,11 ****
;;; ispell.el --- interface to International Ispell Versions 3.1 and 3.2
! ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
;; Author: Ken Stevens <address@hidden>
;; Maintainer: Ken Stevens <address@hidden>
! ;; Stevens Mod Date: Fri Aug 4 09:41:50 PDT 2000
! ;; Stevens Revision: 3.4
;; Status : Release with 3.1.12+ and 3.2.0+ ispell.
;; Bug Reports : address@hidden
;; Web Site : http://kdstevens.com/~stevens/ispell-page.html
--- 1,11 ----
;;; ispell.el --- interface to International Ispell Versions 3.1 and 3.2
! ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
Software Foundation, Inc.
;; Author: Ken Stevens <address@hidden>
;; Maintainer: Ken Stevens <address@hidden>
! ;; Stevens Mod Date: Mon Jan 7 12:32:44 PST 2003
! ;; Stevens Revision: 3.6
;; Status : Release with 3.1.12+ and 3.2.0+ ispell.
;; Bug Reports : address@hidden
;; Web Site : http://kdstevens.com/~stevens/ispell-page.html
***************
*** 129,134 ****
--- 129,152 ----
;; Modifications made in latest versions:
+ ;; Revision 3.6 2003/01/07 12:32:44 kss
+ ;; Removed extra -d LIB in dictionary defs. (Pavel Janik)
+ ;; Filtered process calls with duplicate dictionary entries.
+ ;; Fixed bug where message-text-end is inside a mime skipped region.
+ ;; Minor fixes to get ispell menus right in XEmacs
+ ;; Fixed skip regexp so it doesn't match stuff like `/.\w'.
+ ;; Detecting dictionary change not working. Fixed. kss
+ ;; function `ispell-change-dictionary' now only completes valid dicts.
+
+ ;; Revision 3.5 2001/7/11 18:43:57 kss
+ ;; Added fix for aspell to work in XEmacs (ispell-check-version).
+ ;; Added Portuguese dictionary definition.
+ ;; New feature: MIME mail message support, Fcc support.
+ ;; Bug fix: retain comment syntax on lines with region skipping. (TeX $
bug...)
+ ;; Improved allocation for graphic mode lines. (Miles Bader)
+ ;; Support -v flag for old versions of aspell. (Eli Zaretskii)
+ ;; Clear minibuffer on ^G from ispell-help (Tak Ota)
+
;; Revision 3.4 2000/8/4 09:41:50 kss
;; Support new color display functions.
;; Fixed misalignment offset bug when replacing a string after a shift made.
***************
*** 203,219 ****
(defun buffer-substring-no-properties (start end)
(buffer-substring start end)))
! ;;;###autoload
! (defconst xemacsp (string-match "Lucid\\|XEmacs" emacs-version)
! "Non nil if using XEmacs.")
!
! (defconst ispell-graphic-p
! (if (fboundp 'display-graphic-p)
! (display-graphic-p)
! xemacsp)
! "True if running on a `graphics capable' display.")
!
! (defalias 'ispell-check-version 'check-ispell-version)
;;; **********************************************************************
;;; The following variables should be set according to personal preference
--- 221,227 ----
(defun buffer-substring-no-properties (start end)
(buffer-substring start end)))
! (defalias 'check-ispell-version 'ispell-check-version)
;;; **********************************************************************
;;; The following variables should be set according to personal preference
***************
*** 318,323 ****
--- 326,338 ----
:group 'ispell)
+ (defcustom ispell-message-fcc-skip 50000
+ "*Query before saving Fcc message copy if attachment larger than this value.
+ Always stores Fcc copy of message when nil."
+ :type '(choice integer (const :tag "off" nil))
+ :group 'ispell)
+
+
(defcustom ispell-grep-command "egrep"
"Name of the grep command for search processes."
:type 'string
***************
*** 455,466 ****
(const :tag "use-mode-name" use-mode-name))
:group 'ispell)
;;; Define definitions here only for personal dictionaries.
;;;###autoload
(defcustom ispell-local-dictionary-alist nil
"*Contains local or customized dictionary definitions.
! See `ispell-dictionary-alist'."
:type '(repeat (list (choice :tag "Dictionary"
(string :tag "Dictionary name")
(const :tag "default" nil))
--- 470,489 ----
(const :tag "use-mode-name" use-mode-name))
:group 'ispell)
+ (make-variable-buffer-local 'ispell-skip-html)
+
;;; Define definitions here only for personal dictionaries.
;;;###autoload
(defcustom ispell-local-dictionary-alist nil
"*Contains local or customized dictionary definitions.
!
! These will override the values in `ispell-dictionary-alist'.
!
! Customization changes made to `ispell-dictionary-alist' will not operate
! over emacs sessions. To make permanent changes to your dictionary
! definitions, you will need to make your changes in this variable, save,
! and then re-start emacs."
:type '(repeat (list (choice :tag "Dictionary"
(string :tag "Dictionary name")
(const :tag "default" nil))
***************
*** 475,481 ****
(const "~nroff") (const "~list")
(const "~latin1") (const "~latin3")
(const :tag "default" nil))
! (choice :tag "Character set"
(const iso-8859-1)
(const iso-8859-2)
(const koi8-r))))
--- 498,504 ----
(const "~nroff") (const "~list")
(const "~latin1") (const "~latin3")
(const :tag "default" nil))
! (choice :tag "Coding system"
(const iso-8859-1)
(const iso-8859-2)
(const koi8-r))))
***************
*** 495,507 ****
("brasileiro" ; Brazilian mode
"[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]"
! "[']" nil ("-d" "brasileiro") nil iso-8859-1)
("british" ; British version
! "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "british") nil iso-8859-1)
("castellano" ; Spanish mode
"[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]"
! "[-]" nil ("-B" "-d" "castellano") "~tex" iso-8859-1)
("castellano8" ; 8 bit Spanish mode
"[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]"
--- 518,530 ----
("brasileiro" ; Brazilian mode
"[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]"
! "[']" nil nil nil iso-8859-1)
("british" ; British version
! "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
("castellano" ; Spanish mode
"[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]"
! "[-]" nil ("-B") "~tex" iso-8859-1)
("castellano8" ; 8 bit Spanish mode
"[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]"
***************
*** 515,521 ****
'(("czech"
"[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]"
! "" nil ("-B" "-d" "czech") nil iso-8859-2)
("dansk" ; Dansk.aff
"[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
"[']" nil ("-C") nil iso-8859-1)
--- 538,544 ----
'(("czech"
"[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]"
! "" nil ("-B") nil iso-8859-2)
("dansk" ; Dansk.aff
"[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
"[']" nil ("-C") nil iso-8859-1)
***************
*** 545,620 ****
("francais" ; Francais.aff
"[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
"[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
! "[-']" t nil "~list" iso-8859-1)))
;;; Fourth part of dictionary, shortened for loaddefs.el
;;;###autoload
(setq
ispell-dictionary-alist-4
! '(("francais-tex" ; Francais.aff
!
"[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
!
"[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
! "[-'^`\"]" t nil "~tex" iso-8859-1)
! ("german" ; german.aff
"[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
! ("german8"
"[a-zA-Z\304\326\334\344\366\337\374]"
"[^a-zA-Z\304\326\334\344\366\337\374]"
"[']" t ("-C" "-d" "german") "~latin1" iso-8859-1)
! ("italiano" ; Italian.aff
"[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]"
! "[-]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)))
!
!
! ;;; Fifth part of dictionary, shortened for loaddefs.el
! ;;;###autoload
! (setq
! ispell-dictionary-alist-5
! '(("nederlands" ; Nederlands.aff
"[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]"
"[']" t ("-C") nil iso-8859-1)
("nederlands8" ; Dutch8.aff
"[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]"
! "[']" t ("-C") nil iso-8859-1)
! ("norsk" ; 8 bit Norwegian mode
"[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]"
! "[\"]" nil ("-d" "norsk") "~list" iso-8859-1)
("norsk7-tex" ; 7 bit Norwegian TeX mode
"[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"
! "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)))
;;; Sixth part of dictionary, shortened for loaddefs.el
;;;###autoload
(setq
ispell-dictionary-alist-6
! ;; include Russian iso character set too?
;; "[']" t ("-d" "russian") "~latin1" iso-8859-1
! '(("polish" ; polish mode
!
"[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]"
! "" nil ( "-d" "polish") nil iso-8859-2)
! ("russian" ; Russian.aff (KOI8-R charset)
"[\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]"
! "" nil ("-d" "russian") nil koi8-r)
("svenska" ; Swedish mode
"[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]"
! "[']" nil ("-C") "~list" iso-8859-1)
! ("portugues"
! "[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]"
! "[']" t ("-C" "-d" "portugues") "~latin1" iso-8859-1)
! ("slovak"
!
"[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]"
! "" nil ("-B" "-d" "slovak") nil iso-8859-2)))
;;;###autoload
(defcustom ispell-dictionary-alist
--- 568,644 ----
("francais" ; Francais.aff
"[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
"[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
! "[-']" t nil "~list" iso-8859-1)
! ("francais-tex" ; Francais.aff
!
"[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
!
"[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
! "[-'^`\"]" t nil "~tex" iso-8859-1)))
;;; Fourth part of dictionary, shortened for loaddefs.el
;;;###autoload
(setq
ispell-dictionary-alist-4
! '(("german" ; german.aff
"[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
! ("german8" ; german.aff
"[a-zA-Z\304\326\334\344\366\337\374]"
"[^a-zA-Z\304\326\334\344\366\337\374]"
"[']" t ("-C" "-d" "german") "~latin1" iso-8859-1)
! ("italiano" ; Italian.aff
"[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]"
! "[-]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
! ("nederlands" ; Nederlands.aff
"[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]"
"[']" t ("-C") nil iso-8859-1)
("nederlands8" ; Dutch8.aff
"[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]"
! "[']" t ("-C") nil iso-8859-1)))
!
!
! ;;; Fifth part of dictionary, shortened for loaddefs.el
! ;;;###autoload
! (setq
! ispell-dictionary-alist-5
! '(("norsk" ; 8 bit Norwegian mode
"[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]"
! "[\"]" nil nil "~list" iso-8859-1)
("norsk7-tex" ; 7 bit Norwegian TeX mode
"[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"
! "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
! ("polish" ; Polish mode
!
"[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]"
! "" nil nil nil iso-8859-2)
! ("portugues" ; Portuguese mode
! "[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]"
! "[']" t ("-C") "~latin1" iso-8859-1)))
;;; Sixth part of dictionary, shortened for loaddefs.el
;;;###autoload
(setq
ispell-dictionary-alist-6
! ;; include Russian iso coding system too?
;; "[']" t ("-d" "russian") "~latin1" iso-8859-1
! '(("russian" ; Russian.aff (KOI8-R charset)
"[\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]"
! "" nil nil nil koi8-r)
! ("slovak" ; Slovakian
!
"[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]"
! "" nil ("-B") nil iso-8859-2)
("svenska" ; Swedish mode
"[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]"
! "[']" nil ("-C") "~list" iso-8859-1)))
!
;;;###autoload
(defcustom ispell-dictionary-alist
***************
*** 682,688 ****
(const "~nroff") (const "~list")
(const "~latin1") (const "~latin3")
(const :tag "default" nil))
! (choice :tag "Character set"
(const iso-8859-1)
(const iso-8859-2)
(const koi8-r))))
--- 706,712 ----
(const "~nroff") (const "~list")
(const "~latin1") (const "~latin3")
(const :tag "default" nil))
! (choice :tag "Coding System"
(const iso-8859-1)
(const iso-8859-2)
(const koi8-r))))
***************
*** 711,720 ****
(defvar ispell-offset -1
"Offset that maps protocol differences between ispell 3.1 versions.")
! (defconst ispell-version "ispell.el 3.4 -- Fri Aug 4 09:41:50 PDT 2000")
! (defun check-ispell-version (&optional interactivep)
"Ensure that `ispell-program-name' is valid and the correct version.
Returns version number if called interactively.
Otherwise returns the library directory name, if that is defined."
--- 735,744 ----
(defvar ispell-offset -1
"Offset that maps protocol differences between ispell 3.1 versions.")
! (defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
! (defun ispell-check-version (&optional interactivep)
"Ensure that `ispell-program-name' is valid and the correct version.
Returns version number if called interactively.
Otherwise returns the library directory name, if that is defined."
***************
*** 729,735 ****
(let ((case-fold-search-val case-fold-search)
;; avoid bugs when syntax of `.' changes in various default modes
(default-major-mode 'fundamental-mode)
! (default-directory temporary-file-directory)
result status)
(save-excursion
(let ((buf (get-buffer " *ispell-tmp*")))
--- 753,761 ----
(let ((case-fold-search-val case-fold-search)
;; avoid bugs when syntax of `.' changes in various default modes
(default-major-mode 'fundamental-mode)
! (default-directory (or (and (boundp 'temporary-file-directory)
! temporary-file-directory)
! default-directory))
result status)
(save-excursion
(let ((buf (get-buffer " *ispell-tmp*")))
***************
*** 747,752 ****
--- 773,779 ----
(if (string-match "\\`aspell" speller) "-v" "-vv"))))
(goto-char (point-min))
(if interactivep
+ ;; report version information of ispell and ispell.el
(progn
(end-of-line)
(setq result (concat (buffer-substring-no-properties (point-min)
***************
*** 813,823 ****
(defvar ispell-menu-map-needed
;; only needed when not version 18 and not XEmacs.
(and (not ispell-menu-map)
! (not xemacsp)
'reload))
(defvar ispell-library-directory (condition-case ()
! (check-ispell-version)
(error nil))
"Directory where ispell dictionaries reside.")
--- 840,850 ----
(defvar ispell-menu-map-needed
;; only needed when not version 18 and not XEmacs.
(and (not ispell-menu-map)
! (not (featurep 'xemacs))
'reload))
(defvar ispell-library-directory (condition-case ()
! (ispell-check-version)
(error nil))
"Directory where ispell dictionaries reside.")
***************
*** 833,873 ****
)
"Non-nil means that the OS supports asynchronous processes.")
;;;###autoload
(if ispell-menu-map-needed
! (let ((dicts (reverse (cons (cons "default" nil)
ispell-dictionary-alist)))
! (dir (if (boundp 'ispell-library-directory) ispell-library-directory))
! (dict-map (make-sparse-keymap "Dictionaries"))
! name load-dict)
(setq ispell-menu-map (make-sparse-keymap "Spell"))
;; add the dictionaries to the bottom of the list.
! (dolist (dict dicts)
! (setq name (car dict)
! load-dict (car (cdr (member "-d" (nth 5 dict)))))
! (unless (stringp name)
(define-key ispell-menu-map [default]
'("Select Default Dict"
"Dictionary for which Ispell was configured"
. (lambda () (interactive)
! (ispell-change-dictionary "default"))))))
(fset 'ispell-dict-map dict-map)
(define-key ispell-menu-map [dictionaries]
`(menu-item "Select Dict" ispell-dict-map))
! (dolist (dict dicts)
! (setq name (car dict)
! load-dict (car (cdr (member "-d" (nth 5 dict)))))
! (cond ((not (stringp name)))
! ((or (not dir) ; load all if library dir not defined
! (file-exists-p (concat dir "/" name ".hash"))
! (file-exists-p (concat dir "/" name ".has"))
! (and load-dict
! (or (file-exists-p (concat dir "/" load-dict ".hash"))
! (file-exists-p (concat dir "/" load-dict ".has")))))
! (define-key dict-map (vector (intern name))
! (cons (concat "Select " (capitalize name) " Dict")
! `(lambda () (interactive)
! (ispell-change-dictionary ,name)))))))))
!
;;; define commands in menu in opposite order you want them to appear.
;;;###autoload
--- 860,914 ----
)
"Non-nil means that the OS supports asynchronous processes.")
+ (defun ispell-valid-dictionary-list ()
+ "Returns a list of valid dictionaries.
+ The variable `ispell-library-directory' defines the library location."
+ (let ((dicts ispell-dictionary-alist)
+ (dict-list (cons "default" nil))
+ name load-dict)
+ (dolist (dict dicts)
+ (setq name (car dict)
+ load-dict (car (cdr (member "-d" (nth 5 dict)))))
+ ;; Include if the dictionary is in the library, or dir not defined.
+ (if (and
+ name
+ ;; include all dictionaries if lib directory not known.
+ (or (not ispell-library-directory)
+ (file-exists-p (concat ispell-library-directory
+ "/" name ".hash"))
+ (file-exists-p (concat ispell-library-directory "/" name ".has"))
+ (and load-dict
+ (or (file-exists-p (concat ispell-library-directory
+ "/" load-dict ".hash"))
+ (file-exists-p (concat ispell-library-directory
+ "/" load-dict ".has"))))))
+ (setq dict-list (cons name dict-list))))
+ dict-list))
+
+
;;;###autoload
(if ispell-menu-map-needed
! (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
! (ispell-valid-dictionary-list)
! (mapcar (lambda (x) (or (car x) "default"))
! ispell-dictionary-alist)))
! (dict-map (make-sparse-keymap "Dictionaries")))
(setq ispell-menu-map (make-sparse-keymap "Spell"))
;; add the dictionaries to the bottom of the list.
! (if (not dicts)
(define-key ispell-menu-map [default]
'("Select Default Dict"
"Dictionary for which Ispell was configured"
. (lambda () (interactive)
! (ispell-change-dictionary "default")))))
(fset 'ispell-dict-map dict-map)
(define-key ispell-menu-map [dictionaries]
`(menu-item "Select Dict" ispell-dict-map))
! (dolist (name dicts)
! (define-key dict-map (vector (intern name))
! (cons (concat "Select " (capitalize name) " Dict")
! `(lambda () (interactive)
! (ispell-change-dictionary ,name)))))))
;;; define commands in menu in opposite order you want them to appear.
;;;###autoload
***************
*** 940,950 ****
(fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
;;; XEmacs versions 19 & 20
! (if (and xemacsp
(featurep 'menubar)
! (null ispell-menu-xemacs)
(not (and (boundp 'infodock-version) infodock-version)))
! (let ((dicts (cons (cons "default" nil) ispell-dictionary-alist))
(current-menubar (or current-menubar default-menubar))
(menu
'(["Help" (describe-function 'ispell-help) t]
--- 981,992 ----
(fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
;;; XEmacs versions 19 & 20
! (if (and (featurep 'xemacs)
(featurep 'menubar)
! ;;(null ispell-menu-xemacs)
(not (and (boundp 'infodock-version) infodock-version)))
! (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
! (reverse (ispell-valid-dictionary-list))))
(current-menubar (or current-menubar default-menubar))
(menu
'(["Help" (describe-function 'ispell-help) t]
***************
*** 958,997 ****
["Complete Word Frag"ispell-complete-word-interior-frag t]
["Complete Word" ispell-complete-word t]
["Kill Process" ispell-kill-ispell t]
"-"
["Save Personal Dict"(ispell-pdict-save t t) t]
! ["Change Dictionary" ispell-change-dictionary t]
! ["Select Default" (ispell-change-dictionary "default") t]))
! name load-dict)
! (while dicts
! (setq name (car (car dicts))
! load-dict (car (cdr (member "-d" (nth 5 (car dicts)))))
! dicts (cdr dicts))
! ;; Include if the dictionary is in the library, or dir not defined.
! (if (and (stringp name)
! (or (not ispell-library-directory)
! (file-exists-p (concat ispell-library-directory "/"
! name ".hash"))
! (file-exists-p (concat ispell-library-directory "/"
! name ".has"))
! (and load-dict
! (or (file-exists-p (concat ispell-library-directory
"/"
! load-dict ".hash"))
! (file-exists-p (concat ispell-library-directory
"/"
! load-dict ".has"))))))
! (setq menu (append menu
! (list
! (vector (concat "Select " (capitalize name))
! (list 'ispell-change-dictionary name)
! t))))))
(setq ispell-menu-xemacs menu)
(if current-menubar
(progn
! (delete-menu-item '("Edit" "Spell")) ; in case already defined
! (add-menu '("Edit") "Spell" ispell-menu-xemacs)))))
;;; Allow incrementing characters as integers in XEmacs 20
! (if (and xemacsp
(fboundp 'int-char))
(fset 'ispell-int-char 'int-char)
;; Emacs and XEmacs 19 or earlier
--- 1000,1035 ----
["Complete Word Frag"ispell-complete-word-interior-frag t]
["Complete Word" ispell-complete-word t]
["Kill Process" ispell-kill-ispell t]
+ ["Customize..." (customize-group 'ispell) t]
+ ;; flyspell-mode may not be bound...
+ ;;["flyspell" flyspell-mode
+ ;; :style toggle :selected flyspell-mode ]
"-"
["Save Personal Dict"(ispell-pdict-save t t) t]
! ["Change Dictionary" ispell-change-dictionary t])))
! (if (null dicts)
! (setq dicts (cons "default" nil)))
! (dolist (name dicts)
! (setq menu (append menu
! (list
! (vector
! (concat "Select " (capitalize name))
! (list 'ispell-change-dictionary name)
! t)))))
(setq ispell-menu-xemacs menu)
(if current-menubar
(progn
! (if (car (find-menu-item current-menubar '("Cmds")))
! (progn
! ;; XEmacs 21.2
! (delete-menu-item '("Cmds" "Spell-Check"))
! (add-menu '("Cmds") "Spell-Check" ispell-menu-xemacs))
! ;; previous
! (delete-menu-item '("Edit" "Spell")) ; in case already defined
! (add-menu '("Edit") "Spell" ispell-menu-xemacs))))))
;;; Allow incrementing characters as integers in XEmacs 20
! (if (and (featurep 'xemacs)
(fboundp 'int-char))
(fset 'ispell-int-char 'int-char)
;; Emacs and XEmacs 19 or earlier
***************
*** 1014,1020 ****
(defun ispell-decode-string (str)
"Decodes multibyte character strings.
Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
! (if (and (or xemacsp
(and (boundp 'enable-multibyte-characters)
enable-multibyte-characters))
(fboundp 'decode-coding-string)
--- 1052,1058 ----
(defun ispell-decode-string (str)
"Decodes multibyte character strings.
Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
! (if (and (or (featurep 'xemacs)
(and (boundp 'enable-multibyte-characters)
enable-multibyte-characters))
(fboundp 'decode-coding-string)
***************
*** 1074,1080 ****
"Marker for return point from recursive edit.")
(defvar ispell-checking-message nil
! "Non-nil when we're checking a mail message.")
(defconst ispell-choices-buffer "*Choices*")
--- 1112,1119 ----
"Marker for return point from recursive edit.")
(defvar ispell-checking-message nil
! "Non-nil when we're checking a mail message.
! Set to the MIME boundary locations when checking messages.")
(defconst ispell-choices-buffer "*Choices*")
***************
*** 1114,1123 ****
(ispell-pdict-keyword forward-line)
(ispell-parsing-keyword forward-line)
("^---*BEGIN PGP [A-Z ]*--*" . "^---*END PGP [A-Z ]*--*")
! ("^---* \\(Start of \\)?[Ff]orwarded [Mm]essage" . "^---* End of
[Ff]orwarded [Mm]essage")
;; Matches e-mail addresses, file names, http addresses, etc. The `-+'
;; pattern necessary for performance reasons when `-' part of word syntax.
!
("\\(-+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+\\)")
;; This is a pretty complex regexp. It can be simplified to the
following:
;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
;; but some valid text will be skipped, e.g. "his/her". This could be
--- 1153,1168 ----
(ispell-pdict-keyword forward-line)
(ispell-parsing-keyword forward-line)
("^---*BEGIN PGP [A-Z ]*--*" . "^---*END PGP [A-Z ]*--*")
! ;; assume multiline uuencoded file? "\nM.*$"?
! ("^begin [0-9][0-9][0-9] [^ \t]+$" . "\nend\n")
! ("^%!PS-Adobe-[123].0" . "\n%%EOF\n")
! ("^---* \\(Start of \\)?[Ff]orwarded [Mm]essage"
! . "^---* End of [Ff]orwarded [Mm]essage")
;; Matches e-mail addresses, file names, http addresses, etc. The `-+'
;; pattern necessary for performance reasons when `-' part of word syntax.
!
("\\(--+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
! ;; above checks /.\w sequences
!
;;("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
;; This is a pretty complex regexp. It can be simplified to the
following:
;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
;; but some valid text will be skipped, e.g. "his/her". This could be
***************
*** 1165,1170 ****
--- 1210,1231 ----
for skipping in latex mode.")
+ ;;;###autoload
+ (defvar ispell-html-skip-alists
+ '(("<[cC][oO][dD][eE]\\>[^>]*>" "</[cC][oO][dD][eE]*>")
+ ("<[sS][cC][rR][iI][pP][tT]\\>[^>]*>" "</[sS][cC][rR][iI][pP][tT]>")
+ ("<[aA][pP][pP][lL][eE][tT]\\>[^>]*>" "</[aA][pP][pP][lL][eE][tT]>")
+ ("<[vV][eE][rR][bB]\\>[^>]*>" "<[vV][eE][rR][bB]\\>[^>]*>")
+ ;;("<[tT][tT]\\>[^>]*>" "<[tT][tT]\\>[^>]*>")
+ ("<[tT][tT]/" "/")
+ ("<[^ \t\n>]" ">")
+ ("&[^ \t\n;]" "[; \t\n]"))
+ "*Lists of start and end keys to skip in HTML buffers.
+ Same format as `ispell-skip-region-alist'
+ Note - substrings of other matches must come last
+ (e.g. \"<[tT][tT]/\" and \"<[^ \t\n>]\").")
+
+
(defvar ispell-local-pdict ispell-personal-dictionary
"A buffer local variable containing the current personal dictionary.
If non-nil, the value must be a string, which is a file name.
***************
*** 1189,1195 ****
You can set this variable in hooks in your init file -- eg:
! (add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex))))")
(defvar ispell-region-end (make-marker)
"Marker that allows spelling continuations.")
--- 1250,1256 ----
You can set this variable in hooks in your init file -- eg:
! \(add-hook 'tex-mode-hook (lambda () (setq ispell-parser 'tex)))")
(defvar ispell-region-end (make-marker)
"Marker that allows spelling continuations.")
***************
*** 1203,1210 ****
! ;;;###autoload
! (define-key esc-map "$" 'ispell-word)
(defun ispell-accept-output (&optional timeout-secs timeout-msecs)
--- 1264,1270 ----
! ;;;###autoload (define-key esc-map "$" 'ispell-word)
(defun ispell-accept-output (&optional timeout-secs timeout-msecs)
***************
*** 1255,1263 ****
(insert string)
(if (not (memq cmd cmds-to-defer))
(let (coding-system-for-read coding-system-for-write status)
! (if (or xemacsp
! (and (boundp 'enable-multibyte-characters)
! enable-multibyte-characters))
(setq coding-system-for-read (ispell-get-coding-system)
coding-system-for-write (ispell-get-coding-system)))
(set-buffer output-buf)
--- 1315,1322 ----
(insert string)
(if (not (memq cmd cmds-to-defer))
(let (coding-system-for-read coding-system-for-write status)
! (if (and (boundp 'enable-multibyte-characters)
! enable-multibyte-characters)
(setq coding-system-for-read (ispell-get-coding-system)
coding-system-for-write (ispell-get-coding-system)))
(set-buffer output-buf)
***************
*** 1327,1333 ****
or \\[ispell-region] to update the Ispell process.
return values:
! nil word is correct or spelling is accpeted.
0 word is inserted into buffer-local definitions.
\"word\" word corrected from word list.
\(\"word\" arg\) word is hand entered.
--- 1386,1392 ----
or \\[ispell-region] to update the Ispell process.
return values:
! nil word is correct or spelling is accepted.
0 word is inserted into buffer-local definitions.
\"word\" word corrected from word list.
\(\"word\" arg\) word is hand entered.
***************
*** 1369,1384 ****
(cond ((eq poss t)
(or quietly
(message "%s is correct"
! (funcall ispell-format-word word))))
((stringp poss)
(or quietly
(message "%s is correct because of root %s"
(funcall ispell-format-word word)
! (funcall ispell-format-word poss))))
((null poss) (message "Error in ispell process"))
(ispell-check-only ; called from ispell minor mode.
! (beep)
! (message "%s is incorrect" (funcall ispell-format-word word)))
(t ; prompt for correct word.
(save-window-excursion
(setq replace (ispell-command-loop
--- 1428,1453 ----
(cond ((eq poss t)
(or quietly
(message "%s is correct"
! (funcall ispell-format-word word)))
! (and (fboundp 'extent-at)
! (extent-at start)
! (delete-extent (extent-at start))))
((stringp poss)
(or quietly
(message "%s is correct because of root %s"
(funcall ispell-format-word word)
! (funcall ispell-format-word poss)))
! (and (fboundp 'extent-at)
! (extent-at start)
! (delete-extent (extent-at start))))
((null poss) (message "Error in ispell process"))
(ispell-check-only ; called from ispell minor mode.
! (if (fboundp 'make-extent)
! (let ((ext (make-extent start end)))
! (set-extent-property ext 'face ispell-highlight-face)
! (set-extent-property ext 'priority 2000))
! (beep)
! (message "%s is incorrect"(funcall ispell-format-word word))))
(t ; prompt for correct word.
(save-window-excursion
(setq replace (ispell-command-loop
***************
*** 1530,1538 ****
(save-excursion
(set-buffer (get-buffer-create ispell-choices-buffer))
(setq mode-line-format (concat "-- %b -- word: " word))
! ;; XEmacs: prevent thick modeline vs increasing height in overlay-window
! ;;(and (fboundp 'set-specifier)
! ;; (set-specifier has-modeline-p (cons (current-buffer) nil)))
(erase-buffer)
(if guess
(progn
--- 1599,1609 ----
(save-excursion
(set-buffer (get-buffer-create ispell-choices-buffer))
(setq mode-line-format (concat "-- %b -- word: " word))
! ;; XEmacs: no need for horizontal scrollbar in choices window
! (and (fboundp 'set-specifier)
! (boundp 'horizontal-scrollbar-visible-p)
! (set-specifier horizontal-scrollbar-visible-p nil
! (cons (current-buffer) nil)))
(erase-buffer)
(if guess
(progn
***************
*** 1803,1809 ****
(set-window-start (selected-window)
(if (> (point) visible) visible (point)))
(goto-char end)
! (select-window (previous-window)) ; *Choices* window
(enlarge-window window-line)))
;; Overlay *Choices* window when it isn't showing
(ispell-overlay-window (max line ispell-choices-win-default-height)))
--- 1874,1880 ----
(set-window-start (selected-window)
(if (> (point) visible) visible (point)))
(goto-char end)
! (select-window choices-window)
(enlarge-window window-line)))
;; Overlay *Choices* window when it isn't showing
(ispell-overlay-window (max line ispell-choices-win-default-height)))
***************
*** 1844,1852 ****
;;This shouldn't be necessary: with-electric-help needs
;; an optional argument telling it about the smallest
;; acceptable window-height of the help buffer.
! (if (< (window-height) 15)
! (enlarge-window
! (- 15 (ispell-adjusted-window-height))))
(princ "Selections are:
DIGIT: Replace the word with a digit offered in the *Choices* buffer.
--- 1915,1923 ----
;;This shouldn't be necessary: with-electric-help needs
;; an optional argument telling it about the smallest
;; acceptable window-height of the help buffer.
! ;;(if (< (window-height) 15)
! ;; (enlarge-window
! ;; (- 15 (ispell-adjusted-window-height))))
(princ "Selections are:
DIGIT: Replace the word with a digit offered in the *Choices* buffer.
***************
*** 2059,2065 ****
(defun ispell-highlight-spelling-error (start end &optional highlight refresh)
(cond
! (xemacsp
(ispell-highlight-spelling-error-xemacs start end highlight))
((and (featurep 'faces)
(or (and (fboundp 'display-color-p) (display-color-p))
--- 2130,2136 ----
(defun ispell-highlight-spelling-error (start end &optional highlight refresh)
(cond
! ((featurep 'xemacs)
(ispell-highlight-spelling-error-xemacs start end highlight))
((and (featurep 'faces)
(or (and (fboundp 'display-color-p) (display-color-p))
***************
*** 2076,2082 ****
`window-height'."
(cond ((fboundp 'window-text-height)
(1+ (window-text-height window)))
! (ispell-graphic-p
(1- (window-height window)))
(t
(window-height window))))
--- 2147,2154 ----
`window-height'."
(cond ((fboundp 'window-text-height)
(1+ (window-text-height window)))
! ((or (and (fboundp 'display-graphic-p) (display-graphic-p))
! (and (featurep 'xemacs) window-system))
(1- (window-height window)))
(t
(window-height window))))
***************
*** 2128,2134 ****
((string= output "") t) ; for startup with pipes...
((string= output "*") t) ; exact match
((string= output "-") t) ; compound word match
! ((string= (substring output 0 1) "+") ; found because of root word
(substring output 2)) ; return root word
((equal 0 (string-match "[\ra-zA-Z]" output))
(ding) ; error message from ispell!
--- 2200,2206 ----
((string= output "") t) ; for startup with pipes...
((string= output "*") t) ; exact match
((string= output "-") t) ; compound word match
! ((eq (aref output 0) ?+) ; found because of root word
(substring output 2)) ; return root word
((equal 0 (string-match "[\ra-zA-Z]" output))
(ding) ; error message from ispell!
***************
*** 2136,2152 ****
(sit-for 5)
nil)
(t ; need to process &, ?, and #'s
! (let ((type (substring output 0 1)) ; &, ?, or #
(original-word (substring output 2 (string-match " " output 2)))
(cur-count 0) ; contains number of misses + guesses
count miss-list guess-list offset)
(setq output (substring output (match-end 0))) ; skip over misspelling
! (if (string= type "#")
(setq count 0) ; no misses for type #
(setq count (string-to-int output) ; get number of misses.
output (substring output (1+ (string-match " " output 1)))))
(setq offset (string-to-int output))
! (if (string= type "#") ; No miss or guess list.
(setq output nil)
(setq output (substring output (1+ (string-match " " output 1)))))
(while output
--- 2208,2224 ----
(sit-for 5)
nil)
(t ; need to process &, ?, and #'s
! (let ((type (aref output 0)) ; &, ?, or #
(original-word (substring output 2 (string-match " " output 2)))
(cur-count 0) ; contains number of misses + guesses
count miss-list guess-list offset)
(setq output (substring output (match-end 0))) ; skip over misspelling
! (if (eq type ?#)
(setq count 0) ; no misses for type #
(setq count (string-to-int output) ; get number of misses.
output (substring output (1+ (string-match " " output 1)))))
(setq offset (string-to-int output))
! (if (eq type ?#) ; No miss or guess list.
(setq output nil)
(setq output (substring output (1+ (string-match " " output 1)))))
(while output
***************
*** 2183,2189 ****
(if ispell-local-dictionary
(setq ispell-dictionary ispell-local-dictionary))
(setq args (ispell-get-ispell-args))
! (if ispell-dictionary ; use specified dictionary
(setq args
(append (list "-d" ispell-dictionary) args)))
(if ispell-personal-dictionary ; use specified pers dict
--- 2255,2262 ----
(if ispell-local-dictionary
(setq ispell-dictionary ispell-local-dictionary))
(setq args (ispell-get-ispell-args))
! (if (and ispell-dictionary ; use specified dictionary
! (not (member "-d" args))) ; only define if not overridden
(setq args
(append (list "-d" ispell-dictionary) args)))
(if ispell-personal-dictionary ; use specified pers dict
***************
*** 2221,2235 ****
(ispell-kill-ispell t)
(message "Starting new Ispell process...")
(sit-for 0)
! (check-ispell-version)
! (setq ispell-process-directory default-directory
ispell-process (ispell-start-process)
ispell-filter nil
ispell-filter-continue nil)
(if ispell-async-processp
(set-process-filter ispell-process 'ispell-filter))
;; protect against bogus binding of `enable-multibyte-characters' in
XEmacs
! (if (and (or xemacsp
(and (boundp 'enable-multibyte-characters)
enable-multibyte-characters))
(fboundp 'set-process-coding-system))
--- 2294,2308 ----
(ispell-kill-ispell t)
(message "Starting new Ispell process...")
(sit-for 0)
! (setq ispell-library-directory (ispell-check-version)
! ispell-process-directory default-directory
ispell-process (ispell-start-process)
ispell-filter nil
ispell-filter-continue nil)
(if ispell-async-processp
(set-process-filter ispell-process 'ispell-filter))
;; protect against bogus binding of `enable-multibyte-characters' in
XEmacs
! (if (and (or (featurep 'xemacs)
(and (boundp 'enable-multibyte-characters)
enable-multibyte-characters))
(fboundp 'set-process-coding-system))
***************
*** 2310,2316 ****
(interactive
(list (completing-read
"Use new dictionary (RET for current, SPC to complete): "
! (cons (cons "default" nil) ispell-dictionary-alist) nil t)
current-prefix-arg))
(if (equal dict "default") (setq dict nil))
;; This relies on completing-read's bug of returning "" for no match
--- 2383,2391 ----
(interactive
(list (completing-read
"Use new dictionary (RET for current, SPC to complete): "
! (and (fboundp 'ispell-valid-dictionary-list)
! (mapcar (lambda (x)(cons x nil)) (ispell-valid-dictionary-list)))
! nil t)
current-prefix-arg))
(if (equal dict "default") (setq dict nil))
;; This relies on completing-read's bug of returning "" for no match
***************
*** 2354,2359 ****
--- 2429,2436 ----
(interactive "r") ; Don't flag errors on read-only bufs.
(if (not recheckp)
(ispell-accept-buffer-local-defs)) ; set up dictionary, local words,
etc.
+ (let ((skip-region-start (make-marker))
+ (rstart (make-marker)))
(unwind-protect
(save-excursion
(message "Spell checking %s using %s dictionary..."
***************
*** 2365,2383 ****
(goto-char reg-start)
(let ((transient-mark-mode)
(case-fold-search case-fold-search)
! (skip-region-start (make-marker))
! (skip-regexp (ispell-begin-skip-region-regexp))
! (skip-alist ispell-skip-region-alist)
! key)
! (if (eq ispell-parser 'tex)
! (setq case-fold-search nil
! skip-alist
! (append (car ispell-tex-skip-alists)
! (car (cdr ispell-tex-skip-alists))
! skip-alist)))
(let (message-log-max)
(message "searching for regions to skip"))
! (if (re-search-forward skip-regexp reg-end t)
(progn
(setq key (buffer-substring-no-properties
(match-beginning 0) (match-end 0)))
--- 2442,2452 ----
(goto-char reg-start)
(let ((transient-mark-mode)
(case-fold-search case-fold-search)
! (query-fcc t)
! in-comment key)
(let (message-log-max)
(message "searching for regions to skip"))
! (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t)
(progn
(setq key (buffer-substring-no-properties
(match-beginning 0) (match-end 0)))
***************
*** 2386,2391 ****
--- 2455,2461 ----
(let (message-log-max)
(message "Continuing spelling check using %s dictionary..."
(or ispell-dictionary "default")))
+ (set-marker rstart reg-start)
(set-marker ispell-region-end reg-end)
(while (and (not ispell-quit)
(< (point) ispell-region-end))
***************
*** 2393,2417 ****
(if (and (marker-position skip-region-start)
(<= skip-region-start (point)))
(progn
! (ispell-skip-region key skip-alist) ; moves pt past region.
! (setq reg-start (point))
! (if (and (< reg-start ispell-region-end)
! (re-search-forward skip-regexp
! ispell-region-end t))
(progn
(setq key (buffer-substring-no-properties
(car (match-data))
(car (cdr (match-data)))))
(set-marker skip-region-start
(- (point) (length key)))
! (goto-char reg-start))
(set-marker skip-region-start nil))))
! (setq reg-end (if (marker-position skip-region-start)
! (min skip-region-start ispell-region-end)
! (marker-position ispell-region-end)))
(let* ((start (point))
(end (save-excursion (end-of-line) (min (point) reg-end)))
! (string (ispell-get-line start end reg-end)))
(setq end (point)) ; "end" tracks region retrieved.
(if string ; there is something to spell check!
;; (special start end)
--- 2463,2506 ----
(if (and (marker-position skip-region-start)
(<= skip-region-start (point)))
(progn
! ;; If region inside line comment, must keep comment start.
! (setq in-comment (point)
! in-comment
! (and comment-start
! (or (null comment-end) (string= "" comment-end))
! (save-excursion
! (beginning-of-line)
! (re-search-forward comment-start in-comment t))
! comment-start))
! ;; Can change skip-regexps (in ispell-message)
! (ispell-skip-region key) ; moves pt past region.
! (set-marker rstart (point))
! ;; check for saving large attachments...
! (setq query-fcc (and query-fcc
! (ispell-ignore-fcc skip-region-start
! rstart)))
! (if (and (< rstart ispell-region-end)
! (re-search-forward
! (ispell-begin-skip-region-regexp)
! ispell-region-end t))
(progn
(setq key (buffer-substring-no-properties
(car (match-data))
(car (cdr (match-data)))))
(set-marker skip-region-start
(- (point) (length key)))
! (goto-char rstart))
(set-marker skip-region-start nil))))
! (setq reg-end (max (point)
! (if (marker-position skip-region-start)
! (min skip-region-start ispell-region-end)
! (marker-position ispell-region-end))))
(let* ((start (point))
(end (save-excursion (end-of-line) (min (point) reg-end)))
! (string (ispell-get-line start end in-comment)))
! (if in-comment ; account for comment chars added
! (setq start (- start (length in-comment))
! in-comment nil))
(setq end (point)) ; "end" tracks region retrieved.
(if string ; there is something to spell check!
;; (special start end)
***************
*** 2425,2430 ****
--- 2514,2521 ----
(if (and (not (and recheckp ispell-keep-choices-win))
(get-buffer ispell-choices-buffer))
(kill-buffer ispell-choices-buffer))
+ (set-marker skip-region-start nil)
+ (set-marker rstart nil)
(if ispell-quit
(progn
;; preserve or clear the region for ispell-continue.
***************
*** 2441,2488 ****
(if (not recheckp) (set-marker ispell-region-end nil))
;; Only save if successful exit.
(ispell-pdict-save ispell-silently-savep)
! (message "Spell-checking done"))))
- ;;; Creates the regexp for skipping a region.
- ;;; Makes the skip-regexp local for tex buffers adding in the
- ;;; tex expressions to skip as well.
- ;;; Call AFTER ispell-buffer-local-parsing.
(defun ispell-begin-skip-region-regexp ()
! (let ((skip-regexp (ispell-begin-skip-region)))
(if (and (null ispell-check-comments) comment-start)
(setq skip-regexp (concat (regexp-quote comment-start) "\\|"
skip-regexp)))
(if (and (eq 'exclusive ispell-check-comments) comment-start)
(setq skip-regexp (concat (if (string= "" comment-end) "^"
(regexp-quote comment-end))
"\\|" skip-regexp)))
(if ispell-skip-tib
(setq skip-regexp (concat ispell-tib-ref-beginning "\\|" skip-regexp)))
(if ispell-skip-html
! (setq skip-regexp (concat "<[cC][oO][dD][eE]\\>[^>]*>" "\\|"
! "<[sS][cC][rR][iI][pP][tT]\\>[^>]*>" "\\|"
! "<[aA][pP][pP][lL][eE][tT]\\>[^>]*>" "\\|"
! "<[vV][eE][rR][bB]\\>[^>]*>" "\\|"
! ;; "<[tT][tT]\\>[^>]*>" "\\|"
! "<[tT][tT]/" "\\|"
! "<" "\\|"
! "&" "\\|"
! skip-regexp)))
(if (eq ispell-parser 'tex)
(setq skip-regexp (concat (ispell-begin-tex-skip-regexp) "\\|"
skip-regexp)))
skip-regexp))
(defun ispell-begin-tex-skip-regexp ()
"Regular expression of tex commands to skip.
Generated from `ispell-tex-skip-alists'."
(concat
(mapconcat (function (lambda (lst) (car lst)))
(car ispell-tex-skip-alists)
"\\|")
"\\|"
(mapconcat (function (lambda (lst)
(concat "\\\\begin[ \t\n]*{[ \t\n]*"
(car lst)
--- 2532,2601 ----
(if (not recheckp) (set-marker ispell-region-end nil))
;; Only save if successful exit.
(ispell-pdict-save ispell-silently-savep)
! (message "Spell-checking done")))))
(defun ispell-begin-skip-region-regexp ()
! "Returns a regexp of the search keys for region skipping.
! Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys.
! Must call after ispell-buffer-local-parsing due to dependence on mode."
! ;; start with regions generic to all buffers
! (let ((skip-regexp (ispell-begin-skip-region ispell-skip-region-alist)))
! ;; Comments
(if (and (null ispell-check-comments) comment-start)
(setq skip-regexp (concat (regexp-quote comment-start) "\\|"
skip-regexp)))
(if (and (eq 'exclusive ispell-check-comments) comment-start)
+ ;; search from end of current comment to start of next comment.
(setq skip-regexp (concat (if (string= "" comment-end) "^"
(regexp-quote comment-end))
"\\|" skip-regexp)))
+ ;; tib
(if ispell-skip-tib
(setq skip-regexp (concat ispell-tib-ref-beginning "\\|" skip-regexp)))
+ ;; html stuff
(if ispell-skip-html
! (setq skip-regexp (concat
! (ispell-begin-skip-region ispell-html-skip-alists)
! "\\|"
! skip-regexp)))
! ;; tex
(if (eq ispell-parser 'tex)
(setq skip-regexp (concat (ispell-begin-tex-skip-regexp) "\\|"
skip-regexp)))
+ ;; messages
+ (if (and ispell-checking-message
+ (not (eq t ispell-checking-message)))
+ (setq skip-regexp (concat
+ (mapconcat (lambda (lst) (car lst))
+ ispell-checking-message
+ "\\|")
+ "\\|"
+ skip-regexp)))
+
+ ;; return new regexp
skip-regexp))
+ (defun ispell-begin-skip-region (skip-alist)
+ "Regular expression for start of regions to skip generated from SKIP-ALIST.
+ Each selection should be a key of SKIP-ALIST;
+ otherwise, the current line is skipped."
+ (mapconcat (lambda (lst) (if (stringp (car lst)) (car lst) (eval (car
lst))))
+ skip-alist
+ "\\|"))
+
+
(defun ispell-begin-tex-skip-regexp ()
"Regular expression of tex commands to skip.
Generated from `ispell-tex-skip-alists'."
(concat
+ ;; raw tex keys
(mapconcat (function (lambda (lst) (car lst)))
(car ispell-tex-skip-alists)
"\\|")
"\\|"
+ ;; keys wrapped in begin{}
(mapconcat (function (lambda (lst)
(concat "\\\\begin[ \t\n]*{[ \t\n]*"
(car lst)
***************
*** 2491,2507 ****
"\\|")))
! (defun ispell-begin-skip-region ()
! "Regular expression of regions to skip for all buffers.
! Each selection should be a key of `ispell-skip-region-alist';
! otherwise, the current line is skipped."
! (mapconcat (function (lambda (lst) (if (stringp (car lst)) (car lst)
! (eval (car lst)))))
! ispell-skip-region-alist
! "\\|"))
(defun ispell-tex-arg-end (&optional arg)
(condition-case nil
(progn
(while (looking-at "[ \t\n]*\\[") (forward-sexp))
--- 2604,2633 ----
"\\|")))
! (defun ispell-skip-region-list ()
! "Returns a list describing key and body regions to skip for this buffer.
! Includes regions defined by `ispell-skip-region-alist', tex mode,
! `ispell-html-skip-alists', and `ispell-checking-message'.
! Manual checking must include comments and tib references.
! The list is of the form described by variable `ispell-skip-region-alist'.
! Must call after `ispell-buffer-local-parsing' due to dependence on mode."
! (let ((skip-alist ispell-skip-region-alist))
! ;; only additional explicit region definition is tex.
! (if (eq ispell-parser 'tex)
! (setq case-fold-search nil
! skip-alist (append (car ispell-tex-skip-alists)
! (car (cdr ispell-tex-skip-alists))
! skip-alist)))
! (if ispell-skip-html
! (setq skip-alist (append ispell-html-skip-alists skip-alist)))
! (if (and ispell-checking-message
! (not (eq t ispell-checking-message)))
! (setq skip-alist (append ispell-checking-message skip-alist)))
! skip-alist))
(defun ispell-tex-arg-end (&optional arg)
+ "Skip across ARG number of braces."
(condition-case nil
(progn
(while (looking-at "[ \t\n]*\\[") (forward-sexp))
***************
*** 2512,2523 ****
(sit-for 2))))
! ;;; Skips to region-end from point, or a single line.
! ;;; Places point at end of region skipped.
! (defun ispell-skip-region (key alist)
;; move over key to begin checking.
(forward-char (length key))
(let ((start (point))
alist-key null-skip)
(cond
;; what about quoted comment, or comment inside strings?
--- 2638,2679 ----
(sit-for 2))))
! (defun ispell-ignore-fcc (start end)
! "Deletes the Fcc: message header when large attachments are included.
! Return value `nil' if file with large attachments are saved.
! This can be used to avoid multiple questions for multiple large attachments.
! Returns point to starting location afterwards."
! (let ((result t))
! (if (and ispell-checking-message ispell-message-fcc-skip)
! (if (< ispell-message-fcc-skip (- end start))
! (let (case-fold-search head-end)
! (goto-char (point-min))
! (setq head-end
! (or (re-search-forward
! (concat "^" (regexp-quote mail-header-separator) "$")
! nil t)
! (re-search-forward "^$" nil t)
! (point-min)))
! (goto-char (point-min))
! (if (re-search-forward "^Fcc:" head-end t)
! (if (y-or-n-p
! "Save copy of this message with large attachments? ")
! (setq result nil)
! (beginning-of-line)
! (kill-line 1)))
! (goto-char end))))
! result))
!
!
! (defun ispell-skip-region (key)
! "Skips across KEY and then to end of region.
! Key lookup determines region to skip.
! Point is placed at end of skipped region."
;; move over key to begin checking.
(forward-char (length key))
(let ((start (point))
+ ;; Regenerate each call... This function can change region definition.
+ (alist (ispell-skip-region-list))
alist-key null-skip)
(cond
;; what about quoted comment, or comment inside strings?
***************
*** 2531,2556 ****
(search-forward comment-start ispell-region-end :end))
((and ispell-skip-tib (string-match ispell-tib-ref-beginning key))
(re-search-forward ispell-tib-ref-end ispell-region-end t))
- ((and ispell-skip-html (string-match "</" key))
- (search-forward ">" ispell-region-end t))
- ((and ispell-skip-html (string-match "<[cC][oO][dD][eE]\\>[^>]*>" key))
- (search-forward-regexp "</[cC][oO][dD][eE]>" ispell-region-end t))
- ((and ispell-skip-html
- (string-match "<[sS][cC][rR][iI][pP][tT]\\>[^>]*>" key))
- (search-forward-regexp "</[sS][cC][rR][iI][pP][tT]>" ispell-region-end
t))
- ((and ispell-skip-html
- (string-match "<[aA][pP][pP][lL][eE][tT]\\>[^>]*>" key))
- (search-forward-regexp "</[aA][pP][pP][lL][eE][tT]>" ispell-region-end
t))
- ((and ispell-skip-html (string-match "<[vV][eE][rR][bB]\\>[^>]*>" key))
- (search-forward-regexp "</[vV][eE][rR][bB]>" ispell-region-end t))
- ;;((and ispell-skip-html (string-match "<[tT][tT]\\>[^>]*>" key))
- ;; (search-forward-regexp "</[tT][tT]>" ispell-region-end t))
- ((and ispell-skip-html (string-match "<[tT][tT]/" key))
- (search-forward "/" ispell-region-end t))
- ((and ispell-skip-html (string-match "<" key))
- (search-forward ">" ispell-region-end t))
- ((and ispell-skip-html (string-match "&" key))
- (search-forward-regexp "[; \t\n]" ispell-region-end t))
;; markings from alist
(t
(while alist
--- 2687,2692 ----
***************
*** 2563,2575 ****
((not (consp alist))
;; Search past end of spell region to find this region end.
(re-search-forward (eval alist) (point-max) t))
! ((consp alist)
! (if (stringp alist)
! (re-search-forward alist (point-max) t)
! (setq null-skip t) ; error handling in functions!
! (if (consp (cdr alist))
! (apply (car alist) (cdr alist))
! (funcall (car alist))))))
(setq alist nil))
(setq alist (cdr alist))))))
(if (and (= start (point)) (null null-skip))
--- 2699,2712 ----
((not (consp alist))
;; Search past end of spell region to find this region end.
(re-search-forward (eval alist) (point-max) t))
! ((and (= 1 (length alist))
! (stringp (car alist)))
! (re-search-forward (car alist) (point-max) t))
! (t
! (setq null-skip t) ; error handling in functions!
! (if (consp (cdr alist))
! (apply (car alist) (cdr alist))
! (funcall (car alist)))))
(setq alist nil))
(setq alist (cdr alist))))))
(if (and (= start (point)) (null null-skip))
***************
*** 2582,2588 ****
;;; Grab the next line of data.
;;; Returns a string with the line data
! (defun ispell-get-line (start end reg-end)
(let ((ispell-casechars (ispell-get-casechars))
string)
(cond ; LOOK AT THIS LINE AND SKIP OR PROCESS
--- 2719,2725 ----
;;; Grab the next line of data.
;;; Returns a string with the line data
! (defun ispell-get-line (start end in-comment)
(let ((ispell-casechars (ispell-get-casechars))
string)
(cond ; LOOK AT THIS LINE AND SKIP OR PROCESS
***************
*** 2592,2598 ****
;; (forward-char 1)) ; not needed as quoted below.
((or (re-search-forward ispell-casechars end t) ; TEXT EXISTS
(re-search-forward "[][()${}]" end t)) ; or MATH COMMANDS
! (setq string (concat "^" (buffer-substring-no-properties start end)
"\n"))
(goto-char end))
(t (goto-char end))) ; EMPTY LINE, skip it.
--- 2729,2736 ----
;; (forward-char 1)) ; not needed as quoted below.
((or (re-search-forward ispell-casechars end t) ; TEXT EXISTS
(re-search-forward "[][()${}]" end t)) ; or MATH COMMANDS
! (setq string (concat "^" in-comment
! (buffer-substring-no-properties start end)
"\n"))
(goto-char end))
(t (goto-char end))) ; EMPTY LINE, skip it.
***************
*** 2649,2655 ****
;; `query-replace' makes multiple corrections on the starting line.
(if (/= (+ word-len (point))
(progn
! ;; NB: Search can fail with Mule character sets that don't
;; display properly. Ignore the error in this case?
(search-forward (car poss) (+ word-len (point)) t)
(point)))
--- 2787,2793 ----
;; `query-replace' makes multiple corrections on the starting line.
(if (/= (+ word-len (point))
(progn
! ;; NB: Search can fail with Mule coding systems that don't
;; display properly. Ignore the error in this case?
(search-forward (car poss) (+ word-len (point)) t)
(point)))
***************
*** 2845,2856 ****
(cond
((string-equal (upcase word) word)
(setq possibilities (mapcar 'upcase possibilities)))
! ((string-equal (upcase (substring word 0 1)) (substring word 0 1))
(setq possibilities (mapcar (function
(lambda (pos)
! (if (string-equal
! (substring word 0 1)
! (substring pos 0 1))
pos
(capitalize pos))))
possibilities))))
--- 2983,2992 ----
(cond
((string-equal (upcase word) word)
(setq possibilities (mapcar 'upcase possibilities)))
! ((eq (upcase (aref word 0)) (aref word 0))
(setq possibilities (mapcar (function
(lambda (pos)
! (if (eq (aref word 0) (aref pos
0))
pos
(capitalize pos))))
possibilities))))
***************
*** 2895,2901 ****
program, or do an Internet search; there are various dictionaries
available on the net."
(interactive)
! (if (and transient-mark-mode mark-active)
(ispell-region (region-beginning) (region-end))
(ispell-buffer)))
--- 3031,3038 ----
program, or do an Internet search; there are various dictionaries
available on the net."
(interactive)
! (if (and (boundp 'transient-mark-mode) transient-mark-mode
! (boundp 'mark-active) mark-active)
(ispell-region (region-beginning) (region-end))
(ispell-buffer)))
***************
*** 2960,2967 ****
;;; **********************************************************************
;;; Ispell Message
;;; **********************************************************************
- ;;; Original from D. Quinlan, E. Bradford, A. Albert, and M. Ernst
-
(defvar ispell-message-text-end
(mapconcat (function identity)
--- 3097,3102 ----
***************
*** 2969,2977 ****
;; Don't spell check signatures
"^-- $"
;; Matches postscript files.
! "^%!PS-Adobe-[123].0"
;; Matches uuencoded text
! "^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM"
;; Matches shell files (especially auto-decoding)
"^#! /bin/[ck]?sh"
;; Matches context difference listing
--- 3104,3112 ----
;; Don't spell check signatures
"^-- $"
;; Matches postscript files.
! ;;"^%!PS-Adobe-[123].0"
;; Matches uuencoded text
! ;;"^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM"
;; Matches shell files (especially auto-decoding)
"^#! /bin/[ck]?sh"
;; Matches context difference listing
***************
*** 2988,2993 ****
--- 3123,3219 ----
Otherwise, it must be a function which is called to get the limit.")
+ (defun ispell-mime-multipartp (&optional limit)
+ "Return multipart message start boundary or nil if none."
+ ;; caller must ensure `case-fold-search' is set to `t'
+ (and
+ (re-search-forward
+ "Content-Type: *multipart/\\([^ \t\n]*;[ \t]*[\n]?[ \t]*\\)+boundary="
+ limit t)
+ (let (boundary)
+ (if (looking-at "\"")
+ (let (start)
+ (forward-char)
+ (setq start (point))
+ (while (not (looking-at "\""))
+ (forward-char 1))
+ (setq boundary (buffer-substring-no-properties start (point))))
+ (let ((start (point)))
+ (while (looking-at "[-0-9a-zA-Z'()+_,./:=?]")
+ (forward-char))
+ (setq boundary (buffer-substring-no-properties start (point)))))
+ (if (< (length boundary) 1)
+ (setq boundary nil)
+ (concat "--" boundary)))))
+
+
+ (defun ispell-mime-skip-part (boundary)
+ "Moves point across header, or entire MIME part if message is encoded.
+ All specified types except `7bit' `8bit' and `quoted-printable' are considered
+ encoded and therefore skipped. See rfc 1521, 2183, ...
+ If no boundary is given, then entire message is skipped.
+
+ This starts one line ABOVE the MIME content messages, on the boundary marker,
+ for operation with the generic region-skipping code.
+ This places new MIME boundaries into variable `ispell-checking-message'."
+ (forward-line) ; skip over boundary to headers
+ (let ((save-case-fold-search case-fold-search)
+ (continuep t)
+ textp)
+ (setq case-fold-search t
+ ispell-skip-html nil)
+ (while continuep
+ (setq continuep nil)
+ (if (looking-at "Content-Type: *text/")
+ (progn
+ (goto-char (match-end 0))
+ (if (looking-at "html")
+ (setq ispell-skip-html t))
+ (setq textp t
+ continuep t)
+ (re-search-forward "\\(.*;[ \t]*[\n]\\)*.*$" nil t)
+ (forward-line)))
+ (if (looking-at "Content-Transfer-Encoding: *\\([^ \t\n]*\\)")
+ (let ((match (buffer-substring (match-beginning 1) (match-end 1))))
+ (setq textp (member (upcase match)
+ ;; only spell check the following encodings:
+ '("7BIT" "8BIT" "QUOTED-PRINTABLE" "BINARY"))
+ continuep t)
+ (goto-char (match-end 0))
+ (re-search-forward "\\(.*;[ \t]*[\n]\\)*.*$" nil t)
+ (forward-line)))
+ ;; hierarchical boundary definition
+ (if (looking-at "Content-Type: *multipart/")
+ (let ((new-boundary (ispell-mime-multipartp)))
+ (if (string-match new-boundary boundary)
+ (setq continuep t)
+ ;; first pass redefine skip function to include new boundary
+ ;;(re-search-backward boundary nil t)
+ (forward-line)
+ (setq ispell-checking-message
+ (cons
+ (list new-boundary 'ispell-mime-skip-part new-boundary)
+ (if (eq t ispell-checking-message) nil
+ ispell-checking-message))
+ textp t
+ continuep t)))
+ ;; Skip all MIME headers that don't affect spelling
+ (if (looking-at "Content-[^ \t]*: *\\(.*;[ \t]*[\n]\\)*.*$")
+ (progn
+ (setq continuep t)
+ (goto-char (match-end 0))
+ (forward-line)))))
+
+ (setq case-fold-search save-case-fold-search)
+ (if textp
+ (point)
+ ;; encoded message. Skip to boundary, or entire message.
+ (if (not boundary)
+ (goto-char (point-max))
+ (re-search-forward boundary nil t)
+ (beginning-of-line)
+ (point)))))
+
;;;###autoload
(defun ispell-message ()
***************
*** 3012,3018 ****
(interactive)
(save-excursion
(goto-char (point-min))
! (let* (
;; Nil when message came from outside (eg calling emacs as editor)
;; Non-nil marker of end of headers.
(internal-messagep
--- 3238,3245 ----
(interactive)
(save-excursion
(goto-char (point-min))
! (let* (boundary mimep
! (ispell-skip-region-alist-save ispell-skip-region-alist)
;; Nil when message came from outside (eg calling emacs as editor)
;; Non-nil marker of end of headers.
(internal-messagep
***************
*** 3037,3046 ****
" \\|\t"))
(cite-regexp ;Prefix of quoted text
(cond
! ((functionp 'sc-cite-regexp) ; sc 3.0
(concat "\\(" (sc-cite-regexp) "\\)" "\\|"
(ispell-non-empty-string sc-reference-tag-string)))
! ((boundp 'sc-cite-regexp) ; sc 2.3
(concat "\\(" sc-cite-regexp "\\)" "\\|"
(ispell-non-empty-string sc-reference-tag-string)))
((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
--- 3264,3273 ----
" \\|\t"))
(cite-regexp ;Prefix of quoted text
(cond
! ((functionp 'sc-cite-regexp) ; sc 3.0
(concat "\\(" (sc-cite-regexp) "\\)" "\\|"
(ispell-non-empty-string sc-reference-tag-string)))
! ((boundp 'sc-cite-regexp) ; sc 2.3
(concat "\\(" sc-cite-regexp "\\)" "\\|"
(ispell-non-empty-string sc-reference-tag-string)))
((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
***************
*** 3082,3088 ****
(progn
;; Spell check any original Subject:
(goto-char (point-min))
! (setq case-fold-search t)
(if (re-search-forward "^Subject: *" end-of-headers t)
(progn
(goto-char (match-end 0))
--- 3309,3317 ----
(progn
;; Spell check any original Subject:
(goto-char (point-min))
! (setq case-fold-search t
! mimep (re-search-forward "MIME-Version:" end-of-headers t))
! (goto-char (point-min))
(if (re-search-forward "^Subject: *" end-of-headers t)
(progn
(goto-char (match-end 0))
***************
*** 3096,3107 ****
(while (looking-at "\n[ \t]")
(end-of-line 2))
(point)))))))
! (setq case-fold-search old-case-fold-search)
! (goto-char end-of-headers)
(forward-line 1)
(ispell-region (point) limit))
(set-marker end-of-headers nil)
! (set-marker limit nil)))))
(defun ispell-non-empty-string (string)
--- 3325,3365 ----
(while (looking-at "\n[ \t]")
(end-of-line 2))
(point)))))))
! (if mimep
! (progn
! (goto-char (point-min))
! (setq boundary (ispell-mime-multipartp end-of-headers))))
! ;; Adjust message limit to MIME message if necessary.
! (and boundary
! (re-search-forward (concat boundary "--") nil t)
! (re-search-backward boundary nil t)
! (< (point) (marker-position limit))
! (set-marker limit (point)))
! (goto-char (point-min))
! ;; Select type or skip checking if this is a non-multipart message
! ;; Point moved to end of buffer if region is encoded.
! (if (and mimep (not boundary))
! (let (skip-regexp) ; protect from `ispell-mime-skip-part'
! (goto-char (point-min))
! (re-search-forward "Content-[^ \t]*:" end-of-headers t)
! (forward-line -1) ; following fn starts one line above
! (ispell-mime-skip-part nil)
! ;; if message-text-end region, limit may be less than point.
! (if (> (point) limit)
! (set-marker limit (point)))))
! (goto-char (max end-of-headers (point)))
(forward-line 1)
+ (setq case-fold-search old-case-fold-search)
+ ;; Define MIME regions to skip.
+ (if boundary
+ (setq ispell-checking-message
+ (list (list boundary 'ispell-mime-skip-part boundary))))
(ispell-region (point) limit))
(set-marker end-of-headers nil)
! (set-marker limit nil)
! (setq ispell-skip-region-alist ispell-skip-region-alist-save
! ispell-skip-html nil
! case-fold-search old-case-fold-search)))))
(defun ispell-non-empty-string (string)
***************
*** 3142,3150 ****
(ispell-send-string "-\n")) ; set mode to normal (nroff)
;; If needed, test for SGML & HTML modes and set a buffer local nil/t value.
(if (and ispell-skip-html (not (eq ispell-skip-html t)))
! (set (make-local-variable 'ispell-skip-html)
! (not (null (string-match "sgml\\|html\\|xml"
! (downcase (symbol-name major-mode)))))))
;; Set default extended character mode for given buffer, if any.
(let ((extended-char-mode (ispell-get-extended-character-mode)))
(if extended-char-mode
--- 3400,3408 ----
(ispell-send-string "-\n")) ; set mode to normal (nroff)
;; If needed, test for SGML & HTML modes and set a buffer local nil/t value.
(if (and ispell-skip-html (not (eq ispell-skip-html t)))
! (setq ispell-skip-html
! (not (null (string-match "sgml\\|html\\|xml"
! (downcase (symbol-name major-mode)))))))
;; Set default extended character mode for given buffer, if any.
(let ((extended-char-mode (ispell-get-extended-character-mode)))
(if extended-char-mode
***************
*** 3210,3217 ****
(ispell-kill-ispell t)
(setq ispell-personal-dictionary ispell-local-pdict)))
;; Reload if new dictionary defined.
! (if (and ispell-local-dictionary
! (not (equal ispell-local-dictionary ispell-dictionary)))
(ispell-change-dictionary ispell-local-dictionary)))
--- 3468,3474 ----
(ispell-kill-ispell t)
(setq ispell-personal-dictionary ispell-local-pdict)))
;; Reload if new dictionary defined.
! (if (not (equal ispell-local-dictionary ispell-dictionary))
(ispell-change-dictionary ispell-local-dictionary)))
***************
*** 3315,3318 ****
--- 3572,3576 ----
; LocalWords: uuencoded unidiff sc nn VM SGML eval IspellPersDict unsplitable
; LocalWords: lns XEmacs HTML casechars Multibyte
+ ;;; arch-tag: 4941b9f9-3b7c-4a76-a4ed-5fa8b6010ef5
;;; ispell.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el [lexbind],
Miles Bader <=