Mercurial > emacs
comparison lisp/textmodes/ispell.el @ 70814:6a91e8b1eea0
(ispell-format-word): Make this the alias for the following variable.
(ispell-format-word-function): Make this the real name.
(ispell-message-text-end): Mark as risky.
author | Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> |
---|---|
date | Sun, 21 May 2006 20:25:43 +0000 |
parents | 5c3e7e42952a |
children | 95f5febb2bb5 a8190f7e546e |
comparison
equal
deleted
inserted
replaced
70813:423563b78756 | 70814:6a91e8b1eea0 |
---|---|
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: |
1593 | 1594 |
1594 ;; At this point it used to ignore 2-letter words. | 1595 ;; At this point it used to ignore 2-letter words. |
1595 ;; But that is silly; if the user asks for it, we should do it. - rms. | 1596 ;; But that is silly; if the user asks for it, we should do it. - rms. |
1596 (or quietly | 1597 (or quietly |
1597 (message "Checking spelling of %s..." | 1598 (message "Checking spelling of %s..." |
1598 (funcall ispell-format-word word))) | 1599 (funcall ispell-format-word-function word))) |
1599 (ispell-send-string "%\n") ; put in verbose mode | 1600 (ispell-send-string "%\n") ; put in verbose mode |
1600 (ispell-send-string (concat "^" word "\n")) | 1601 (ispell-send-string (concat "^" word "\n")) |
1601 ;; wait until ispell has processed word | 1602 ;; wait until ispell has processed word |
1602 (while (progn | 1603 (while (progn |
1603 (ispell-accept-output) | 1604 (ispell-accept-output) |
1609 (error "Ispell and its process have different character maps") | 1610 (error "Ispell and its process have different character maps") |
1610 (setq poss (ispell-parse-output (car ispell-filter))))) | 1611 (setq poss (ispell-parse-output (car ispell-filter))))) |
1611 (cond ((eq poss t) | 1612 (cond ((eq poss t) |
1612 (or quietly | 1613 (or quietly |
1613 (message "%s is correct" | 1614 (message "%s is correct" |
1614 (funcall ispell-format-word word))) | 1615 (funcall ispell-format-word-function word))) |
1615 (and (fboundp 'extent-at) | 1616 (and (fboundp 'extent-at) |
1616 (extent-at start) | 1617 (extent-at start) |
1617 (and (fboundp 'delete-extent) | 1618 (and (fboundp 'delete-extent) |
1618 (delete-extent (extent-at start))))) | 1619 (delete-extent (extent-at start))))) |
1619 ((stringp poss) | 1620 ((stringp poss) |
1620 (or quietly | 1621 (or quietly |
1621 (message "%s is correct because of root %s" | 1622 (message "%s is correct because of root %s" |
1622 (funcall ispell-format-word word) | 1623 (funcall ispell-format-word-function word) |
1623 (funcall ispell-format-word poss))) | 1624 (funcall ispell-format-word-function poss))) |
1624 (and (fboundp 'extent-at) | 1625 (and (fboundp 'extent-at) |
1625 (extent-at start) | 1626 (extent-at start) |
1626 (and (fboundp 'delete-extent) | 1627 (and (fboundp 'delete-extent) |
1627 (delete-extent (extent-at start))))) | 1628 (delete-extent (extent-at start))))) |
1628 ((null poss) (message "Error in ispell process")) | 1629 ((null poss) (message "Error in ispell process")) |
1631 (if (fboundp 'set-extent-property) | 1632 (if (fboundp 'set-extent-property) |
1632 (let ((ext (make-extent start end))) | 1633 (let ((ext (make-extent start end))) |
1633 (set-extent-property ext 'face ispell-highlight-face) | 1634 (set-extent-property ext 'face ispell-highlight-face) |
1634 (set-extent-property ext 'priority 2000))) | 1635 (set-extent-property ext 'priority 2000))) |
1635 (beep) | 1636 (beep) |
1636 (message "%s is incorrect"(funcall ispell-format-word word)))) | 1637 (message "%s is incorrect" |
1638 (funcall ispell-format-word-function word)))) | |
1637 (t ; prompt for correct word. | 1639 (t ; prompt for correct word. |
1638 (save-window-excursion | 1640 (save-window-excursion |
1639 (setq replace (ispell-command-loop | 1641 (setq replace (ispell-command-loop |
1640 (car (cdr (cdr poss))) | 1642 (car (cdr (cdr poss))) |
1641 (car (cdr (cdr (cdr poss)))) | 1643 (car (cdr (cdr (cdr poss)))) |
3357 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)") | 3359 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)") |
3358 "\\|") | 3360 "\\|") |
3359 "*End of text which will be checked in `ispell-message'. | 3361 "*End of text which will be checked in `ispell-message'. |
3360 If it is a string, limit at first occurrence of that regular expression. | 3362 If it is a string, limit at first occurrence of that regular expression. |
3361 Otherwise, it must be a function which is called to get the limit.") | 3363 Otherwise, it must be a function which is called to get the limit.") |
3364 (put 'ispell-message-text-end 'risky-local-variable t) | |
3362 | 3365 |
3363 | 3366 |
3364 (defun ispell-mime-multipartp (&optional limit) | 3367 (defun ispell-mime-multipartp (&optional limit) |
3365 "Return multipart message start boundary or nil if none." | 3368 "Return multipart message start boundary or nil if none." |
3366 ;; caller must ensure `case-fold-search' is set to `t' | 3369 ;; caller must ensure `case-fold-search' is set to `t' |