aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-11-10 18:36:26 +0000
committerRichard M. Stallman2001-11-10 18:36:26 +0000
commita63f25a404d8ce395324c929baa96f9256d712f6 (patch)
tree6b8608323529c7afdc55ead7721dabe30ab28ddb
parent7a1494ceebc800fedbdb4b68a174229ec427fc25 (diff)
downloademacs-a63f25a404d8ce395324c929baa96f9256d712f6.tar.gz
emacs-a63f25a404d8ce395324c929baa96f9256d712f6.zip
(flyspell-correct-word/local-keymap): Function deleted.
(flyspell-correct-word): Old definition deleted. (flyspell-correct-word/mouse-keymap): Renamed to flyspell-correct-word. All references renamed too.
-rw-r--r--lisp/textmodes/flyspell.el57
1 files changed, 3 insertions, 54 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 4ae3c0e84a6..bed5739de3b 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -363,10 +363,10 @@ property of the major mode name.")
363 (let ((map (make-sparse-keymap))) 363 (let ((map (make-sparse-keymap)))
364 (cond 364 (cond
365 ((eq flyspell-emacs 'xemacs) 365 ((eq flyspell-emacs 'xemacs)
366 (define-key map [(button2)] #'flyspell-correct-word/mouse-keymap) 366 (define-key map [(button2)] #'flyspell-correct-word)
367 (define-key map "\M-\t" #'flyspell-auto-correct-word)) 367 (define-key map "\M-\t" #'flyspell-auto-correct-word))
368 (flyspell-use-local-map 368 (flyspell-use-local-map
369 (define-key map [(mouse-2)] #'flyspell-correct-word/mouse-keymap) 369 (define-key map [(mouse-2)] #'flyspell-correct-word)
370 (define-key map "\M-\t" #'flyspell-auto-correct-word))) 370 (define-key map "\M-\t" #'flyspell-auto-correct-word)))
371 map)) 371 map))
372 372
@@ -1664,62 +1664,11 @@ This command proposes various successive corrections for the current word."
1664 old-max)))))))))) 1664 old-max))))))))))
1665 (setq flyspell-auto-correct-pos (point)) 1665 (setq flyspell-auto-correct-pos (point))
1666 (ispell-pdict-save t))))) 1666 (ispell-pdict-save t)))))
1667 1667
1668;*---------------------------------------------------------------------*/ 1668;*---------------------------------------------------------------------*/
1669;* flyspell-correct-word ... */ 1669;* flyspell-correct-word ... */
1670;*---------------------------------------------------------------------*/ 1670;*---------------------------------------------------------------------*/
1671(defun flyspell-correct-word (event) 1671(defun flyspell-correct-word (event)
1672 "Check spelling of word under or before the cursor.
1673If the word is not found in dictionary, display possible corrections
1674in a popup menu allowing you to choose one.
1675
1676Word syntax described by `ispell-dictionary-alist' (which see).
1677
1678This will check or reload the dictionary. Use \\[ispell-change-dictionary]
1679or \\[ispell-region] to update the Ispell process."
1680 (interactive "e")
1681 (if (eq flyspell-emacs 'xemacs)
1682 (flyspell-correct-word/mouse-keymap event)
1683 (flyspell-correct-word/local-keymap event)))
1684
1685;*---------------------------------------------------------------------*/
1686;* flyspell-correct-word/local-keymap ... */
1687;*---------------------------------------------------------------------*/
1688(defun flyspell-correct-word/local-keymap (event)
1689 "emacs 19.xx seems to be buggous. Overlay keymap does not seems
1690to work correctly with local map. That is, if a key is not
1691defined for the overlay keymap, the current local map, is not
1692checked. The binding is resolved with the global map. The
1693consequence is that we can not use overlay map with flyspell."
1694 (interactive "e")
1695 (save-window-excursion
1696 (let ((save (point)))
1697 (mouse-set-point event)
1698 ;; we look for a flyspell overlay here
1699 (let ((overlays (overlays-at (point)))
1700 (overlay nil))
1701 (while (consp overlays)
1702 (if (flyspell-overlay-p (car overlays))
1703 (progn
1704 (setq overlay (car overlays))
1705 (setq overlays nil))
1706 (setq overlays (cdr overlays))))
1707 ;; we return to the correct location
1708 (goto-char save)
1709 ;; we check to see if button2 has been used overlay a
1710 ;; flyspell overlay
1711 (if overlay
1712 ;; yes, so we use the flyspell function
1713 (flyspell-correct-word/mouse-keymap event)
1714 ;; no so we have to use the non flyspell binding
1715 (let ((flyspell-mode nil))
1716 (if (key-binding (this-command-keys))
1717 (command-execute (key-binding (this-command-keys))))))))))
1718
1719;*---------------------------------------------------------------------*/
1720;* flyspell-correct-word/mouse-keymap ... */
1721;*---------------------------------------------------------------------*/
1722(defun flyspell-correct-word/mouse-keymap (event)
1723 "Pop up a menu of possible corrections for a misspelled word. 1672 "Pop up a menu of possible corrections for a misspelled word.
1724The word checked is the word at the mouse position." 1673The word checked is the word at the mouse position."
1725 (interactive "e") 1674 (interactive "e")