emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/nsmenu.m,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/nsmenu.m,v
Date: Thu, 17 Jul 2008 03:34:04 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/07/17 03:33:59

Index: src/nsmenu.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsmenu.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/nsmenu.m        16 Jul 2008 02:22:04 -0000      1.4
+++ src/nsmenu.m        17 Jul 2008 03:33:58 -0000      1.5
@@ -401,9 +401,9 @@
         {
           for (i = 0; i<n; i++)
             {
-              string = XVECTOR (items)->contents[4*i+1];
+             string = AREF (items, 4*i+1);
 
-              if (!string)
+              if (EQ (string, make_number (0))) // FIXME: Why???  --Stef
                 continue;
               if (NILP (string))
                 if (previous_strings[i][0])
@@ -691,8 +691,8 @@
 - (EmacsMenu *)addSubmenuWithTitle: (char *)title forFrame: (struct frame *)f
 {
   NSString *titleStr = [NSString stringWithUTF8String: title];
-  id <NSMenuItem> item =
-    [self addItemWithTitle: titleStr
+  id <NSMenuItem> item
+      = [self addItemWithTitle: titleStr
                     action: nil /address@hidden (menuDown:) */
              keyEquivalent: @""];
   EmacsMenu *submenu = [[EmacsMenu alloc] initWithTitle: titleStr frame: f];
@@ -724,8 +724,9 @@
   [NSMenu popUpContextMenu: self withEvent: event forView: view];
   retVal = context_menu_value;
   context_menu_value = 0;
-  return retVal > 0 ?
-    find_and_return_menu_selection (f, keymaps, (void *)retVal) : Qnil;
+  return retVal > 0
+      ? find_and_return_menu_selection (f, keymaps, (void *)retVal)
+      : Qnil;
 }
 
 @end  /* EmacsMenu */
@@ -1061,8 +1062,8 @@
          /* If this item has a null value,
             make the call_data null so that it won't display a box
             when the mouse is on it.  */
-         wv->call_data =
-            !NILP (def) ? (void *) &XVECTOR (menu_items)->contents[i] : 0;
+         wv->call_data
+             = !NILP (def) ? (void *) &XVECTOR (menu_items)->contents[i] : 0;
          wv->enabled = !NILP (enable);
 
          if (NILP (type))
@@ -1157,9 +1158,6 @@
   int i;
   EmacsToolbar *toolbar = [FRAME_NS_VIEW (f) toolbar];
 
-  if (NILP (f->tool_bar_lines) || !INTEGERP (f->tool_bar_lines))
-    return;
-
   [toolbar clearActive];
 
   /* update EmacsToolbar as in GtkUtils, build items list */
@@ -1294,8 +1292,8 @@
                         helpText: (char *)help enabled: (BOOL)enabled
 {
   /* 1) come up w/identifier */
-  NSString *identifier =
-    [NSString stringWithFormat: @"%u", [img hash]];
+  NSString *identifier
+      = [NSString stringWithFormat: @"%u", [img hash]];
 
   /* 2) create / reuse item */
   NSToolbarItem *item = [identifierToItem objectForKey: identifier];
@@ -1557,7 +1555,7 @@
   NSSize spacing = {SPACER, SPACER};
   NSRect area;
   char this_cmd_name[80];
-  id cell, tem;
+  id cell;
   static NSImageView *imgView;
   static FlippedView *contentView;
 
@@ -1649,7 +1647,7 @@
 
 - (BOOL)windowShouldClose: (id)sender
 {
-  [NSApp stopModalWithCode: Qnil];
+  [NSApp stopModalWithCode: XHASH (Qnil)]; // FIXME: BIG UGLY HACK!!
   return NO;
 }
 
@@ -1693,7 +1691,7 @@
   [cell setTarget: self];
   [cell setAction: @selector (clicked: )];
   [cell setTitle: [NSString stringWithUTF8String: str]];
-  [cell setTag: (int)val];
+  [cell setTag: XHASH (val)];  // FIXME: BIG UGLY HACK!!
   [cell setBordered: YES];
   [cell setEnabled: YES];
 
@@ -1730,14 +1728,14 @@
 - clicked: sender
 {
   NSArray *sellist = nil;
-  Lisp_Object seltag;
+  EMACS_INT seltag;
 
   sellist = [sender selectedCells];
   if ([sellist count]<1) 
     return self;
 
-  seltag = (Lisp_Object)[[sellist objectAtIndex: 0] tag];
-  if (! EQ (seltag, Qundefined))
+  seltag = [[sellist objectAtIndex: 0] tag];
+  if (seltag == XHASH (Qundefined)) // FIXME: BIG UGLY HACK!!
     [NSApp stopModalWithCode: seltag];
   return self;
 }
@@ -1844,7 +1842,11 @@
     }
   [NSApp endModalSession: session];
 
-  return (Lisp_Object)ret;
+  {                            // FIXME: BIG UGLY HACK!!!
+      Lisp_Object tmp;
+      *(EMACS_INT*)(&tmp) = ret;
+      return tmp;
+  }
 }
 
 @end




reply via email to

[Prev in Thread] Current Thread [Next in Thread]