* Wrong local keymap after setting major mode in a timer
@ 2009-08-04 9:37 Lennart Borgman
0 siblings, 0 replies; only message in thread
From: Lennart Borgman @ 2009-08-04 9:37 UTC (permalink / raw)
To: Emacs-Devel devel
Sometimes the (current-local-map) seems to be wrong after setting
major mode in a timer in MuMaMo:
(defun mumamo-idle-set-major-mode (buffer window)
"Set major mode from mumamo chunk when Emacs is idle.
Do this only if current buffer is BUFFER and then do it in window
WINDOW.
See the variable `mumamo-set-major-mode-delay' for an
explanation."
(save-match-data ;; runs in idle timer
(mumamo-msgfntfy "mumamo-idle-set-major-mode b=%s, window=%s" buffer window)
(with-selected-window window
;; According to Stefan Monnier we need to set the buffer too.
(with-current-buffer (window-buffer)
(when (eq buffer (current-buffer))
(mumamo-condition-case err
;;(let* ((ovl (mumamo-get-chunk-at (point)))
(let* ((ovl (mumamo-find-chunks (point)
"mumamo-idle-set-major-mode"))
(major (mumamo-chunk-major-mode ovl))
(modified (buffer-modified-p)))
(unless (eq major major-mode)
;;(message "mumamo-set-major at A")
(mumamo-set-major major)
I have just seen this happen. The major mode is set to text-mode, but
the keymap is still php-mode map. php-mode is derived from c-mode (if
that matter).
I think someone saw a problem with setting major mode/keymap in a
timer some months ago, but I do not remember more.
Anyone knows what might be going on here? (This is with the latest CVS Emacs.)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-04 9:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-04 9:37 Wrong local keymap after setting major mode in a timer Lennart Borgman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.