]> git.eshelyaron.com Git - emacs.git/commitdiff
* nsfns.m (ns-read-file-name): BLOCK_INPUT while showing dialog. \n \n* nsmenu.m...
authorAdrian Robert <Adrian.B.Robert@gmail.com>
Fri, 13 Feb 2009 13:30:35 +0000 (13:30 +0000)
committerAdrian Robert <Adrian.B.Robert@gmail.com>
Fri, 13 Feb 2009 13:30:35 +0000 (13:30 +0000)
src/ChangeLog
src/nsfns.m
src/nsfont.m
src/nsmenu.m

index 7e56fb1e9776f745ae76263b0f9fe651e3be173e..f9c2499650076b846f5f2eacad6a99ab3189357b 100644 (file)
@@ -1,3 +1,14 @@
+2009-02-13  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+       * nsfns.m (ns-read-file-name): BLOCK_INPUT while showing dialog.
+
+       * nsmenu.m (pop_down_menu): Check popup_activated_flag.
+       (ns_popup_dialog, EmacsDialogPanel-runDialogAt:): Let
+       pop_down_menu do the cleanup work as it is always called. (Bug#2154)
+
+       * nsfont.m (nsfont_make_fontset_for_font): For now, don't try to
+       set fontset font for "mathematical-" sub-scripts. (Bug #2218)
+
 2009-02-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * keyboard.c (adjust_point_for_property): Allow stopping betwen two
index f3b80c11622ae94f6b4ecb7d3212af58ecf36f8e..963445b624cd7ccb5253fe19d12ac16442d035a2 100644 (file)
@@ -1449,7 +1449,7 @@ Optional arg INIT, if non-nil, provides a default file name to use.  */)
   static id fileDelegate = nil;
   int ret;
   id panel;
-  NSString *fname;
+  Lisp_Object fname;
 
   NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil :
     [NSString stringWithUTF8String: SDATA (prompt)];
@@ -1482,6 +1482,7 @@ Optional arg INIT, if non-nil, provides a default file name to use.  */)
   [panel setDelegate: fileDelegate];
 
   panelOK = 0;
+  BLOCK_INPUT;
   if (NILP (isLoad))
     {
       ret = [panel runModalForDirectory: dirS file: initS];
@@ -1494,11 +1495,13 @@ Optional arg INIT, if non-nil, provides a default file name to use.  */)
 
   ret = (ret == NSOKButton) || panelOK;
 
-  fname = [panel filename];
-
+  if (ret)
+    fname = build_string ([[panel filename] UTF8String]);
+  
   [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
+  UNBLOCK_INPUT;
 
-  return ret ? build_string ([fname UTF8String]) : Qnil;
+  return ret ? fname : Qnil;
 }
 
 
@@ -2644,6 +2647,7 @@ Value is t if tooltip was open, nil otherwise.  */)
 
 #endif
 
+
 /* ==========================================================================
 
     Lisp interface declaration
index d1bbf8260d9d7a42b841b6764b7efbb933ae2df3..386637df59abf621bbdc7bbd96f240c64b9f77bc 100644 (file)
@@ -1235,7 +1235,13 @@ void nsfont_make_fontset_for_font (Lisp_Object name, Lisp_Object font_object)
                       font_info->name, family,
                        SDATA (SYMBOL_NAME (scripts[i])));
 
-            Fset_fontset_font (name, scripts[i], famAndReg, Qnil, Qnil);
+            /* TODO: Some of the "scripts" in script-representative-chars are
+               actually only "sub-scripts" which are not fully defined.  For
+               these, calling set_fontset_font generates an abort.  Try to
+               guess which ones these are and avoid it. */
+            if (strstr (SDATA (SYMBOL_NAME (scripts[i])), "mathematical-")
+                    != SDATA (SYMBOL_NAME (scripts[i])))
+              Fset_fontset_font (name, scripts[i], famAndReg, Qnil, Qnil);
             free (family);
           }
         else
index f6b2075a8415b8d6c9d7afc58a8537e1ffc3df1f..636b71cf308e8969b4bd236c75b3a7beebec561c 100644 (file)
@@ -1494,12 +1494,15 @@ static Lisp_Object
 pop_down_menu (Lisp_Object arg)
 {
   struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
-  popup_activated_flag = 0;
-  BLOCK_INPUT;
-  [NSApp endModalSession: popupSession];
-  [((EmacsDialogPanel *) (p->pointer)) close];
-  [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
-  UNBLOCK_INPUT;
+  if (popup_activated_flag)
+    {
+      popup_activated_flag = 0;
+      BLOCK_INPUT;
+      [NSApp endModalSession: popupSession];
+      [((EmacsDialogPanel *) (p->pointer)) close];
+      [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
+      UNBLOCK_INPUT;
+    }
   return Qnil;
 }
 
@@ -1565,12 +1568,8 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
     record_unwind_protect (pop_down_menu, make_save_value (dialog, 0));
     popup_activated_flag = 1;
     tem = [dialog runDialogAt: p];
-    popup_activated_flag = 0;
-    unbind_to (specpdl_count, Qnil);
+    unbind_to (specpdl_count, Qnil);  /* calls pop_down_menu */
   }
-
-  [dialog close];
-  [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
   UNBLOCK_INPUT;
 
   return tem;
@@ -1879,6 +1878,7 @@ void process_dialog (id window, Lisp_Object list)
 {
   int ret;
 
+  /* initiate a session that will be ended by pop_down_menu */
   popupSession = [NSApp beginModalSessionForWindow: self];
   while (popup_activated_flag
          && (ret = [NSApp runModalSession: popupSession])
@@ -1889,7 +1889,6 @@ void process_dialog (id window, Lisp_Object list)
       timer_check (1);
       [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
     }
-  [NSApp endModalSession: popupSession];
 
   {                            /* FIXME: BIG UGLY HACK!!! */
       Lisp_Object tmp;