-;;;;;;;;;;;;;;;;;;;;;;;;;;; -*- Mode: emacs-lisp -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; GNU EMACS interface for International Ispell Version 3.1 by Geoff Kuenning.
-;;;
-;;;
+;;; ispell.el --- spell checking using Ispell
+
;;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-;;;
-;;;
+
;;; Authors : Ken Stevens <k.stevens@ieee.org>
;;; Note: version numbers and time stamp are not updated
;;; when this file is edited for release with GNU Emacs.
-;;; Last Modified On: Mon Feb 6 17:39:38 EST 1995
-;;; Update Revision : 2.36
+;;; Last Modified On: Tue Jun 13 12:05:28 EDT 1995
+;;; Update Revision : 2.37
;;; Syntax : emacs-lisp
;;; Status : Release with 3.1.12+ ispell.
;;; Version : International Ispell Version 3.1 by Geoff Kuenning.
;;; Bug Reports : ispell-el-bugs@itcorp.com
-;;;
+
+;;; Note: version numbers and time stamp are not updated
+;;; when this file is edited for release with GNU Emacs.
+
;;; This file is part of GNU Emacs.
;;;
;;; GNU Emacs is free software; you can redistribute it and/or modify
;;;
;;; HISTORY
;;;
+;;; Revision 2.37 1995/6/13 12:05:28 stevens
+;;; Removed autoload from ispell-dictionary-alist. *choices* mode-line shows
+;;; misspelled word. Block skip for pgp & forwarded messages added.
+;;; RMS: the autoload changes had problems and I removed them.
+;;;
;;; Revision 2.36 1995/2/6 17:39:38 stevens
;;; Properly adjust screen with different ispell-choices-win-default-height
;;; settings. Skips SGML entity references.
words as correct. See also `ispell-dictionary-alist', which may be used
for language-specific arguments.")
+;;; The preparation of the menu bar menu must be autoloaded
+;;; because otherwise this file gets autoloaded every time Emacs starts
+;;; so that it can set up the menus and determine keyboard equivalents.
+
;;;###autoload
(defvar ispell-dictionary-alist-1 ; sk 9-Aug-1991 18:28
'((nil ; default (english.aff)
contain the same character set as casechars and otherchars in the
language.aff file \(e.g., english.aff\).")
-
;;;###autoload
(defvar ispell-menu-map nil "Key map for ispell menu")
;;; due to the fact that menu-bar is loaded much later than loaddefs.
;;; ;; make sure this isn't Lucid Emacs
;;; (featurep 'menu-bar)
- (string-lessp "19" emacs-version)))
+ (not (string-match "Lucid" emacs-version))))
-
-;;; setup dictionary
+;;; Set up dictionary
;;;###autoload
(if ispell-menu-map-needed
(let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
;;; The version must be 3.1 or greater for this version of ispell.el
-;;; There is an incompatibility between versin 3.1.12 and lower versions.
+;;; There is an incompatibility between version 3.1.12 and lower versions.
(defconst ispell-required-version '("3.1." 12)
"Ispell versions with which this version of ispell.el is known to work.")
(defvar ispell-offset 1
(defvar ispell-skip-sgml nil
"Skips spell checking of SGML tags and entity references when non-nil.
-This variable is set when major-mode is sgml-mode.")
+This variable is set when major-mode is sgml-mode or html-mode.")
-;;;###autoload
(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.
(not (boundp 'epoch::version))
(defalias 'ispell 'ispell-buffer))
-;;;###autoload (define-key global-map "\M-$" 'ispell-word)
+;;;###autoload
+(define-key global-map "\M-$" 'ispell-word)
;;;###autoload
(defun ispell-word (&optional following quietly continue)
;; setup the *Choices* buffer with valid data.
(save-excursion
(set-buffer (get-buffer-create ispell-choices-buffer))
- (setq mode-line-format "-- %b --")
+ (setq mode-line-format (concat "-- %b -- word: " word))
(erase-buffer)
(if guess
(progn
(erase-buffer)
(setq count ?0
skipped 0
- mode-line-format "-- %b --"
+ mode-line-format (concat
+ "-- %b -- word: "
+ new-word)
miss (lookup-words new-word)
choices miss)
(while (and choices ; adjust choices window.
nil))
-;;; ispell-change-dictionary is set in some people's hooks. Maybe it should
+;;; ispell-change-dictionary is set in some people's hooks. Maybe this should
;;; call ispell-init-process rather than wait for a spell checking command?
;;;###autoload
(concat "Ispell misalignment: word "
"`%s' point %d; please retry")
(car poss) word-start))
+ (if (not (pos-visible-in-window-p))
+ (sit-for 0))
(if ispell-keep-choices-win
(setq replace
(ispell-command-loop
(setq ispell-minor-mode
(not (or (and (null arg) ispell-minor-mode)
(<= (prefix-numeric-value arg) 0))))
- (set-buffer-modified-p (buffer-modified-p)))
+ (force-mode-line-update))
(defun ispell-minor-check ()
;; Check previous word then continue with the normal binding of this key.
(mapconcat (function identity)
'(
;; Matches postscript files.
- "^%!PS-Adobe-[23].0"
+ "^%!PS-Adobe-[123].0"
;; Matches uuencoded text
"^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM"
;; Matches shell files (esp. auto-decoding)
"^#! /bin/[ck]?sh"
;; Matches context difference listing
"\\(diff -c .*\\)?\n\\*\\*\\* .*\n--- .*\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*"
+ ;; Matches reporter.el bug report
+ "^current state:\n==============\n"
;; Matches "----------------- cut here"
- "^[-=_]+\\s ?cut here")
+ ;; and "------- Start of forwarded message"
+ "^[-=_]+\\s ?\\(cut here\\|Start of forwarded message\\)")
"\\|")
"*End of text which will be checked in ispell-message.
If it is a string, limit at first occurrence of that regular expression.
Otherwise, it must be a function which is called to get the limit.")
+(defvar ispell-message-start-skip
+ (mapconcat (function identity)
+ '(
+ ;; Matches forwarded messages
+ "^---* Forwarded Message"
+ ;; Matches PGP Public Key block
+ "^---*BEGIN PGP [A-Z ]*--*"
+ )
+ "\\|")
+ "Spelling is skipped inside these start/end groups by ispell-message.
+Assumed that blocks are not mutually inclusive.")
+
+
+(defvar ispell-message-end-skip
+ (mapconcat (function identity)
+ '(
+ ;; Matches forwarded messages
+ "^--- End of Forwarded Message"
+ ;; Matches PGP Public Key block
+ "^---*END PGP [A-Z ]*--*"
+ )
+ "\\|")
+ "Spelling is skipped inside these start/end groups by ispell-message.
+Assumed that blocks are not mutually inclusive.")
+
+
;;;###autoload
(defun ispell-message ()
"Check the spelling of a mail message or news post.
;; Check the next batch of lines that *aren't* cited.
(end-c (and (re-search-forward cite-regexp-end limit 'end)
(match-beginning 0)))
- ;; skip a forwarded message
+ ;; Skip a block of included text.
(end-fwd (and (goto-char start)
- (re-search-forward "---* Forwarded Message"
- limit 'end)))
+ (re-search-forward ispell-message-start-skip
+ limit 'end)
+ (progn (beginning-of-line)
+ (point))))
(end (or (and end-c end-fwd (min end-c end-fwd))
end-c end-fwd
;; defalut to limit of text.
(if (and end-fwd (= end end-fwd))
(progn
(goto-char end)
- (search-forward "--- End of Forwarded Message" limit 'end))
+ (re-search-forward ispell-message-end-skip limit 'end))
(goto-char end)))))
(set-marker limit nil))))
(eq ispell-parser 'tex))
(process-send-string ispell-process "+\n") ; set ispell mode to tex
(process-send-string ispell-process "-\n")) ; set mode to normal (nroff)
- ;; Hard-wire test for SGML mode.
- (setq ispell-skip-sgml (eq 'sgml-mode major-mode))
+ ;; Hard-wire test for SGML & HTML mode.
+ (setq ispell-skip-sgml (memq major-mode '(sgml-mode html-mode)))
;; Set default extended character mode for given buffer, if any.
(let ((extended-char-mode (ispell-get-extended-character-mode)))
(if extended-char-mode
reg-end)
-(defconst ispell-version "2.36 -- Mon Feb 6 17:39:38 EST 1995")
+(defconst ispell-version "2.37 -- Tue Jun 13 12:05:28 EDT 1995")
(provide 'ispell)