(flyspell-use-meta-tab): Add a custom :set function. (Bug#2429)
authorGlenn Morris <rgm@gnu.org>
Tue, 24 Feb 2009 04:44:19 +0000 (04:44 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 24 Feb 2009 04:44:19 +0000 (04:44 +0000)
lisp/ChangeLog
lisp/textmodes/flyspell.el

index 99b3bd7..fad9ebe 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-24  Glenn Morris  <rgm@gnu.org>
 
+       * textmodes/flyspell.el (flyspell-use-meta-tab): Add a custom
+       :set function.  (Bug#2429)
+
        * eshell/esh-util.el (eshell-parse-ange-ls): Define `name' before
        potential use.
 
index 70fd05a..4b9121d 100644 (file)
@@ -262,10 +262,17 @@ If `flyspell-large-region' is nil, all regions are treated as small."
   :group 'flyspell
   :type '(choice string (const nil)))
 
+(defvar flyspell-mode-map)
+
 (defcustom flyspell-use-meta-tab t
   "Non-nil means that flyspell uses M-TAB to correct word."
   :group 'flyspell
-  :type 'boolean)
+  :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))))
 
 (defcustom flyspell-auto-correct-binding
   [(control ?\;)]