diff options
| author | Stefan Monnier | 2010-03-30 22:37:57 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-03-30 22:37:57 -0400 |
| commit | 857387516c3cea919953b39ab170b1ff40f77934 (patch) | |
| tree | 33f6de32a3909240c7b1ab2d760891d62c3acaf5 /src | |
| parent | 75d1428c578eea9077c679c1e821af8d6643f1ed (diff) | |
| parent | a6d676d9f41be8ad0c436c6d04cfedc1ce68adc8 (diff) | |
| download | emacs-857387516c3cea919953b39ab170b1ff40f77934.tar.gz emacs-857387516c3cea919953b39ab170b1ff40f77934.zip | |
Merge from emacs-23 branch
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 34 | ||||
| -rw-r--r-- | src/Makefile.in | 2 | ||||
| -rw-r--r-- | src/menu.c | 18 | ||||
| -rw-r--r-- | src/nsfns.m | 20 | ||||
| -rw-r--r-- | src/nsterm.h | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 66 |
7 files changed, 71 insertions, 73 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 45140762c0c..767780d6938 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,37 @@ | |||
| 1 | 2010-03-31 Bernhard Herzog <bh@intevation.de> (tiny change) | ||
| 2 | |||
| 3 | * menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930). | ||
| 4 | |||
| 5 | 2010-03-31 Jan Djärv <jan.h.d@swipnet.se> | ||
| 6 | |||
| 7 | * xdisp.c (note_mouse_highlight): Don't do highlight if pointer is | ||
| 8 | invisible (Bug#5766). | ||
| 9 | |||
| 10 | 2010-03-31 Adrian Robert <adrian.b.robert@gmail.com> | ||
| 11 | |||
| 12 | * xdisp.c (x_consider_frame_title, update_window_cursor): Remove | ||
| 13 | HAVE_NS conditionals. | ||
| 14 | (prepare_menu_bars)[HAVE_NS]: Call ns_set_doc_edited. | ||
| 15 | |||
| 16 | * nsfns.m (x_implicitly_set_name): If frame-title-format is t, use | ||
| 17 | filename for the title. | ||
| 18 | (ns_set_doc_edited): Do nothing if the selected window is a | ||
| 19 | minibuffer window. | ||
| 20 | |||
| 21 | * nsterm.h: Add prototypes for ns_set_name_as_filename and | ||
| 22 | ns_set_doc_edited. | ||
| 23 | |||
| 24 | * nsterm.m: Remove unneeded prototype. | ||
| 25 | |||
| 26 | 2010-03-31 Glenn Morris <rgm@gnu.org> | ||
| 27 | |||
| 28 | * Makefile.in (SOME_MACHINE_OBJECTS): Ensure dbus stuff is always | ||
| 29 | in the DOC file. (Bug#5336) | ||
| 30 | |||
| 31 | 2010-03-31 Chong Yidong <cyd@stupidchicken.com> | ||
| 32 | |||
| 33 | * xdisp.c (pos_visible_p): Revert 2008-01-25 change (Bug#5730). | ||
| 34 | |||
| 1 | 2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca> | 35 | 2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 36 | ||
| 3 | * window.c (keys_of_window): Remove redundant/overridden bindings. | 37 | * window.c (keys_of_window): Remove redundant/overridden bindings. |
diff --git a/src/Makefile.in b/src/Makefile.in index ed44cd7700f..2305f6f6533 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -515,7 +515,7 @@ obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ | |||
| 515 | in case they are needed there. */ | 515 | in case they are needed there. */ |
| 516 | SOME_MACHINE_OBJECTS = dosfns.o msdos.o \ | 516 | SOME_MACHINE_OBJECTS = dosfns.o msdos.o \ |
| 517 | xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ | 517 | xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ |
| 518 | fontset.o \ | 518 | fontset.o dbusbind.o \ |
| 519 | nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \ | 519 | nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \ |
| 520 | w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ | 520 | w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ |
| 521 | w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS) | 521 | w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS) |
diff --git a/src/menu.c b/src/menu.c index ad6054d7192..bfe54a53328 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -61,6 +61,10 @@ extern HMENU current_popup_menu; | |||
| 61 | #define HAVE_BOXES 1 | 61 | #define HAVE_BOXES 1 |
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | /* The timestamp of the last input event Emacs received from the X server. */ | ||
| 65 | /* Defined in keyboard.c. */ | ||
| 66 | extern unsigned long last_event_timestamp; | ||
| 67 | |||
| 64 | extern Lisp_Object QCtoggle, QCradio; | 68 | extern Lisp_Object QCtoggle, QCradio; |
| 65 | 69 | ||
| 66 | Lisp_Object menu_items; | 70 | Lisp_Object menu_items; |
| @@ -1073,7 +1077,6 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1073 | int keymaps = 0; | 1077 | int keymaps = 0; |
| 1074 | int for_click = 0; | 1078 | int for_click = 0; |
| 1075 | int specpdl_count = SPECPDL_INDEX (); | 1079 | int specpdl_count = SPECPDL_INDEX (); |
| 1076 | Lisp_Object timestamp = Qnil; | ||
| 1077 | struct gcpro gcpro1; | 1080 | struct gcpro gcpro1; |
| 1078 | 1081 | ||
| 1079 | if (NILP (position)) | 1082 | if (NILP (position)) |
| @@ -1107,10 +1110,9 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1107 | for_click = 1; | 1110 | for_click = 1; |
| 1108 | tem = Fcar (Fcdr (position)); /* EVENT_START (position) */ | 1111 | tem = Fcar (Fcdr (position)); /* EVENT_START (position) */ |
| 1109 | window = Fcar (tem); /* POSN_WINDOW (tem) */ | 1112 | window = Fcar (tem); /* POSN_WINDOW (tem) */ |
| 1110 | tem = Fcdr (Fcdr (tem)); | 1113 | tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */ |
| 1111 | x = Fcar (Fcar (tem)); | 1114 | x = Fcar (tem); |
| 1112 | y = Fcdr (Fcar (tem)); | 1115 | y = Fcdr (tem); |
| 1113 | timestamp = Fcar (Fcdr (tem)); | ||
| 1114 | } | 1116 | } |
| 1115 | 1117 | ||
| 1116 | /* If a click happens in an external tool bar or a detached | 1118 | /* If a click happens in an external tool bar or a detached |
| @@ -1318,9 +1320,13 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1318 | selection = ns_menu_show (f, xpos, ypos, for_click, | 1320 | selection = ns_menu_show (f, xpos, ypos, for_click, |
| 1319 | keymaps, title, &error_name); | 1321 | keymaps, title, &error_name); |
| 1320 | #else /* MSDOS and X11 */ | 1322 | #else /* MSDOS and X11 */ |
| 1323 | /* Assume last_event_timestamp is the timestamp of the button event. | ||
| 1324 | Is this assumption ever violated? We can't use the timestamp | ||
| 1325 | stored within POSITION because there the top bits from the actual | ||
| 1326 | timestamp may be truncated away (Bug#4930). */ | ||
| 1321 | selection = xmenu_show (f, xpos, ypos, for_click, | 1327 | selection = xmenu_show (f, xpos, ypos, for_click, |
| 1322 | keymaps, title, &error_name, | 1328 | keymaps, title, &error_name, |
| 1323 | INTEGERP (timestamp) ? XUINT (timestamp) : 0); | 1329 | last_event_timestamp); |
| 1324 | #endif | 1330 | #endif |
| 1325 | 1331 | ||
| 1326 | UNBLOCK_INPUT; | 1332 | UNBLOCK_INPUT; |
diff --git a/src/nsfns.m b/src/nsfns.m index 357222bb18a..9de7681b2f7 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -81,6 +81,7 @@ extern Lisp_Object Qunderline, Qundefined; | |||
| 81 | extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; | 81 | extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; |
| 82 | extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle; | 82 | extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle; |
| 83 | extern Lisp_Object Qnone; | 83 | extern Lisp_Object Qnone; |
| 84 | extern Lisp_Object Vframe_title_format; | ||
| 84 | 85 | ||
| 85 | Lisp_Object Qbuffered; | 86 | Lisp_Object Qbuffered; |
| 86 | Lisp_Object Qfontsize; | 87 | Lisp_Object Qfontsize; |
| @@ -583,6 +584,8 @@ x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) | |||
| 583 | NSTRACE (x_implicitly_set_name); | 584 | NSTRACE (x_implicitly_set_name); |
| 584 | if (FRAME_ICONIFIED_P (f)) | 585 | if (FRAME_ICONIFIED_P (f)) |
| 585 | ns_set_name_iconic (f, arg, 0); | 586 | ns_set_name_iconic (f, arg, 0); |
| 587 | else if (FRAME_NS_P (f) && EQ (Vframe_title_format, Qt)) | ||
| 588 | ns_set_name_as_filename (f); | ||
| 586 | else | 589 | else |
| 587 | ns_set_name (f, arg, 0); | 590 | ns_set_name (f, arg, 0); |
| 588 | } | 591 | } |
| @@ -627,14 +630,14 @@ ns_set_name_as_filename (struct frame *f) | |||
| 627 | 630 | ||
| 628 | BLOCK_INPUT; | 631 | BLOCK_INPUT; |
| 629 | pool = [[NSAutoreleasePool alloc] init]; | 632 | pool = [[NSAutoreleasePool alloc] init]; |
| 630 | name =XBUFFER (buf)->filename; | 633 | name = XBUFFER (buf)->filename; |
| 631 | if (NILP (name) || FRAME_ICONIFIED_P (f)) name =XBUFFER (buf)->name; | 634 | if (NILP (name) || FRAME_ICONIFIED_P (f)) name =XBUFFER (buf)->name; |
| 632 | 635 | ||
| 633 | if (FRAME_ICONIFIED_P (f) && !NILP (f->icon_name)) | 636 | if (FRAME_ICONIFIED_P (f) && !NILP (f->icon_name)) |
| 634 | name = f->icon_name; | 637 | name = f->icon_name; |
| 635 | 638 | ||
| 636 | if (NILP (name)) | 639 | if (NILP (name)) |
| 637 | name = build_string([ns_app_name UTF8String]); | 640 | name = build_string ([ns_app_name UTF8String]); |
| 638 | else | 641 | else |
| 639 | CHECK_STRING (name); | 642 | CHECK_STRING (name); |
| 640 | 643 | ||
| @@ -687,11 +690,14 @@ ns_set_doc_edited (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 687 | { | 690 | { |
| 688 | NSView *view = FRAME_NS_VIEW (f); | 691 | NSView *view = FRAME_NS_VIEW (f); |
| 689 | NSAutoreleasePool *pool; | 692 | NSAutoreleasePool *pool; |
| 690 | BLOCK_INPUT; | 693 | if (!MINI_WINDOW_P (XWINDOW (f->selected_window))) |
| 691 | pool = [[NSAutoreleasePool alloc] init]; | 694 | { |
| 692 | [[view window] setDocumentEdited: !NILP (arg)]; | 695 | BLOCK_INPUT; |
| 693 | [pool release]; | 696 | pool = [[NSAutoreleasePool alloc] init]; |
| 694 | UNBLOCK_INPUT; | 697 | [[view window] setDocumentEdited: !NILP (arg)]; |
| 698 | [pool release]; | ||
| 699 | UNBLOCK_INPUT; | ||
| 700 | } | ||
| 695 | } | 701 | } |
| 696 | 702 | ||
| 697 | 703 | ||
diff --git a/src/nsterm.h b/src/nsterm.h index 89ed5ba252f..01086e63b69 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -708,6 +708,8 @@ extern void nxatoms_of_nsselect (); | |||
| 708 | extern int ns_lisp_to_cursor_type (); | 708 | extern int ns_lisp_to_cursor_type (); |
| 709 | extern Lisp_Object ns_cursor_type_to_lisp (int arg); | 709 | extern Lisp_Object ns_cursor_type_to_lisp (int arg); |
| 710 | extern Lisp_Object Qnone; | 710 | extern Lisp_Object Qnone; |
| 711 | extern void ns_set_name_as_filename (struct frame *f); | ||
| 712 | extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg); | ||
| 711 | 713 | ||
| 712 | extern int | 714 | extern int |
| 713 | ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, | 715 | ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, |
diff --git a/src/nsterm.m b/src/nsterm.m index a4d06f82d97..7bc82e96104 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -4173,8 +4173,6 @@ ns_term_shutdown (int sig) | |||
| 4173 | ns_send_appdefined (-2); | 4173 | ns_send_appdefined (-2); |
| 4174 | } | 4174 | } |
| 4175 | 4175 | ||
| 4176 | extern void update_window_cursor (struct window *w, int on); | ||
| 4177 | |||
| 4178 | - (void)fd_handler: (NSTimer *) fdEntry | 4176 | - (void)fd_handler: (NSTimer *) fdEntry |
| 4179 | /* -------------------------------------------------------------------------- | 4177 | /* -------------------------------------------------------------------------- |
| 4180 | Check data waiting on file descriptors and terminate if so | 4178 | Check data waiting on file descriptors and terminate if so |
diff --git a/src/xdisp.c b/src/xdisp.c index c8b4c2b9aa5..b6c69f661ed 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1377,33 +1377,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos) | |||
| 1377 | visible_p = 1; | 1377 | visible_p = 1; |
| 1378 | if (visible_p) | 1378 | if (visible_p) |
| 1379 | { | 1379 | { |
| 1380 | if (it_method == GET_FROM_BUFFER) | 1380 | if (it_method == GET_FROM_DISPLAY_VECTOR) |
| 1381 | { | ||
| 1382 | Lisp_Object window, prop; | ||
| 1383 | |||
| 1384 | XSETWINDOW (window, w); | ||
| 1385 | prop = Fget_char_property (make_number (charpos), | ||
| 1386 | Qinvisible, window); | ||
| 1387 | |||
| 1388 | /* If charpos coincides with invisible text covered with an | ||
| 1389 | ellipsis, use the first glyph of the ellipsis to compute | ||
| 1390 | the pixel positions. */ | ||
| 1391 | if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2) | ||
| 1392 | { | ||
| 1393 | struct glyph_row *row = it.glyph_row; | ||
| 1394 | struct glyph *glyph = row->glyphs[TEXT_AREA]; | ||
| 1395 | struct glyph *end = glyph + row->used[TEXT_AREA]; | ||
| 1396 | int x = row->x; | ||
| 1397 | |||
| 1398 | for (; glyph < end | ||
| 1399 | && (!BUFFERP (glyph->object) | ||
| 1400 | || glyph->charpos < charpos); | ||
| 1401 | glyph++) | ||
| 1402 | x += glyph->pixel_width; | ||
| 1403 | top_x = x; | ||
| 1404 | } | ||
| 1405 | } | ||
| 1406 | else if (it_method == GET_FROM_DISPLAY_VECTOR) | ||
| 1407 | { | 1381 | { |
| 1408 | /* We stopped on the last glyph of a display vector. | 1382 | /* We stopped on the last glyph of a display vector. |
| 1409 | Try and recompute. Hack alert! */ | 1383 | Try and recompute. Hack alert! */ |
| @@ -9787,32 +9761,7 @@ x_consider_frame_title (frame) | |||
| 9787 | if (! STRINGP (f->name) | 9761 | if (! STRINGP (f->name) |
| 9788 | || SBYTES (f->name) != len | 9762 | || SBYTES (f->name) != len |
| 9789 | || bcmp (title, SDATA (f->name), len) != 0) | 9763 | || bcmp (title, SDATA (f->name), len) != 0) |
| 9790 | { | 9764 | x_implicitly_set_name (f, make_string (title, len), Qnil); |
| 9791 | #ifdef HAVE_NS | ||
| 9792 | if (FRAME_NS_P (f)) | ||
| 9793 | { | ||
| 9794 | if (!MINI_WINDOW_P(XWINDOW(f->selected_window))) | ||
| 9795 | { | ||
| 9796 | if (EQ (fmt, Qt)) | ||
| 9797 | ns_set_name_as_filename (f); | ||
| 9798 | else | ||
| 9799 | x_implicitly_set_name (f, make_string(title, len), | ||
| 9800 | Qnil); | ||
| 9801 | } | ||
| 9802 | } | ||
| 9803 | else | ||
| 9804 | #endif | ||
| 9805 | x_implicitly_set_name (f, make_string (title, len), Qnil); | ||
| 9806 | } | ||
| 9807 | #ifdef HAVE_NS | ||
| 9808 | if (FRAME_NS_P (f)) | ||
| 9809 | { | ||
| 9810 | /* do this also for frames with explicit names */ | ||
| 9811 | ns_implicitly_set_icon_type(f); | ||
| 9812 | ns_set_doc_edited(f, Fbuffer_modified_p | ||
| 9813 | (XWINDOW (f->selected_window)->buffer), Qnil); | ||
| 9814 | } | ||
| 9815 | #endif | ||
| 9816 | } | 9765 | } |
| 9817 | } | 9766 | } |
| 9818 | 9767 | ||
| @@ -9909,6 +9858,11 @@ prepare_menu_bars () | |||
| 9909 | #ifdef HAVE_WINDOW_SYSTEM | 9858 | #ifdef HAVE_WINDOW_SYSTEM |
| 9910 | update_tool_bar (f, 0); | 9859 | update_tool_bar (f, 0); |
| 9911 | #endif | 9860 | #endif |
| 9861 | #ifdef HAVE_NS | ||
| 9862 | if (windows_or_buffers_changed) | ||
| 9863 | ns_set_doc_edited (f, Fbuffer_modified_p | ||
| 9864 | (XWINDOW (f->selected_window)->buffer)); | ||
| 9865 | #endif | ||
| 9912 | UNGCPRO; | 9866 | UNGCPRO; |
| 9913 | } | 9867 | } |
| 9914 | 9868 | ||
| @@ -23519,9 +23473,6 @@ display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 23519 | /* Switch the display of W's cursor on or off, according to the value | 23473 | /* Switch the display of W's cursor on or off, according to the value |
| 23520 | of ON. */ | 23474 | of ON. */ |
| 23521 | 23475 | ||
| 23522 | #ifndef HAVE_NS | ||
| 23523 | static | ||
| 23524 | #endif | ||
| 23525 | void | 23476 | void |
| 23526 | update_window_cursor (w, on) | 23477 | update_window_cursor (w, on) |
| 23527 | struct window *w; | 23478 | struct window *w; |
| @@ -24440,7 +24391,8 @@ note_mouse_highlight (f, x, y) | |||
| 24440 | #endif | 24391 | #endif |
| 24441 | 24392 | ||
| 24442 | if (NILP (Vmouse_highlight) | 24393 | if (NILP (Vmouse_highlight) |
| 24443 | || !f->glyphs_initialized_p) | 24394 | || !f->glyphs_initialized_p |
| 24395 | || f->pointer_invisible) | ||
| 24444 | return; | 24396 | return; |
| 24445 | 24397 | ||
| 24446 | dpyinfo->mouse_face_mouse_x = x; | 24398 | dpyinfo->mouse_face_mouse_x = x; |