From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Wrong local keymap after setting major mode in a timer Date: Tue, 4 Aug 2009 11:37:30 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249378674 16260 80.91.229.12 (4 Aug 2009 09:37:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2009 09:37:54 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 04 11:37:47 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MYGSo-0002SJ-H7 for ged-emacs-devel@m.gmane.org; Tue, 04 Aug 2009 11:37:47 +0200 Original-Received: from localhost ([127.0.0.1]:36142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYGSn-0001I5-HA for ged-emacs-devel@m.gmane.org; Tue, 04 Aug 2009 05:37:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYGSf-0001GK-4y for emacs-devel@gnu.org; Tue, 04 Aug 2009 05:37:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYGSZ-0001CW-JY for emacs-devel@gnu.org; Tue, 04 Aug 2009 05:37:35 -0400 Original-Received: from [199.232.76.173] (port=35455 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYGSZ-0001CG-9d for emacs-devel@gnu.org; Tue, 04 Aug 2009 05:37:31 -0400 Original-Received: from mail-yx0-f172.google.com ([209.85.210.172]:64784) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYGSY-0001K9-UZ for emacs-devel@gnu.org; Tue, 04 Aug 2009 05:37:31 -0400 Original-Received: by yxe2 with SMTP id 2so6757755yxe.14 for ; Tue, 04 Aug 2009 02:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=99v7hGr3R6YXISJlskm89S1LOq4l2HS86BKzVsDG5n4=; b=Zl049SuHYiwL5YJiCwejxea8utdz7n0c7xxgU29qwgnCzY7Ri5sCnFLNGSZKXvEuoh 8Brg3moMhsTQ3upI7x2fl5RgCl6Ovnts8EJfGp3WY897F4G9tZ3xrjbdEBZ4gpzMkKTn n7ZXVB56GnJTXB3unTPadfNT+wZ6xA/nBx3s0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=OW4GrfKmJ6712c7T470qlIeDT2KNGcgmERxt01IydUc3f4AL5o+ZBlhlVLaC+2mtg9 no+MSvFIEIyWejMQEEnLolMoM5jKJ3ns8DXTLUe2n3HeVuQ7t+KP+fC6+dQMcgDTBkdK LSNkQZLU6p4hB0K0228igQdADEs9h6+Fiye7A= Original-Received: by 10.100.127.13 with SMTP id z13mr8534522anc.3.1249378650388; Tue, 04 Aug 2009 02:37:30 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113655 Archived-At: 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.)