diff options
| author | Adrian Robert | 2009-02-13 13:30:35 +0000 |
|---|---|---|
| committer | Adrian Robert | 2009-02-13 13:30:35 +0000 |
| commit | ba301db32981a147c1866bf90781ec3c2714f5b7 (patch) | |
| tree | 36e4702a6812f85761493a7dfdcbd0979cbccd08 /src | |
| parent | 5ae6e65f654ad1c405b8d2113007866e6b595fe6 (diff) | |
| download | emacs-ba301db32981a147c1866bf90781ec3c2714f5b7.tar.gz emacs-ba301db32981a147c1866bf90781ec3c2714f5b7.zip | |
* nsfns.m (ns-read-file-name): BLOCK_INPUT while showing dialog. \n \n* nsmenu.m (pop_down_menu): Check popup_activated_flag. \n(ns_popup_dialog, EmacsDialogPanel-runDialogAt:): Let \npop_down_menu do the cleanup work as it is always called. (Bug#2154) \n \n* nsfont.m (nsfont_make_fontset_for_font): For now, don't try to \nset fontset font for 'mathematical-' sub-scripts. (Bug #2218)\n
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/nsfns.m | 12 | ||||
| -rw-r--r-- | src/nsfont.m | 8 | ||||
| -rw-r--r-- | src/nsmenu.m | 23 |
4 files changed, 37 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7e56fb1e977..f9c24996500 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2009-02-13 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 2 | |||
| 3 | * nsfns.m (ns-read-file-name): BLOCK_INPUT while showing dialog. | ||
| 4 | |||
| 5 | * nsmenu.m (pop_down_menu): Check popup_activated_flag. | ||
| 6 | (ns_popup_dialog, EmacsDialogPanel-runDialogAt:): Let | ||
| 7 | pop_down_menu do the cleanup work as it is always called. (Bug#2154) | ||
| 8 | |||
| 9 | * nsfont.m (nsfont_make_fontset_for_font): For now, don't try to | ||
| 10 | set fontset font for "mathematical-" sub-scripts. (Bug #2218) | ||
| 11 | |||
| 1 | 2009-02-12 Stefan Monnier <monnier@iro.umontreal.ca> | 12 | 2009-02-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 13 | ||
| 3 | * keyboard.c (adjust_point_for_property): Allow stopping betwen two | 14 | * keyboard.c (adjust_point_for_property): Allow stopping betwen two |
diff --git a/src/nsfns.m b/src/nsfns.m index f3b80c11622..963445b624c 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1449,7 +1449,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */) | |||
| 1449 | static id fileDelegate = nil; | 1449 | static id fileDelegate = nil; |
| 1450 | int ret; | 1450 | int ret; |
| 1451 | id panel; | 1451 | id panel; |
| 1452 | NSString *fname; | 1452 | Lisp_Object fname; |
| 1453 | 1453 | ||
| 1454 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : | 1454 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : |
| 1455 | [NSString stringWithUTF8String: SDATA (prompt)]; | 1455 | [NSString stringWithUTF8String: SDATA (prompt)]; |
| @@ -1482,6 +1482,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */) | |||
| 1482 | [panel setDelegate: fileDelegate]; | 1482 | [panel setDelegate: fileDelegate]; |
| 1483 | 1483 | ||
| 1484 | panelOK = 0; | 1484 | panelOK = 0; |
| 1485 | BLOCK_INPUT; | ||
| 1485 | if (NILP (isLoad)) | 1486 | if (NILP (isLoad)) |
| 1486 | { | 1487 | { |
| 1487 | ret = [panel runModalForDirectory: dirS file: initS]; | 1488 | ret = [panel runModalForDirectory: dirS file: initS]; |
| @@ -1494,11 +1495,13 @@ Optional arg INIT, if non-nil, provides a default file name to use. */) | |||
| 1494 | 1495 | ||
| 1495 | ret = (ret == NSOKButton) || panelOK; | 1496 | ret = (ret == NSOKButton) || panelOK; |
| 1496 | 1497 | ||
| 1497 | fname = [panel filename]; | 1498 | if (ret) |
| 1498 | 1499 | fname = build_string ([[panel filename] UTF8String]); | |
| 1500 | |||
| 1499 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; | 1501 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; |
| 1502 | UNBLOCK_INPUT; | ||
| 1500 | 1503 | ||
| 1501 | return ret ? build_string ([fname UTF8String]) : Qnil; | 1504 | return ret ? fname : Qnil; |
| 1502 | } | 1505 | } |
| 1503 | 1506 | ||
| 1504 | 1507 | ||
| @@ -2644,6 +2647,7 @@ Value is t if tooltip was open, nil otherwise. */) | |||
| 2644 | 2647 | ||
| 2645 | #endif | 2648 | #endif |
| 2646 | 2649 | ||
| 2650 | |||
| 2647 | /* ========================================================================== | 2651 | /* ========================================================================== |
| 2648 | 2652 | ||
| 2649 | Lisp interface declaration | 2653 | Lisp interface declaration |
diff --git a/src/nsfont.m b/src/nsfont.m index d1bbf8260d9..386637df59a 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -1235,7 +1235,13 @@ void nsfont_make_fontset_for_font (Lisp_Object name, Lisp_Object font_object) | |||
| 1235 | font_info->name, family, | 1235 | font_info->name, family, |
| 1236 | SDATA (SYMBOL_NAME (scripts[i]))); | 1236 | SDATA (SYMBOL_NAME (scripts[i]))); |
| 1237 | 1237 | ||
| 1238 | Fset_fontset_font (name, scripts[i], famAndReg, Qnil, Qnil); | 1238 | /* TODO: Some of the "scripts" in script-representative-chars are |
| 1239 | actually only "sub-scripts" which are not fully defined. For | ||
| 1240 | these, calling set_fontset_font generates an abort. Try to | ||
| 1241 | guess which ones these are and avoid it. */ | ||
| 1242 | if (strstr (SDATA (SYMBOL_NAME (scripts[i])), "mathematical-") | ||
| 1243 | != SDATA (SYMBOL_NAME (scripts[i]))) | ||
| 1244 | Fset_fontset_font (name, scripts[i], famAndReg, Qnil, Qnil); | ||
| 1239 | free (family); | 1245 | free (family); |
| 1240 | } | 1246 | } |
| 1241 | else | 1247 | else |
diff --git a/src/nsmenu.m b/src/nsmenu.m index f6b2075a841..636b71cf308 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1494,12 +1494,15 @@ static Lisp_Object | |||
| 1494 | pop_down_menu (Lisp_Object arg) | 1494 | pop_down_menu (Lisp_Object arg) |
| 1495 | { | 1495 | { |
| 1496 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 1496 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); |
| 1497 | popup_activated_flag = 0; | 1497 | if (popup_activated_flag) |
| 1498 | BLOCK_INPUT; | 1498 | { |
| 1499 | [NSApp endModalSession: popupSession]; | 1499 | popup_activated_flag = 0; |
| 1500 | [((EmacsDialogPanel *) (p->pointer)) close]; | 1500 | BLOCK_INPUT; |
| 1501 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; | 1501 | [NSApp endModalSession: popupSession]; |
| 1502 | UNBLOCK_INPUT; | 1502 | [((EmacsDialogPanel *) (p->pointer)) close]; |
| 1503 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; | ||
| 1504 | UNBLOCK_INPUT; | ||
| 1505 | } | ||
| 1503 | return Qnil; | 1506 | return Qnil; |
| 1504 | } | 1507 | } |
| 1505 | 1508 | ||
| @@ -1565,12 +1568,8 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1565 | record_unwind_protect (pop_down_menu, make_save_value (dialog, 0)); | 1568 | record_unwind_protect (pop_down_menu, make_save_value (dialog, 0)); |
| 1566 | popup_activated_flag = 1; | 1569 | popup_activated_flag = 1; |
| 1567 | tem = [dialog runDialogAt: p]; | 1570 | tem = [dialog runDialogAt: p]; |
| 1568 | popup_activated_flag = 0; | 1571 | unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */ |
| 1569 | unbind_to (specpdl_count, Qnil); | ||
| 1570 | } | 1572 | } |
| 1571 | |||
| 1572 | [dialog close]; | ||
| 1573 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; | ||
| 1574 | UNBLOCK_INPUT; | 1573 | UNBLOCK_INPUT; |
| 1575 | 1574 | ||
| 1576 | return tem; | 1575 | return tem; |
| @@ -1879,6 +1878,7 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1879 | { | 1878 | { |
| 1880 | int ret; | 1879 | int ret; |
| 1881 | 1880 | ||
| 1881 | /* initiate a session that will be ended by pop_down_menu */ | ||
| 1882 | popupSession = [NSApp beginModalSessionForWindow: self]; | 1882 | popupSession = [NSApp beginModalSessionForWindow: self]; |
| 1883 | while (popup_activated_flag | 1883 | while (popup_activated_flag |
| 1884 | && (ret = [NSApp runModalSession: popupSession]) | 1884 | && (ret = [NSApp runModalSession: popupSession]) |
| @@ -1889,7 +1889,6 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1889 | timer_check (1); | 1889 | timer_check (1); |
| 1890 | [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]]; | 1890 | [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]]; |
| 1891 | } | 1891 | } |
| 1892 | [NSApp endModalSession: popupSession]; | ||
| 1893 | 1892 | ||
| 1894 | { /* FIXME: BIG UGLY HACK!!! */ | 1893 | { /* FIXME: BIG UGLY HACK!!! */ |
| 1895 | Lisp_Object tmp; | 1894 | Lisp_Object tmp; |