aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDave Love <[email protected]>2000-02-20 19:03:33 +0000
committerDave Love <[email protected]>2000-02-20 19:03:33 +0000
commit2be80b63e783039ddf68ec968ec7fab760a90b7c (patch)
treebee20e86edc1ea5ba6b2f245de1dffdb4e49739b /lisp
parent2505742bda6f24068d16e7cf02329e15049fd2ea (diff)
(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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/textmodes/flyspell.el59
2 files changed, 53 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ee7bef7850..f644d8f156 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
+2000-02-20 Dave Love <[email protected]>
+
+ * 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 <[email protected]>
* dired.el (dired-mode): Call propertized-buffer-identification
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 4e546e1ab9..2f3251f6d0 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1,6 +1,6 @@
;;; 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 <[email protected]>
;; Keywords: convenience
@@ -213,31 +213,31 @@ property of the major mode name.")
(defvar flyspell-mode nil)
(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-mouse-map (make-sparse-keymap))
(or (assoc 'flyspell-mode minor-mode-alist)
(setq minor-mode-alist
(cons '(flyspell-mode " Fly") minor-mode-alist)))
;; mouse or local-map bindings
-(cond
- ((eq flyspell-emacs 'xemacs)
- (define-key flyspell-mouse-map [(button2)]
- (function flyspell-correct-word/mouse-keymap))
- (define-key flyspell-mouse-map "\M-\t" 'flyspell-auto-correct-word))
- (flyspell-use-local-map
- (define-key flyspell-mouse-map [(mouse-2)]
- (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))))
+(when (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
(defvar flyspell-overlay-keymap-property-name
@@ -311,6 +311,8 @@ flyspell-buffer checks the whole buffer."
;*---------------------------------------------------------------------*/
;* flyspell-mode-on ... */
;*---------------------------------------------------------------------*/
+(eval-when-compile (defvar flyspell-local-mouse-map))
+
(defun flyspell-mode-on ()
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead."
(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
;; improvement).
(add-hook 'kill-buffer-hook
- '(lambda ()
- (if (and flyspell-multi-language-p ispell-process)
- (ispell-kill-ispell t))))
+ (lambda ()
+ (if (and flyspell-multi-language-p ispell-process)
+ (ispell-kill-ispell t))))
(make-local-hook 'change-major-mode-hook)
(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
(run-hooks 'flyspell-mode-hook))
@@ -884,7 +895,7 @@ for the overlay."
(if flyspell-use-local-map
(overlay-put flyspell-overlay
flyspell-overlay-keymap-property-name
- flyspell-mouse-map))))
+ flyspell-local-mouse-map))))
;*---------------------------------------------------------------------*/
;* flyspell-highlight-incorrect-region ... */
@@ -1125,7 +1136,7 @@ The word checked is the word at the mouse position."
(progn
(delete-region start end)
(insert word))))))
- ((string-match "XEmacs" (emacs-version))
+ ((eq flyspell-emacs 'xemacs)
(flyspell-xemacs-popup
event poss word cursor-location start end)))
(ispell-pdict-save t))