[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el |
Date: |
Tue, 14 Jun 2005 07:36:04 -0400 |
Index: emacs/lisp/textmodes/flyspell.el
diff -c emacs/lisp/textmodes/flyspell.el:1.68
emacs/lisp/textmodes/flyspell.el:1.69
*** emacs/lisp/textmodes/flyspell.el:1.68 Fri Jun 10 10:46:38 2005
--- emacs/lisp/textmodes/flyspell.el Tue Jun 14 11:36:04 2005
***************
*** 172,178 ****
"*List of functions to be called when incorrect words are encountered.
Each function is given three arguments: the beginning and the end
of the incorrect region. The third is either the symbol 'doublon' or the list
! of possible corrections as returned by 'ispell-parse-output'.
If any of the functions return non-Nil, the word is not highlighted as
incorrect."
--- 172,178 ----
"*List of functions to be called when incorrect words are encountered.
Each function is given three arguments: the beginning and the end
of the incorrect region. The third is either the symbol 'doublon' or the list
! of possible corrections as returned by `ispell-parse-output'.
If any of the functions return non-Nil, the word is not highlighted as
incorrect."
***************
*** 982,988 ****
(setq r p)
(goto-char p))))
r)))
!
;*---------------------------------------------------------------------*/
;* flyspell-word-search-forward ... */
;*---------------------------------------------------------------------*/
--- 982,988 ----
(setq r p)
(goto-char p))))
r)))
!
;*---------------------------------------------------------------------*/
;* flyspell-word-search-forward ... */
;*---------------------------------------------------------------------*/
***************
*** 996,1002 ****
(setq r p)
(goto-char (1+ p)))))
r)))
!
;*---------------------------------------------------------------------*/
;* flyspell-word ... */
;*---------------------------------------------------------------------*/
--- 996,1002 ----
(setq r p)
(goto-char (1+ p)))))
r)))
!
;*---------------------------------------------------------------------*/
;* flyspell-word ... */
;*---------------------------------------------------------------------*/
***************
*** 1026,1032 ****
flyspell-mark-duplications-flag
(save-excursion
(goto-char (1- start))
! (let ((p (flyspell-word-search-backward
word
(- start (1+ (- end start))))))
(and p (/= p (1- start))))))
--- 1026,1032 ----
flyspell-mark-duplications-flag
(save-excursion
(goto-char (1- start))
! (let ((p (flyspell-word-search-backward
word
(- start (1+ (- end start))))))
(and p (/= p (1- start))))))
***************
*** 1126,1132 ****
(flyspell-notify-misspell start end word poss))
nil))))
;; return to original location
! (goto-char cursor-location)
(if ispell-quit (setq ispell-quit nil))
res))))))))
--- 1126,1132 ----
(flyspell-notify-misspell start end word poss))
nil))))
;; return to original location
! (goto-char cursor-location)
(if ispell-quit (setq ispell-quit nil))
res))))))))
***************
*** 1839,1845 ****
(defun flyspell-auto-correct-previous-hook ()
"Hook to track successive calls to `flyspell-auto-correct-previous-word'.
Sets `flyspell-auto-correct-previous-pos' to nil"
! (interactive)
(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)))
--- 1839,1845 ----
(defun flyspell-auto-correct-previous-hook ()
"Hook to track successive calls to `flyspell-auto-correct-previous-word'.
Sets `flyspell-auto-correct-previous-pos' to nil"
! (interactive)
(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)))
***************
*** 1847,1853 ****
;*---------------------------------------------------------------------*/
;* flyspell-auto-correct-previous-word ... */
;*---------------------------------------------------------------------*/
! (defun flyspell-auto-correct-previous-word (position)
"*Auto correct the first mispelled word that occurs before point.
But don't look beyond what's visible on the screen."
(interactive "d")
--- 1847,1853 ----
;*---------------------------------------------------------------------*/
;* flyspell-auto-correct-previous-word ... */
;*---------------------------------------------------------------------*/
! (defun flyspell-auto-correct-previous-word (position)
"*Auto correct the first mispelled word that occurs before point.
But don't look beyond what's visible on the screen."
(interactive "d")
***************
*** 1863,1891 ****
(narrow-to-region top bot)
(overlay-recenter (point))
! (add-hook 'pre-command-hook
(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)
!
(let ((overlay-list (overlays-in (point-min) position))
(new-overlay 'dummy-value))
!
;; search for previous (new) flyspell overlay
(while (and new-overlay
(or (not (flyspell-overlay-p new-overlay))
;; check if its face has changed
! (not (eq (get-char-property
! (overlay-start new-overlay) 'face)
'flyspell-incorrect))))
(setq new-overlay (car-safe overlay-list))
(setq overlay-list (cdr-safe overlay-list)))
!
;; if nothing new exits new-overlay should be nil
(if new-overlay ;; the length of the word may change so go to the
start
! (setq flyspell-auto-correct-previous-pos
(overlay-start new-overlay)))))
(when flyspell-auto-correct-previous-pos
--- 1863,1891 ----
(narrow-to-region top bot)
(overlay-recenter (point))
! (add-hook 'pre-command-hook
(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)
!
(let ((overlay-list (overlays-in (point-min) position))
(new-overlay 'dummy-value))
!
;; search for previous (new) flyspell overlay
(while (and new-overlay
(or (not (flyspell-overlay-p new-overlay))
;; check if its face has changed
! (not (eq (get-char-property
! (overlay-start new-overlay) 'face)
'flyspell-incorrect))))
(setq new-overlay (car-safe overlay-list))
(setq overlay-list (cdr-safe overlay-list)))
!
;; if nothing new exits new-overlay should be nil
(if new-overlay ;; the length of the word may change so go to the
start
! (setq flyspell-auto-correct-previous-pos
(overlay-start new-overlay)))))
(when flyspell-auto-correct-previous-pos
***************
*** 2134,2142 ****
and return t.
The third arg POSS is either the symbol 'doublon' or a list of
! possible corrections as returned by 'ispell-parse-output'.
! This function is meant to be added to 'flyspell-incorrect-hook'."
(when (consp poss)
(catch 'done
(let ((str (buffer-substring beg end))
--- 2134,2142 ----
and return t.
The third arg POSS is either the symbol 'doublon' or a list of
! possible corrections as returned by `ispell-parse-output'.
! This function is meant to be added to `flyspell-incorrect-hook'."
(when (consp poss)
(catch 'done
(let ((str (buffer-substring beg end))
***************
*** 2164,2172 ****
and return t.
The third arg POSS is either the symbol 'doublon' or a list of
! possible corrections as returned by 'ispell-parse-output'.
! This function is meant to be added to 'flyspell-incorrect-hook'."
(when (consp poss)
(catch 'done
(let ((str (buffer-substring beg end))
--- 2164,2172 ----
and return t.
The third arg POSS is either the symbol 'doublon' or a list of
! possible corrections as returned by `ispell-parse-output'.
! This function is meant to be added to `flyspell-incorrect-hook'."
(when (consp poss)
(catch 'done
(let ((str (buffer-substring beg end))
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el, Stefan Monnier, 2005/06/03
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el, Stefan Monnier, 2005/06/06
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el, Lute Kamstra, 2005/06/08
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el, Lute Kamstra, 2005/06/08
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el, Miles Bader, 2005/06/10
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el,
Juanma Barranquero <=
- [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el, Richard M . Stallman, 2005/06/28