(flyspell-mouse-map): Change definition
and assignments to it. (flyspell-mode-on): Define flyspell-local-mouse-map, inheriting current local map. (make-flyspell-overlay): Use it. (flyspell-correct-word/mouse-keymap): Change XEmacs test.
This commit is contained in:
parent
2505742bda
commit
2be80b63e7
2 changed files with 53 additions and 24 deletions
|
@ -1,3 +1,21 @@
|
||||||
|
2000-02-20 Dave Love <fx@gnu.org>
|
||||||
|
|
||||||
|
* textmodes/flyspell.el (flyspell-mouse-map): Change definition
|
||||||
|
and assignments to it.
|
||||||
|
(flyspell-mode-on): Define flyspell-local-mouse-map, inheriting
|
||||||
|
current local map.
|
||||||
|
(make-flyspell-overlay): Use it.
|
||||||
|
(flyspell-correct-word/mouse-keymap): Change XEmacs test.
|
||||||
|
|
||||||
|
* emacs-lisp/lisp-mnt.el: Don't require emacsbug at top level.
|
||||||
|
(lm-get-header-re): Defun, not defsubst.
|
||||||
|
(lm-get-package-name): Defun, not defsubst. Simplify.
|
||||||
|
(lm-version): Doc fix. Simplify.
|
||||||
|
(lm-header, lm-header-multiline, lm-header-multiline, lm-summary)
|
||||||
|
(lm-crack-address, lm-last-modified-date, lm-commentary)
|
||||||
|
(lm-verify, lm-synopsis): Simplify.
|
||||||
|
(lm-report-bug): Require emacsbug. Use compose-mail.
|
||||||
|
|
||||||
2000-02-20 Gerd Moellmann <gerd@gnu.org>
|
2000-02-20 Gerd Moellmann <gerd@gnu.org>
|
||||||
|
|
||||||
* dired.el (dired-mode): Call propertized-buffer-identification
|
* dired.el (dired-mode): Call propertized-buffer-identification
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; flyspell.el --- On-the-fly spell checker
|
;;; flyspell.el --- On-the-fly spell checker
|
||||||
|
|
||||||
;; Copyright (C) 1998 Free Software Foundation, Inc.
|
;; Copyright (C) 1998, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
;; Author: Manuel Serrano <Manuel.Serrano@unice.fr>
|
;; Author: Manuel Serrano <Manuel.Serrano@unice.fr>
|
||||||
;; Keywords: convenience
|
;; Keywords: convenience
|
||||||
|
@ -213,31 +213,31 @@ property of the major mode name.")
|
||||||
(defvar flyspell-mode nil)
|
(defvar flyspell-mode nil)
|
||||||
(make-variable-buffer-local 'flyspell-mode)
|
(make-variable-buffer-local 'flyspell-mode)
|
||||||
|
|
||||||
|
(defvar flyspell-mouse-map
|
||||||
|
(let ((map (make-sparse-keymap)))
|
||||||
|
(cond
|
||||||
|
((eq flyspell-emacs 'xemacs)
|
||||||
|
(define-key map [(button2)]
|
||||||
|
#'flyspell-correct-word/mouse-keymap)
|
||||||
|
(define-key flyspell-mouse-map "\M-\t" #'flyspell-auto-correct-word))
|
||||||
|
(flyspell-use-local-map
|
||||||
|
(define-key map [(mouse-2)] #'flyspell-correct-word/mouse-keymap)
|
||||||
|
(define-key map "\M-\t" #'flyspell-auto-correct-word)))
|
||||||
|
map))
|
||||||
(defvar flyspell-mode-map (make-sparse-keymap))
|
(defvar flyspell-mode-map (make-sparse-keymap))
|
||||||
(defvar flyspell-mouse-map (make-sparse-keymap))
|
|
||||||
|
|
||||||
(or (assoc 'flyspell-mode minor-mode-alist)
|
(or (assoc 'flyspell-mode minor-mode-alist)
|
||||||
(setq minor-mode-alist
|
(setq minor-mode-alist
|
||||||
(cons '(flyspell-mode " Fly") minor-mode-alist)))
|
(cons '(flyspell-mode " Fly") minor-mode-alist)))
|
||||||
|
|
||||||
;; mouse or local-map bindings
|
;; mouse or local-map bindings
|
||||||
(cond
|
(when (or (assoc 'flyspell-mode minor-mode-map-alist)
|
||||||
((eq flyspell-emacs 'xemacs)
|
(setq minor-mode-map-alist
|
||||||
(define-key flyspell-mouse-map [(button2)]
|
(cons (cons 'flyspell-mode flyspell-mode-map)
|
||||||
(function flyspell-correct-word/mouse-keymap))
|
minor-mode-map-alist)))
|
||||||
(define-key flyspell-mouse-map "\M-\t" 'flyspell-auto-correct-word))
|
(define-key flyspell-mode-map "\M-\t" 'flyspell-auto-correct-word)
|
||||||
(flyspell-use-local-map
|
(define-key flyspell-mode-map [(mouse-2)]
|
||||||
(define-key flyspell-mouse-map [(mouse-2)]
|
(function flyspell-correct-word/local-keymap)))
|
||||||
(function flyspell-correct-word/mouse-keymap))
|
|
||||||
(define-key flyspell-mouse-map "\M-\t" 'flyspell-auto-correct-word))
|
|
||||||
(t
|
|
||||||
(or (assoc 'flyspell-mode minor-mode-map-alist)
|
|
||||||
(setq minor-mode-map-alist
|
|
||||||
(cons (cons 'flyspell-mode flyspell-mode-map)
|
|
||||||
minor-mode-map-alist)))
|
|
||||||
(define-key flyspell-mode-map "\M-\t" 'flyspell-auto-correct-word)
|
|
||||||
(define-key flyspell-mode-map [(mouse-2)]
|
|
||||||
(function flyspell-correct-word/local-keymap))))
|
|
||||||
|
|
||||||
;; the name of the overlay property that defines the keymap
|
;; the name of the overlay property that defines the keymap
|
||||||
(defvar flyspell-overlay-keymap-property-name
|
(defvar flyspell-overlay-keymap-property-name
|
||||||
|
@ -311,6 +311,8 @@ flyspell-buffer checks the whole buffer."
|
||||||
;*---------------------------------------------------------------------*/
|
;*---------------------------------------------------------------------*/
|
||||||
;* flyspell-mode-on ... */
|
;* flyspell-mode-on ... */
|
||||||
;*---------------------------------------------------------------------*/
|
;*---------------------------------------------------------------------*/
|
||||||
|
(eval-when-compile (defvar flyspell-local-mouse-map))
|
||||||
|
|
||||||
(defun flyspell-mode-on ()
|
(defun flyspell-mode-on ()
|
||||||
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead."
|
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead."
|
||||||
(setq ispell-highlight-face 'flyspell-incorrect-face)
|
(setq ispell-highlight-face 'flyspell-incorrect-face)
|
||||||
|
@ -356,11 +358,20 @@ flyspell-buffer checks the whole buffer."
|
||||||
;; (thanks to Jeff Miller and Roland Rosenfeld who sent me this
|
;; (thanks to Jeff Miller and Roland Rosenfeld who sent me this
|
||||||
;; improvement).
|
;; improvement).
|
||||||
(add-hook 'kill-buffer-hook
|
(add-hook 'kill-buffer-hook
|
||||||
'(lambda ()
|
(lambda ()
|
||||||
(if (and flyspell-multi-language-p ispell-process)
|
(if (and flyspell-multi-language-p ispell-process)
|
||||||
(ispell-kill-ispell t))))
|
(ispell-kill-ispell t))))
|
||||||
(make-local-hook 'change-major-mode-hook)
|
(make-local-hook 'change-major-mode-hook)
|
||||||
(add-hook 'change-major-mode-hook 'flyspell-mode-off)
|
(add-hook 'change-major-mode-hook 'flyspell-mode-off)
|
||||||
|
;; Use this so that we can still get major mode bindings at a
|
||||||
|
;; misspelled word (unless they're overridden by
|
||||||
|
;; `flyspell-mouse-map').
|
||||||
|
(set (make-local-variable 'flyspell-local-mouse-map)
|
||||||
|
(let ((map (copy-keymap flyspell-mouse-map)))
|
||||||
|
(if (eq flyspell-emacs 'xemacs)
|
||||||
|
(set-keymap-parents (list (current-local-map)))
|
||||||
|
(set-keymap-parent map (current-local-map)))
|
||||||
|
map))
|
||||||
;; we end with the flyspell hooks
|
;; we end with the flyspell hooks
|
||||||
(run-hooks 'flyspell-mode-hook))
|
(run-hooks 'flyspell-mode-hook))
|
||||||
|
|
||||||
|
@ -884,7 +895,7 @@ for the overlay."
|
||||||
(if flyspell-use-local-map
|
(if flyspell-use-local-map
|
||||||
(overlay-put flyspell-overlay
|
(overlay-put flyspell-overlay
|
||||||
flyspell-overlay-keymap-property-name
|
flyspell-overlay-keymap-property-name
|
||||||
flyspell-mouse-map))))
|
flyspell-local-mouse-map))))
|
||||||
|
|
||||||
;*---------------------------------------------------------------------*/
|
;*---------------------------------------------------------------------*/
|
||||||
;* flyspell-highlight-incorrect-region ... */
|
;* flyspell-highlight-incorrect-region ... */
|
||||||
|
@ -1125,7 +1136,7 @@ The word checked is the word at the mouse position."
|
||||||
(progn
|
(progn
|
||||||
(delete-region start end)
|
(delete-region start end)
|
||||||
(insert word))))))
|
(insert word))))))
|
||||||
((string-match "XEmacs" (emacs-version))
|
((eq flyspell-emacs 'xemacs)
|
||||||
(flyspell-xemacs-popup
|
(flyspell-xemacs-popup
|
||||||
event poss word cursor-location start end)))
|
event poss word cursor-location start end)))
|
||||||
(ispell-pdict-save t))
|
(ispell-pdict-save t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue