33 |
;; To enable Flyspell in text representing computer programs, type |
;; To enable Flyspell in text representing computer programs, type |
34 |
;; M-x flyspell-prog-mode. |
;; M-x flyspell-prog-mode. |
35 |
;; In that mode only text inside comments is checked. |
;; In that mode only text inside comments is checked. |
36 |
;; |
;; |
37 |
;; Note: consider setting the variable ispell-parser to `tex' to |
;; Note: consider setting the variable ispell-parser to `tex' to |
38 |
;; avoid TeX command checking; use `(setq ispell-parser 'tex)'. |
;; avoid TeX command checking; use `(setq ispell-parser 'tex)'. |
39 |
;; |
;; |
40 |
;; Some user variables control the behavior of flyspell. They are |
;; Some user variables control the behavior of flyspell. They are |
41 |
;; those defined under the `User variables' comment. |
;; those defined under the `User variables' comment. |
42 |
|
|
43 |
;;; Code: |
;;; Code: |
44 |
|
|
45 |
(require 'ispell) |
(require 'ispell) |
46 |
|
|
47 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
204 |
:group 'flyspell |
:group 'flyspell |
205 |
:version "21.1" |
:version "21.1" |
206 |
:type 'boolean) |
:type 'boolean) |
207 |
|
|
208 |
;;;###autoload |
;;;###autoload |
209 |
(defcustom flyspell-mode-line-string " Fly" |
(defcustom flyspell-mode-line-string " Fly" |
210 |
"*String displayed on the modeline when flyspell is active. |
"*String displayed on the modeline when flyspell is active. |
423 |
The default flyspell behavior is to highlight incorrect words. |
The default flyspell behavior is to highlight incorrect words. |
424 |
With no argument, this command toggles Flyspell mode. |
With no argument, this command toggles Flyspell mode. |
425 |
With a prefix argument ARG, turn Flyspell minor mode on iff ARG is positive. |
With a prefix argument ARG, turn Flyspell minor mode on iff ARG is positive. |
426 |
|
|
427 |
Bindings: |
Bindings: |
428 |
\\[ispell-word]: correct words (using Ispell). |
\\[ispell-word]: correct words (using Ispell). |
429 |
\\[flyspell-auto-correct-word]: automatically correct word. |
\\[flyspell-auto-correct-word]: automatically correct word. |
473 |
;* For remembering buffers running flyspell */ |
;* For remembering buffers running flyspell */ |
474 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
475 |
(defvar flyspell-buffers nil) |
(defvar flyspell-buffers nil) |
476 |
|
|
477 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
478 |
;* flyspell-minibuffer-p ... */ |
;* flyspell-minibuffer-p ... */ |
479 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
489 |
(ispell-accept-buffer-local-defs) |
(ispell-accept-buffer-local-defs) |
490 |
(if (not (and (eq flyspell-dash-dictionary ispell-dictionary) |
(if (not (and (eq flyspell-dash-dictionary ispell-dictionary) |
491 |
(eq flyspell-dash-local-dictionary ispell-local-dictionary))) |
(eq flyspell-dash-local-dictionary ispell-local-dictionary))) |
492 |
;; the dictionary as changed |
;; the dictionary has changed |
493 |
(progn |
(progn |
494 |
(setq flyspell-dash-dictionary ispell-dictionary) |
(setq flyspell-dash-dictionary ispell-dictionary) |
495 |
(setq flyspell-dash-local-dictionary ispell-local-dictionary) |
(setq flyspell-dash-local-dictionary ispell-local-dictionary) |
768 |
(insert (format " cache-start: %S\n" flyspell-word-cache-start)) |
(insert (format " cache-start: %S\n" flyspell-word-cache-start)) |
769 |
(insert (format " cache-end : %S\n" flyspell-word-cache-end)) |
(insert (format " cache-end : %S\n" flyspell-word-cache-end)) |
770 |
(goto-char (point-max))))) |
(goto-char (point-max))))) |
771 |
|
|
772 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
773 |
;* flyspell-debug-signal-word-checked ... */ |
;* flyspell-debug-signal-word-checked ... */ |
774 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1107 |
(setq flyspell-ispell-casechars-cache ispell-casechars) |
(setq flyspell-ispell-casechars-cache ispell-casechars) |
1108 |
(setq flyspell-casechars-cache ispell-casechars) |
(setq flyspell-casechars-cache ispell-casechars) |
1109 |
flyspell-casechars-cache)))) |
flyspell-casechars-cache)))) |
1110 |
|
|
1111 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1112 |
;* flyspell-get-not-casechars-cache ... */ |
;* flyspell-get-not-casechars-cache ... */ |
1113 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1270 |
;; have to kill the temporary buffer |
;; have to kill the temporary buffer |
1271 |
(kill-buffer flyspell-external-ispell-buffer) |
(kill-buffer flyspell-external-ispell-buffer) |
1272 |
(setq flyspell-external-ispell-buffer nil))) |
(setq flyspell-external-ispell-buffer nil))) |
1273 |
|
|
1274 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1275 |
;* flyspell-large-region ... */ |
;* flyspell-large-region ... */ |
1276 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1459 |
flyspell-overlay-keymap-property-name |
flyspell-overlay-keymap-property-name |
1460 |
flyspell-mouse-map)) |
flyspell-mouse-map)) |
1461 |
flyspell-overlay)) |
flyspell-overlay)) |
1462 |
|
|
1463 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1464 |
;* flyspell-highlight-incorrect-region ... */ |
;* flyspell-highlight-incorrect-region ... */ |
1465 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1481 |
;; now we can use a new overlay |
;; now we can use a new overlay |
1482 |
(setq flyspell-overlay |
(setq flyspell-overlay |
1483 |
(make-flyspell-overlay beg end |
(make-flyspell-overlay beg end |
1484 |
'flyspell-incorrect-face 'highlight)))))) |
'flyspell-incorrect-face |
1485 |
|
'highlight)))))) |
1486 |
|
|
1487 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1488 |
;* flyspell-highlight-duplicate-region ... */ |
;* flyspell-highlight-duplicate-region ... */ |
1679 |
old-max)))))))))) |
old-max)))))))))) |
1680 |
(setq flyspell-auto-correct-pos (point)) |
(setq flyspell-auto-correct-pos (point)) |
1681 |
(ispell-pdict-save t))))) |
(ispell-pdict-save t))))) |
1682 |
|
|
1683 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1684 |
;* flyspell-correct-word ... */ |
;* flyspell-correct-word ... */ |
1685 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1930 |
menu)))) |
menu)))) |
1931 |
|
|
1932 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1933 |
;* Some example functions for real autocorrecting */ |
;* Some example functions for real autocorrecting */ |
1934 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
|
|
|
1935 |
(defun flyspell-maybe-correct-transposition (beg end poss) |
(defun flyspell-maybe-correct-transposition (beg end poss) |
1936 |
"Check replacements for transposed characters. |
"Check replacements for transposed characters. |
1937 |
|
|
2005 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
2006 |
(defun flyspell-change-abbrev (table old new) |
(defun flyspell-change-abbrev (table old new) |
2007 |
(set (abbrev-symbol old table) new)) |
(set (abbrev-symbol old table) new)) |
2008 |
|
|
2009 |
(provide 'flyspell) |
(provide 'flyspell) |
2010 |
|
|
2011 |
;;; flyspell.el ends here |
;;; flyspell.el ends here |