2015-02-04 14:43:47 -05:00
|
|
|
;;; flyspell.el --- On-the-fly spell checker -*- lexical-binding:t -*-
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2021-01-01 01:13:56 -08:00
|
|
|
;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2004-07-24 21:35:56 +00:00
|
|
|
;; Author: Manuel Serrano <Manuel.Serrano@sophia.inria.fr>
|
2019-05-25 13:43:06 -07:00
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
1998-06-26 01:27:40 +00:00
|
|
|
;; Keywords: convenience
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2001-07-16 12:23:00 +00:00
|
|
|
;; This file is part of GNU Emacs.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2008-05-06 04:34:22 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1998-06-26 01:24:05 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 04:34:22 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
;;; Commentary:
|
1998-06-26 01:24:05 +00:00
|
|
|
;;
|
|
|
|
;; Flyspell is a minor Emacs mode performing on-the-fly spelling
|
1998-06-26 01:27:40 +00:00
|
|
|
;; checking.
|
2000-07-24 18:36:17 +00:00
|
|
|
;;
|
2001-01-26 18:52:53 +00:00
|
|
|
;; To enable Flyspell minor mode, type M-x flyspell-mode.
|
1998-08-03 03:27:54 +00:00
|
|
|
;; This applies only to the current buffer.
|
2000-07-24 18:36:17 +00:00
|
|
|
;;
|
|
|
|
;; To enable Flyspell in text representing computer programs, type
|
2001-01-26 18:52:53 +00:00
|
|
|
;; M-x flyspell-prog-mode.
|
2018-07-12 18:59:18 +03:00
|
|
|
;; In that mode only text inside comments and strings is checked.
|
2002-01-29 13:42:12 +00:00
|
|
|
;;
|
1998-06-26 01:24:05 +00:00
|
|
|
;; Some user variables control the behavior of flyspell. They are
|
2018-07-12 18:59:18 +03:00
|
|
|
;; those defined under the `User configuration' comment.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
|
|
|
;;; Code:
|
2002-01-29 13:42:12 +00:00
|
|
|
|
1998-06-26 01:24:05 +00:00
|
|
|
(require 'ispell)
|
2015-02-04 14:43:47 -05:00
|
|
|
(eval-when-compile (require 'cl-lib))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* Group ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defgroup flyspell nil
|
2001-03-26 16:31:20 +00:00
|
|
|
"Spell checking on the fly."
|
1998-06-26 01:24:05 +00:00
|
|
|
:tag "FlySpell"
|
|
|
|
:prefix "flyspell-"
|
2002-02-17 12:15:17 +00:00
|
|
|
:group 'ispell
|
2000-07-24 18:36:17 +00:00
|
|
|
:group 'processes)
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* User configuration ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defcustom flyspell-highlight-flag t
|
2005-11-16 17:00:29 +00:00
|
|
|
"How Flyspell should indicate misspelled words.
|
1998-07-29 03:21:32 +00:00
|
|
|
Non-nil means use highlight, nil means use minibuffer messages."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
1998-07-29 03:21:32 +00:00
|
|
|
(defcustom flyspell-mark-duplications-flag t
|
2005-11-16 17:00:29 +00:00
|
|
|
"Non-nil means Flyspell reports a repeated word as an error.
|
2007-08-31 13:41:31 +00:00
|
|
|
See `flyspell-mark-duplications-exceptions' to add exceptions to this rule.
|
2005-08-15 23:48:30 +00:00
|
|
|
Detection of repeated words is not implemented in
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 18:08:55 -05:00
|
|
|
\"large\" regions; see variable `flyspell-large-region'."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
2018-09-10 15:06:02 +01:00
|
|
|
(defcustom flyspell-case-fold-duplications t
|
|
|
|
"Non-nil means Flyspell matches duplicate words case-insensitively."
|
|
|
|
:type 'boolean
|
2018-09-10 12:17:06 -05:00
|
|
|
:version "27.1")
|
2018-09-10 15:06:02 +01:00
|
|
|
|
2007-08-31 13:41:31 +00:00
|
|
|
(defcustom flyspell-mark-duplications-exceptions
|
2011-04-03 16:59:45 -04:00
|
|
|
'((nil . ("that" "had")) ; Common defaults for English.
|
|
|
|
("\\`francais" . ("nous" "vous")))
|
2007-08-31 13:41:31 +00:00
|
|
|
"A list of exceptions for duplicated words.
|
2011-04-03 16:59:45 -04:00
|
|
|
It should be a list of (LANGUAGE . EXCEPTION-LIST).
|
|
|
|
|
|
|
|
LANGUAGE is nil, which means the exceptions apply regardless of
|
|
|
|
the current dictionary, or a regular expression matching the
|
|
|
|
dictionary name (`ispell-local-dictionary' or
|
|
|
|
`ispell-dictionary') for which the exceptions should apply.
|
|
|
|
|
|
|
|
EXCEPTION-LIST is a list of strings. The checked word is
|
|
|
|
downcased before comparing with these exceptions."
|
|
|
|
:type '(alist :key-type (choice (const :tag "All dictionaries" nil)
|
2019-12-21 18:52:06 +01:00
|
|
|
regexp)
|
2011-04-03 16:59:45 -04:00
|
|
|
:value-type (repeat string))
|
|
|
|
:version "24.1")
|
2007-08-31 13:41:31 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-sort-corrections nil
|
2016-02-29 15:13:30 +11:00
|
|
|
"If non-nil, sort the corrections before popping them.
|
|
|
|
The sorting is controlled by the `flyspell-sort-corrections-function'
|
|
|
|
variable, and defaults to sorting alphabetically."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
2016-02-29 15:13:30 +11:00
|
|
|
(defcustom flyspell-sort-corrections-function
|
|
|
|
'flyspell-sort-corrections-alphabetically
|
|
|
|
"The function used to sort corrections.
|
|
|
|
This only happens if `flyspell-sort-corrections' is non-nil. The
|
|
|
|
function takes three parameters -- the two correction candidates
|
|
|
|
to be sorted, and the third parameter is the word that's being
|
|
|
|
corrected."
|
2016-11-17 00:39:43 +09:00
|
|
|
:version "26.1"
|
2020-08-15 02:43:17 +02:00
|
|
|
:type 'function)
|
2016-02-29 15:13:30 +11:00
|
|
|
|
|
|
|
(defun flyspell-sort-corrections-alphabetically (corr1 corr2 _)
|
|
|
|
(string< corr1 corr2))
|
|
|
|
|
|
|
|
(defun flyspell-sort (corrs word)
|
|
|
|
(if flyspell-sort-corrections
|
|
|
|
(sort corrs
|
|
|
|
(lambda (c1 c2)
|
|
|
|
(funcall flyspell-sort-corrections-function c1 c2 word)))
|
|
|
|
corrs))
|
|
|
|
|
2015-02-12 18:38:11 +01:00
|
|
|
(defcustom flyspell-duplicate-distance 400000
|
2005-11-16 17:00:29 +00:00
|
|
|
"The maximum distance for finding duplicates of unrecognized words.
|
1998-08-08 23:44:03 +00:00
|
|
|
This applies to the feature that when a word is not found in the dictionary,
|
|
|
|
if the same spelling occurs elsewhere in the buffer,
|
2005-06-10 10:46:38 +00:00
|
|
|
Flyspell uses a different face (`flyspell-duplicate') to highlight it.
|
1998-08-08 23:44:03 +00:00
|
|
|
This variable specifies how far to search to find such a duplicate.
|
1998-08-03 03:27:54 +00:00
|
|
|
-1 means no limit (search the whole buffer).
|
1998-08-08 23:44:03 +00:00
|
|
|
0 means do not search for duplicate unrecognized spellings."
|
2015-02-13 13:17:07 -05:00
|
|
|
:version "24.5" ; -1 -> 400000
|
2008-04-06 21:01:50 +00:00
|
|
|
:type '(choice (const :tag "no limit" -1)
|
|
|
|
number))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
|
|
|
(defcustom flyspell-delay 3
|
2005-11-16 17:00:29 +00:00
|
|
|
"The number of seconds to wait before checking, after a \"delayed\" command."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'number)
|
|
|
|
|
|
|
|
(defcustom flyspell-persistent-highlight t
|
2005-11-16 17:00:29 +00:00
|
|
|
"Non-nil means misspelled words remain highlighted until corrected.
|
1998-08-08 06:17:03 +00:00
|
|
|
If this variable is nil, only the most recently detected misspelled word
|
2018-07-12 19:24:06 +03:00
|
|
|
is highlighted, and the highlight is turned off as soon as point moves
|
2018-07-14 10:43:32 +03:00
|
|
|
off the misspelled word.
|
|
|
|
|
|
|
|
Make sure this variable is non-nil if you use `flyspell-region'."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
(defcustom flyspell-highlight-properties t
|
2005-11-16 17:00:29 +00:00
|
|
|
"Non-nil means highlight incorrect words even if a property exists for this word."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
(defcustom flyspell-default-delayed-commands
|
|
|
|
'(self-insert-command
|
|
|
|
delete-backward-char
|
2000-07-24 18:36:17 +00:00
|
|
|
backward-or-forward-delete-char
|
|
|
|
delete-char
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
scrollbar-vertical-drag
|
|
|
|
backward-delete-char-untabify)
|
1998-07-29 03:21:32 +00:00
|
|
|
"The standard list of delayed commands for Flyspell.
|
|
|
|
See `flyspell-delayed-commands'."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
1998-06-26 01:24:05 +00:00
|
|
|
:type '(repeat (symbol)))
|
|
|
|
|
1998-07-29 03:21:32 +00:00
|
|
|
(defcustom flyspell-delayed-commands nil
|
|
|
|
"List of commands that are \"delayed\" for Flyspell mode.
|
1998-08-03 03:27:54 +00:00
|
|
|
After these commands, Flyspell checking is delayed for a short time,
|
|
|
|
whose length is specified by `flyspell-delay'."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type '(repeat (symbol)))
|
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-default-deplacement-commands
|
2012-05-18 15:04:07 -04:00
|
|
|
'(next-line previous-line
|
|
|
|
handle-switch-frame handle-select-window
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 18:08:55 -05:00
|
|
|
scroll-up
|
|
|
|
scroll-down)
|
2000-07-24 18:36:17 +00:00
|
|
|
"The standard list of deplacement commands for Flyspell.
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 18:08:55 -05:00
|
|
|
See variable `flyspell-deplacement-commands'."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2000-07-24 18:36:17 +00:00
|
|
|
:type '(repeat (symbol)))
|
|
|
|
|
|
|
|
(defcustom flyspell-deplacement-commands nil
|
|
|
|
"List of commands that are \"deplacement\" for Flyspell mode.
|
|
|
|
After these commands, Flyspell checking is performed only if the previous
|
|
|
|
command was not the very same command."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2000-07-24 18:36:17 +00:00
|
|
|
:type '(repeat (symbol)))
|
|
|
|
|
1998-06-26 01:24:05 +00:00
|
|
|
(defcustom flyspell-issue-welcome-flag t
|
2005-11-16 17:00:29 +00:00
|
|
|
"Non-nil means that Flyspell should display a welcome message when started."
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
2002-02-02 15:56:45 +00:00
|
|
|
(defcustom flyspell-issue-message-flag t
|
2005-11-16 17:00:29 +00:00
|
|
|
"Non-nil means that Flyspell emits messages when checking words."
|
2002-02-02 15:56:45 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-incorrect-hook nil
|
2005-11-16 17:00:29 +00:00
|
|
|
"List of functions to be called when incorrect words are encountered.
|
2005-09-23 18:29:20 +00:00
|
|
|
Each function is given three arguments. The first two
|
|
|
|
arguments are the beginning and the end of the incorrect region.
|
|
|
|
The third is either the symbol `doublon' or the list
|
2005-06-14 11:36:04 +00:00
|
|
|
of possible corrections as returned by `ispell-parse-output'.
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-09-23 18:29:20 +00:00
|
|
|
If any of the functions return non-nil, the word is not highlighted as
|
2000-07-24 18:36:17 +00:00
|
|
|
incorrect."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2000-07-24 18:36:17 +00:00
|
|
|
:type 'hook)
|
|
|
|
|
2001-11-11 20:12:27 +00:00
|
|
|
(defcustom flyspell-default-dictionary nil
|
2000-07-24 18:36:17 +00:00
|
|
|
"A string that is the name of the default dictionary.
|
2001-01-26 18:52:53 +00:00
|
|
|
This is passed to the `ispell-change-dictionary' when flyspell is started.
|
2001-11-11 20:12:27 +00:00
|
|
|
If the variable `ispell-local-dictionary' or `ispell-dictionary' is non-nil
|
|
|
|
when flyspell is started, the value of that variable is used instead
|
|
|
|
of `flyspell-default-dictionary' to select the default dictionary.
|
|
|
|
Otherwise, if `flyspell-default-dictionary' is nil, it means to use
|
|
|
|
Ispell's ultimate default dictionary."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2001-11-12 08:17:15 +00:00
|
|
|
:type '(choice string (const :tag "Default" nil)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
|
|
|
(defcustom flyspell-tex-command-regexp
|
|
|
|
"\\(\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)"
|
|
|
|
"A string that is the regular expression that matches TeX commands."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2019-12-21 18:52:06 +01:00
|
|
|
:type 'regexp)
|
2000-07-24 18:36:17 +00:00
|
|
|
|
|
|
|
(defcustom flyspell-check-tex-math-command nil
|
2006-11-03 15:11:44 +00:00
|
|
|
"Non-nil means check even inside TeX math environment.
|
2010-08-24 16:58:07 -04:00
|
|
|
TeX math environments are discovered by `texmathp', implemented
|
|
|
|
inside AUCTeX package. That package may be found at
|
2017-09-13 15:52:52 -07:00
|
|
|
URL `https://www.gnu.org/software/auctex/'"
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-dictionaries-that-consider-dash-as-word-delimiter
|
|
|
|
'("francais" "deutsch8" "norsk")
|
|
|
|
"List of dictionary names that consider `-' as word delimiter."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2000-07-24 18:36:17 +00:00
|
|
|
:type '(repeat (string)))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-abbrev-p
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
nil
|
2005-11-16 17:00:29 +00:00
|
|
|
"If non-nil, add correction to abbreviation table."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
1998-06-26 01:24:05 +00:00
|
|
|
:type 'boolean)
|
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-use-global-abbrev-table-p
|
|
|
|
nil
|
2005-11-16 17:00:29 +00:00
|
|
|
"If non-nil, prefer global abbrev table to local abbrev table."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2000-07-24 18:36:17 +00:00
|
|
|
:type 'boolean)
|
2002-01-29 13:42:12 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defcustom flyspell-mode-line-string " Fly"
|
2012-06-02 18:56:09 +08:00
|
|
|
"String displayed on the mode line when flyspell is active.
|
|
|
|
Set this to nil if you don't want a mode line indicator."
|
2002-01-08 23:57:15 +00:00
|
|
|
:type '(choice string (const :tag "None" nil)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
|
|
|
(defcustom flyspell-large-region 1000
|
2005-11-16 17:00:29 +00:00
|
|
|
"The threshold that determines if a region is small.
|
2005-04-08 09:55:48 +00:00
|
|
|
If the region is smaller than this number of characters,
|
|
|
|
`flyspell-region' checks the words sequentially using regular
|
|
|
|
flyspell methods. Else, if the region is large, a new Ispell process is
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
spawned for speed.
|
|
|
|
|
2005-08-15 23:48:30 +00:00
|
|
|
Doubled words are not detected in a large region, because Ispell
|
|
|
|
does not check for them.
|
|
|
|
|
2009-10-17 22:43:13 +00:00
|
|
|
If this variable is nil, all regions are treated as small."
|
2001-01-26 18:52:53 +00:00
|
|
|
:version "21.1"
|
2005-08-15 23:48:30 +00:00
|
|
|
:type '(choice number (const :tag "All small" nil)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2002-02-02 15:56:45 +00:00
|
|
|
(defcustom flyspell-insert-function (function insert)
|
2005-11-16 17:00:29 +00:00
|
|
|
"Function for inserting word by flyspell upon correction."
|
2002-02-02 15:56:45 +00:00
|
|
|
:type 'function)
|
|
|
|
|
|
|
|
(defcustom flyspell-before-incorrect-word-string nil
|
|
|
|
"String used to indicate an incorrect word starting."
|
|
|
|
:type '(choice string (const nil)))
|
|
|
|
|
|
|
|
(defcustom flyspell-after-incorrect-word-string nil
|
|
|
|
"String used to indicate an incorrect word ending."
|
|
|
|
:type '(choice string (const nil)))
|
|
|
|
|
2009-02-24 04:44:19 +00:00
|
|
|
(defvar flyspell-mode-map)
|
|
|
|
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(defcustom flyspell-use-meta-tab t
|
2005-11-16 17:00:29 +00:00
|
|
|
"Non-nil means that flyspell uses M-TAB to correct word."
|
2009-02-24 04:44:19 +00:00
|
|
|
:type 'boolean
|
|
|
|
:initialize 'custom-initialize-default
|
|
|
|
:set (lambda (sym val)
|
|
|
|
(define-key flyspell-mode-map "\M-\t"
|
|
|
|
(if (set sym val)
|
|
|
|
'flyspell-auto-correct-word))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
|
|
|
|
(defcustom flyspell-auto-correct-binding
|
2005-06-06 21:06:19 +00:00
|
|
|
[(control ?\;)]
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
"The key binding for flyspell auto correction."
|
2020-08-15 02:43:17 +02:00
|
|
|
:type 'key-sequence)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* Mode specific options */
|
|
|
|
;;* ------------------------------------------------------------- */
|
|
|
|
;;* Mode specific options enable users to disable flyspell on */
|
|
|
|
;;* certain word depending of the emacs mode. For instance, when */
|
|
|
|
;;* using flyspell with mail-mode add the following expression */
|
2012-09-17 13:41:04 +08:00
|
|
|
;;* in your init file: */
|
2005-11-16 17:00:29 +00:00
|
|
|
;;* (add-hook 'mail-mode */
|
2012-09-17 13:41:04 +08:00
|
|
|
;;* (lambda () (setq flyspell-generic-check-word-predicate */
|
2006-05-21 20:57:08 +00:00
|
|
|
;;* 'mail-mode-flyspell-verify))) */
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
2018-04-20 18:34:39 -04:00
|
|
|
|
|
|
|
(define-obsolete-variable-alias 'flyspell-generic-check-word-p
|
|
|
|
'flyspell-generic-check-word-predicate "25.1")
|
|
|
|
|
2006-05-21 20:57:08 +00:00
|
|
|
(defvar flyspell-generic-check-word-predicate nil
|
1998-06-26 01:24:05 +00:00
|
|
|
"Function providing per-mode customization over which words are flyspelled.
|
1998-07-29 03:21:32 +00:00
|
|
|
Returns t to continue checking, nil otherwise.
|
|
|
|
Flyspell mode sets this variable to whatever is the `flyspell-mode-predicate'
|
|
|
|
property of the major mode name.")
|
2006-05-21 20:57:08 +00:00
|
|
|
(make-variable-buffer-local 'flyspell-generic-check-word-predicate)
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*--- mail mode -------------------------------------------------------*/
|
1998-07-29 03:21:32 +00:00
|
|
|
(put 'mail-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
|
|
|
|
(put 'message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
|
2007-10-29 18:32:32 +00:00
|
|
|
(defvar message-signature-separator)
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun mail-mode-flyspell-verify ()
|
2006-05-21 20:57:08 +00:00
|
|
|
"Function used for `flyspell-generic-check-word-predicate' in Mail mode."
|
2015-02-04 14:43:47 -05:00
|
|
|
(let* ((header-end (save-excursion
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward
|
|
|
|
(concat "^\\(?:"
|
|
|
|
(regexp-quote mail-header-separator)
|
|
|
|
"\\)?$")
|
|
|
|
nil t)
|
|
|
|
(point)))
|
|
|
|
(signature-begin
|
|
|
|
(if (not (boundp 'message-signature-separator))
|
|
|
|
(point-max)
|
|
|
|
(save-excursion
|
|
|
|
(goto-char (point-max))
|
|
|
|
(re-search-backward message-signature-separator
|
|
|
|
(max header-end (- (point) 4000)) t)
|
|
|
|
(point)))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(cond ((< (point) header-end)
|
2001-01-16 14:04:21 +00:00
|
|
|
(and (save-excursion (beginning-of-line)
|
|
|
|
(looking-at "^Subject:"))
|
|
|
|
(> (point) (match-end 0))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
((> (point) signature-begin)
|
2000-12-29 15:14:51 +00:00
|
|
|
nil)
|
|
|
|
(t
|
|
|
|
(save-excursion
|
|
|
|
(beginning-of-line)
|
2005-03-23 14:39:08 +00:00
|
|
|
(not (looking-at "[>}|]\\|To:")))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*--- texinfo mode ----------------------------------------------------*/
|
1998-07-29 03:21:32 +00:00
|
|
|
(put 'texinfo-mode 'flyspell-mode-predicate 'texinfo-mode-flyspell-verify)
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun texinfo-mode-flyspell-verify ()
|
2006-05-21 20:57:08 +00:00
|
|
|
"Function used for `flyspell-generic-check-word-predicate' in Texinfo mode."
|
1998-06-26 01:24:05 +00:00
|
|
|
(save-excursion
|
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
New functions.
(word-move-empty-char-table): New variable.
* etc/NEWS: Mention 'forward-word-strictly' and
'backward-word-strictly'.
* doc/lispref/positions.texi (Word Motion): Document
'find-word-boundary-function-table', 'forward-word-strictly', and
'backward-word-strictly'. (Bug#22560)
* src/syntax.c (syms_of_syntax)
<find-word-boundary-function-table>: Doc fix.
* lisp/wdired.el (wdired-xcase-word):
* lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name)
(texinfo-copy-section-title, texinfo-start-menu-description)
(texinfo-copy-menu-title, texinfo-specific-section-type)
(texinfo-insert-node-lines, texinfo-copy-next-section-title):
* lisp/textmodes/texinfo.el (texinfo-clone-environment)
(texinfo-insert-@end):
* lisp/textmodes/texinfmt.el (texinfo-format-scan)
(texinfo-anchor, texinfo-multitable-widths)
(texinfo-multitable-item):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify):
* lisp/skeleton.el (skeleton-insert):
* lisp/simple.el (count-words):
* lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit)
(vhdl-beginning-of-defun, vhdl-beginning-of-statement-1)
(vhdl-update-sensitivity-list, vhdl-template-block)
(vhdl-template-break, vhdl-template-case, vhdl-template-default)
(vhdl-template-default-indent, vhdl-template-for-loop)
(vhdl-template-if-then-use, vhdl-template-bare-loop)
(vhdl-template-nature, vhdl-template-procedural)
(vhdl-template-process, vhdl-template-selected-signal-asst)
(vhdl-template-type, vhdl-template-variable)
(vhdl-template-while-loop, vhdl-beginning-of-block)
(vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func):
* lisp/progmodes/verilog-mode.el (verilog-backward-sexp)
(verilog-forward-sexp, verilog-beg-of-statement)
(verilog-set-auto-endcomments, verilog-backward-token)
(verilog-do-indent):
* lisp/progmodes/vera-mode.el (vera-guess-basic-syntax)
(vera-indent-block-closing):
* lisp/progmodes/simula.el (simula-context)
(simula-backward-up-level, simula-forward-down-level)
(simula-previous-statement, simula-next-statement)
(simula-skip-comment-backward, simula-calculate-indent)
(simula-find-if, simula-electric-keyword):
* lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p):
* lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-singleton-class-p, ruby-calculate-indent)
(ruby-forward-sexp, ruby-backward-sexp):
* lisp/progmodes/ps-mode.el (ps-run-goto-error):
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function)
(perl-syntax-propertize-special-constructs)
(perl-backward-to-start-of-continued-exp):
* lisp/progmodes/pascal.el (pascal-indent-declaration):
* lisp/progmodes/octave.el (octave-function-file-p):
* lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax):
* lisp/progmodes/js.el (js--forward-function-decl):
* lisp/progmodes/idlwave.el (idlwave-show-begin-check)
(idlwave-beginning-of-block, idlwave-end-of-block)
(idlwave-block-jump-out, idlwave-determine-class):
* lisp/progmodes/icon.el (icon-is-continuation-line)
(icon-backward-to-start-of-continued-exp, end-of-icon-defun):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/f90.el (f90-change-keywords):
* lisp/progmodes/cperl-mode.el (cperl-electric-pod)
(cperl-linefeed, cperl-electric-terminator)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-invert-if-unless):
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur):
* lisp/progmodes/cc-align.el (c-lineup-java-inher):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error)
(ada-adjust-case-skeleton, ada-create-case-exception)
(ada-create-case-exception-substring)
(ada-case-read-exceptions-from-file, ada-after-keyword-p)
(ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end)
(ada-get-indent-if, ada-get-indent-block-start)
(ada-get-indent-loop, ada-get-indent-type)
(ada-search-prev-end-stmt, ada-check-defun-name)
(ada-goto-decl-start, ada-goto-matching-start)
(ada-goto-matching-end, ada-looking-at-semi-or)
(ada-looking-at-semi-private, ada-in-paramlist-p)
(ada-search-ignore-complex-boolean, ada-move-to-start)
(ada-move-to-end, ada-which-function, ada-gen-treat-proc):
* lisp/net/quickurl.el (quickurl-grab-url):
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/mail/rmail.el (rmail-resend):
* lisp/mail/mailabbrev.el (mail-abbrev-complete-alias):
* lisp/mail/mail-extr.el (mail-extract-address-components):
* lisp/json.el (json-read-keyword):
* lisp/files.el (insert-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/completion.el (symbol-under-point, symbol-before-point)
(symbol-before-point-for-complete, next-cdabbrev)
(add-completions-from-c-buffer):
* lisp/cedet/semantic/texi.el (semantic-up-context)
(semantic-beginning-of-context):
* lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables):
use 'forward-word-strictly' and 'backward-word-strictly' instead
of 'forward-word' and 'backward-word'.
[This reapplies commit c1d32a65372c72d7de4808d620eefd3214a8e92a,
which was inadvertently lost by merge commit
c71e7cc113ed0d5f01aaa2e441a3e3c9fbeb9fa5.]
2016-03-21 17:42:35 -07:00
|
|
|
(forward-word-strictly -1)
|
1998-06-26 01:24:05 +00:00
|
|
|
(not (looking-at "@"))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*--- tex mode --------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(put 'tex-mode 'flyspell-mode-predicate 'tex-mode-flyspell-verify)
|
|
|
|
(defun tex-mode-flyspell-verify ()
|
2006-05-21 20:57:08 +00:00
|
|
|
"Function used for `flyspell-generic-check-word-predicate' in LaTeX mode."
|
2000-07-24 18:36:17 +00:00
|
|
|
(and
|
|
|
|
(not (save-excursion
|
2005-12-22 01:51:40 +00:00
|
|
|
(re-search-backward "^[ \t]*%%%[ \t]+Local" nil t)))
|
2000-07-24 18:36:17 +00:00
|
|
|
(not (save-excursion
|
2009-04-16 18:45:20 +00:00
|
|
|
(let ((this (point)))
|
2000-07-24 18:36:17 +00:00
|
|
|
(beginning-of-line)
|
2009-04-16 18:45:20 +00:00
|
|
|
(and (re-search-forward "\\\\\\(cite\\|label\\|ref\\){[^}]*}"
|
|
|
|
(line-end-position) t)
|
|
|
|
(>= this (match-beginning 0))
|
|
|
|
(<= this (match-end 0))))))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*--- sgml mode -------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(put 'sgml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
|
|
|
|
(put 'html-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
|
2008-03-14 10:13:30 +00:00
|
|
|
(put 'nxml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2010-03-22 19:37:11 -07:00
|
|
|
(autoload 'sgml-lexical-context "sgml-mode")
|
2009-11-19 07:27:46 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun sgml-mode-flyspell-verify ()
|
2009-11-16 22:53:21 +00:00
|
|
|
"Function used for `flyspell-generic-check-word-predicate' in SGML mode.
|
|
|
|
Tag and attribute names are not spell checked, everything else is.
|
|
|
|
|
|
|
|
String values of attributes are checked because they can be text
|
|
|
|
like <img alt=\"Some thing.\">."
|
|
|
|
|
|
|
|
(not (memq (car (sgml-lexical-context))
|
|
|
|
'(tag pi))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* Programming mode */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2020-08-27 21:56:26 +02:00
|
|
|
(defcustom flyspell-prog-text-faces
|
2000-11-22 21:05:36 +00:00
|
|
|
'(font-lock-string-face font-lock-comment-face font-lock-doc-face)
|
2020-08-27 21:56:26 +02:00
|
|
|
"Faces corresponding to text in programming-mode buffers."
|
|
|
|
:type '(set (const font-lock-string-face)
|
|
|
|
(const font-lock-comment-face)
|
|
|
|
(const font-lock-doc-face))
|
|
|
|
:version "28.1")
|
2000-11-22 21:05:36 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-generic-progmode-verify ()
|
2006-05-21 20:57:08 +00:00
|
|
|
"Used for `flyspell-generic-check-word-predicate' in programming modes."
|
2019-06-14 13:15:36 -05:00
|
|
|
(unless (eql (point) (point-min))
|
|
|
|
;; (point) is next char after the word. Must check one char before.
|
|
|
|
(let ((f (get-text-property (1- (point)) 'face)))
|
|
|
|
(memq f flyspell-prog-text-faces))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2020-08-27 11:58:27 +02:00
|
|
|
(defvar flyspell--prev-meta-tab-binding nil
|
|
|
|
"Records the binding of M-TAB in effect before flyspell was activated.")
|
2016-01-25 18:31:04 -05:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun flyspell-prog-mode ()
|
|
|
|
"Turn on `flyspell-mode' for comments and strings."
|
|
|
|
(interactive)
|
2006-05-21 20:57:08 +00:00
|
|
|
(setq flyspell-generic-check-word-predicate
|
2015-02-13 22:45:18 -05:00
|
|
|
#'flyspell-generic-progmode-verify)
|
2015-12-31 17:44:07 +02:00
|
|
|
(setq-local flyspell--prev-meta-tab-binding
|
|
|
|
(or (local-key-binding "\M-\t" t)
|
|
|
|
(global-key-binding "\M-\t" t)))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(flyspell-mode 1)
|
|
|
|
(run-hooks 'flyspell-prog-mode-hook))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* Overlay compatibility */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(autoload 'make-overlay "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'overlayp "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'overlays-in "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'delete-overlay "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'overlays-at "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'overlay-put "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'overlay-get "overlay" "Overlay compatibility kit." t)
|
|
|
|
(autoload 'previous-overlay-change "overlay" "Overlay compatibility kit." t)
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* The minor mode declaration. */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-02-20 19:03:33 +00:00
|
|
|
(defvar flyspell-mouse-map
|
2017-04-30 21:55:58 +03:00
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
(define-key map [mouse-2] 'flyspell-correct-word)
|
|
|
|
map)
|
2005-06-28 19:07:45 +00:00
|
|
|
"Keymap for Flyspell to put on erroneous words.")
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-06-06 21:06:19 +00:00
|
|
|
(defvar flyspell-mode-map
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
(if flyspell-use-meta-tab
|
|
|
|
(define-key map "\M-\t" 'flyspell-auto-correct-word))
|
2005-06-28 19:07:45 +00:00
|
|
|
(define-key map flyspell-auto-correct-binding 'flyspell-auto-correct-previous-word)
|
|
|
|
(define-key map [(control ?\,)] 'flyspell-goto-next-error)
|
|
|
|
(define-key map [(control ?\.)] 'flyspell-auto-correct-word)
|
2006-11-11 01:00:10 +00:00
|
|
|
(define-key map [?\C-c ?$] 'flyspell-correct-word-before-point)
|
2005-06-28 19:07:45 +00:00
|
|
|
map)
|
|
|
|
"Minor mode keymap for Flyspell mode--for the whole buffer.")
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2020-08-15 02:53:35 +02:00
|
|
|
;; correct on mouse 3
|
2020-08-18 12:43:16 +02:00
|
|
|
(defun flyspell--set-use-mouse-3-for-menu (var value)
|
2020-08-15 02:53:35 +02:00
|
|
|
(set-default var value)
|
|
|
|
(if value
|
|
|
|
(progn (define-key flyspell-mouse-map [mouse-2] nil)
|
2020-08-18 12:43:16 +02:00
|
|
|
(define-key flyspell-mouse-map [down-mouse-3] 'flyspell-correct-word))
|
2020-08-15 02:53:35 +02:00
|
|
|
(define-key flyspell-mouse-map [mouse-2] 'flyspell-correct-word)
|
2020-08-18 12:43:16 +02:00
|
|
|
(define-key flyspell-mouse-map [down-mouse-3] nil)))
|
2020-08-15 02:53:35 +02:00
|
|
|
|
2020-08-18 12:43:16 +02:00
|
|
|
(defcustom flyspell-use-mouse-3-for-menu nil
|
2020-08-15 02:53:35 +02:00
|
|
|
"Non-nil means to bind `mouse-3' to `flyspell-correct-word'.
|
|
|
|
If this is set, also unbind `mouse-2'."
|
|
|
|
:type 'boolean
|
2020-08-18 12:43:16 +02:00
|
|
|
:set 'flyspell--set-use-mouse-3-for-menu
|
2020-08-15 02:53:35 +02:00
|
|
|
:version "28.1")
|
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
;; dash character machinery
|
|
|
|
(defvar flyspell-consider-dash-as-word-delimiter-flag nil
|
2012-04-09 21:05:48 +08:00
|
|
|
"Non-nil means that the `-' char is considered as a word delimiter.")
|
2000-07-24 18:36:17 +00:00
|
|
|
(make-variable-buffer-local 'flyspell-consider-dash-as-word-delimiter-flag)
|
|
|
|
(defvar flyspell-dash-dictionary nil)
|
|
|
|
(make-variable-buffer-local 'flyspell-dash-dictionary)
|
|
|
|
(defvar flyspell-dash-local-dictionary nil)
|
|
|
|
(make-variable-buffer-local 'flyspell-dash-local-dictionary)
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* Highlighting */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2013-01-09 01:50:40 +02:00
|
|
|
(defface flyspell-incorrect
|
|
|
|
'((((supports :underline (:style wave)))
|
|
|
|
:underline (:style wave :color "Red1"))
|
|
|
|
(t
|
|
|
|
:underline t :inherit error))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-09 00:39:49 +08:00
|
|
|
"Flyspell face for misspelled words."
|
2020-08-15 02:43:17 +02:00
|
|
|
:version "24.4")
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-09 00:39:49 +08:00
|
|
|
|
2013-01-09 01:50:40 +02:00
|
|
|
(defface flyspell-duplicate
|
|
|
|
'((((supports :underline (:style wave)))
|
|
|
|
:underline (:style wave :color "DarkOrange"))
|
|
|
|
(t
|
|
|
|
:underline t :inherit warning))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-09 00:39:49 +08:00
|
|
|
"Flyspell face for words that appear twice in a row.
|
1998-08-08 23:44:03 +00:00
|
|
|
See also `flyspell-duplicate-distance'."
|
2020-08-15 02:43:17 +02:00
|
|
|
:version "24.4")
|
1998-07-29 03:21:32 +00:00
|
|
|
|
1998-06-26 01:24:05 +00:00
|
|
|
(defvar flyspell-overlay nil)
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-mode ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2011-11-24 00:21:03 -08:00
|
|
|
;;;###autoload(defvar flyspell-mode nil "Non-nil if Flyspell mode is enabled.")
|
1998-06-26 01:24:05 +00:00
|
|
|
;;;###autoload
|
2005-06-08 08:14:32 +00:00
|
|
|
(define-minor-mode flyspell-mode
|
2011-10-19 20:26:14 -04:00
|
|
|
"Toggle on-the-fly spell checking (Flyspell mode).
|
|
|
|
|
|
|
|
Flyspell mode is a buffer-local minor mode. When enabled, it
|
|
|
|
spawns a single Ispell process and checks each word. The default
|
|
|
|
flyspell behavior is to highlight incorrect words.
|
2002-01-29 13:42:12 +00:00
|
|
|
|
1998-06-26 01:24:05 +00:00
|
|
|
Bindings:
|
|
|
|
\\[ispell-word]: correct words (using Ispell).
|
|
|
|
\\[flyspell-auto-correct-word]: automatically correct word.
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
\\[flyspell-auto-correct-previous-word]: automatically correct the last misspelled word.
|
|
|
|
\\[flyspell-correct-word] (or down-mouse-2): popup correct words.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
|
|
|
Hooks:
|
2008-04-29 10:55:35 +00:00
|
|
|
This runs `flyspell-mode-hook' after flyspell mode is entered or exit.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
|
|
|
Remark:
|
|
|
|
`flyspell-mode' uses `ispell-mode'. Thus all Ispell options are
|
2008-08-28 11:33:57 +00:00
|
|
|
valid. For instance, a different dictionary can be used by
|
1998-06-26 01:24:05 +00:00
|
|
|
invoking `ispell-change-dictionary'.
|
|
|
|
|
|
|
|
Consider using the `ispell-parser' to check your text. For instance
|
|
|
|
consider adding:
|
2020-09-30 16:02:22 +02:00
|
|
|
\(add-hook \\='tex-mode-hook (lambda () (setq ispell-parser \\='tex)))
|
2012-09-17 13:41:04 +08:00
|
|
|
in your init file.
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2001-11-10 01:20:22 +00:00
|
|
|
\\[flyspell-region] checks all words inside a region.
|
|
|
|
\\[flyspell-buffer] checks the whole buffer."
|
2020-09-19 16:05:55 +02:00
|
|
|
:lighter (flyspell-mode-line-string
|
|
|
|
;; If `flyspell-mode-line-string' is nil, then nothing of
|
|
|
|
;; the following is displayed in the mode line.
|
|
|
|
((:propertize flyspell-mode-line-string)
|
|
|
|
(:propertize
|
|
|
|
(:eval
|
|
|
|
(concat "/" (substring (or ispell-local-dictionary
|
|
|
|
ispell-dictionary
|
|
|
|
"--")
|
|
|
|
0 2)))
|
|
|
|
help-echo "mouse-1: Change dictionary"
|
|
|
|
local-map (keymap
|
|
|
|
(mode-line keymap
|
|
|
|
(mouse-1 . ispell-change-dictionary))))))
|
2005-06-08 08:14:32 +00:00
|
|
|
:keymap flyspell-mode-map
|
|
|
|
:group 'flyspell
|
|
|
|
(if flyspell-mode
|
2010-10-23 14:58:18 -07:00
|
|
|
(condition-case err
|
2020-08-15 02:53:35 +02:00
|
|
|
(progn
|
2020-08-18 12:43:16 +02:00
|
|
|
(when flyspell-use-mouse-3-for-menu
|
|
|
|
(flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t))
|
2020-08-27 11:38:00 +02:00
|
|
|
(flyspell-mode-on (called-interactively-p 'interactive)))
|
2010-10-23 14:58:18 -07:00
|
|
|
(error (message "Error enabling Flyspell mode:\n%s" (cdr err))
|
2007-08-27 16:26:48 +00:00
|
|
|
(flyspell-mode -1)))
|
2005-06-08 08:14:32 +00:00
|
|
|
(flyspell-mode-off)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2006-05-30 18:37:15 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun turn-on-flyspell ()
|
|
|
|
"Unconditionally turn on Flyspell mode."
|
|
|
|
(flyspell-mode 1))
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun turn-off-flyspell ()
|
|
|
|
"Unconditionally turn off Flyspell mode."
|
|
|
|
(flyspell-mode -1))
|
|
|
|
|
|
|
|
(custom-add-option 'text-mode-hook 'turn-on-flyspell)
|
|
|
|
|
2020-08-27 11:58:27 +02:00
|
|
|
(defvar flyspell-buffers nil
|
|
|
|
"For remembering buffers running flyspell")
|
|
|
|
(make-obsolete-variable 'flyspell-buffers "not used." "28.1")
|
2002-01-29 13:42:12 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-minibuffer-p ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-minibuffer-p (buffer)
|
|
|
|
"Is BUFFER a minibuffer?"
|
|
|
|
(let ((ws (get-buffer-window-list buffer t)))
|
|
|
|
(and (consp ws) (window-minibuffer-p (car ws)))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-accept-buffer-local-defs ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2005-11-28 16:44:37 +00:00
|
|
|
(defvar flyspell-last-buffer nil
|
|
|
|
"The buffer in which the last flyspell operation took place.")
|
|
|
|
|
2006-01-05 21:52:16 +00:00
|
|
|
(defun flyspell-accept-buffer-local-defs (&optional force)
|
2005-11-28 16:44:37 +00:00
|
|
|
;; When flyspell-word is used inside a loop (e.g. when processing
|
|
|
|
;; flyspell-changes), the calls to `ispell-accept-buffer-local-defs' end
|
|
|
|
;; up dwarfing everything else, so only do it when the buffer has changed.
|
2006-01-05 21:52:16 +00:00
|
|
|
(when (or force (not (eq flyspell-last-buffer (current-buffer))))
|
2005-11-28 16:44:37 +00:00
|
|
|
(setq flyspell-last-buffer (current-buffer))
|
|
|
|
;; Strange problem: If buffer in current window has font-lock turned on,
|
|
|
|
;; but SET-BUFFER was called to point to an invisible buffer, this ispell
|
|
|
|
;; call will reset the buffer to the buffer in the current window.
|
|
|
|
;; However, it only happens at startup (fix by Albert L. Ting).
|
|
|
|
(save-current-buffer
|
|
|
|
(ispell-accept-buffer-local-defs))
|
|
|
|
(unless (and (eq flyspell-dash-dictionary ispell-dictionary)
|
|
|
|
(eq flyspell-dash-local-dictionary ispell-local-dictionary))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
;; The dictionary has changed
|
2005-11-28 16:44:37 +00:00
|
|
|
(setq flyspell-dash-dictionary ispell-dictionary)
|
|
|
|
(setq flyspell-dash-local-dictionary ispell-local-dictionary)
|
|
|
|
(setq flyspell-consider-dash-as-word-delimiter-flag
|
|
|
|
(member (or ispell-local-dictionary ispell-dictionary)
|
|
|
|
flyspell-dictionaries-that-consider-dash-as-word-delimiter)))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2006-12-09 13:02:32 +00:00
|
|
|
(defun flyspell-hack-local-variables-hook ()
|
|
|
|
;; When local variables are loaded, see if the dictionary context
|
|
|
|
;; has changed.
|
|
|
|
(flyspell-accept-buffer-local-defs 'force))
|
|
|
|
|
2006-01-15 05:46:20 +00:00
|
|
|
(defun flyspell-kill-ispell-hook ()
|
|
|
|
(setq flyspell-last-buffer nil)
|
|
|
|
(dolist (buf (buffer-list))
|
2006-01-15 05:47:44 +00:00
|
|
|
(with-current-buffer buf
|
|
|
|
(kill-local-variable 'flyspell-word-cache-word))))
|
2006-01-15 05:46:20 +00:00
|
|
|
|
2006-01-17 16:35:52 +00:00
|
|
|
;; Make sure we flush our caches when needed. Do it here rather than in
|
|
|
|
;; flyspell-mode-on, since flyspell-region may be used without ever turning
|
|
|
|
;; on flyspell-mode.
|
|
|
|
(add-hook 'ispell-kill-ispell-hook 'flyspell-kill-ispell-hook)
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-mode-on ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2020-08-27 07:07:39 +02:00
|
|
|
(defun flyspell-mode-on (&optional show-msg)
|
|
|
|
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead.
|
|
|
|
|
|
|
|
If optional argument SHOW-MSG is non-nil, show a welcome message
|
|
|
|
if `flyspell-issue-message-flag' and `flyspell-issue-welcome-flag'
|
|
|
|
are both non-nil."
|
2008-04-23 20:39:10 +00:00
|
|
|
(ispell-set-spellchecker-params) ; Initialize variables and dicts alists
|
2005-06-10 10:46:38 +00:00
|
|
|
(setq ispell-highlight-face 'flyspell-incorrect)
|
2000-07-24 18:36:17 +00:00
|
|
|
;; local dictionaries setup
|
2005-02-27 10:36:38 +00:00
|
|
|
(or ispell-local-dictionary ispell-dictionary
|
|
|
|
(if flyspell-default-dictionary
|
|
|
|
(ispell-change-dictionary flyspell-default-dictionary)))
|
2000-07-24 18:36:17 +00:00
|
|
|
;; we have to force ispell to accept the local definition or
|
|
|
|
;; otherwise it could be too late, the local dictionary may
|
|
|
|
;; be forgotten!
|
2006-01-05 21:52:16 +00:00
|
|
|
;; Pass the `force' argument for the case where flyspell was active already
|
|
|
|
;; but the buffer's local-defs have been edited.
|
|
|
|
(flyspell-accept-buffer-local-defs 'force)
|
2002-05-08 15:27:26 +00:00
|
|
|
;; we put the `flyspell-delayed' property on some commands
|
1998-06-26 01:24:05 +00:00
|
|
|
(flyspell-delay-commands)
|
2002-05-08 15:27:26 +00:00
|
|
|
;; we put the `flyspell-deplacement' property on some commands
|
2000-07-24 18:36:17 +00:00
|
|
|
(flyspell-deplacement-commands)
|
1998-06-26 01:24:05 +00:00
|
|
|
;; we bound flyspell action to post-command hook
|
1998-08-08 23:44:03 +00:00
|
|
|
(add-hook 'post-command-hook (function flyspell-post-command-hook) t t)
|
1998-06-26 01:24:05 +00:00
|
|
|
;; we bound flyspell action to pre-command hook
|
1998-08-08 23:44:03 +00:00
|
|
|
(add-hook 'pre-command-hook (function flyspell-pre-command-hook) t t)
|
2000-07-24 18:36:17 +00:00
|
|
|
;; we bound flyspell action to after-change hook
|
2005-11-28 16:44:37 +00:00
|
|
|
(add-hook 'after-change-functions 'flyspell-after-change-function nil t)
|
2006-12-09 13:02:32 +00:00
|
|
|
;; we bound flyspell action to hack-local-variables-hook
|
|
|
|
(add-hook 'hack-local-variables-hook
|
|
|
|
(function flyspell-hack-local-variables-hook) t t)
|
2006-05-21 20:57:08 +00:00
|
|
|
;; set flyspell-generic-check-word-predicate based on the major mode
|
1998-07-29 03:21:32 +00:00
|
|
|
(let ((mode-predicate (get major-mode 'flyspell-mode-predicate)))
|
|
|
|
(if mode-predicate
|
2006-05-21 20:57:08 +00:00
|
|
|
(setq flyspell-generic-check-word-predicate mode-predicate)))
|
1998-06-26 01:24:05 +00:00
|
|
|
;; the welcome message
|
2002-02-02 15:56:45 +00:00
|
|
|
(if (and flyspell-issue-message-flag
|
2020-08-27 07:07:39 +02:00
|
|
|
flyspell-issue-welcome-flag
|
|
|
|
show-msg)
|
2020-08-27 06:48:39 +02:00
|
|
|
(let* ((binding (where-is-internal 'flyspell-auto-correct-word
|
|
|
|
nil 'non-ascii))
|
|
|
|
(mouse-button (if flyspell-use-mouse-3-for-menu
|
|
|
|
"Mouse-3" "Mouse-2")))
|
2020-08-27 07:07:39 +02:00
|
|
|
(message (format-message
|
|
|
|
"Welcome to Flyspell. Use %s to correct words."
|
|
|
|
(if binding
|
|
|
|
(format "`%s' or `%s'" (key-description binding) mouse-button)
|
|
|
|
(format "`%s'" mouse-button)))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-delay-commands ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-delay-commands ()
|
1998-09-10 16:07:02 +00:00
|
|
|
"Install the standard set of Flyspell delayed commands."
|
2007-09-26 00:32:27 +00:00
|
|
|
(mapc 'flyspell-delay-command flyspell-default-delayed-commands)
|
2012-05-18 15:04:07 -04:00
|
|
|
(mapc 'flyspell-delay-command flyspell-delayed-commands))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-delay-command ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-delay-command (command)
|
1998-09-10 16:07:02 +00:00
|
|
|
"Set COMMAND to be delayed, for Flyspell.
|
1998-06-26 01:24:05 +00:00
|
|
|
When flyspell `post-command-hook' is invoked because a delayed command
|
2012-05-18 15:04:07 -04:00
|
|
|
has been used, the current word is not immediately checked.
|
1998-07-29 03:21:32 +00:00
|
|
|
It will be checked only after `flyspell-delay' seconds."
|
|
|
|
(interactive "SDelay Flyspell after Command: ")
|
1998-06-26 01:24:05 +00:00
|
|
|
(put command 'flyspell-delayed t))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-deplacement-commands ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-deplacement-commands ()
|
|
|
|
"Install the standard set of Flyspell deplacement commands."
|
2007-09-26 00:32:27 +00:00
|
|
|
(mapc 'flyspell-deplacement-command flyspell-default-deplacement-commands)
|
2012-05-18 15:04:07 -04:00
|
|
|
(mapc 'flyspell-deplacement-command flyspell-deplacement-commands))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-deplacement-command ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-deplacement-command (command)
|
|
|
|
"Set COMMAND that implement cursor movements, for Flyspell.
|
2012-05-18 15:04:07 -04:00
|
|
|
When flyspell `post-command-hook' is invoked because a deplacement command
|
|
|
|
has been used, the current word is not checked."
|
2000-07-24 18:36:17 +00:00
|
|
|
(interactive "SDeplacement Flyspell after Command: ")
|
|
|
|
(put command 'flyspell-deplacement t))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-word-cache ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defvar flyspell-word-cache-start nil)
|
|
|
|
(defvar flyspell-word-cache-end nil)
|
|
|
|
(defvar flyspell-word-cache-word nil)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(defvar flyspell-word-cache-result '_)
|
1998-06-26 01:24:05 +00:00
|
|
|
(make-variable-buffer-local 'flyspell-word-cache-start)
|
|
|
|
(make-variable-buffer-local 'flyspell-word-cache-end)
|
|
|
|
(make-variable-buffer-local 'flyspell-word-cache-word)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(make-variable-buffer-local 'flyspell-word-cache-result)
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* The flyspell pre-hook, store the current position. In the */
|
|
|
|
;;* post command hook, we will check, if the word at this position */
|
|
|
|
;;* has to be spell checked. */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2012-05-18 15:04:07 -04:00
|
|
|
(defvar flyspell-pre-buffer nil "Buffer current before `this-command'.")
|
|
|
|
(defvar flyspell-pre-point nil "Point before running `this-command'")
|
|
|
|
(defvar flyspell-pre-column nil "Column before running `this-command'")
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-pre-pre-buffer nil)
|
|
|
|
(defvar flyspell-pre-pre-point nil)
|
2012-05-18 15:04:07 -04:00
|
|
|
(make-variable-buffer-local 'flyspell-pre-point) ;Why?? --Stef
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-previous-command ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-previous-command nil
|
|
|
|
"The last interactive command checked by Flyspell.")
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-pre-command-hook ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-pre-command-hook ()
|
1998-07-29 03:21:32 +00:00
|
|
|
"Save the current buffer and point for Flyspell's post-command hook."
|
1998-06-26 01:24:05 +00:00
|
|
|
(interactive)
|
|
|
|
(setq flyspell-pre-buffer (current-buffer))
|
2000-07-24 18:36:17 +00:00
|
|
|
(setq flyspell-pre-point (point))
|
|
|
|
(setq flyspell-pre-column (current-column)))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-mode-off ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-09-10 16:07:02 +00:00
|
|
|
;;;###autoload
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-mode-off ()
|
1998-09-10 16:07:02 +00:00
|
|
|
"Turn Flyspell mode off."
|
2012-05-18 15:04:07 -04:00
|
|
|
;; We remove the hooks.
|
1998-08-08 23:44:03 +00:00
|
|
|
(remove-hook 'post-command-hook (function flyspell-post-command-hook) t)
|
|
|
|
(remove-hook 'pre-command-hook (function flyspell-pre-command-hook) t)
|
2005-11-28 16:44:37 +00:00
|
|
|
(remove-hook 'after-change-functions 'flyspell-after-change-function t)
|
2006-12-09 13:02:32 +00:00
|
|
|
(remove-hook 'hack-local-variables-hook
|
|
|
|
(function flyspell-hack-local-variables-hook) t)
|
2012-05-18 15:04:07 -04:00
|
|
|
;; We remove all the flyspell highlightings.
|
1998-06-26 01:24:05 +00:00
|
|
|
(flyspell-delete-all-overlays)
|
2012-05-18 15:04:07 -04:00
|
|
|
;; We have to erase pre cache variables.
|
1998-06-26 01:24:05 +00:00
|
|
|
(setq flyspell-pre-buffer nil)
|
|
|
|
(setq flyspell-pre-point nil)
|
2012-05-18 15:04:07 -04:00
|
|
|
;; We mark the mode as killed.
|
1998-06-26 01:24:05 +00:00
|
|
|
(setq flyspell-mode nil))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-check-pre-word-p ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-check-pre-word-p ()
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
"Return non-nil if we should check the word before point.
|
1998-07-29 03:21:32 +00:00
|
|
|
More precisely, it applies to the word that was before point
|
|
|
|
before the current command."
|
2012-05-18 09:04:04 +02:00
|
|
|
(let ((ispell-otherchars (ispell-get-otherchars)))
|
|
|
|
(cond
|
2012-05-18 15:04:07 -04:00
|
|
|
((not (and (numberp flyspell-pre-point)
|
2013-04-17 20:03:46 +02:00
|
|
|
(eq flyspell-pre-buffer (current-buffer))))
|
2012-05-18 09:04:04 +02:00
|
|
|
nil)
|
|
|
|
((and (eq flyspell-pre-pre-point flyspell-pre-point)
|
|
|
|
(eq flyspell-pre-pre-buffer flyspell-pre-buffer))
|
|
|
|
nil)
|
|
|
|
((or (and (= flyspell-pre-point (- (point) 1))
|
|
|
|
(or (eq (char-syntax (char-after flyspell-pre-point)) ?w)
|
|
|
|
(and (not (string= "" ispell-otherchars))
|
2012-05-28 18:11:15 +02:00
|
|
|
(string-match
|
2012-05-18 09:04:04 +02:00
|
|
|
ispell-otherchars
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
flyspell-pre-point (1+ flyspell-pre-point))))))
|
|
|
|
(= flyspell-pre-point (point))
|
|
|
|
(= flyspell-pre-point (+ (point) 1)))
|
|
|
|
nil)
|
|
|
|
((and (symbolp this-command)
|
|
|
|
(not executing-kbd-macro)
|
|
|
|
(or (get this-command 'flyspell-delayed)
|
|
|
|
(and (get this-command 'flyspell-deplacement)
|
|
|
|
(eq flyspell-previous-command this-command)))
|
|
|
|
(or (= (current-column) 0)
|
|
|
|
(= (current-column) flyspell-pre-column)
|
|
|
|
;; If other post-command-hooks change the buffer,
|
|
|
|
;; flyspell-pre-point can lie past eob (bug#468).
|
|
|
|
(null (char-after flyspell-pre-point))
|
|
|
|
(or (eq (char-syntax (char-after flyspell-pre-point)) ?w)
|
|
|
|
(and (not (string= "" ispell-otherchars))
|
2012-05-28 18:11:15 +02:00
|
|
|
(string-match
|
2012-05-18 09:04:04 +02:00
|
|
|
ispell-otherchars
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
flyspell-pre-point (1+ flyspell-pre-point)))))))
|
|
|
|
nil)
|
|
|
|
((not (eq (current-buffer) flyspell-pre-buffer))
|
|
|
|
t)
|
|
|
|
((not (and (numberp flyspell-word-cache-start)
|
|
|
|
(numberp flyspell-word-cache-end)))
|
|
|
|
t)
|
|
|
|
(t
|
|
|
|
(or (< flyspell-pre-point flyspell-word-cache-start)
|
|
|
|
(> flyspell-pre-point flyspell-word-cache-end))))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* The flyspell after-change-hook, store the change position. In */
|
|
|
|
;;* the post command hook, we will check, if the word at this */
|
|
|
|
;;* position has to be spell checked. */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-changes nil)
|
2005-11-28 16:44:37 +00:00
|
|
|
(make-variable-buffer-local 'flyspell-changes)
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-after-change-function ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2015-02-04 14:43:47 -05:00
|
|
|
(defun flyspell-after-change-function (start stop _len)
|
2000-07-24 18:36:17 +00:00
|
|
|
"Save the current buffer and point for Flyspell's post-command hook."
|
2005-11-28 16:44:37 +00:00
|
|
|
(push (cons start stop) flyspell-changes))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-check-changed-word-p ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-check-changed-word-p (start stop)
|
2012-05-18 15:04:07 -04:00
|
|
|
"Return non-nil when the changed word has to be checked.
|
2000-07-24 18:36:17 +00:00
|
|
|
The answer depends of several criteria.
|
|
|
|
Mostly we check word delimiters."
|
2012-05-18 15:04:07 -04:00
|
|
|
(not (and (not (and (memq (char-after start) '(?\n ? )) (> stop start)))
|
|
|
|
(numberp flyspell-pre-point)
|
|
|
|
(or
|
|
|
|
(and (>= flyspell-pre-point start) (<= flyspell-pre-point stop))
|
|
|
|
(let ((pos (point)))
|
|
|
|
(or (>= pos start) (<= pos stop) (= pos (1+ stop))))))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-check-word-p ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-check-word-p ()
|
|
|
|
"Return t when the word at `point' has to be checked.
|
|
|
|
The answer depends of several criteria.
|
|
|
|
Mostly we check word delimiters."
|
2012-05-18 09:04:04 +02:00
|
|
|
(let ((ispell-otherchars (ispell-get-otherchars)))
|
2000-07-24 18:36:17 +00:00
|
|
|
(cond
|
2012-05-18 09:04:04 +02:00
|
|
|
((<= (- (point-max) 1) (point-min))
|
2012-05-18 15:04:07 -04:00
|
|
|
;; The buffer is not filled enough.
|
2012-05-18 09:04:04 +02:00
|
|
|
nil)
|
|
|
|
((and (and (> (current-column) 0)
|
|
|
|
(not (eq (current-column) flyspell-pre-column)))
|
|
|
|
(save-excursion
|
|
|
|
(backward-char 1)
|
|
|
|
(and (looking-at (flyspell-get-not-casechars))
|
|
|
|
(or (string= "" ispell-otherchars)
|
2012-05-18 09:36:09 +02:00
|
|
|
(not (looking-at ispell-otherchars)))
|
2012-05-18 09:04:04 +02:00
|
|
|
(or flyspell-consider-dash-as-word-delimiter-flag
|
|
|
|
(not (looking-at "-"))))))
|
2012-05-18 15:04:07 -04:00
|
|
|
;; Yes because we have reached or typed a word delimiter.
|
2012-05-18 09:04:04 +02:00
|
|
|
t)
|
|
|
|
((symbolp this-command)
|
|
|
|
(cond
|
|
|
|
((get this-command 'flyspell-deplacement)
|
|
|
|
(not (eq flyspell-previous-command this-command)))
|
|
|
|
((get this-command 'flyspell-delayed)
|
2012-05-18 15:04:07 -04:00
|
|
|
;; The current command is not delayed, that
|
|
|
|
;; is that we must check the word now.
|
2012-05-18 09:04:04 +02:00
|
|
|
(and (not unread-command-events)
|
|
|
|
(sit-for flyspell-delay)))
|
|
|
|
(t t)))
|
|
|
|
(t t))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-debug-signal-no-check ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-debug-signal-no-check (msg obj)
|
|
|
|
(setq debug-on-error t)
|
2005-11-16 17:00:29 +00:00
|
|
|
(with-current-buffer (get-buffer-create "*flyspell-debug*")
|
|
|
|
(erase-buffer)
|
|
|
|
(insert "NO-CHECK:\n")
|
|
|
|
(insert (format " %S : %S\n" msg obj))))
|
|
|
|
|
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-debug-signal-pre-word-checked ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-debug-signal-pre-word-checked ()
|
|
|
|
(setq debug-on-error t)
|
2005-11-16 17:00:29 +00:00
|
|
|
(with-current-buffer (get-buffer-create "*flyspell-debug*")
|
|
|
|
(insert "PRE-WORD:\n")
|
|
|
|
(insert (format " pre-point : %S\n" flyspell-pre-point))
|
|
|
|
(insert (format " pre-buffer : %S\n" flyspell-pre-buffer))
|
|
|
|
(insert (format " cache-start: %S\n" flyspell-word-cache-start))
|
|
|
|
(insert (format " cache-end : %S\n" flyspell-word-cache-end))
|
|
|
|
(goto-char (point-max))))
|
|
|
|
|
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-debug-signal-word-checked ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-debug-signal-word-checked ()
|
|
|
|
(setq debug-on-error t)
|
2012-05-18 09:04:04 +02:00
|
|
|
(let ((ispell-otherchars (ispell-get-otherchars))
|
|
|
|
(oldbuf (current-buffer))
|
2005-11-16 17:00:29 +00:00
|
|
|
(point (point)))
|
|
|
|
(with-current-buffer (get-buffer-create "*flyspell-debug*")
|
2012-05-18 15:04:07 -04:00
|
|
|
(insert
|
|
|
|
"WORD:\n"
|
|
|
|
(format " this-cmd : %S\n" this-command)
|
|
|
|
(format " delayed : %S\n" (and (symbolp this-command)
|
|
|
|
(get this-command
|
|
|
|
'flyspell-delayed)))
|
|
|
|
(format " point : %S\n" point)
|
|
|
|
(format " prev-char : [%c] %S\n"
|
|
|
|
(with-current-buffer oldbuf
|
|
|
|
(if (bobp) ?\ (char-before)))
|
|
|
|
(with-current-buffer oldbuf
|
|
|
|
(if (bobp)
|
|
|
|
nil
|
|
|
|
(save-excursion
|
|
|
|
(backward-char 1)
|
|
|
|
(and (looking-at (flyspell-get-not-casechars))
|
|
|
|
(or (string= "" ispell-otherchars)
|
|
|
|
(not (looking-at ispell-otherchars)))
|
|
|
|
(or flyspell-consider-dash-as-word-delimiter-flag
|
Fix regular-expression glitches and typos
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00085.html
* admin/admin.el (set-version):
* lisp/allout.el (allout-latexify-one-item):
* lisp/arc-mode.el (archive-arc-rename-entry)
(archive-rar-summarize):
* lisp/calc/calc-graph.el (calc-graph-set-styles)
(calc-graph-hide):
* lisp/calc/calc-help.el (calc-describe-key):
* lisp/calc/calc-lang.el (math-compose-tex-func, eqn):
* lisp/calc/calc.el (calcDigit-key):
* lisp/cedet/ede/makefile-edit.el (makefile-macro-file-list):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/comint.el (comint-substitute-in-file-name):
* lisp/dired.el (dired-actual-switches):
* lisp/emacs-lisp/chart.el (chart-rmail-from):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/rx.el (rx-not, rx-atomic-p):
* lisp/emulation/viper-ex.el (viper-get-ex-token)
(viper-get-ex-pat, ex-set-read-variable):
* lisp/epg.el (epg--status-SIG_CREATED):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-user):
(erc-speedbar-expand-channel, erc-speedbar-expand-server)
* lisp/erc/erc.el (erc-is-message-ctcp-and-not-action-p)
(erc-banlist-update):
* lisp/eshell/em-dirs.el (eshell-parse-drive-letter, eshell/pwd):
* lisp/find-dired.el (find-dired):
* lisp/frame.el (frame-set-background-mode):
* lisp/generic-x.el (apache-log-generic-mode):
* lisp/gnus/gnus-art.el (gnus-button-valid-localpart-regexp):
* lisp/gnus/gnus.el (gnus-short-group-name):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/ibuffer.el (ibuffer-fontification-alist):
* lisp/ido.el (ido-set-matches-1):
* lisp/info-xref.el (info-xref-lock-file-p):
* lisp/info.el (Info-dir-remove-duplicates)
(Info-unescape-quotes, Info-split-parameter-string)
(Info-speedbar-expand-node):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/language/ethio-util.el (ethio-fidel-to-tex-buffer):
* lisp/mail/rmail.el (rmail-collect-deleted):
* lisp/mh-e/mh-alias.el (mh-alias-suggest-alias):
* lisp/mh-e/mh-comp.el (mh-forward):
* lisp/mh-e/mh-search.el (mh-index-next-folder)
(mh-index-create-imenu-index):
* lisp/mh-e/mh-xface.el (mh-picon-get-image):
* lisp/minibuffer.el (completion--embedded-envvar-re):
* lisp/net/ange-ftp.el (ange-ftp-ls-parser):
* lisp/net/goto-addr.el (goto-address-mail-regexp)
(goto-address-find-address-at-point):
* lisp/net/pop3.el (pop3-read-response, pop3-user)
(pop3-pass, pop3-apop):
* lisp/net/tramp.el (tramp-ipv6-regexp)
(tramp-replace-environment-variables):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/nxml/rng-uri.el (rng-uri-escape-multibyte):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-any-uri):
* lisp/obsolete/pgg.el (pgg-fetch-key):
* lisp/obsolete/vip.el (vip-get-ex-token):
* lisp/org/ob-core.el (org-babel-string-read):
* lisp/org/org-agenda.el:
(org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org/org-element.el (org-element-keyword-parser):
* lisp/org/org-list.el (org-list-indent-item-generic):
* lisp/org/org-mhe.el (org-mhe-get-message-folder-from-index):
* lisp/org/org-mobile.el (org-mobile-apply):
* lisp/org/org-mouse.el (org-mouse-context-menu):
* lisp/org/org-plot.el (org-plot/gnuplot):
* lisp/org/org-protocol.el (org-protocol-flatten-greedy):
* lisp/org/org-table.el (org-table-copy-down)
(org-table-formula-make-cmp-string)
(org-table-get-stored-formulas, org-table-recalculate)
(org-table-edit-formulas):
* lisp/org/org.el (org-translate-link-from-planner)
(org-fill-line-break-nobreak-p):
* lisp/org/ox-ascii.el (org-ascii-item):
* lisp/org/ox-latex.el (org-latex-clean-invalid-line-breaks):
* lisp/org/ox.el (org-export-expand-include-keyword):
* lisp/progmodes/ada-xref.el (ada-treat-cmd-string):
* lisp/progmodes/cfengine.el (cfengine2-font-lock-keywords):
* lisp/progmodes/cperl-mode.el (cperl-to-comment-or-eol)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-have-help-regexp, cperl-word-at-point-hard)
(cperl-make-regexp-x):
* lisp/progmodes/dcl-mode.el (dcl-option-value-offset):
* lisp/progmodes/etags.el (tag-implicit-name-match-p):
* lisp/progmodes/fortran.el (fortran-fill):
* lisp/progmodes/gdb-mi.el (gdb-speedbar-expand-node)
(gdb-locals-handler-custom):
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
* lisp/progmodes/gud.el (gud-jdb-find-source-using-classpath):
* lisp/progmodes/js.el (js--continued-expression-p):
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords):
* lisp/progmodes/meta-mode.el (meta-indent-level-count):
* lisp/progmodes/mixal-mode.el (mixal-font-lock-keywords):
* lisp/progmodes/opascal.el (opascal-find-unit-in-directory):
* lisp/progmodes/pascal.el (pascal-progbeg-re):
* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re)
(ruby-expr-beg, ruby-parse-partial)
(ruby-toggle-string-quotes, ruby-font-lock-keywords):
* lisp/progmodes/sql.el (sql--make-help-docstring):
* lisp/progmodes/verilog-mode.el (verilog-coverpoint-re)
(verilog-skip-forward-comment-p)
(verilog-read-sub-decls-gate)
(verilog-read-auto-template-middle):
* lisp/progmodes/vhdl-mode.el (vhdl-resolve-env-variable)
(vhdl-speedbar-expand-project, vhdl-speedbar-expand-entity)
(vhdl-speedbar-expand-architecture)
(vhdl-speedbar-expand-config, vhdl-speedbar-expand-package)
(vhdl-speedbar-dired):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
* lisp/textmodes/flyspell.el (flyspell-debug-signal-word-checked):
* lisp/textmodes/ispell.el (ispell-process-line):
* lisp/textmodes/reftex-cite.el (reftex-end-of-bib-entry):
* lisp/textmodes/reftex-ref.el (reftex-replace-prefix-escapes):
* lisp/url/url-parse.el (url-generic-parse-url):
* lisp/url/url-util.el (url-truncate-url-for-viewing):
* lisp/vc/diff-mode.el (diff-unified->context):
* lisp/vc/vc-bzr.el (vc-bzr-error-regexp-alist):
* lisp/vc/vc-cvs.el (vc-cvs-parse-status):
* lisp/woman.el (woman0-el, woman-if-ignore)
(woman-change-fonts):
* lisp/xdg.el (xdg--substitute-home-env):
Fix regular-expression infelicities and typos.
Fix regular expression typos
Fix typos reported by Mattias Engdegård in:
that occurred in preloaded modules.
* lisp/frame.el (frame-set-background-mode):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/minibuffer.el (completion--embedded-envvar-re):
2019-03-04 18:00:00 -08:00
|
|
|
(not (looking-at "-")))
|
2012-05-18 15:04:07 -04:00
|
|
|
2)))))
|
|
|
|
(format " because : %S\n"
|
|
|
|
(cond
|
|
|
|
((not (and (symbolp this-command)
|
|
|
|
(get this-command 'flyspell-delayed)))
|
|
|
|
;; The current command is not delayed, that
|
|
|
|
;; is that we must check the word now.
|
|
|
|
'not-delayed)
|
|
|
|
((with-current-buffer oldbuf
|
|
|
|
(if (bobp)
|
|
|
|
nil
|
|
|
|
(save-excursion
|
|
|
|
(backward-char 1)
|
|
|
|
(and (looking-at (flyspell-get-not-casechars))
|
|
|
|
(or (string= "" ispell-otherchars)
|
|
|
|
(not (looking-at ispell-otherchars)))
|
|
|
|
(or flyspell-consider-dash-as-word-delimiter-flag
|
Fix regular-expression glitches and typos
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00085.html
* admin/admin.el (set-version):
* lisp/allout.el (allout-latexify-one-item):
* lisp/arc-mode.el (archive-arc-rename-entry)
(archive-rar-summarize):
* lisp/calc/calc-graph.el (calc-graph-set-styles)
(calc-graph-hide):
* lisp/calc/calc-help.el (calc-describe-key):
* lisp/calc/calc-lang.el (math-compose-tex-func, eqn):
* lisp/calc/calc.el (calcDigit-key):
* lisp/cedet/ede/makefile-edit.el (makefile-macro-file-list):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/comint.el (comint-substitute-in-file-name):
* lisp/dired.el (dired-actual-switches):
* lisp/emacs-lisp/chart.el (chart-rmail-from):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/rx.el (rx-not, rx-atomic-p):
* lisp/emulation/viper-ex.el (viper-get-ex-token)
(viper-get-ex-pat, ex-set-read-variable):
* lisp/epg.el (epg--status-SIG_CREATED):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-user):
(erc-speedbar-expand-channel, erc-speedbar-expand-server)
* lisp/erc/erc.el (erc-is-message-ctcp-and-not-action-p)
(erc-banlist-update):
* lisp/eshell/em-dirs.el (eshell-parse-drive-letter, eshell/pwd):
* lisp/find-dired.el (find-dired):
* lisp/frame.el (frame-set-background-mode):
* lisp/generic-x.el (apache-log-generic-mode):
* lisp/gnus/gnus-art.el (gnus-button-valid-localpart-regexp):
* lisp/gnus/gnus.el (gnus-short-group-name):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/ibuffer.el (ibuffer-fontification-alist):
* lisp/ido.el (ido-set-matches-1):
* lisp/info-xref.el (info-xref-lock-file-p):
* lisp/info.el (Info-dir-remove-duplicates)
(Info-unescape-quotes, Info-split-parameter-string)
(Info-speedbar-expand-node):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/language/ethio-util.el (ethio-fidel-to-tex-buffer):
* lisp/mail/rmail.el (rmail-collect-deleted):
* lisp/mh-e/mh-alias.el (mh-alias-suggest-alias):
* lisp/mh-e/mh-comp.el (mh-forward):
* lisp/mh-e/mh-search.el (mh-index-next-folder)
(mh-index-create-imenu-index):
* lisp/mh-e/mh-xface.el (mh-picon-get-image):
* lisp/minibuffer.el (completion--embedded-envvar-re):
* lisp/net/ange-ftp.el (ange-ftp-ls-parser):
* lisp/net/goto-addr.el (goto-address-mail-regexp)
(goto-address-find-address-at-point):
* lisp/net/pop3.el (pop3-read-response, pop3-user)
(pop3-pass, pop3-apop):
* lisp/net/tramp.el (tramp-ipv6-regexp)
(tramp-replace-environment-variables):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/nxml/rng-uri.el (rng-uri-escape-multibyte):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-any-uri):
* lisp/obsolete/pgg.el (pgg-fetch-key):
* lisp/obsolete/vip.el (vip-get-ex-token):
* lisp/org/ob-core.el (org-babel-string-read):
* lisp/org/org-agenda.el:
(org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org/org-element.el (org-element-keyword-parser):
* lisp/org/org-list.el (org-list-indent-item-generic):
* lisp/org/org-mhe.el (org-mhe-get-message-folder-from-index):
* lisp/org/org-mobile.el (org-mobile-apply):
* lisp/org/org-mouse.el (org-mouse-context-menu):
* lisp/org/org-plot.el (org-plot/gnuplot):
* lisp/org/org-protocol.el (org-protocol-flatten-greedy):
* lisp/org/org-table.el (org-table-copy-down)
(org-table-formula-make-cmp-string)
(org-table-get-stored-formulas, org-table-recalculate)
(org-table-edit-formulas):
* lisp/org/org.el (org-translate-link-from-planner)
(org-fill-line-break-nobreak-p):
* lisp/org/ox-ascii.el (org-ascii-item):
* lisp/org/ox-latex.el (org-latex-clean-invalid-line-breaks):
* lisp/org/ox.el (org-export-expand-include-keyword):
* lisp/progmodes/ada-xref.el (ada-treat-cmd-string):
* lisp/progmodes/cfengine.el (cfengine2-font-lock-keywords):
* lisp/progmodes/cperl-mode.el (cperl-to-comment-or-eol)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-have-help-regexp, cperl-word-at-point-hard)
(cperl-make-regexp-x):
* lisp/progmodes/dcl-mode.el (dcl-option-value-offset):
* lisp/progmodes/etags.el (tag-implicit-name-match-p):
* lisp/progmodes/fortran.el (fortran-fill):
* lisp/progmodes/gdb-mi.el (gdb-speedbar-expand-node)
(gdb-locals-handler-custom):
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
* lisp/progmodes/gud.el (gud-jdb-find-source-using-classpath):
* lisp/progmodes/js.el (js--continued-expression-p):
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords):
* lisp/progmodes/meta-mode.el (meta-indent-level-count):
* lisp/progmodes/mixal-mode.el (mixal-font-lock-keywords):
* lisp/progmodes/opascal.el (opascal-find-unit-in-directory):
* lisp/progmodes/pascal.el (pascal-progbeg-re):
* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re)
(ruby-expr-beg, ruby-parse-partial)
(ruby-toggle-string-quotes, ruby-font-lock-keywords):
* lisp/progmodes/sql.el (sql--make-help-docstring):
* lisp/progmodes/verilog-mode.el (verilog-coverpoint-re)
(verilog-skip-forward-comment-p)
(verilog-read-sub-decls-gate)
(verilog-read-auto-template-middle):
* lisp/progmodes/vhdl-mode.el (vhdl-resolve-env-variable)
(vhdl-speedbar-expand-project, vhdl-speedbar-expand-entity)
(vhdl-speedbar-expand-architecture)
(vhdl-speedbar-expand-config, vhdl-speedbar-expand-package)
(vhdl-speedbar-dired):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
* lisp/textmodes/flyspell.el (flyspell-debug-signal-word-checked):
* lisp/textmodes/ispell.el (ispell-process-line):
* lisp/textmodes/reftex-cite.el (reftex-end-of-bib-entry):
* lisp/textmodes/reftex-ref.el (reftex-replace-prefix-escapes):
* lisp/url/url-parse.el (url-generic-parse-url):
* lisp/url/url-util.el (url-truncate-url-for-viewing):
* lisp/vc/diff-mode.el (diff-unified->context):
* lisp/vc/vc-bzr.el (vc-bzr-error-regexp-alist):
* lisp/vc/vc-cvs.el (vc-cvs-parse-status):
* lisp/woman.el (woman0-el, woman-if-ignore)
(woman-change-fonts):
* lisp/xdg.el (xdg--substitute-home-env):
Fix regular-expression infelicities and typos.
Fix regular expression typos
Fix typos reported by Mattias Engdegård in:
that occurred in preloaded modules.
* lisp/frame.el (frame-set-background-mode):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/minibuffer.el (completion--embedded-envvar-re):
2019-03-04 18:00:00 -08:00
|
|
|
(not (looking-at "-")))))))
|
2012-05-18 15:04:07 -04:00
|
|
|
;; Yes because we have reached or typed a word delimiter.
|
|
|
|
'separator)
|
|
|
|
((not (integerp flyspell-delay))
|
|
|
|
;; Yes because the user set up a no-delay configuration.
|
|
|
|
'no-delay)
|
|
|
|
(t
|
|
|
|
'sit-for))))
|
2000-07-24 18:36:17 +00:00
|
|
|
(goto-char (point-max)))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-debug-signal-changed-checked ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-debug-signal-changed-checked ()
|
|
|
|
(setq debug-on-error t)
|
2005-11-16 17:00:29 +00:00
|
|
|
(let ((point (point)))
|
|
|
|
(with-current-buffer (get-buffer-create "*flyspell-debug*")
|
2000-07-24 18:36:17 +00:00
|
|
|
(insert "CHANGED WORD:\n")
|
|
|
|
(insert (format " point : %S\n" point))
|
|
|
|
(goto-char (point-max)))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-post-command-hook ... */
|
|
|
|
;;* ------------------------------------------------------------- */
|
|
|
|
;;* It is possible that we check several words: */
|
|
|
|
;;* 1- the current word is checked if the predicate */
|
|
|
|
;;* FLYSPELL-CHECK-WORD-P is true */
|
|
|
|
;;* 2- the word that used to be the current word before the */
|
|
|
|
;;* THIS-COMMAND is checked if: */
|
|
|
|
;;* a- the previous word is different from the current word */
|
2012-05-18 15:04:07 -04:00
|
|
|
;;* b- the previous word has not just been checked by the */
|
2005-11-16 17:00:29 +00:00
|
|
|
;;* previous FLYSPELL-POST-COMMAND-HOOK */
|
|
|
|
;;* 3- the words changed by the THIS-COMMAND that are neither the */
|
|
|
|
;;* previous word nor the current word */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-post-command-hook ()
|
2011-10-11 22:48:40 -04:00
|
|
|
"The `post-command-hook' used by flyspell to check a word on-the-fly."
|
1998-06-26 01:24:05 +00:00
|
|
|
(interactive)
|
2009-01-16 15:20:49 +00:00
|
|
|
(when flyspell-mode
|
2011-10-11 22:48:40 -04:00
|
|
|
(with-local-quit
|
|
|
|
(let ((command this-command)
|
|
|
|
;; Prevent anything we do from affecting the mark.
|
|
|
|
deactivate-mark)
|
2018-03-14 08:09:50 -07:00
|
|
|
(if (and (eq command 'transpose-chars)
|
|
|
|
flyspell-pre-point)
|
|
|
|
(save-excursion
|
|
|
|
(goto-char (- flyspell-pre-point 1))
|
|
|
|
(flyspell-word)))
|
2011-10-11 22:48:40 -04:00
|
|
|
(if (flyspell-check-pre-word-p)
|
2013-04-17 20:03:46 +02:00
|
|
|
(save-excursion
|
2011-10-11 22:48:40 -04:00
|
|
|
'(flyspell-debug-signal-pre-word-checked)
|
2013-04-17 20:03:46 +02:00
|
|
|
(goto-char flyspell-pre-point)
|
|
|
|
(flyspell-word)))
|
2011-10-11 22:48:40 -04:00
|
|
|
(if (flyspell-check-word-p)
|
|
|
|
(progn
|
|
|
|
'(flyspell-debug-signal-word-checked)
|
|
|
|
;; FIXME: This should be asynchronous!
|
|
|
|
(flyspell-word)
|
|
|
|
;; we remember which word we have just checked.
|
|
|
|
;; this will be used next time we will check a word
|
|
|
|
;; to compare the next current word with the word
|
2012-05-18 15:04:07 -04:00
|
|
|
;; that has been registered in the pre-command-hook
|
2011-10-11 22:48:40 -04:00
|
|
|
;; that is these variables are used within the predicate
|
|
|
|
;; FLYSPELL-CHECK-PRE-WORD-P
|
|
|
|
(setq flyspell-pre-pre-buffer (current-buffer))
|
|
|
|
(setq flyspell-pre-pre-point (point)))
|
2013-04-17 20:03:46 +02:00
|
|
|
(setq flyspell-pre-pre-buffer nil)
|
|
|
|
(setq flyspell-pre-pre-point nil)
|
|
|
|
;; when a word is not checked because of a delayed command
|
|
|
|
;; we do not disable the ispell cache.
|
|
|
|
(when (and (symbolp this-command)
|
2011-10-11 22:48:40 -04:00
|
|
|
(get this-command 'flyspell-delayed))
|
2013-04-17 20:03:46 +02:00
|
|
|
(setq flyspell-word-cache-end -1)
|
|
|
|
(setq flyspell-word-cache-result '_)))
|
2011-10-11 22:48:40 -04:00
|
|
|
(while (and (not (input-pending-p)) (consp flyspell-changes))
|
|
|
|
(let ((start (car (car flyspell-changes)))
|
|
|
|
(stop (cdr (car flyspell-changes))))
|
|
|
|
(if (flyspell-check-changed-word-p start stop)
|
|
|
|
(save-excursion
|
|
|
|
'(flyspell-debug-signal-changed-checked)
|
|
|
|
(goto-char start)
|
|
|
|
(flyspell-word)))
|
|
|
|
(setq flyspell-changes (cdr flyspell-changes))))
|
|
|
|
(setq flyspell-previous-command command)))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-notify-misspell ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
(defun flyspell-notify-misspell (word poss)
|
2000-07-24 18:36:17 +00:00
|
|
|
(let ((replacements (if (stringp poss)
|
|
|
|
poss
|
2016-02-29 15:13:30 +11:00
|
|
|
(flyspell-sort (car (cdr (cdr poss))) word))))
|
2002-02-02 15:56:45 +00:00
|
|
|
(if flyspell-issue-message-flag
|
2005-11-14 04:53:14 +00:00
|
|
|
(message "misspelling `%s' %S" word replacements))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-word-search-backward ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2011-07-01 01:19:45 +02:00
|
|
|
(defun flyspell-word-search-backward (word bound &optional ignore-case)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(save-excursion
|
2015-02-12 18:38:11 +01:00
|
|
|
(let* ((r '())
|
|
|
|
(inhibit-point-motion-hooks t)
|
|
|
|
(flyspell-not-casechars (flyspell-get-not-casechars))
|
|
|
|
(bound (if (and bound
|
|
|
|
(> bound (point-min)))
|
|
|
|
(- bound 1)))
|
|
|
|
(word-re (concat
|
|
|
|
"\\(?:" flyspell-not-casechars "\\|\\`\\)"
|
|
|
|
(regexp-quote word)
|
|
|
|
flyspell-not-casechars))
|
|
|
|
p)
|
|
|
|
(while
|
|
|
|
(and (not r)
|
|
|
|
(setq p
|
|
|
|
(and
|
|
|
|
(re-search-backward word-re bound t)
|
|
|
|
(if (bobp)
|
|
|
|
(point)
|
|
|
|
(forward-char)
|
|
|
|
(point)))))
|
|
|
|
(let ((lw (flyspell-get-word)))
|
|
|
|
(if (and (consp lw)
|
|
|
|
(if ignore-case
|
|
|
|
(string-equal (downcase (car lw)) (downcase word))
|
|
|
|
(string-equal (car lw) word)))
|
|
|
|
(setq r p)
|
|
|
|
(goto-char p))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
r)))
|
2005-06-14 11:36:04 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-word-search-forward ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(defun flyspell-word-search-forward (word bound)
|
|
|
|
(save-excursion
|
2015-02-12 18:38:11 +01:00
|
|
|
(let* ((r '())
|
|
|
|
(inhibit-point-motion-hooks t)
|
|
|
|
(flyspell-not-casechars (flyspell-get-not-casechars))
|
|
|
|
(bound (if (and bound
|
|
|
|
(< bound (point-max)))
|
|
|
|
(+ bound 1)))
|
|
|
|
(word-re (concat flyspell-not-casechars
|
|
|
|
(regexp-quote word)
|
|
|
|
"\\(?:" flyspell-not-casechars "\\|\\'\\)"))
|
|
|
|
p)
|
|
|
|
(while
|
|
|
|
(and (not r)
|
|
|
|
(setq p (and
|
|
|
|
(re-search-forward word-re bound t)
|
|
|
|
(if (eobp)
|
|
|
|
(point)
|
|
|
|
(backward-char)
|
|
|
|
(point)))))
|
|
|
|
(let ((lw (flyspell-get-word)))
|
|
|
|
(if (and (consp lw) (string-equal (car lw) word))
|
|
|
|
(setq r p)
|
|
|
|
(goto-char (1+ p)))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
r)))
|
2005-06-14 11:36:04 +00:00
|
|
|
|
2015-02-13 22:45:18 -05:00
|
|
|
(defvar flyspell-word) ;Backward compatibility; some predicates made use of it!
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-word ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2010-11-10 11:54:43 +01:00
|
|
|
(defun flyspell-word (&optional following known-misspelling)
|
2009-10-17 22:43:13 +00:00
|
|
|
"Spell check a word.
|
|
|
|
If the optional argument FOLLOWING, or, when called interactively
|
|
|
|
`ispell-following-word', is non-nil, checks the following (rather
|
2010-11-10 11:54:43 +01:00
|
|
|
than preceding) word when the cursor is not over a word. If
|
lisp/*.el, src/*.c: Fix typos in docstrings
* lisp/apropos.el (apropos-do-all):
* lisp/auth-source-pass.el (auth-source-pass--select-from-entries):
* lisp/auth-source.el (auth-source-user-or-password):
* lisp/calc/calc-forms.el (math-tzone-names):
* lisp/calendar/diary-lib.el (diary-face-attrs)
(diary-mark-entries-1):
* lisp/cedet/cedet-files.el (cedet-files-list-recursively):
* lisp/cedet/ede.el (ede-constructing, ede-deep-rescan):
* lisp/cedet/ede/cpp-root.el (ede-cpp-root-header-file-p):
* lisp/cedet/ede/proj.el (ede-proj-target-makefile):
* lisp/cedet/inversion.el (inversion-check-version)
(inversion-test):
* lisp/cedet/mode-local.el (mode-local-map-file-buffers):
* lisp/cedet/semantic/complete.el (semantic-displayer-ghost):
* lisp/cedet/semantic/db-find.el (semanticdb-find-translate-path-default):
* lisp/cedet/semantic/db.el (semanticdb-table)
(semanticdb-search-system-databases):
* lisp/cedet/semantic/imenu.el (semantic-imenu-index-directory):
* lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-use-headers-flag):
* lisp/cedet/semantic/lex.el (semantic-lex-make-keyword-table)
(semantic-lex-make-type-table, semantic-lex-debug-analyzers):
* lisp/cedet/semantic/tag-ls.el (semantic-tag-abstract-p)
(semantic-tag-leaf-p, semantic-tag-static-p)
(semantic-tag-prototype-p):
* lisp/dnd.el (dnd-open-remote-file-function, dnd-open-local-file):
* lisp/emacs-lisp/eieio-opt.el (eieio-build-class-alist)
(eieio-read-class, eieio-read-subclass):
* lisp/emacs-lisp/generator.el (cps--replace-variable-references)
(cps--handle-loop-for):
* lisp/erc/erc-dcc.el (erc-dcc-list, erc-dcc-member, erc-dcc-server)
(erc-dcc-auto-mask-p, erc-dcc-get-file, erc-dcc-chat-accept):
* lisp/eshell/em-pred.el (eshell-pred-file-type):
* lisp/faces.el (defined-colors-with-face-attributes):
* lisp/font-core.el (font-lock-mode):
* lisp/frame.el (frame-restack):
* lisp/net/shr.el (shr-image-animate):
* lisp/org/org-agenda.el (org-agenda-change-all-lines)
(org-agenda-today-p):
* lisp/org/org-id.el (org-id-get):
* lisp/org/org.el (org-highlight-latex-and-related)
(org--valid-property-p):
* lisp/org/ox-beamer.el (org-beamer--get-label):
* lisp/org/ox-latex.el (org-latex--caption-above-p):
* lisp/org/ox-odt.el (org-odt--copy-image-file)
(org-odt--copy-formula-file):
* lisp/org/ox.el (org-export-with-timestamps):
* lisp/progmodes/verilog-mode.el (verilog-indent-declaration-macros):
* lisp/ses.el (ses-file-format-extend-parameter-list):
* lisp/term.el (ansi-term):
* lisp/textmodes/bibtex.el (bibtex-no-opt-remove-re)
(bibtex-beginning-of-first-entry, bibtex-autokey-get-title)
(bibtex-read-key, bibtex-initialize):
* lisp/textmodes/flyspell.el (flyspell-word):
* lisp/view.el (view-mode-exit):
* src/composite.c:
* src/floatfns.c (Fisnan): Fix typos in docstrings.
2019-09-19 04:32:25 +02:00
|
|
|
optional argument KNOWN-MISSPELLING is non-nil considers word a
|
2018-02-20 06:22:57 +02:00
|
|
|
misspelling and skips redundant spell-checking step.
|
|
|
|
|
|
|
|
See `flyspell-get-word' for details of how this finds the word to
|
|
|
|
spell-check."
|
2004-11-04 10:20:35 +00:00
|
|
|
(interactive (list ispell-following-word))
|
2008-04-23 20:39:10 +00:00
|
|
|
(ispell-set-spellchecker-params) ; Initialize variables and dicts alists
|
1998-06-26 01:24:05 +00:00
|
|
|
(save-excursion
|
2000-07-24 18:36:17 +00:00
|
|
|
;; use the correct dictionary
|
2001-01-26 18:52:53 +00:00
|
|
|
(flyspell-accept-buffer-local-defs)
|
2000-07-24 18:36:17 +00:00
|
|
|
(let* ((cursor-location (point))
|
2005-11-16 17:00:29 +00:00
|
|
|
(flyspell-word (flyspell-get-word following))
|
2006-09-14 01:19:38 +00:00
|
|
|
start end poss word ispell-filter)
|
2000-07-24 18:36:17 +00:00
|
|
|
(if (or (eq flyspell-word nil)
|
2017-02-16 13:28:56 -08:00
|
|
|
(and (functionp flyspell-generic-check-word-predicate)
|
|
|
|
(not (funcall flyspell-generic-check-word-predicate))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
t
|
1998-06-26 01:24:05 +00:00
|
|
|
(progn
|
2000-07-24 18:36:17 +00:00
|
|
|
;; destructure return flyspell-word info list.
|
|
|
|
(setq start (car (cdr flyspell-word))
|
|
|
|
end (car (cdr (cdr flyspell-word)))
|
|
|
|
word (car flyspell-word))
|
1998-06-26 01:24:05 +00:00
|
|
|
;; before checking in the directory, we check for doublons.
|
|
|
|
(cond
|
2000-07-24 18:36:17 +00:00
|
|
|
((and (or (not (eq ispell-parser 'tex))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(and (> start (point-min))
|
2005-06-06 21:06:19 +00:00
|
|
|
(not (memq (char-after (1- start)) '(?\} ?\\)))))
|
2000-07-24 18:36:17 +00:00
|
|
|
flyspell-mark-duplications-flag
|
2007-08-31 13:41:31 +00:00
|
|
|
(not (catch 'exception
|
2011-04-03 16:59:45 -04:00
|
|
|
(let ((dict (or ispell-local-dictionary
|
|
|
|
ispell-dictionary)))
|
|
|
|
(dolist (except flyspell-mark-duplications-exceptions)
|
|
|
|
(and (or (null (car except))
|
|
|
|
(and (stringp dict)
|
|
|
|
(string-match (car except) dict)))
|
|
|
|
(member (downcase word) (cdr except))
|
|
|
|
(throw 'exception t))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
(save-excursion
|
2006-10-22 21:29:33 +00:00
|
|
|
(goto-char start)
|
|
|
|
(let* ((bound
|
|
|
|
(- start
|
|
|
|
(- end start)
|
2015-07-29 20:52:23 +03:00
|
|
|
(- (save-excursion
|
|
|
|
(skip-chars-backward " \t\n\f")))))
|
2006-10-22 21:29:33 +00:00
|
|
|
(p (when (>= bound (point-min))
|
2018-09-10 15:06:02 +01:00
|
|
|
(flyspell-word-search-backward
|
|
|
|
word bound flyspell-case-fold-duplications))))
|
2006-10-22 21:29:33 +00:00
|
|
|
(and p (/= p start)))))
|
1998-06-26 01:24:05 +00:00
|
|
|
;; yes, this is a doublon
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(flyspell-highlight-incorrect-region start end 'doublon)
|
|
|
|
nil)
|
1998-06-26 01:24:05 +00:00
|
|
|
((and (eq flyspell-word-cache-start start)
|
|
|
|
(eq flyspell-word-cache-end end)
|
|
|
|
(string-equal flyspell-word-cache-word word))
|
|
|
|
;; this word had been already checked, we skip
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
flyspell-word-cache-result)
|
1998-06-26 01:24:05 +00:00
|
|
|
((and (eq ispell-parser 'tex)
|
2000-07-24 18:36:17 +00:00
|
|
|
(flyspell-tex-command-p flyspell-word))
|
1998-06-26 01:24:05 +00:00
|
|
|
;; this is a correct word (because a tex command)
|
|
|
|
(flyspell-unhighlight-at start)
|
|
|
|
(if (> end start)
|
|
|
|
(flyspell-unhighlight-at (- end 1)))
|
|
|
|
t)
|
|
|
|
(t
|
|
|
|
;; we setup the cache
|
|
|
|
(setq flyspell-word-cache-start start)
|
|
|
|
(setq flyspell-word-cache-end end)
|
|
|
|
(setq flyspell-word-cache-word word)
|
|
|
|
;; now check spelling of word.
|
2010-11-10 11:54:43 +01:00
|
|
|
(if (not known-misspelling)
|
|
|
|
(progn
|
|
|
|
(ispell-send-string "%\n")
|
|
|
|
;; put in verbose mode
|
|
|
|
(ispell-send-string (concat "^" word "\n"))
|
|
|
|
;; we mark the ispell process so it can be killed
|
|
|
|
;; when emacs is exited without query
|
2016-12-17 19:06:34 +00:00
|
|
|
(set-process-query-on-exit-flag ispell-process nil)
|
2011-10-11 22:48:40 -04:00
|
|
|
;; Wait until ispell has processed word.
|
|
|
|
(while (progn
|
|
|
|
(accept-process-output ispell-process)
|
|
|
|
(not (string= "" (car ispell-filter)))))
|
2010-11-10 11:54:43 +01:00
|
|
|
;; (ispell-send-string "!\n")
|
|
|
|
;; back to terse mode.
|
|
|
|
;; Remove leading empty element
|
|
|
|
(setq ispell-filter (cdr ispell-filter))
|
|
|
|
;; ispell process should return something after word is sent.
|
|
|
|
;; Tag word as valid (i.e., skip) otherwise
|
|
|
|
(or ispell-filter
|
|
|
|
(setq ispell-filter '(*)))
|
|
|
|
(if (consp ispell-filter)
|
|
|
|
(setq poss (ispell-parse-output (car ispell-filter)))))
|
|
|
|
;; Else, this was a known misspelling to begin with, and
|
|
|
|
;; we should forge an ispell return value.
|
2011-10-29 12:37:29 +08:00
|
|
|
(setq poss (list word 1 nil nil)))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(let ((res (cond ((eq poss t)
|
|
|
|
;; correct
|
|
|
|
(setq flyspell-word-cache-result t)
|
|
|
|
(flyspell-unhighlight-at start)
|
|
|
|
(if (> end start)
|
|
|
|
(flyspell-unhighlight-at (- end 1)))
|
|
|
|
t)
|
|
|
|
((and (stringp poss) flyspell-highlight-flag)
|
|
|
|
;; correct
|
|
|
|
(setq flyspell-word-cache-result t)
|
|
|
|
(flyspell-unhighlight-at start)
|
|
|
|
(if (> end start)
|
|
|
|
(flyspell-unhighlight-at (- end 1)))
|
|
|
|
t)
|
|
|
|
((null poss)
|
|
|
|
(setq flyspell-word-cache-result t)
|
|
|
|
(flyspell-unhighlight-at start)
|
|
|
|
(if (> end start)
|
|
|
|
(flyspell-unhighlight-at (- end 1)))
|
|
|
|
t)
|
|
|
|
((or (and (< flyspell-duplicate-distance 0)
|
|
|
|
(or (save-excursion
|
|
|
|
(goto-char start)
|
|
|
|
(flyspell-word-search-backward
|
|
|
|
word
|
|
|
|
(point-min)))
|
|
|
|
(save-excursion
|
|
|
|
(goto-char end)
|
|
|
|
(flyspell-word-search-forward
|
|
|
|
word
|
|
|
|
(point-max)))))
|
|
|
|
(and (> flyspell-duplicate-distance 0)
|
|
|
|
(or (save-excursion
|
|
|
|
(goto-char start)
|
|
|
|
(flyspell-word-search-backward
|
|
|
|
word
|
|
|
|
(- start
|
|
|
|
flyspell-duplicate-distance)))
|
|
|
|
(save-excursion
|
|
|
|
(goto-char end)
|
|
|
|
(flyspell-word-search-forward
|
|
|
|
word
|
|
|
|
(+ end
|
|
|
|
flyspell-duplicate-distance))))))
|
2005-09-23 18:29:20 +00:00
|
|
|
;; This is a misspelled word which occurs
|
|
|
|
;; twice within flyspell-duplicate-distance.
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(setq flyspell-word-cache-result nil)
|
|
|
|
(if flyspell-highlight-flag
|
|
|
|
(flyspell-highlight-duplicate-region
|
|
|
|
start end poss)
|
2005-09-18 12:28:30 +00:00
|
|
|
(message "duplicate `%s'" word))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
nil)
|
|
|
|
(t
|
|
|
|
(setq flyspell-word-cache-result nil)
|
2010-02-16 09:23:44 -05:00
|
|
|
;; Highlight the location as incorrect,
|
|
|
|
;; including offset specified in POSS.
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(if flyspell-highlight-flag
|
|
|
|
(flyspell-highlight-incorrect-region
|
2010-02-16 09:23:44 -05:00
|
|
|
(if (and (consp poss)
|
|
|
|
(integerp (nth 1 poss)))
|
|
|
|
(+ start (nth 1 poss) -1)
|
|
|
|
start)
|
|
|
|
end poss)
|
2005-11-16 17:00:29 +00:00
|
|
|
(flyspell-notify-misspell word poss))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
nil))))
|
|
|
|
;; return to original location
|
2005-06-14 11:36:04 +00:00
|
|
|
(goto-char cursor-location)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(if ispell-quit (setq ispell-quit nil))
|
|
|
|
res))))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-math-tex-command-p ... */
|
|
|
|
;;* ------------------------------------------------------------- */
|
2008-09-17 00:55:38 +00:00
|
|
|
;;* This function uses the texmathp package to check if point */
|
|
|
|
;;* is within a TeX math environment. `texmathp' can yield errors */
|
|
|
|
;;* if the document is currently not valid TeX syntax. */
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-math-tex-command-p ()
|
2005-06-06 21:06:19 +00:00
|
|
|
(when (fboundp 'texmathp)
|
2008-09-17 00:55:38 +00:00
|
|
|
(if flyspell-check-tex-math-command
|
|
|
|
nil
|
2005-06-06 21:06:19 +00:00
|
|
|
(condition-case nil
|
|
|
|
(texmathp)
|
2008-09-17 00:55:38 +00:00
|
|
|
(error nil)))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-tex-command-p ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-tex-command-p (word)
|
1998-07-29 03:21:32 +00:00
|
|
|
"Return t if WORD is a TeX command."
|
2000-07-24 18:36:17 +00:00
|
|
|
(or (save-excursion
|
|
|
|
(let ((b (car (cdr word))))
|
|
|
|
(and (re-search-backward "\\\\" (- (point) 100) t)
|
|
|
|
(or (= (match-end 0) b)
|
|
|
|
(and (goto-char (match-end 0))
|
|
|
|
(looking-at flyspell-tex-command-regexp)
|
|
|
|
(>= (match-end 0) b))))))
|
|
|
|
(flyspell-math-tex-command-p)))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2012-05-18 15:04:07 -04:00
|
|
|
(defalias 'flyspell-get-casechars 'ispell-get-casechars)
|
|
|
|
(defalias 'flyspell-get-not-casechars 'ispell-get-not-casechars)
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-get-word ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2009-10-17 03:10:10 +00:00
|
|
|
(defun flyspell-get-word (&optional following extra-otherchars)
|
1998-06-26 01:24:05 +00:00
|
|
|
"Return the word for spell-checking according to Ispell syntax.
|
2009-10-17 22:43:13 +00:00
|
|
|
Optional argument FOLLOWING non-nil means to get the following
|
|
|
|
\(rather than preceding) word when the cursor is not over a word.
|
|
|
|
Optional second argument EXTRA-OTHERCHARS is a regexp of characters
|
2018-02-20 06:22:57 +02:00
|
|
|
that may be included as part of a word (see `ispell-dictionary-alist').
|
|
|
|
|
|
|
|
This finds the word to spell-check by searching for CASECHARS defined
|
|
|
|
in `ispell-dictionary-alist' for the current dictionary. Thus, the
|
2018-02-20 20:31:30 -05:00
|
|
|
word could be far away from point if point is inside whitespace or
|
2018-02-20 06:22:57 +02:00
|
|
|
punctuation characters, or in text that belongs to a different
|
|
|
|
language."
|
1998-06-26 01:24:05 +00:00
|
|
|
(let* ((flyspell-casechars (flyspell-get-casechars))
|
|
|
|
(flyspell-not-casechars (flyspell-get-not-casechars))
|
|
|
|
(ispell-otherchars (ispell-get-otherchars))
|
|
|
|
(ispell-many-otherchars-p (ispell-get-many-otherchars-p))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(word-regexp (concat flyspell-casechars
|
|
|
|
"+\\("
|
|
|
|
(if (not (string= "" ispell-otherchars))
|
|
|
|
(concat ispell-otherchars "?"))
|
|
|
|
(if extra-otherchars
|
|
|
|
(concat extra-otherchars "?"))
|
|
|
|
flyspell-casechars
|
|
|
|
"+\\)"
|
|
|
|
(if (or ispell-many-otherchars-p
|
|
|
|
extra-otherchars)
|
|
|
|
"*" "?")))
|
|
|
|
did-it-once prevpt
|
1998-06-26 01:24:05 +00:00
|
|
|
start end word)
|
|
|
|
;; find the word
|
2000-07-24 18:36:17 +00:00
|
|
|
(if (not (looking-at flyspell-casechars))
|
1998-06-26 01:24:05 +00:00
|
|
|
(if following
|
2005-12-22 01:51:40 +00:00
|
|
|
(re-search-forward flyspell-casechars nil t)
|
|
|
|
(re-search-backward flyspell-casechars nil t)))
|
1998-06-26 01:24:05 +00:00
|
|
|
;; move to front of word
|
2005-12-22 01:51:40 +00:00
|
|
|
(re-search-backward flyspell-not-casechars nil 'start)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(while (and (or (and (not (string= "" ispell-otherchars))
|
|
|
|
(looking-at ispell-otherchars))
|
|
|
|
(and extra-otherchars (looking-at extra-otherchars)))
|
|
|
|
(not (bobp))
|
|
|
|
(or (not did-it-once)
|
|
|
|
ispell-many-otherchars-p)
|
|
|
|
(not (eq prevpt (point))))
|
|
|
|
(if (and extra-otherchars (looking-at extra-otherchars))
|
|
|
|
(progn
|
1999-07-12 16:01:16 +00:00
|
|
|
(backward-char 1)
|
|
|
|
(if (looking-at flyspell-casechars)
|
2005-12-22 01:51:40 +00:00
|
|
|
(re-search-backward flyspell-not-casechars nil 'move)))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(setq did-it-once t
|
|
|
|
prevpt (point))
|
|
|
|
(backward-char 1)
|
|
|
|
(if (looking-at flyspell-casechars)
|
2005-12-22 01:51:40 +00:00
|
|
|
(re-search-backward flyspell-not-casechars nil 'move)
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(backward-char -1))))
|
1998-06-26 01:24:05 +00:00
|
|
|
;; Now mark the word and save to string.
|
2005-12-22 01:51:40 +00:00
|
|
|
(if (not (re-search-forward word-regexp nil t))
|
1998-06-26 01:24:05 +00:00
|
|
|
nil
|
|
|
|
(progn
|
|
|
|
(setq start (match-beginning 0)
|
|
|
|
end (point)
|
2001-02-16 15:05:24 +00:00
|
|
|
word (buffer-substring-no-properties start end))
|
1998-06-26 01:24:05 +00:00
|
|
|
(list word start end)))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-small-region ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-small-region (beg end)
|
2018-07-14 10:43:32 +03:00
|
|
|
"Flyspell text between BEG and END.
|
|
|
|
|
|
|
|
This function is intended to work on small regions, as
|
|
|
|
determined by `flyspell-large-region'."
|
1998-06-26 01:24:05 +00:00
|
|
|
(save-excursion
|
2000-07-24 18:36:17 +00:00
|
|
|
(if (> beg end)
|
|
|
|
(let ((old beg))
|
|
|
|
(setq beg end)
|
|
|
|
(setq end old)))
|
1998-06-26 01:24:05 +00:00
|
|
|
(goto-char beg)
|
1998-06-26 01:27:40 +00:00
|
|
|
(let ((count 0))
|
|
|
|
(while (< (point) end)
|
2002-02-02 15:56:45 +00:00
|
|
|
(if (and flyspell-issue-message-flag (= count 100))
|
1998-06-26 01:27:40 +00:00
|
|
|
(progn
|
|
|
|
(message "Spell Checking...%d%%"
|
2015-07-31 10:12:37 -07:00
|
|
|
(floor (* 100.0 (- (point) beg)) (- end beg)))
|
1998-06-26 01:27:40 +00:00
|
|
|
(setq count 0))
|
|
|
|
(setq count (+ 1 count)))
|
|
|
|
(flyspell-word)
|
2000-07-24 18:36:17 +00:00
|
|
|
(sit-for 0)
|
1998-06-26 01:27:40 +00:00
|
|
|
(let ((cur (point)))
|
|
|
|
(forward-word 1)
|
|
|
|
(if (and (< (point) end) (> (point) (+ cur 1)))
|
|
|
|
(backward-char 1)))))
|
1998-06-26 01:24:05 +00:00
|
|
|
(backward-char 1)
|
2002-02-02 15:56:45 +00:00
|
|
|
(if flyspell-issue-message-flag (message "Spell Checking completed."))
|
1998-06-26 01:24:05 +00:00
|
|
|
(flyspell-word)))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-external-ispell-process ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-external-ispell-process '()
|
2001-01-26 18:52:53 +00:00
|
|
|
"The external Flyspell Ispell process.")
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-external-ispell-buffer ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-external-ispell-buffer '())
|
|
|
|
(defvar flyspell-large-region-buffer '())
|
|
|
|
(defvar flyspell-large-region-beg (point-min))
|
|
|
|
(defvar flyspell-large-region-end (point-max))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-external-point-words ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-external-point-words ()
|
2005-10-10 01:14:28 +00:00
|
|
|
"Mark words from a buffer listing incorrect words in order of appearance.
|
|
|
|
The list of incorrect words should be in `flyspell-external-ispell-buffer'.
|
|
|
|
\(We finish by killing that buffer and setting the variable to nil.)
|
|
|
|
The buffer to mark them in is `flyspell-large-region-buffer'."
|
2018-08-07 18:35:12 +03:00
|
|
|
(let* (words-not-found
|
|
|
|
(flyspell-casechars (flyspell-get-casechars))
|
|
|
|
(ispell-otherchars (ispell-get-otherchars))
|
|
|
|
(ispell-many-otherchars-p (ispell-get-many-otherchars-p))
|
|
|
|
(word-chars (concat flyspell-casechars
|
|
|
|
"+\\("
|
|
|
|
(if (not (string= "" ispell-otherchars))
|
|
|
|
(concat ispell-otherchars "?"))
|
|
|
|
flyspell-casechars
|
|
|
|
"+\\)"
|
|
|
|
(if ispell-many-otherchars-p
|
|
|
|
"*" "?")))
|
|
|
|
(buffer-scan-pos flyspell-large-region-beg)
|
|
|
|
case-fold-search)
|
2005-12-02 13:17:38 +00:00
|
|
|
(with-current-buffer flyspell-external-ispell-buffer
|
|
|
|
(goto-char (point-min))
|
2005-12-27 22:49:46 +00:00
|
|
|
;; Loop over incorrect words, in the order they were reported,
|
|
|
|
;; which is also the order they appear in the buffer being checked.
|
2005-12-22 01:51:40 +00:00
|
|
|
(while (re-search-forward "\\([^\n]+\\)\n" nil t)
|
2005-12-02 13:17:38 +00:00
|
|
|
;; Bind WORD to the next one.
|
|
|
|
(let ((word (match-string 1)) (wordpos (point)))
|
|
|
|
;; Here there used to be code to see if WORD is the same
|
|
|
|
;; as the previous iteration, and count the number of consecutive
|
|
|
|
;; identical words, and the loop below would search for that many.
|
|
|
|
;; That code seemed to be incorrect, and on principle, should
|
|
|
|
;; be unnecessary too. -- rms.
|
|
|
|
(if flyspell-issue-message-flag
|
|
|
|
(message "Spell Checking...%d%% [%s]"
|
2015-07-31 10:12:37 -07:00
|
|
|
(floor (* 100.0 (point)) (point-max))
|
2005-12-02 13:17:38 +00:00
|
|
|
word))
|
|
|
|
(with-current-buffer flyspell-large-region-buffer
|
2005-12-27 22:49:46 +00:00
|
|
|
(goto-char buffer-scan-pos)
|
2005-12-02 13:17:38 +00:00
|
|
|
(let ((keep t))
|
|
|
|
;; Iterate on string search until string is found as word,
|
2012-05-18 15:04:07 -04:00
|
|
|
;; not as substring.
|
2005-12-02 13:17:38 +00:00
|
|
|
(while keep
|
|
|
|
(if (search-forward word
|
|
|
|
flyspell-large-region-end t)
|
2005-12-27 22:49:46 +00:00
|
|
|
(let* ((found-list
|
|
|
|
(save-excursion
|
|
|
|
;; Move back into the match
|
|
|
|
;; so flyspell-get-word will find it.
|
|
|
|
(forward-char -1)
|
2018-08-07 18:35:12 +03:00
|
|
|
;; Is this a word that matches the
|
|
|
|
;; current dictionary?
|
|
|
|
(if (looking-at word-chars)
|
|
|
|
(flyspell-get-word))))
|
2005-12-27 22:49:46 +00:00
|
|
|
(found (car found-list))
|
|
|
|
(found-length (length found))
|
|
|
|
(misspell-length (length word)))
|
|
|
|
(when (or
|
2018-08-07 18:35:12 +03:00
|
|
|
;; Misspelled word is not from the
|
|
|
|
;; language supported by the current
|
|
|
|
;; dictionary.
|
|
|
|
(null found)
|
2005-12-27 22:49:46 +00:00
|
|
|
;; Size matches, we really found it.
|
|
|
|
(= found-length misspell-length)
|
2012-05-18 15:04:07 -04:00
|
|
|
;; Matches as part of a boundary-char separated
|
|
|
|
;; word.
|
2005-12-27 22:49:46 +00:00
|
|
|
(member word
|
|
|
|
(split-string found ispell-otherchars))
|
|
|
|
;; Misspelling has higher length than
|
2012-05-18 15:04:07 -04:00
|
|
|
;; what flyspell considers the word.
|
|
|
|
;; Caused by boundary-chars mismatch.
|
|
|
|
;; Validating seems safe.
|
2005-12-27 22:49:46 +00:00
|
|
|
(< found-length misspell-length)
|
|
|
|
;; ispell treats beginning of some TeX
|
|
|
|
;; commands as nroff control sequences
|
|
|
|
;; and strips them in the list of
|
|
|
|
;; misspelled words thus giving a
|
|
|
|
;; non-existent word. Skip if ispell
|
|
|
|
;; is used, string is a TeX command
|
|
|
|
;; (char before beginning of word is
|
|
|
|
;; backslash) and none of the previous
|
2011-11-14 23:55:13 -08:00
|
|
|
;; conditions match.
|
2005-12-27 22:49:46 +00:00
|
|
|
(and (not ispell-really-aspell)
|
2018-08-07 18:35:12 +03:00
|
|
|
(not ispell-really-hunspell)
|
|
|
|
(not ispell-really-enchant)
|
2005-12-27 22:49:46 +00:00
|
|
|
(save-excursion
|
|
|
|
(goto-char (- (nth 1 found-list) 1))
|
|
|
|
(if (looking-at "[\\]" )
|
|
|
|
t
|
|
|
|
nil))))
|
|
|
|
(setq keep nil)
|
2018-08-07 18:35:12 +03:00
|
|
|
;; Don't try spell-checking words whose
|
|
|
|
;; characters don't match CASECHARS, because
|
|
|
|
;; flyspell-word will then consider as
|
|
|
|
;; misspelling the preceding word that matches
|
|
|
|
;; CASECHARS.
|
|
|
|
(or (null found)
|
|
|
|
(flyspell-word nil t))
|
2005-12-27 22:49:46 +00:00
|
|
|
;; Search for next misspelled word will begin from
|
|
|
|
;; end of last validated match.
|
|
|
|
(setq buffer-scan-pos (point))))
|
2005-12-02 13:17:38 +00:00
|
|
|
;; Record if misspelling is not found and try new one
|
2015-02-04 14:43:47 -05:00
|
|
|
(cl-pushnew (concat " -> " word " - "
|
|
|
|
(int-to-string wordpos))
|
|
|
|
words-not-found :test #'equal)
|
2005-12-02 13:17:38 +00:00
|
|
|
(setq keep nil)))))))
|
|
|
|
;; we are done
|
|
|
|
(if flyspell-issue-message-flag (message "Spell Checking completed.")))
|
|
|
|
;; Warn about not found misspellings
|
|
|
|
(dolist (word words-not-found)
|
|
|
|
(message "%s: word not found" word))
|
|
|
|
;; Kill and forget the buffer with the list of incorrect words.
|
|
|
|
(kill-buffer flyspell-external-ispell-buffer)
|
|
|
|
(setq flyspell-external-ispell-buffer nil)))
|
2002-01-29 13:42:12 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-process-localwords ... */
|
|
|
|
;;* ------------------------------------------------------------- */
|
|
|
|
;;* This function is used to prevent marking of words explicitly */
|
|
|
|
;;* declared correct. */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2005-11-14 04:53:14 +00:00
|
|
|
(defun flyspell-process-localwords (misspellings-buffer)
|
2012-04-23 12:33:25 +02:00
|
|
|
(let ((localwords ispell-buffer-session-localwords)
|
|
|
|
case-fold-search
|
2005-11-14 04:53:14 +00:00
|
|
|
(ispell-casechars (ispell-get-casechars)))
|
|
|
|
;; Get localwords from the original buffer
|
|
|
|
(save-excursion
|
|
|
|
(goto-char (point-min))
|
|
|
|
;; Localwords parsing copied from ispell.el.
|
|
|
|
(while (search-forward ispell-words-keyword nil t)
|
Replace end-of-line, save-excursion etc with point-at-eol, point-at-bol.
* lisp/mh-e/mh-seq.el (mh-read-msg-list): Use point-at-eol.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-show-infos)
(gnus-bookmark-kill-line): Use point-at-eol.
* lisp/cedet/ede/proj-elisp.el (ede-proj-flush-autoconf): Use point-at-bol.
* lisp/emacs-lisp/chart.el (chart-zap-chars):
* lisp/play/decipher.el (decipher-set-map):
* lisp/progmodes/ada-mode.el (ada-get-current-indent)
(ada-search-ignore-string-comment, ada-tab-hard, ada-untab-hard):
* lisp/progmodes/ada-prj.el (ada-prj-load-from-file, ada-prj-display-help):
* lisp/progmodes/ada-xref.el (ada-initialize-runtime-library)
(ada-get-all-references):
* lisp/progmodes/cperl-mode.el (cperl-electric-paren)
(cperl-electric-rparen, cperl-electric-keyword, cperl-electric-else)
(cperl-linefeed, cperl-sniff-for-indent, cperl-to-comment-or-eol)
(cperl-find-pods-heres, cperl-indent-exp, cperl-fix-line-spacing)
(cperl-word-at-point-hard):
* lisp/progmodes/idlw-shell.el (idlwave-shell-move-or-history)
(idlwave-shell-filename-string, idlwave-shell-batch-command)
(idlwave-shell-display-line):
* lisp/progmodes/idlwave.el (idlwave-show-begin, idlwave-fill-paragraph)
(idlwave-calc-hanging-indent, idlwave-auto-fill, idlwave-template):
* lisp/progmodes/js.el (js--re-search-forward-inner)
(js--re-search-backward-inner):
* lisp/progmodes/vhdl-mode.el (vhdl-align-region-1, vhdl-align-region-2)
(vhdl-fix-clause, vhdl-compose-configuration-architecture):
* lisp/progmodes/ruby-mode.el (ruby-parse-partial, eval-when-compile):
* lisp/textmodes/flyspell.el (flyspell-process-localwords):
* lisp/textmodes/ispell.el (ispell-buffer-local-parsing)
(ispell-buffer-local-dict, ispell-buffer-local-words):
Use point-at-bol and point-at-eol.
2010-11-06 18:36:33 -07:00
|
|
|
(let ((end (point-at-eol))
|
2005-11-14 04:53:14 +00:00
|
|
|
string)
|
|
|
|
;; buffer-local words separated by a space, and can contain
|
|
|
|
;; any character other than a space. Not rigorous enough.
|
|
|
|
(while (re-search-forward " *\\([^ ]+\\)" end t)
|
|
|
|
(setq string (buffer-substring-no-properties (match-beginning 1)
|
|
|
|
(match-end 1)))
|
|
|
|
;; This can fail when string contains a word with invalid chars.
|
|
|
|
;; Error handling needs to be added between Ispell and Emacs.
|
2005-12-02 13:17:38 +00:00
|
|
|
(if (and (< 1 (length string))
|
2005-11-14 04:53:14 +00:00
|
|
|
(equal 0 (string-match ispell-casechars string)))
|
|
|
|
(push string localwords))))))
|
|
|
|
;; Remove localwords matches from misspellings-buffer.
|
|
|
|
;; The usual mechanism of communicating the local words to ispell
|
|
|
|
;; does not affect the special ispell process used by
|
|
|
|
;; flyspell-large-region.
|
|
|
|
(with-current-buffer misspellings-buffer
|
|
|
|
(save-excursion
|
|
|
|
(dolist (word localwords)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(let ((regexp (concat "^" word "\n")))
|
|
|
|
(while (re-search-forward regexp nil t)
|
|
|
|
(delete-region (match-beginning 0) (match-end 0)))))))))
|
|
|
|
|
2006-09-16 15:05:47 +00:00
|
|
|
;;* ---------------------------------------------------------------
|
|
|
|
;;* flyspell-check-region-doublons
|
|
|
|
;;* ---------------------------------------------------------------
|
|
|
|
(defun flyspell-check-region-doublons (beg end)
|
|
|
|
"Check for adjacent duplicated words (doublons) in the given region."
|
|
|
|
(save-excursion
|
|
|
|
(goto-char beg)
|
|
|
|
(flyspell-word) ; Make sure current word is checked
|
|
|
|
(backward-word 1)
|
|
|
|
(while (and (< (point) end)
|
2006-10-23 13:59:44 +00:00
|
|
|
(re-search-forward "\\<\\(\\w+\\)\\>[ \n\t\f]+\\1\\>"
|
2006-09-16 15:05:47 +00:00
|
|
|
end 'move))
|
|
|
|
(flyspell-word)
|
|
|
|
(backward-word 1))
|
|
|
|
(flyspell-word)))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-large-region ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-large-region (beg end)
|
|
|
|
(let* ((curbuf (current-buffer))
|
|
|
|
(buffer (get-buffer-create "*flyspell-region*")))
|
|
|
|
(setq flyspell-external-ispell-buffer buffer)
|
|
|
|
(setq flyspell-large-region-buffer curbuf)
|
|
|
|
(setq flyspell-large-region-beg beg)
|
|
|
|
(setq flyspell-large-region-end end)
|
2005-11-14 04:53:14 +00:00
|
|
|
(flyspell-accept-buffer-local-defs)
|
2000-07-24 18:36:17 +00:00
|
|
|
(set-buffer buffer)
|
|
|
|
(erase-buffer)
|
2001-03-26 16:31:20 +00:00
|
|
|
;; this is done, we can start checking...
|
2002-02-02 15:56:45 +00:00
|
|
|
(if flyspell-issue-message-flag (message "Checking region..."))
|
2000-07-24 18:36:17 +00:00
|
|
|
(set-buffer curbuf)
|
2008-04-23 20:39:10 +00:00
|
|
|
(ispell-set-spellchecker-params) ; Initialize variables and dicts alists
|
2007-12-02 18:18:19 +00:00
|
|
|
;; Local dictionary becomes the global dictionary in use.
|
|
|
|
(setq ispell-current-dictionary
|
|
|
|
(or ispell-local-dictionary ispell-dictionary))
|
|
|
|
(setq ispell-current-personal-dictionary
|
|
|
|
(or ispell-local-pdict ispell-personal-dictionary))
|
|
|
|
(let ((args (ispell-get-ispell-args))
|
|
|
|
(encoding (ispell-get-coding-system))
|
|
|
|
c)
|
|
|
|
(if (and ispell-current-dictionary ; use specified dictionary
|
|
|
|
(not (member "-d" args))) ; only define if not overridden
|
|
|
|
(setq args
|
|
|
|
(append (list "-d" ispell-current-dictionary) args)))
|
|
|
|
(if ispell-current-personal-dictionary ; use specified pers dict
|
|
|
|
(setq args
|
|
|
|
(append args
|
|
|
|
(list "-p"
|
|
|
|
(expand-file-name
|
|
|
|
ispell-current-personal-dictionary)))))
|
2011-10-13 20:37:57 +02:00
|
|
|
|
|
|
|
;; Check for extended character mode
|
|
|
|
(let ((extended-char-mode (ispell-get-extended-character-mode)))
|
|
|
|
(and extended-char-mode ; ~ extended character mode
|
|
|
|
(string-match "[^~]+$" extended-char-mode)
|
2015-02-04 14:43:47 -05:00
|
|
|
(cl-pushnew (concat "-T" (match-string 0 extended-char-mode))
|
|
|
|
args :test #'equal)))
|
2011-10-13 20:37:57 +02:00
|
|
|
|
|
|
|
;; Add ispell-extra-args
|
2007-12-02 18:18:19 +00:00
|
|
|
(setq args (append args ispell-extra-args))
|
2008-12-18 18:44:31 +00:00
|
|
|
|
|
|
|
;; If we are using recent aspell or hunspell, make sure we use the right encoding
|
|
|
|
;; for communication. ispell or older aspell/hunspell does not support this
|
2009-01-08 18:46:23 +00:00
|
|
|
(if ispell-encoding8-command
|
2007-12-02 18:18:19 +00:00
|
|
|
(setq args
|
|
|
|
(append args
|
2012-04-12 16:19:40 +02:00
|
|
|
(if ispell-really-hunspell
|
|
|
|
(list ispell-encoding8-command
|
|
|
|
(upcase (symbol-name encoding)))
|
|
|
|
(list (concat ispell-encoding8-command
|
|
|
|
(symbol-name encoding)))))))
|
2008-12-18 18:44:31 +00:00
|
|
|
|
2007-12-02 18:18:19 +00:00
|
|
|
(let ((process-coding-system-alist (list (cons "\\.*" encoding))))
|
|
|
|
(setq c (apply 'ispell-call-process-region beg
|
|
|
|
end
|
|
|
|
ispell-program-name
|
|
|
|
nil
|
|
|
|
buffer
|
|
|
|
nil
|
|
|
|
(if ispell-really-aspell "list" "-l")
|
|
|
|
args)))
|
2004-01-03 12:12:01 +00:00
|
|
|
(if (eq c 0)
|
2005-11-14 04:53:14 +00:00
|
|
|
(progn
|
|
|
|
(flyspell-process-localwords buffer)
|
|
|
|
(with-current-buffer curbuf
|
2006-09-16 15:05:47 +00:00
|
|
|
(flyspell-delete-region-overlays beg end)
|
|
|
|
(flyspell-check-region-doublons beg end))
|
2005-11-14 04:53:14 +00:00
|
|
|
(flyspell-external-point-words))
|
2009-10-17 22:43:13 +00:00
|
|
|
(error "Can't check region")))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-region ... */
|
|
|
|
;;* ------------------------------------------------------------- */
|
|
|
|
;;* Because `ispell -a' is too slow, it is not possible to use */
|
|
|
|
;;* it on large region. Then, when ispell is invoked on a large */
|
|
|
|
;;* text region, a new `ispell -l' process is spawned. The */
|
|
|
|
;;* pointed out words are then searched in the region a checked with */
|
|
|
|
;;* regular flyspell means. */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2001-02-16 13:21:11 +00:00
|
|
|
;;;###autoload
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-region (beg end)
|
2018-07-14 10:43:32 +03:00
|
|
|
"Flyspell text between BEG and END.
|
|
|
|
|
|
|
|
Make sure `flyspell-mode' is turned on if you want the highlight
|
|
|
|
of a misspelled word removed when you've corrected it."
|
2000-07-24 18:36:17 +00:00
|
|
|
(interactive "r")
|
2008-04-23 20:39:10 +00:00
|
|
|
(ispell-set-spellchecker-params) ; Initialize variables and dicts alists
|
2000-07-24 18:36:17 +00:00
|
|
|
(if (= beg end)
|
|
|
|
()
|
|
|
|
(save-excursion
|
|
|
|
(if (> beg end)
|
|
|
|
(let ((old beg))
|
|
|
|
(setq beg end)
|
|
|
|
(setq end old)))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(if (and flyspell-large-region (> (- end beg) flyspell-large-region))
|
2000-07-24 18:36:17 +00:00
|
|
|
(flyspell-large-region beg end)
|
|
|
|
(flyspell-small-region beg end)))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-buffer ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2001-02-16 13:21:11 +00:00
|
|
|
;;;###autoload
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-buffer ()
|
|
|
|
"Flyspell whole buffer."
|
|
|
|
(interactive)
|
|
|
|
(flyspell-region (point-min) (point-max)))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* old next error position ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-old-buffer-error nil)
|
|
|
|
(defvar flyspell-old-pos-error nil)
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-goto-next-error ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-goto-next-error ()
|
|
|
|
"Go to the next previously detected error.
|
|
|
|
In general FLYSPELL-GOTO-NEXT-ERROR must be used after
|
|
|
|
FLYSPELL-BUFFER."
|
|
|
|
(interactive)
|
|
|
|
(let ((pos (point))
|
|
|
|
(max (point-max)))
|
|
|
|
(if (and (eq (current-buffer) flyspell-old-buffer-error)
|
|
|
|
(eq pos flyspell-old-pos-error))
|
|
|
|
(progn
|
|
|
|
(if (= flyspell-old-pos-error max)
|
|
|
|
;; goto beginning of buffer
|
|
|
|
(progn
|
|
|
|
(message "Restarting from beginning of buffer")
|
|
|
|
(goto-char (point-min)))
|
|
|
|
(forward-word 1))
|
|
|
|
(setq pos (point))))
|
|
|
|
;; seek the next error
|
|
|
|
(while (and (< pos max)
|
|
|
|
(let ((ovs (overlays-at pos))
|
|
|
|
(r '()))
|
|
|
|
(while (and (not r) (consp ovs))
|
|
|
|
(if (flyspell-overlay-p (car ovs))
|
|
|
|
(setq r t)
|
|
|
|
(setq ovs (cdr ovs))))
|
|
|
|
(not r)))
|
|
|
|
(setq pos (1+ pos)))
|
2001-03-26 16:31:20 +00:00
|
|
|
;; save the current location for next invocation
|
2000-07-24 18:36:17 +00:00
|
|
|
(setq flyspell-old-pos-error pos)
|
|
|
|
(setq flyspell-old-buffer-error (current-buffer))
|
|
|
|
(goto-char pos)
|
|
|
|
(if (= pos max)
|
|
|
|
(message "No more miss-spelled word!"))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-overlay-p ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-overlay-p (o)
|
2007-08-08 07:27:21 +00:00
|
|
|
"Return true if O is an overlay used by flyspell."
|
1998-06-26 01:24:05 +00:00
|
|
|
(and (overlayp o) (overlay-get o 'flyspell-overlay)))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-delete-region-overlays, flyspell-delete-all-overlays */
|
|
|
|
;;* ------------------------------------------------------------- */
|
|
|
|
;;* Remove overlays introduced by flyspell. */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2005-11-14 04:53:14 +00:00
|
|
|
(defun flyspell-delete-region-overlays (beg end)
|
|
|
|
"Delete overlays used by flyspell in a given region."
|
2016-12-17 19:06:34 +00:00
|
|
|
(remove-overlays beg end 'flyspell-overlay t))
|
2005-11-14 04:53:14 +00:00
|
|
|
|
|
|
|
(defun flyspell-delete-all-overlays ()
|
|
|
|
"Delete all the overlays used by flyspell."
|
2012-05-28 18:11:15 +02:00
|
|
|
(flyspell-delete-region-overlays (point-min) (point-max)))
|
2005-11-14 04:53:14 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-unhighlight-at ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-unhighlight-at (pos)
|
|
|
|
"Remove the flyspell overlay that are located at POS."
|
|
|
|
(if flyspell-persistent-highlight
|
|
|
|
(let ((overlays (overlays-at pos)))
|
|
|
|
(while (consp overlays)
|
|
|
|
(if (flyspell-overlay-p (car overlays))
|
|
|
|
(delete-overlay (car overlays)))
|
|
|
|
(setq overlays (cdr overlays))))
|
2000-07-24 18:36:17 +00:00
|
|
|
(if (flyspell-overlay-p flyspell-overlay)
|
2005-11-16 17:00:29 +00:00
|
|
|
(delete-overlay flyspell-overlay))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-properties-at-p ... */
|
|
|
|
;;* ------------------------------------------------------------- */
|
2018-02-16 17:33:57 -05:00
|
|
|
;;* Is there a highlight property at position pos? */
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-08-03 03:27:54 +00:00
|
|
|
(defun flyspell-properties-at-p (pos)
|
|
|
|
"Return t if there is a text property at POS, not counting `local-map'.
|
|
|
|
If variable `flyspell-highlight-properties' is set to nil,
|
|
|
|
text with properties are not checked. This function is used to discover
|
|
|
|
if the character at POS has any other property."
|
|
|
|
(let ((prop (text-properties-at pos))
|
1998-06-26 01:24:05 +00:00
|
|
|
(keep t))
|
|
|
|
(while (and keep (consp prop))
|
|
|
|
(if (and (eq (car prop) 'local-map) (consp (cdr prop)))
|
|
|
|
(setq prop (cdr (cdr prop)))
|
|
|
|
(setq keep nil)))
|
|
|
|
(consp prop)))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* make-flyspell-overlay ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun make-flyspell-overlay (beg end face mouse-face)
|
1998-07-29 03:21:32 +00:00
|
|
|
"Allocate an overlay to highlight an incorrect word.
|
|
|
|
BEG and END specify the range in the buffer of that word.
|
|
|
|
FACE and MOUSE-FACE specify the `face' and `mouse-face' properties
|
|
|
|
for the overlay."
|
2005-11-16 17:00:29 +00:00
|
|
|
(let ((overlay (make-overlay beg end nil t nil)))
|
|
|
|
(overlay-put overlay 'face face)
|
|
|
|
(overlay-put overlay 'mouse-face mouse-face)
|
|
|
|
(overlay-put overlay 'flyspell-overlay t)
|
|
|
|
(overlay-put overlay 'evaporate t)
|
2020-08-27 06:48:39 +02:00
|
|
|
(overlay-put overlay 'help-echo (concat (if flyspell-use-mouse-3-for-menu
|
|
|
|
"mouse-3"
|
|
|
|
"mouse-2") ": correct word at point"))
|
2017-04-30 21:55:58 +03:00
|
|
|
;; If misspelled text has a 'keymap' property, let that remain in
|
|
|
|
;; effect for the bindings that flyspell-mouse-map doesn't override.
|
|
|
|
(set-keymap-parent flyspell-mouse-map (get-char-property beg 'keymap))
|
2005-11-16 17:00:29 +00:00
|
|
|
(overlay-put overlay 'keymap flyspell-mouse-map)
|
2005-06-10 10:46:38 +00:00
|
|
|
(when (eq face 'flyspell-incorrect)
|
2002-02-02 15:56:45 +00:00
|
|
|
(and (stringp flyspell-before-incorrect-word-string)
|
2005-11-16 17:00:29 +00:00
|
|
|
(overlay-put overlay 'before-string
|
2002-02-02 15:56:45 +00:00
|
|
|
flyspell-before-incorrect-word-string))
|
|
|
|
(and (stringp flyspell-after-incorrect-word-string)
|
2005-11-16 17:00:29 +00:00
|
|
|
(overlay-put overlay 'after-string
|
2002-02-02 15:56:45 +00:00
|
|
|
flyspell-after-incorrect-word-string)))
|
2005-11-16 17:00:29 +00:00
|
|
|
overlay))
|
2002-01-29 13:42:12 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-highlight-incorrect-region ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-highlight-incorrect-region (beg end poss)
|
2005-09-23 18:29:20 +00:00
|
|
|
"Set up an overlay on a misspelled word, in the buffer from BEG to END.
|
|
|
|
POSS is usually a list of possible spelling/correction lists,
|
|
|
|
as returned by `ispell-parse-output'.
|
|
|
|
It can also be the symbol `doublon', in the case where the word
|
|
|
|
is itself incorrect, but suspiciously repeated."
|
2004-05-08 12:48:49 +00:00
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(unless (run-hook-with-args-until-success
|
|
|
|
'flyspell-incorrect-hook beg end poss)
|
|
|
|
(if (or flyspell-highlight-properties
|
|
|
|
(not (flyspell-properties-at-p beg)))
|
|
|
|
(progn
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
;; we cleanup all the overlay that are in the region, not
|
|
|
|
;; beginning at the word start position
|
|
|
|
(if (< (1+ beg) end)
|
|
|
|
(let ((os (overlays-in (1+ beg) end)))
|
|
|
|
(while (consp os)
|
|
|
|
(if (flyspell-overlay-p (car os))
|
|
|
|
(delete-overlay (car os)))
|
|
|
|
(setq os (cdr os)))))
|
2004-05-08 12:48:49 +00:00
|
|
|
;; we cleanup current overlay at the same position
|
2005-11-16 17:00:29 +00:00
|
|
|
(flyspell-unhighlight-at beg)
|
2004-05-08 12:48:49 +00:00
|
|
|
;; now we can use a new overlay
|
|
|
|
(setq flyspell-overlay
|
|
|
|
(make-flyspell-overlay
|
2006-10-22 21:29:33 +00:00
|
|
|
beg end
|
|
|
|
(if (eq poss 'doublon) 'flyspell-duplicate 'flyspell-incorrect)
|
|
|
|
'highlight)))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-highlight-duplicate-region ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2004-08-22 17:15:55 +00:00
|
|
|
(defun flyspell-highlight-duplicate-region (beg end poss)
|
2005-09-23 18:29:20 +00:00
|
|
|
"Set up an overlay on a duplicate misspelled word, in the buffer from BEG to END.
|
|
|
|
POSS is a list of possible spelling/correction lists,
|
|
|
|
as returned by `ispell-parse-output'."
|
2004-05-08 12:48:49 +00:00
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(unless (run-hook-with-args-until-success
|
|
|
|
'flyspell-incorrect-hook beg end poss)
|
|
|
|
(if (or flyspell-highlight-properties
|
|
|
|
(not (flyspell-properties-at-p beg)))
|
|
|
|
(progn
|
|
|
|
;; we cleanup current overlay at the same position
|
2005-11-16 17:00:29 +00:00
|
|
|
(flyspell-unhighlight-at beg)
|
2004-05-08 12:48:49 +00:00
|
|
|
;; now we can use a new overlay
|
|
|
|
(setq flyspell-overlay
|
|
|
|
(make-flyspell-overlay beg end
|
2005-06-10 10:46:38 +00:00
|
|
|
'flyspell-duplicate
|
2004-05-08 12:48:49 +00:00
|
|
|
'highlight)))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-auto-correct-cache ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-06-26 01:24:05 +00:00
|
|
|
(defvar flyspell-auto-correct-pos nil)
|
|
|
|
(defvar flyspell-auto-correct-region nil)
|
|
|
|
(defvar flyspell-auto-correct-ring nil)
|
2000-07-24 18:36:17 +00:00
|
|
|
(defvar flyspell-auto-correct-word nil)
|
|
|
|
(make-variable-buffer-local 'flyspell-auto-correct-pos)
|
|
|
|
(make-variable-buffer-local 'flyspell-auto-correct-region)
|
|
|
|
(make-variable-buffer-local 'flyspell-auto-correct-ring)
|
|
|
|
(make-variable-buffer-local 'flyspell-auto-correct-word)
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-check-previous-highlighted-word ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-check-previous-highlighted-word (&optional arg)
|
2015-07-25 12:35:16 +03:00
|
|
|
"Correct the closest previous word that is highlighted as misspelled.
|
|
|
|
This function scans for a word which starts before point that has been
|
|
|
|
highlighted by Flyspell as misspelled. If it finds one, it proposes
|
|
|
|
a replacement for that word. With prefix arg N, check the Nth word
|
|
|
|
before point that's highlighted as misspelled."
|
|
|
|
(interactive "P")
|
2000-07-24 18:36:17 +00:00
|
|
|
(let ((pos1 (point))
|
|
|
|
(pos (point))
|
|
|
|
(arg (if (or (not (numberp arg)) (< arg 1)) 1 arg))
|
|
|
|
ov ovs)
|
|
|
|
(if (catch 'exit
|
|
|
|
(while (and (setq pos (previous-overlay-change pos))
|
|
|
|
(not (= pos pos1)))
|
|
|
|
(setq pos1 pos)
|
2020-09-02 17:31:08 +02:00
|
|
|
(if (>= pos (point-min))
|
2000-07-24 18:36:17 +00:00
|
|
|
(progn
|
2015-07-25 12:35:16 +03:00
|
|
|
(setq ovs (overlays-at pos))
|
2000-07-24 18:36:17 +00:00
|
|
|
(while (consp ovs)
|
|
|
|
(setq ov (car ovs))
|
|
|
|
(setq ovs (cdr ovs))
|
2005-11-16 17:00:29 +00:00
|
|
|
(if (and (flyspell-overlay-p ov)
|
2000-07-24 18:36:17 +00:00
|
|
|
(= 0 (setq arg (1- arg))))
|
|
|
|
(throw 'exit t)))))))
|
1998-06-26 01:24:05 +00:00
|
|
|
(save-excursion
|
2000-07-24 18:36:17 +00:00
|
|
|
(goto-char pos)
|
2010-06-25 10:19:11 +02:00
|
|
|
(ispell-word)
|
|
|
|
(setq flyspell-word-cache-word nil) ;; Force flyspell-word re-check
|
|
|
|
(flyspell-word))
|
2001-01-26 18:52:53 +00:00
|
|
|
(error "No word to correct before point"))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-display-next-corrections ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-display-next-corrections (corrections)
|
|
|
|
(let ((string "Corrections:")
|
|
|
|
(l corrections)
|
|
|
|
(pos '()))
|
|
|
|
(while (< (length string) 80)
|
|
|
|
(if (equal (car l) flyspell-auto-correct-word)
|
|
|
|
(setq pos (cons (+ 1 (length string)) pos)))
|
|
|
|
(setq string (concat string " " (car l)))
|
|
|
|
(setq l (cdr l)))
|
|
|
|
(while (consp pos)
|
|
|
|
(let ((num (car pos)))
|
|
|
|
(put-text-property num
|
|
|
|
(+ num (length flyspell-auto-correct-word))
|
2005-06-10 10:46:38 +00:00
|
|
|
'face 'flyspell-incorrect
|
2000-07-24 18:36:17 +00:00
|
|
|
string))
|
|
|
|
(setq pos (cdr pos)))
|
|
|
|
(if (fboundp 'display-message)
|
|
|
|
(display-message 'no-log string)
|
2005-09-18 12:28:30 +00:00
|
|
|
(message "%s" string))))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-abbrev-table ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-abbrev-table ()
|
|
|
|
(if flyspell-use-global-abbrev-table-p
|
|
|
|
global-abbrev-table
|
2003-12-29 20:06:19 +00:00
|
|
|
(or local-abbrev-table global-abbrev-table)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-define-abbrev ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2002-02-02 15:56:45 +00:00
|
|
|
(defun flyspell-define-abbrev (name expansion)
|
|
|
|
(let ((table (flyspell-abbrev-table)))
|
|
|
|
(when table
|
2007-04-22 00:22:14 +00:00
|
|
|
(define-abbrev table (downcase name) expansion))))
|
2002-02-02 15:56:45 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-auto-correct-word ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-auto-correct-word ()
|
|
|
|
"Correct the current word.
|
2018-02-16 16:30:02 +02:00
|
|
|
This command proposes various successive corrections for the
|
|
|
|
current word. If invoked repeatedly on the same position, it
|
2018-02-20 06:22:57 +02:00
|
|
|
cycles through the possible corrections of the current word.
|
|
|
|
|
|
|
|
See `flyspell-get-word' for details of how this finds the word to
|
|
|
|
spell-check."
|
2000-07-24 18:36:17 +00:00
|
|
|
(interactive)
|
2015-12-31 17:44:07 +02:00
|
|
|
;; If we are not in the construct where flyspell should be active,
|
|
|
|
;; invoke the original binding of M-TAB, if that was recorded.
|
|
|
|
(if (and (local-variable-p 'flyspell--prev-meta-tab-binding)
|
|
|
|
(commandp flyspell--prev-meta-tab-binding t)
|
2017-02-16 13:28:56 -08:00
|
|
|
(functionp flyspell-generic-check-word-predicate)
|
2015-12-31 17:44:07 +02:00
|
|
|
(not (funcall flyspell-generic-check-word-predicate))
|
|
|
|
(equal (where-is-internal 'flyspell-auto-correct-word nil t)
|
|
|
|
[?\M-\t]))
|
|
|
|
(call-interactively flyspell--prev-meta-tab-binding)
|
|
|
|
(let ((pos (point))
|
|
|
|
(old-max (point-max)))
|
2018-03-03 12:47:47 +02:00
|
|
|
;; Flush a possibly stale cache from previous invocations of
|
2018-04-17 20:45:51 +03:00
|
|
|
;; flyspell-auto-correct-word/flyspell-auto-correct-previous-word.
|
|
|
|
(if (not (memq last-command '(flyspell-auto-correct-word
|
|
|
|
flyspell-auto-correct-previous-word)))
|
2018-03-03 12:47:47 +02:00
|
|
|
(setq flyspell-auto-correct-region nil))
|
2015-12-31 17:44:07 +02:00
|
|
|
;; Use the correct dictionary.
|
|
|
|
(flyspell-accept-buffer-local-defs)
|
|
|
|
(if (and (eq flyspell-auto-correct-pos pos)
|
|
|
|
(consp flyspell-auto-correct-region))
|
|
|
|
;; We have already been using the function at the same location.
|
|
|
|
(let* ((start (car flyspell-auto-correct-region))
|
|
|
|
(len (cdr flyspell-auto-correct-region)))
|
|
|
|
(flyspell-unhighlight-at start)
|
|
|
|
(delete-region start (+ start len))
|
|
|
|
(setq flyspell-auto-correct-ring (cdr flyspell-auto-correct-ring))
|
|
|
|
(let* ((word (car flyspell-auto-correct-ring))
|
|
|
|
(len (length word)))
|
|
|
|
(rplacd flyspell-auto-correct-region len)
|
|
|
|
(goto-char start)
|
|
|
|
(if flyspell-abbrev-p
|
|
|
|
(if (flyspell-already-abbrevp (flyspell-abbrev-table)
|
|
|
|
flyspell-auto-correct-word)
|
|
|
|
(flyspell-change-abbrev (flyspell-abbrev-table)
|
|
|
|
flyspell-auto-correct-word
|
|
|
|
word)
|
|
|
|
(flyspell-define-abbrev flyspell-auto-correct-word word)))
|
|
|
|
(funcall flyspell-insert-function word)
|
|
|
|
(flyspell-word)
|
|
|
|
(flyspell-display-next-corrections flyspell-auto-correct-ring))
|
2016-12-17 19:09:41 +00:00
|
|
|
(flyspell-adjust-cursor-point pos (point) old-max)
|
2015-12-31 17:44:07 +02:00
|
|
|
(setq flyspell-auto-correct-pos (point)))
|
|
|
|
;; Fetch the word to be checked.
|
|
|
|
(let ((word (flyspell-get-word)))
|
|
|
|
(if (consp word)
|
|
|
|
(let ((start (car (cdr word)))
|
|
|
|
(end (car (cdr (cdr word))))
|
|
|
|
(word (car word))
|
|
|
|
poss ispell-filter)
|
|
|
|
(setq flyspell-auto-correct-word word)
|
|
|
|
;; Now check spelling of word..
|
|
|
|
(ispell-send-string "%\n") ;Put in verbose mode.
|
|
|
|
(ispell-send-string (concat "^" word "\n"))
|
|
|
|
;; Wait until ispell has processed word.
|
|
|
|
(while (progn
|
|
|
|
(accept-process-output ispell-process)
|
|
|
|
(not (string= "" (car ispell-filter)))))
|
|
|
|
;; Remove leading empty element.
|
|
|
|
(setq ispell-filter (cdr ispell-filter))
|
|
|
|
;; Ispell process should return something after word is sent.
|
|
|
|
;; Tag word as valid (i.e., skip) otherwise.
|
|
|
|
(or ispell-filter
|
|
|
|
(setq ispell-filter '(*)))
|
|
|
|
(if (consp ispell-filter)
|
|
|
|
(setq poss (ispell-parse-output (car ispell-filter))))
|
|
|
|
(cond
|
|
|
|
((or (eq poss t) (stringp poss))
|
|
|
|
;; Don't correct word.
|
|
|
|
t)
|
|
|
|
((null poss)
|
|
|
|
;; Ispell error.
|
|
|
|
(error "Ispell: error in Ispell process"))
|
|
|
|
(t
|
|
|
|
;; The word is incorrect, we have to propose a replacement.
|
2016-02-29 15:13:30 +11:00
|
|
|
(let ((replacements (flyspell-sort (car (cdr (cdr poss)))
|
|
|
|
word)))
|
2015-12-31 17:44:07 +02:00
|
|
|
(setq flyspell-auto-correct-region nil)
|
|
|
|
(if (consp replacements)
|
|
|
|
(progn
|
|
|
|
(let ((replace (car replacements)))
|
|
|
|
(let ((new-word replace))
|
|
|
|
(if (not (equal new-word (car poss)))
|
|
|
|
(progn
|
2018-02-17 18:12:23 +02:00
|
|
|
;; then save the current replacements
|
2015-12-31 17:44:07 +02:00
|
|
|
(setq flyspell-auto-correct-region
|
|
|
|
(cons start (length new-word)))
|
|
|
|
(let ((l replacements))
|
|
|
|
(while (consp (cdr l))
|
|
|
|
(setq l (cdr l)))
|
|
|
|
(rplacd l (cons (car poss) replacements)))
|
|
|
|
(setq flyspell-auto-correct-ring
|
|
|
|
replacements)
|
|
|
|
(flyspell-unhighlight-at start)
|
|
|
|
(delete-region start end)
|
|
|
|
(funcall flyspell-insert-function new-word)
|
|
|
|
(if flyspell-abbrev-p
|
|
|
|
(if (flyspell-already-abbrevp
|
|
|
|
(flyspell-abbrev-table) word)
|
|
|
|
(flyspell-change-abbrev
|
|
|
|
(flyspell-abbrev-table)
|
|
|
|
word
|
|
|
|
new-word)
|
|
|
|
(flyspell-define-abbrev word
|
|
|
|
new-word)))
|
|
|
|
(flyspell-word)
|
|
|
|
(flyspell-display-next-corrections
|
|
|
|
(cons new-word flyspell-auto-correct-ring))
|
2016-12-17 19:09:41 +00:00
|
|
|
(flyspell-adjust-cursor-point pos
|
2015-12-31 17:44:07 +02:00
|
|
|
(point)
|
|
|
|
old-max))))))))))
|
|
|
|
(setq flyspell-auto-correct-pos (point))
|
|
|
|
(ispell-pdict-save t))))))))
|
2002-01-29 13:42:12 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-auto-correct-previous-pos ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2002-02-02 15:56:45 +00:00
|
|
|
(defvar flyspell-auto-correct-previous-pos nil
|
|
|
|
"Holds the start of the first incorrect word before point.")
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-auto-correct-previous-hook ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2002-02-02 15:56:45 +00:00
|
|
|
(defun flyspell-auto-correct-previous-hook ()
|
|
|
|
"Hook to track successive calls to `flyspell-auto-correct-previous-word'.
|
lisp/*.el: Fix typos and other trivial doc fixes
* lisp/allout-widgets.el (allout-widgets-auto-activation)
(allout-current-decorated-p):
* lisp/auth-source.el (auth-source-protocols):
* lisp/autorevert.el (auto-revert-set-timer):
* lisp/battery.el (battery-mode-line-limit):
* lisp/calc/calcalg3.el (math-map-binop):
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
* lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute):
* lisp/calendar/calendar.el (calendar-date-echo-text)
(calendar-generate-month, calendar-string-spread)
(calendar-cursor-to-date, calendar-read, calendar-read-date)
(calendar-mark-visible-date, calendar-dayname-on-or-before):
* lisp/calendar/diary-lib.el (diary-ordinal-suffix):
* lisp/cedet/ede/autoconf-edit.el (autoconf-new-program)
(autoconf-find-last-macro, autoconf-parameter-strip):
* lisp/cedet/ede/config.el (ede-target-with-config-build):
* lisp/cedet/ede/linux.el (ede-linux--detect-architecture)
(ede-linux--get-architecture):
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache)
(semantic-displayer-abstract, semantic-displayer-point-position):
* lisp/cedet/semantic/format.el (semantic-format-face-alist)
(semantic-format-tag-short-doc):
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time)
(semantic-idle-breadcrumbs-display-function)
(semantic-idle-breadcrumbs-format-tag-list-function):
* lisp/cedet/semantic/lex.el (semantic-lex-map-types)
(define-lex, define-lex-block-type-analyzer):
* lisp/cedet/semantic/senator.el (senator-search-default-tag-filter):
* lisp/cedet/semantic/symref.el (semantic-symref-result)
(semantic-symref-hit-to-tag-via-db):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass):
* lisp/cedet/semantic/tag.el (semantic-tag-new-variable)
(semantic-tag-new-include, semantic-tag-new-package)
(semantic-tag-set-faux, semantic-create-tag-proxy)
(semantic-tag-function-parent)
(semantic-tag-components-with-overlays):
* lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces)
(srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict):
* lisp/cedet/srecode/dictionary.el (srecode-create-dictionary)
(srecode-dictionary-add-entries, srecode-dictionary-lookup-name)
(srecode-create-dictionaries-from-tags):
* lisp/cmuscheme.el (scheme-compile-region):
* lisp/color.el (color-lab-to-lch):
* lisp/doc-view.el (doc-view-image-width)
(doc-view-set-up-single-converter):
* lisp/dynamic-setting.el (font-setting-change-default-font)
(dynamic-setting-handle-config-changed-event):
* lisp/elec-pair.el (electric-pair-text-pairs)
(electric-pair-skip-whitespace-function)
(electric-pair-string-bound-function):
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance)
(avl-tree-member, avl-tree-mapcar, avl-tree-iter):
* lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree):
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag)
(checkdoc-spellcheck-documentation-flag, checkdoc-ispell)
(checkdoc-ispell-current-buffer, checkdoc-ispell-interactive)
(checkdoc-ispell-message-interactive)
(checkdoc-ispell-message-text, checkdoc-ispell-start)
(checkdoc-ispell-continue, checkdoc-ispell-comments)
(checkdoc-ispell-defun):
* lisp/emacs-lisp/cl-generic.el (cl--generic-search-method):
* lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group):
* lisp/emacs-lisp/lisp.el (forward-sexp, up-list):
* lisp/emacs-lisp/package-x.el (package--archive-contents-from-file):
* lisp/emacs-lisp/package.el (package-desc)
(package--make-autoloads-and-stuff, package-hidden-regexps):
* lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup):
* lisp/emacs-lisp/testcover.el (testcover-nohits)
(testcover-1value):
* lisp/epg.el (epg-receive-keys, epg-start-edit-key):
* lisp/erc/erc-backend.el (erc-server-processing-p)
(erc-split-line-length, erc-server-coding-system)
(erc-server-send, erc-message):
* lisp/erc/erc-button.el (erc-button-face, erc-button-alist)
(erc-browse-emacswiki):
* lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login):
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation):
* lisp/erc/erc-log.el (erc-current-logfile):
* lisp/erc/erc-match.el (erc-log-match-format)
(erc-text-matched-hook):
* lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug):
* lisp/erc/erc-networks.el (erc-server-alist)
(erc-networks-alist, erc-current-network):
* lisp/erc/erc-ring.el (erc-input-ring-index):
* lisp/erc/erc-speedbar.el (erc-speedbar)
(erc-speedbar-update-channel):
* lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag):
* lisp/erc/erc-track.el (erc-track-position-in-mode-line)
(erc-track-remove-from-mode-line, erc-modified-channels-update)
(erc-track-last-non-erc-buffer, erc-track-sort-by-importance)
(erc-track-get-active-buffer):
* lisp/erc/erc.el (erc-get-channel-user-list)
(erc-echo-notice-hook, erc-echo-notice-always-hook)
(erc-wash-quit-reason, erc-format-@nick):
* lisp/ffap.el (ffap-latex-mode):
* lisp/files.el (abort-if-file-too-large)
(dir-locals--get-sort-score, buffer-stale--default-function):
* lisp/filesets.el (filesets-tree-max-level, filesets-data)
(filesets-update-pre010505):
* lisp/gnus/gnus-agent.el (gnus-agent-flush-cache):
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-prefer-mid-or-mail):
* lisp/gnus/gnus-cus.el (gnus-group-parameters):
* lisp/gnus/gnus-demon.el (gnus-demon-handlers)
(gnus-demon-run-callback):
* lisp/gnus/gnus-dired.el (gnus-dired-print):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer):
* lisp/gnus/gnus-range.el (gnus-range-normalize):
* lisp/gnus/gnus-spec.el (gnus-pad-form):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-closed, gnus-server-denied)
(gnus-server-offline):
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir)
(gnus-refer-thread-limit-to-thread)
(gnus-summary-limit-include-thread, gnus-summary-refer-thread)
(gnus-summary-find-matching):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server):
* lisp/gnus/mail-source.el (mail-source-incoming-file-prefix):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style-outlook, message-cite-style-thunderbird)
(message-cite-style-gmail, message--send-mail-maybe-partially):
* lisp/gnus/mm-extern.el (mm-inline-external-body):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mml-sec.el (mml-secure-message-sign)
(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
* lisp/gnus/mml2015.el (mml2015-epg-key-image)
(mml2015-epg-key-image-to-string):
* lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail):
* lisp/gnus/nnheader.el (nnheader-directory-files-is-safe):
* lisp/gnus/nnir.el (nnir-search-history)
(nnir-imap-search-other, nnir-artlist-length)
(nnir-artlist-article, nnir-artitem-group, nnir-artitem-number)
(nnir-artitem-rsv, nnir-article-group, nnir-article-number)
(nnir-article-rsv, nnir-article-ids, nnir-categorize)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-hyrex-additional-switches)
(gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms)
(nnir-read-parm, nnir-read-server-parm, nnir-search-thread):
* lisp/gnus/nnmairix.el (nnmairix-default-group)
(nnmairix-propagate-marks):
* lisp/gnus/smime.el (smime-keys, smime-crl-check)
(smime-verify-buffer, smime-noverify-buffer):
* lisp/gnus/spam-report.el (spam-report-url-ping-mm-url):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header)
(spam-spamassassin-spam-status-header, spam-sa-learn-rebuild)
(spam-classifications, spam-check-stat, spam-spamassassin-score):
* lisp/help.el (describe-minor-mode-from-symbol):
* lisp/hippie-exp.el (hippie-expand-ignore-buffers):
* lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face)
(hfy-begin-span):
* lisp/ibuf-ext.el (ibuffer-update-saved-filters-format)
(ibuffer-saved-filters, ibuffer-old-saved-filters-warning)
(ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters)
(eval, ibuffer-unary-operand, file-extension, directory):
* lisp/image-dired.el (image-dired-cmd-pngcrush-options):
* lisp/image-mode.el (image-toggle-display):
* lisp/international/ccl.el (ccl-compile-read-multibyte-character)
(ccl-compile-write-multibyte-character):
* lisp/international/kkc.el (kkc-save-init-file):
* lisp/international/latin1-disp.el (latin1-display):
* lisp/international/ogonek.el (ogonek-name-encoding-alist)
(ogonek-information, ogonek-lookup-encoding)
(ogonek-deprefixify-region):
* lisp/isearch.el (isearch-filter-predicate)
(isearch--momentary-message):
* lisp/jsonrpc.el (jsonrpc-connection-send)
(jsonrpc-process-connection, jsonrpc-shutdown)
(jsonrpc--async-request-1):
* lisp/language/tibet-util.el (tibetan-char-p):
* lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date)
(feedmail-last-chance-hook, feedmail-before-fcc-hook)
(feedmail-send-it-immediately-wrapper, feedmail-find-eoh):
* lisp/mail/hashcash.el (hashcash-generate-payment)
(hashcash-generate-payment-async, hashcash-insert-payment)
(hashcash-verify-payment):
* lisp/mail/rmail.el (rmail-movemail-variant-in-use)
(rmail-get-attr-value):
* lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime):
* lisp/mail/rmailsum.el (rmail-summary-show-message):
* lisp/mail/supercite.el (sc-raw-mode-toggle):
* lisp/man.el (Man-start-calling):
* lisp/mh-e/mh-acros.el (mh-do-at-event-location)
(mh-iterate-on-messages-in-region, mh-iterate-on-range):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases)
(mh-alias-reload, mh-alias-ali)
(mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file)
(mh-alias-add-alias):
* lisp/mouse.el (mouse-save-then-kill):
* lisp/net/browse-url.el (browse-url-default-macosx-browser):
* lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value)
(eudc-variable-server-value, eudc-update-variable)
(eudc-expand-inline):
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result):
* lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list):
* lisp/net/pop3.el (pop3-list):
* lisp/net/soap-client.el (soap-namespace-put)
(soap-xs-parse-sequence, soap-parse-envelope):
* lisp/net/soap-inspect.el (soap-inspect-xs-complex-type):
* lisp/nxml/rng-xsd.el (rng-xsd-date-to-days):
* lisp/org/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/org/ob-J.el (org-babel-execute:J):
* lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/org/ob-awk.el (org-babel-execute:awk):
* lisp/org/ob-core.el (org-babel-process-file-name):
* lisp/org/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/org/ob-forth.el (org-babel-execute:forth):
* lisp/org/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/org/ob-groovy.el (org-babel-execute:groovy):
* lisp/org/ob-io.el (org-babel-execute:io):
* lisp/org/ob-js.el (org-babel-execute:js):
* lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/org/ob-lua.el (org-babel-prep-session:lua):
* lisp/org/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/org/ob-processing.el (org-babel-prep-session:processing):
* lisp/org/ob-python.el (org-babel-prep-session:python):
* lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/org/ob-shen.el (org-babel-execute:shen):
* lisp/org/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org/org-colview.el (org-columns--overlay-text):
* lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org/org-indent.el (org-indent-set-line-properties):
* lisp/org/org-macs.el (org-get-limited-outline-regexp):
* lisp/org/org-mobile.el (org-mobile-files):
* lisp/org/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties, org-open-at-point-global)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/org/ox-html.el (org-html-checkbox-type):
* lisp/org/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/org/ox-publish.el (org-publish-sitemap-default):
* lisp/outline.el (outline-head-from-level):
* lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-calc-command-indent, dcl-indent-to):
* lisp/progmodes/flymake.el (flymake-make-diagnostic)
(flymake--overlays, flymake-diagnostic-functions)
(flymake-diagnostic-types-alist, flymake--backend-state)
(flymake-is-running, flymake--collect, flymake-mode):
* lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop)
(gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer):
* lisp/progmodes/grep.el (grep-error-screen-columns):
* lisp/progmodes/gud.el (gud-prev-expr):
* lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column)
(ps-run-goto-error):
* lisp/progmodes/python.el (python-eldoc-get-doc)
(python-eldoc-function-timeout-permanent, python-eldoc-function):
* lisp/shadowfile.el (shadow-make-group):
* lisp/speedbar.el (speedbar-obj-do-check):
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook):
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib):
* lisp/textmodes/reftex-index.el (reftex-index-goto-entry)
(reftex-index-kill, reftex-index-undo):
* lisp/textmodes/reftex-parse.el (reftex-context-substring):
* lisp/textmodes/reftex.el (reftex-TeX-master-file):
* lisp/textmodes/rst.el (rst-next-hdr, rst-toc)
(rst-uncomment-region, rst-font-lock-extend-region-internal):
* lisp/thumbs.el (thumbs-mode):
* lisp/vc/ediff-util.el (ediff-restore-diff):
* lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p):
* lisp/wid-edit.el (widget-field-value-set, string):
* lisp/x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
|
|
|
Sets `flyspell-auto-correct-previous-pos' to nil."
|
2005-06-14 11:36:04 +00:00
|
|
|
(interactive)
|
2002-02-02 15:56:45 +00:00
|
|
|
(remove-hook 'pre-command-hook (function flyspell-auto-correct-previous-hook) t)
|
|
|
|
(unless (eq this-command (function flyspell-auto-correct-previous-word))
|
|
|
|
(setq flyspell-auto-correct-previous-pos nil)))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-auto-correct-previous-word ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2005-06-14 11:36:04 +00:00
|
|
|
(defun flyspell-auto-correct-previous-word (position)
|
2009-10-17 22:43:13 +00:00
|
|
|
"Auto correct the first misspelled word that occurs before point.
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
But don't look beyond what's visible on the screen."
|
2002-02-02 15:56:45 +00:00
|
|
|
(interactive "d")
|
|
|
|
|
2007-04-27 18:53:31 +00:00
|
|
|
(let ((top (window-start))
|
|
|
|
(bot (window-end)))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(save-excursion
|
|
|
|
(save-restriction
|
|
|
|
(narrow-to-region top bot)
|
|
|
|
(overlay-recenter (point))
|
|
|
|
|
2005-06-14 11:36:04 +00:00
|
|
|
(add-hook 'pre-command-hook
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(function flyspell-auto-correct-previous-hook) t t)
|
|
|
|
|
|
|
|
(unless flyspell-auto-correct-previous-pos
|
|
|
|
;; only reset if a new overlay exists
|
|
|
|
(setq flyspell-auto-correct-previous-pos nil)
|
2005-06-14 11:36:04 +00:00
|
|
|
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(let ((overlay-list (overlays-in (point-min) position))
|
|
|
|
(new-overlay 'dummy-value))
|
2005-06-14 11:36:04 +00:00
|
|
|
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
;; search for previous (new) flyspell overlay
|
|
|
|
(while (and new-overlay
|
|
|
|
(or (not (flyspell-overlay-p new-overlay))
|
|
|
|
;; check if its face has changed
|
2005-06-14 11:36:04 +00:00
|
|
|
(not (eq (get-char-property
|
|
|
|
(overlay-start new-overlay) 'face)
|
2005-06-10 10:46:38 +00:00
|
|
|
'flyspell-incorrect))))
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(setq new-overlay (car-safe overlay-list))
|
|
|
|
(setq overlay-list (cdr-safe overlay-list)))
|
2005-06-14 11:36:04 +00:00
|
|
|
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
;; if nothing new exits new-overlay should be nil
|
|
|
|
(if new-overlay ;; the length of the word may change so go to the start
|
2005-06-14 11:36:04 +00:00
|
|
|
(setq flyspell-auto-correct-previous-pos
|
(flyspell-version): Function deleted.
(flyspell-auto-correct-previous-hook): Doc fix.
(flyspell-emacs, flyspell-use-local-map): Vars moved up.
(flyspell-default-delayed-commands): add backward-delete-char-untabify.
(flyspell-abbrev-p): Default to nil.
(flyspell-use-global-abbrev-table-p): Doc fix.
(flyspell-large-region): Allow nil as value.
(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
(mail-mode-flyspell-verify): More robust handling
of `mail-header-separator'. More efficient signature detection.
Allow for regexp metacharacters in message-header-separator.
Adding `To' not to be checked in mail-mode-flyspell-verify.
(flyspell-prog-mode): Run flyspell-prog-mode-hook.
(flyspell-mouse-map, flyspell-mode-map): Bind C-. and C-, .
Bind M-TAB only if flyspell-use-meta-tab.
Bind flyspell-auto-correct-binding.
(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
(flyspell-mode): Doc fix.
(flyspell-accept-buffer-local-defs): Preserve current buffer.
(flyspell-word-cache-result): New var, always local.
(flyspell-check-pre-word-p): Doc fix.
(flyspell-check-changed-word-p): Handle spc like newline.
(flyspell-post-command-hook): Set flyspell-word-cache-result.
(flyspell-word-search-backward, flyspell-word-search-forward): New functions.
(flyspell-word): Return t if nothing to check.
When parsing TeX code, check for after } or \.
Use flyspell-word-search-backward to find previous word.
Return nil if duplicated word.
For word already checked, return same value as last time.
Set flyspell-word-cache-result after checking.
Don't clobber the return value.
(flyspell-get-word): Major rewrite.
(flyspell-external-point-words): New locals pword, pcount.
Fix size used in progress message.
Find the proper corresponding word in flyspell-large-region-buffer.
(flyspell-region): Check for flyspell-large-region = nil.
(flyspell-highlight-incorrect-region): Clean up overlays in region.
(flyspell-auto-correct-word): Check that WORD is a cons.
(flyspell-correct-word): Likewise.
(flyspell-auto-correct-previous-word):
Narrow down to what's on the screen, and recenter overlays
at the end of the next word.
2005-05-29 14:29:34 +00:00
|
|
|
(overlay-start new-overlay)))))
|
|
|
|
|
|
|
|
(when flyspell-auto-correct-previous-pos
|
|
|
|
(save-excursion
|
|
|
|
(goto-char flyspell-auto-correct-previous-pos)
|
|
|
|
(let ((ispell-following-word t)) ;; point is at start
|
|
|
|
(if (numberp flyspell-auto-correct-previous-pos)
|
|
|
|
(goto-char flyspell-auto-correct-previous-pos))
|
|
|
|
(flyspell-auto-correct-word))
|
|
|
|
;; the point may have moved so reset this
|
|
|
|
(setq flyspell-auto-correct-previous-pos (point))))))))
|
2002-02-02 15:56:45 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-correct-word ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2006-11-06 16:06:11 +00:00
|
|
|
|
1998-06-26 01:24:05 +00:00
|
|
|
(defun flyspell-correct-word (event)
|
1998-07-29 03:21:32 +00:00
|
|
|
"Pop up a menu of possible corrections for a misspelled word.
|
|
|
|
The word checked is the word at the mouse position."
|
1998-06-26 01:24:05 +00:00
|
|
|
(interactive "e")
|
|
|
|
(let ((save (point)))
|
|
|
|
(mouse-set-point event)
|
2006-11-06 16:06:11 +00:00
|
|
|
(flyspell-correct-word-before-point event save)))
|
|
|
|
|
|
|
|
(defun flyspell-correct-word-before-point (&optional event opoint)
|
|
|
|
"Pop up a menu of possible corrections for misspelled word before point.
|
|
|
|
If EVENT is non-nil, it is the mouse event that invoked this operation;
|
|
|
|
that controls where to put the menu.
|
|
|
|
If OPOINT is non-nil, restore point there after adjusting it for replacement."
|
|
|
|
(interactive)
|
|
|
|
;; use the correct dictionary
|
|
|
|
(flyspell-accept-buffer-local-defs)
|
2009-04-16 18:45:20 +00:00
|
|
|
(or opoint (setq opoint (point)))
|
2006-11-06 16:06:11 +00:00
|
|
|
(let ((cursor-location (point))
|
2009-10-17 03:10:10 +00:00
|
|
|
(word (flyspell-get-word)))
|
2006-11-06 16:06:11 +00:00
|
|
|
(if (consp word)
|
|
|
|
(let ((start (car (cdr word)))
|
|
|
|
(end (car (cdr (cdr word))))
|
|
|
|
(word (car word))
|
|
|
|
poss ispell-filter)
|
|
|
|
;; now check spelling of word.
|
|
|
|
(ispell-send-string "%\n") ;put in verbose mode
|
|
|
|
(ispell-send-string (concat "^" word "\n"))
|
|
|
|
;; wait until ispell has processed word
|
|
|
|
(while (progn
|
|
|
|
(accept-process-output ispell-process)
|
|
|
|
(not (string= "" (car ispell-filter)))))
|
|
|
|
;; Remove leading empty element
|
|
|
|
(setq ispell-filter (cdr ispell-filter))
|
|
|
|
;; ispell process should return something after word is sent.
|
|
|
|
;; Tag word as valid (i.e., skip) otherwise
|
|
|
|
(or ispell-filter
|
|
|
|
(setq ispell-filter '(*)))
|
|
|
|
(if (consp ispell-filter)
|
|
|
|
(setq poss (ispell-parse-output (car ispell-filter))))
|
|
|
|
(cond
|
|
|
|
((or (eq poss t) (stringp poss))
|
|
|
|
;; don't correct word
|
|
|
|
t)
|
|
|
|
((null poss)
|
|
|
|
;; ispell error
|
|
|
|
(error "Ispell: error in Ispell process"))
|
2016-12-17 19:06:34 +00:00
|
|
|
(t
|
2006-11-06 16:06:11 +00:00
|
|
|
;; The word is incorrect, we have to propose a replacement.
|
|
|
|
(flyspell-do-correct (flyspell-emacs-popup event poss word)
|
|
|
|
poss word cursor-location start end opoint)))
|
|
|
|
(ispell-pdict-save t)))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-do-correct ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2005-06-06 21:06:19 +00:00
|
|
|
(defun flyspell-do-correct (replace poss word cursor-location start end save)
|
|
|
|
"The popup menu callback."
|
1998-06-26 01:24:05 +00:00
|
|
|
(cond ((eq replace 'ignore)
|
2005-06-06 21:06:19 +00:00
|
|
|
(goto-char save)
|
1998-06-26 01:24:05 +00:00
|
|
|
nil)
|
|
|
|
((eq replace 'save)
|
2005-06-06 21:06:19 +00:00
|
|
|
(goto-char save)
|
|
|
|
(ispell-send-string (concat "*" word "\n"))
|
|
|
|
(ispell-send-string "#\n")
|
1998-06-26 01:24:05 +00:00
|
|
|
(flyspell-unhighlight-at cursor-location)
|
|
|
|
(setq ispell-pdict-modified-p '(t)))
|
|
|
|
((or (eq replace 'buffer) (eq replace 'session))
|
2005-06-06 21:06:19 +00:00
|
|
|
(ispell-send-string (concat "@" word "\n"))
|
2012-04-23 12:33:25 +02:00
|
|
|
(add-to-list 'ispell-buffer-session-localwords word)
|
|
|
|
(or ispell-buffer-local-name ; session localwords might conflict
|
|
|
|
(setq ispell-buffer-local-name (buffer-name)))
|
1998-06-26 01:24:05 +00:00
|
|
|
(flyspell-unhighlight-at cursor-location)
|
|
|
|
(if (null ispell-pdict-modified-p)
|
|
|
|
(setq ispell-pdict-modified-p
|
|
|
|
(list ispell-pdict-modified-p)))
|
2005-06-06 21:06:19 +00:00
|
|
|
(goto-char save)
|
1998-06-26 01:24:05 +00:00
|
|
|
(if (eq replace 'buffer)
|
|
|
|
(ispell-add-per-file-word-list word)))
|
|
|
|
(replace
|
2005-06-06 21:06:19 +00:00
|
|
|
(flyspell-unhighlight-at cursor-location)
|
2000-07-24 18:36:17 +00:00
|
|
|
(let ((old-max (point-max))
|
|
|
|
(new-word (if (atom replace)
|
|
|
|
replace
|
|
|
|
(car replace)))
|
|
|
|
(cursor-location (+ (- (length word) (- end start))
|
|
|
|
cursor-location)))
|
2005-06-06 21:06:19 +00:00
|
|
|
(unless (equal new-word (car poss))
|
|
|
|
(delete-region start end)
|
|
|
|
(goto-char start)
|
|
|
|
(funcall flyspell-insert-function new-word)
|
|
|
|
(if flyspell-abbrev-p
|
|
|
|
(flyspell-define-abbrev word new-word)))
|
2016-12-17 19:09:41 +00:00
|
|
|
(flyspell-adjust-cursor-point save cursor-location old-max)))
|
2005-06-06 21:06:19 +00:00
|
|
|
(t
|
|
|
|
(goto-char save)
|
|
|
|
nil)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
2016-12-17 19:09:41 +00:00
|
|
|
;;* flyspell-adjust-cursor-point ... */
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
2016-12-17 19:09:41 +00:00
|
|
|
(defun flyspell-adjust-cursor-point (save cursor-location old-max)
|
2000-07-24 18:36:17 +00:00
|
|
|
(if (>= save cursor-location)
|
|
|
|
(let ((new-pos (+ save (- (point-max) old-max))))
|
|
|
|
(goto-char (cond
|
|
|
|
((< new-pos (point-min))
|
|
|
|
(point-min))
|
|
|
|
((> new-pos (point-max))
|
|
|
|
(point-max))
|
|
|
|
(t new-pos))))
|
|
|
|
(goto-char save)))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-emacs-popup ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
1998-07-29 03:21:32 +00:00
|
|
|
(defun flyspell-emacs-popup (event poss word)
|
|
|
|
"The Emacs popup menu."
|
2015-07-24 10:47:05 +03:00
|
|
|
(if (and (not event)
|
|
|
|
(display-mouse-p))
|
1998-06-26 01:24:05 +00:00
|
|
|
(let* ((mouse-pos (mouse-position))
|
|
|
|
(mouse-pos (if (nth 1 mouse-pos)
|
|
|
|
mouse-pos
|
|
|
|
(set-mouse-position (car mouse-pos)
|
2000-07-24 18:36:17 +00:00
|
|
|
(/ (frame-width) 2) 2)
|
1998-06-26 01:24:05 +00:00
|
|
|
(mouse-position))))
|
|
|
|
(setq event (list (list (car (cdr mouse-pos))
|
|
|
|
(1+ (cdr (cdr mouse-pos))))
|
|
|
|
(car mouse-pos)))))
|
2016-02-29 15:13:30 +11:00
|
|
|
(let* ((corrects (flyspell-sort (car (cdr (cdr poss))) word))
|
1998-06-26 01:24:05 +00:00
|
|
|
(cor-menu (if (consp corrects)
|
|
|
|
(mapcar (lambda (correct)
|
|
|
|
(list correct correct))
|
|
|
|
corrects)
|
|
|
|
'()))
|
|
|
|
(affix (car (cdr (cdr (cdr poss)))))
|
2006-01-21 13:11:21 +00:00
|
|
|
show-affix-info
|
|
|
|
(base-menu (let ((save (if (and (consp affix) show-affix-info)
|
1998-06-26 01:24:05 +00:00
|
|
|
(list
|
|
|
|
(list (concat "Save affix: " (car affix))
|
|
|
|
'save)
|
2002-02-02 15:56:45 +00:00
|
|
|
'("Accept (session)" session)
|
1998-06-26 01:24:05 +00:00
|
|
|
'("Accept (buffer)" buffer))
|
|
|
|
'(("Save word" save)
|
|
|
|
("Accept (session)" session)
|
|
|
|
("Accept (buffer)" buffer)))))
|
|
|
|
(if (consp cor-menu)
|
|
|
|
(append cor-menu (cons "" save))
|
|
|
|
save)))
|
|
|
|
(menu (cons "flyspell correction menu" base-menu)))
|
|
|
|
(car (x-popup-menu event
|
|
|
|
(list (format "%s [%s]" word (or ispell-local-dictionary
|
|
|
|
ispell-dictionary))
|
|
|
|
menu)))))
|
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* Some example functions for real autocorrecting */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-maybe-correct-transposition (beg end poss)
|
2001-03-26 16:31:20 +00:00
|
|
|
"Check replacements for transposed characters.
|
|
|
|
|
|
|
|
If the text between BEG and END is equal to a correction suggested by
|
|
|
|
Ispell, after transposing two adjacent characters, correct the text,
|
|
|
|
and return t.
|
|
|
|
|
2015-08-20 17:33:48 -07:00
|
|
|
The third arg POSS is either the symbol `doublon' or a list of
|
2005-06-14 11:36:04 +00:00
|
|
|
possible corrections as returned by `ispell-parse-output'.
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-06-14 11:36:04 +00:00
|
|
|
This function is meant to be added to `flyspell-incorrect-hook'."
|
2001-03-26 16:31:20 +00:00
|
|
|
(when (consp poss)
|
2004-05-08 12:48:49 +00:00
|
|
|
(catch 'done
|
|
|
|
(let ((str (buffer-substring beg end))
|
|
|
|
(i 0) (len (- end beg)) tmp)
|
|
|
|
(while (< (1+ i) len)
|
|
|
|
(setq tmp (aref str i))
|
|
|
|
(aset str i (aref str (1+ i)))
|
|
|
|
(aset str (1+ i) tmp)
|
|
|
|
(when (member str (nth 2 poss))
|
|
|
|
(save-excursion
|
|
|
|
(goto-char (+ beg i 1))
|
|
|
|
(transpose-chars 1))
|
|
|
|
(throw 'done t))
|
|
|
|
(setq tmp (aref str i))
|
|
|
|
(aset str i (aref str (1+ i)))
|
|
|
|
(aset str (1+ i) tmp)
|
|
|
|
(setq i (1+ i))))
|
|
|
|
nil)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
|
|
|
(defun flyspell-maybe-correct-doubling (beg end poss)
|
2001-03-26 16:31:20 +00:00
|
|
|
"Check replacements for doubled characters.
|
|
|
|
|
|
|
|
If the text between BEG and END is equal to a correction suggested by
|
|
|
|
Ispell, after removing a pair of doubled characters, correct the text,
|
|
|
|
and return t.
|
|
|
|
|
2015-08-20 17:33:48 -07:00
|
|
|
The third arg POSS is either the symbol `doublon' or a list of
|
2005-06-14 11:36:04 +00:00
|
|
|
possible corrections as returned by `ispell-parse-output'.
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-06-14 11:36:04 +00:00
|
|
|
This function is meant to be added to `flyspell-incorrect-hook'."
|
2001-01-26 18:52:53 +00:00
|
|
|
(when (consp poss)
|
2004-05-08 12:48:49 +00:00
|
|
|
(catch 'done
|
|
|
|
(let ((str (buffer-substring beg end))
|
|
|
|
(i 0) (len (- end beg)))
|
|
|
|
(while (< (1+ i) len)
|
|
|
|
(when (and (= (aref str i) (aref str (1+ i)))
|
|
|
|
(member (concat (substring str 0 (1+ i))
|
|
|
|
(substring str (+ i 2)))
|
|
|
|
(nth 2 poss)))
|
|
|
|
(goto-char (+ beg i))
|
|
|
|
(delete-char 1)
|
|
|
|
(throw 'done t))
|
|
|
|
(setq i (1+ i))))
|
|
|
|
nil)))
|
2000-07-24 18:36:17 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-already-abbrevp ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-already-abbrevp (table word)
|
|
|
|
(let ((sym (abbrev-symbol word table)))
|
|
|
|
(and sym (symbolp sym))))
|
1998-06-26 01:24:05 +00:00
|
|
|
|
2005-11-16 17:00:29 +00:00
|
|
|
;;*---------------------------------------------------------------------*/
|
|
|
|
;;* flyspell-change-abbrev ... */
|
|
|
|
;;*---------------------------------------------------------------------*/
|
2000-07-24 18:36:17 +00:00
|
|
|
(defun flyspell-change-abbrev (table old new)
|
|
|
|
(set (abbrev-symbol old table) new))
|
2002-01-29 13:42:12 +00:00
|
|
|
|
2000-07-24 18:36:17 +00:00
|
|
|
(provide 'flyspell)
|
2001-07-16 12:23:00 +00:00
|
|
|
|
1998-06-26 01:24:05 +00:00
|
|
|
;;; flyspell.el ends here
|