Emacs, flyspell, deactivate "C-". key binding

I have this little problem, I have some key bindings like C-. C-xor C-. C-m. After activating flyspell mode, I cannot use these commands. In my .emacs file, I have the following two lines before

(global-unset-key (kbd "C-."))
(define-key (current-global-map) (kbd "C-.") nil)
(global-set-key (kbd "C-. C-l") 'global-linum-mode) 

Then mine C-. C-lworks, but doesn't work when flyspell mode is activated. The command attached to C-.is flyspell-auto-correct-word. I tried to deactivate it as follows:

;; first try
(defun flyspell-auto-correct-word-disable() (define-key (current-local-map) (kbd "C-.") nil))
(add-hook 'flyspell-mode-hook 'flyspell-auto-correct-word-disable)
;; second try
(define-key (current-global-map) [remap flyspell-auto-correct-word] nil)

None of the attempts work, what can I do? I tried on Emacs 23 and 24 and I have the same problem.

+5
source share
1 answer

What about:

(eval-after-load "flyspell"
  '(define-key flyspell-mode-map (kbd "C-.") nil))

, , , . , flyspell-mode-map ( - minor-mode-map-alist, , ).

, eval-after-load ( , ), ( : , flyspell-mode). , .

+9

All Articles