[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el |
Date: |
Tue, 13 May 2003 21:54:28 -0400 |
Index: emacs/lisp/textmodes/ispell.el
diff -c emacs/lisp/textmodes/ispell.el:1.137
emacs/lisp/textmodes/ispell.el:1.138
*** emacs/lisp/textmodes/ispell.el:1.137 Tue Feb 4 08:30:44 2003
--- emacs/lisp/textmodes/ispell.el Tue May 13 21:54:28 2003
***************
*** 1,6 ****
;;; 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>
--- 1,6 ----
;;; 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>
***************
*** 203,218 ****
(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)
;;; **********************************************************************
--- 203,208 ----
***************
*** 813,819 ****
(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 ()
--- 803,809 ----
(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 ()
***************
*** 841,855 ****
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))
--- 831,841 ----
name load-dict)
(setq ispell-menu-map (make-sparse-keymap "Spell"))
;; add the dictionaries to the bottom of the list.
! (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))
***************
*** 940,946 ****
(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)))
--- 926,932 ----
(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)))
***************
*** 991,997 ****
(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
--- 977,983 ----
(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)
--- 1000,1006 ----
(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)
***************
*** 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.")
--- 1175,1181 ----
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.")
***************
*** 1255,1261 ****
(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)
--- 1241,1247 ----
(insert string)
(if (not (memq cmd cmds-to-defer))
(let (coding-system-for-read coding-system-for-write status)
! (if (or (featurep 'xemacs)
(and (boundp 'enable-multibyte-characters)
enable-multibyte-characters))
(setq coding-system-for-read (ispell-get-coding-system)
***************
*** 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))
--- 2045,2051 ----
(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))))
--- 2062,2070 ----
`window-height'."
(cond ((fboundp 'window-text-height)
(1+ (window-text-height window)))
! ((if (fboundp 'display-graphic-p)
! (display-graphic-p)
! (featurep 'xemacs))
(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!
--- 2116,2122 ----
((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
--- 2124,2140 ----
(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
***************
*** 2229,2235 ****
(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))
--- 2217,2223 ----
(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))
***************
*** 2411,2417 ****
(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)
--- 2399,2405 ----
(marker-position ispell-region-end)))
(let* ((start (point))
(end (save-excursion (end-of-line) (min (point) reg-end)))
! (string (ispell-get-line start end)))
(setq end (point)) ; "end" tracks region retrieved.
(if string ; there is something to spell check!
;; (special start end)
***************
*** 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
--- 2570,2576 ----
;;; Grab the next line of data.
;;; Returns a string with the line data
! (defun ispell-get-line (start end)
(let ((ispell-casechars (ispell-get-casechars))
string)
(cond ; LOOK AT THIS LINE AND SKIP OR PROCESS
***************
*** 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))))
--- 2833,2842 ----
(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))))