comparison lisp/textmodes/ispell.el @ 90428:a8190f7e546e

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 285-296) - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: admin/FOR-RELEASE: Update refcard section. * gnus--rel--5.10 (patch 102-104) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-64
author Miles Bader <miles@gnu.org>
date Wed, 07 Jun 2006 18:05:10 +0000
parents 146cd8369025 6a91e8b1eea0
children 138027c8c982
comparison
equal deleted inserted replaced
90427:ddb25860d044 90428:a8190f7e546e
414 (defcustom ispell-quietly nil 414 (defcustom ispell-quietly nil
415 "*Non-nil means suppress messages in `ispell-word'." 415 "*Non-nil means suppress messages in `ispell-word'."
416 :type 'boolean 416 :type 'boolean
417 :group 'ispell) 417 :group 'ispell)
418 418
419 (defcustom ispell-format-word (function upcase) 419 (defcustom ispell-format-word-function (function upcase)
420 "*Formatting function for displaying word being spell checked. 420 "*Formatting function for displaying word being spell checked.
421 The function must take one string argument and return a string." 421 The function must take one string argument and return a string."
422 :type 'function 422 :type 'function
423 :group 'ispell) 423 :group 'ispell)
424 (defvaralias 'ispell-format-word 'ispell-format-word-function)
424 425
425 (defcustom ispell-use-framepop-p nil 426 (defcustom ispell-use-framepop-p nil
426 "When non-nil ispell uses framepop to display choices in a dedicated frame. 427 "When non-nil ispell uses framepop to display choices in a dedicated frame.
427 You can set this variable to dynamically use framepop if you are in a 428 You can set this variable to dynamically use framepop if you are in a
428 window system by evaluating the following on startup to set this variable: 429 window system by evaluating the following on startup to set this variable:
1563 1564
1564 ;; At this point it used to ignore 2-letter words. 1565 ;; At this point it used to ignore 2-letter words.
1565 ;; But that is silly; if the user asks for it, we should do it. - rms. 1566 ;; But that is silly; if the user asks for it, we should do it. - rms.
1566 (or quietly 1567 (or quietly
1567 (message "Checking spelling of %s..." 1568 (message "Checking spelling of %s..."
1568 (funcall ispell-format-word word))) 1569 (funcall ispell-format-word-function word)))
1569 (ispell-send-string "%\n") ; put in verbose mode 1570 (ispell-send-string "%\n") ; put in verbose mode
1570 (ispell-send-string (concat "^" word "\n")) 1571 (ispell-send-string (concat "^" word "\n"))
1571 ;; wait until ispell has processed word 1572 ;; wait until ispell has processed word
1572 (while (progn 1573 (while (progn
1573 (ispell-accept-output) 1574 (ispell-accept-output)
1579 (error "Ispell and its process have different character maps") 1580 (error "Ispell and its process have different character maps")
1580 (setq poss (ispell-parse-output (car ispell-filter))))) 1581 (setq poss (ispell-parse-output (car ispell-filter)))))
1581 (cond ((eq poss t) 1582 (cond ((eq poss t)
1582 (or quietly 1583 (or quietly
1583 (message "%s is correct" 1584 (message "%s is correct"
1584 (funcall ispell-format-word word))) 1585 (funcall ispell-format-word-function word)))
1585 (and (fboundp 'extent-at) 1586 (and (fboundp 'extent-at)
1586 (extent-at start) 1587 (extent-at start)
1587 (and (fboundp 'delete-extent) 1588 (and (fboundp 'delete-extent)
1588 (delete-extent (extent-at start))))) 1589 (delete-extent (extent-at start)))))
1589 ((stringp poss) 1590 ((stringp poss)
1590 (or quietly 1591 (or quietly
1591 (message "%s is correct because of root %s" 1592 (message "%s is correct because of root %s"
1592 (funcall ispell-format-word word) 1593 (funcall ispell-format-word-function word)
1593 (funcall ispell-format-word poss))) 1594 (funcall ispell-format-word-function poss)))
1594 (and (fboundp 'extent-at) 1595 (and (fboundp 'extent-at)
1595 (extent-at start) 1596 (extent-at start)
1596 (and (fboundp 'delete-extent) 1597 (and (fboundp 'delete-extent)
1597 (delete-extent (extent-at start))))) 1598 (delete-extent (extent-at start)))))
1598 ((null poss) (message "Error in ispell process")) 1599 ((null poss) (message "Error in ispell process"))
1601 (if (fboundp 'set-extent-property) 1602 (if (fboundp 'set-extent-property)
1602 (let ((ext (make-extent start end))) 1603 (let ((ext (make-extent start end)))
1603 (set-extent-property ext 'face ispell-highlight-face) 1604 (set-extent-property ext 'face ispell-highlight-face)
1604 (set-extent-property ext 'priority 2000))) 1605 (set-extent-property ext 'priority 2000)))
1605 (beep) 1606 (beep)
1606 (message "%s is incorrect"(funcall ispell-format-word word)))) 1607 (message "%s is incorrect"
1608 (funcall ispell-format-word-function word))))
1607 (t ; prompt for correct word. 1609 (t ; prompt for correct word.
1608 (save-window-excursion 1610 (save-window-excursion
1609 (setq replace (ispell-command-loop 1611 (setq replace (ispell-command-loop
1610 (car (cdr (cdr poss))) 1612 (car (cdr (cdr poss)))
1611 (car (cdr (cdr (cdr poss)))) 1613 (car (cdr (cdr (cdr poss))))
3327 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)") 3329 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)")
3328 "\\|") 3330 "\\|")
3329 "*End of text which will be checked in `ispell-message'. 3331 "*End of text which will be checked in `ispell-message'.
3330 If it is a string, limit at first occurrence of that regular expression. 3332 If it is a string, limit at first occurrence of that regular expression.
3331 Otherwise, it must be a function which is called to get the limit.") 3333 Otherwise, it must be a function which is called to get the limit.")
3334 (put 'ispell-message-text-end 'risky-local-variable t)
3332 3335
3333 3336
3334 (defun ispell-mime-multipartp (&optional limit) 3337 (defun ispell-mime-multipartp (&optional limit)
3335 "Return multipart message start boundary or nil if none." 3338 "Return multipart message start boundary or nil if none."
3336 ;; caller must ensure `case-fold-search' is set to `t' 3339 ;; caller must ensure `case-fold-search' is set to `t'