VM

Merge lp:~tcross/vm/605799 into lp:vm

Proposed by Tim Cross
Status: Merged
Merged at revision: 1102
Proposed branch: lp:~tcross/vm/605799
Merge into: lp:vm
Diff against target: 41 lines (+12/-4)
1 file modified
lisp/vm-menu.el (+12/-4)
To merge this branch: bzr merge lp:~tcross/vm/605799
Reviewer Review Type Date Requested Status
Uday Reddy Pending
Review via email: mp+51408@code.launchpad.net

Description of the change

A partial fix for bug 605799.

The problem looks like it is due to a bug in emacs force-mode-line-update. For some reason, when you select Help -> Swith to Emacs Menubar, the menu is not updated immediately (which should occur due to the call to vm-menu-set-menubar-ditry-flag. However, putting a (message "") into the function prior to the call to force-mode-line-update appears to work and the menu bar gets updated.

Without this, the menu bar does not get updated unless some other event occurs i.e. mouse click, move cursor or even wait until something else occurs (maybe gc?). I think it will be necessary to instrument some of the emacs functions and/or run under gdb to really see what is going on. Will raise it on emacs-dev to see if I can get some advice.

Interestingly, the menu pdate delay/problem does not appear to affect the new VM -> Switch to VM Menubar menu, which works without the dummy 'message' line. So, the problem could be due to the way the Help -> Switch to Emacs Menubar is installed. There are a number of other menu related bugs to fix and there is some 'old/moldy' code (even some emacs 19 specific stuff), which I think I might try and clean-up and see if that improves things. This may take a while.

As the 'fix' is really a bit of a kludge, you may not want to merge it. However, I think it is an improvement over what is currently there. At the very least, it would be good if you could try out the changes under Windows and see if it fixes the issue there as well.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lisp/vm-menu.el'
2--- lisp/vm-menu.el 2010-12-22 20:16:48 +0000
3+++ lisp/vm-menu.el 2011-02-26 08:43:02 +0000
4@@ -273,7 +273,7 @@
5
6 (defvar vm-menu-help-menu
7 '("Help"
8- ["Switch to Emacs Toolbar" vm-menu-toggle-menubar]
9+ ["Switch to Emacs Menubar" vm-menu-toggle-menubar t]
10 "---"
11 ["What Now?" vm-help t]
12 ["Describe Mode" describe-mode t]
13@@ -1123,7 +1123,13 @@
14 (cond ((vm-menu-xemacs-menus-p)
15 (set-menubar-dirty-flag))
16 ((vm-menu-fsfemacs-menus-p)
17- (force-mode-line-update))))
18+ ;; This 'dummy' message added to work around a redisplay bug
19+ ;; affecting menu redisplay. Without this, selecting the
20+ ;; "Switch to Emacs Menubar" does not refresh the menu bar display
21+ ;; until some other action (mouse click, keyboard event or timer runs)
22+ ;; This is temporary kludge fix
23+ (message "")
24+ (force-mode-line-update t))))
25
26 (defun vm-menu-toggle-menubar (&optional buffer)
27 (interactive)
28@@ -1156,9 +1162,11 @@
29 (define-key vm-mode-map [menu-bar]
30 (lookup-key vm-mode-menu-map [rootmenu vm]))
31 (define-key vm-mode-map [menu-bar]
32- (make-sparse-keymap))
33+ (make-sparse-keymap "Menu"))
34 (define-key vm-mode-map [menu-bar vm]
35- (cons "[VM]" 'vm-menu-toggle-menubar)))
36+ (cons "VM" (make-sparse-keymap "VM")))
37+ (define-key vm-mode-map [menu-bar vm vm-toggle]
38+ '(menu-item "Switch to VM Menubar" vm-menu-toggle-menubar)))
39 (vm-menu-set-menubar-dirty-flag))))
40
41 (defun vm-menu-install-menubar ()

Subscribers

People subscribed via source and target branches

to all changes: