unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* broken menu items
@ 2003-09-12 11:21 Lennart Staflin
  0 siblings, 0 replies; only message in thread
From: Lennart Staflin @ 2003-09-12 11:21 UTC (permalink / raw)


I sent this to emacs-pretest-bug, but got no response.

In GNU Emacs 21.3.50.7 (powerpc-apple-darwin6.6)
  of 2003-09-11 on Saturn.local.
configured using `configure '--enable-carbon-app' 'CC=cc 
-traditional-cpp' 'CFLAGS=-g' 'CPPFLAGS=-traditional-cpp''

Some of the entries in menu bar of the Carbon port of Emacs
seems to do nothing. Like the "Edit > Select All".

I had a closer look at this and it seems that it is a call to 
SetMenuItemRefCon in add_menu_item that is misplaced, it is called even 
for separators, but for these a parameter is not set but has the same 
value as for the preceding item (hmm. it is actually uninitialized, 
must be reusing the same stack position). This clobbers the preceding 
item.

Moving the call to SetMenuItemRefCon seems to fix this.


2003-09-12  Lennart Staflin  <lenst@lysator.liu.se>

	* macmenu.c (add_menu_item): Don't call SetMenuItemRefCon for
	separators, as the pos parameter will be incorrect.


*** macmenu.c.~1.11.~	Sat Aug 30 20:18:53 2003
--- macmenu.c	Thu Sep 11 21:54:46 2003
***************
*** 2281,2289 ****
         else
   	SetItemMark (menu, pos, noMark);
         }
-     }

!   SetMenuItemRefCon (menu, pos, (UInt32) wv->call_data);

     if (submenu != NULL)
       SetMenuItemHierarchicalID (menu, pos, submenu);
--- 2281,2289 ----
         else
   	SetItemMark (menu, pos, noMark);
         }

!       SetMenuItemRefCon (menu, pos, (UInt32) wv->call_data);
!     }

     if (submenu != NULL)
       SetMenuItemHierarchicalID (menu, pos, submenu);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-12 11:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-12 11:21 broken menu items Lennart Staflin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).