aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-07-03 17:01:39 +0000
committerKaroly Lorentey2004-07-03 17:01:39 +0000
commit76e9cc50019f98e12f342574ba0de1eca6631767 (patch)
tree4d42c708429ab4b564466937f9c235dba2f763fb /src
parent69deab57ea8ab5e3bc1cfb80027341aa0451362b (diff)
parent1e118124a8e4f8e0a0d4ceb7940b11087e3b94e2 (diff)
downloademacs-76e9cc50019f98e12f342574ba0de1eca6631767.tar.gz
emacs-76e9cc50019f98e12f342574ba0de1eca6631767.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-427 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-428 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-429 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-430 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-431 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-432 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-433 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-434 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-435 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-436 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-204
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog101
-rw-r--r--src/Makefile.in2
-rw-r--r--src/fontset.c1
-rw-r--r--src/gtkutil.c52
-rw-r--r--src/image.c25
-rw-r--r--src/lisp.h1
-rw-r--r--src/macterm.c108
-rw-r--r--src/search.c23
-rw-r--r--src/syntax.c2
-rw-r--r--src/w32select.c6
-rw-r--r--src/xfaces.c6
11 files changed, 226 insertions, 101 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 383f479aabd..a1fa10e753c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,68 @@
12004-07-01 Kenichi Handa <handa@m17n.org>
2
3 * w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly
4 after getting a new string by pre-write-conversion.
5
62004-06-30 Stefan <monnier@iro.umontreal.ca>
7
8 * xterm.c (x_detect_focus_change): Remove unused var `nr_events'.
9 (x_calc_absolute_position): Remove unused var `child'.
10
11 * xfaces.c (x_supports_face_attributes_p)
12 (Fdisplay_supports_face_attributes_p): YAILOM.
13 (tty_supports_face_attributes_p): Remove unused var `i'.
14
15 * syntax.c (skip_chars): Remove unused labels fwd_unibyte_ok and
16 back_unibyte_ok.
17
18 * search.c (match_limit, Fmatch_data, Fset_match_data): YAILOM.
19
20 * fontset.c (Fset_fontset_font): Remove unused vars `family' and `registry'.
21
22 * Makefile.in (${etc}DOC): Fix file name of make-docfile.
23
242004-06-30 Andreas Schwab <schwab@suse.de>
25
26 * image.c (CHECK_LIB_AVAILABLE): Add third parameter LIBRARIES.
27 (Finit_image_library): Pass LIBRARIES through to
28 CHECK_LIB_AVAILABLE. Declare parameters. Doc fix.
29 (lookup_image_type): Pass Qnil as second argument to
30 Finit_image_library.
31
32 * lisp.h: Declare Finit_image_library.
33
342004-06-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
35
36 * macterm.c (do_window_activate, do_window_deactivate): Remove.
37 (XTread_socket): Send mouse button events to the toolbox
38 dispatcher even when the mouse is grabbed. Don't process window
39 activate events for non-Emacs windows. Replace function calls to
40 do_window_activate and do_window_deactivate with their contents.
41 Reset mouse grabbing status when a window is deactivated.
42
432004-06-29 Steven Tamm <steventamm@mac.com>
44
45 * macterm.c (mac_get_emulated_btn)
46 (mac_event_to_emacs_modifiers): Fix emulated mouse button
47 support to correctly mask out modifiers.
48
492004-06-29 David Kastrup <dak@gnu.org>
50
51 * search.c (Fset_match_data): Allow buffer before end of list
52 which can happen if set-match-data is using a pre-consed list.
53
542004-06-28 Steven Tamm <steventamm@mac.com>
55
56 * macterm.c (XTread_socket): Correctly set the frame position
57 after the window is moved.
58
592004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
60
61 * gtkutil.c (xg_get_image_for_pixmap): Call g_object_unref on
62 gpix and gmask just before return to avoid memory leak.
63 (xg_get_image_for_pixmap): Add workaround for monochrome displays
64 so insensitive and activated icons look ok.
65
12004-06-27 Jason Rumney <jasonr@gnu.org> 662004-06-27 Jason Rumney <jasonr@gnu.org>
2 67
3 * w32fns.c (file_dialog_callback): Disable edit control if set 68 * w32fns.c (file_dialog_callback): Disable edit control if set
@@ -28,8 +93,7 @@
28 a buffer, add the buffer as last element to the match data. 93 a buffer, add the buffer as last element to the match data.
29 (Fset_match_data): If an additional element of the match-data is a 94 (Fset_match_data): If an additional element of the match-data is a
30 buffer, restore it to last_thing_searched. 95 buffer, restore it to last_thing_searched.
31 (save_search_regs): Save last_thing_searched as part of the match 96 (save_search_regs): Save last_thing_searched as part of the match data.
32 data.
33 (restore_match_data): Restore it again. 97 (restore_match_data): Restore it again.
34 98
352004-06-23 Luc Teirlinck <teirllm@auburn.edu> 992004-06-23 Luc Teirlinck <teirllm@auburn.edu>
@@ -155,7 +219,7 @@
1552004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 2192004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
156 220
157 * gtkutil.c (xg_get_image_for_pixmap): New function. 221 * gtkutil.c (xg_get_image_for_pixmap): New function.
158 (xg_get_gdk_pixmap_and_mask): Removed. 222 (xg_get_gdk_pixmap_and_mask): Remove.
159 (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of 223 (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of
160 xg_get_gdk_pixmap_and_mask. 224 xg_get_gdk_pixmap_and_mask.
161 225
@@ -176,8 +240,7 @@
176 list of possible filenames. 240 list of possible filenames.
177 (init_xpm_functions, init_png_functions, init_jpeg_functions) 241 (init_xpm_functions, init_png_functions, init_jpeg_functions)
178 (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'. 242 (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'.
179 (CHECK_LIB_AVAILABLE): Call `define_image_library' with new 243 (CHECK_LIB_AVAILABLE): Call `define_image_library' with new argument.
180 argument.
181 (Finit_image_library): New function, extracted from `init_image'. 244 (Finit_image_library): New function, extracted from `init_image'.
182 Try to initialize an image library on demand and cache whether we 245 Try to initialize an image library on demand and cache whether we
183 were successful or not. 246 were successful or not.
@@ -301,7 +364,7 @@
301 (merge_face_ref, face_at_buffer_position, face_at_string_position): 364 (merge_face_ref, face_at_buffer_position, face_at_string_position):
302 Use `merge_named_face'. 365 Use `merge_named_face'.
303 (merge_face_inheritance): Function removed. 366 (merge_face_inheritance): Function removed.
304 (merge_face_ref): Renamed from `merge_face_vector_with_property'. 367 (merge_face_ref): Rename from `merge_face_vector_with_property'.
305 Add new `err_msgs' and `named_merge_points' args. Return error 368 Add new `err_msgs' and `named_merge_points' args. Return error
306 status. Only print error messages if ERR_MSGS is true. Don't try to 369 status. Only print error messages if ERR_MSGS is true. Don't try to
307 do :inherit attribute validation. 370 do :inherit attribute validation.
@@ -361,8 +424,8 @@
361 424
362 * xfaces.c (x_supports_face_attributes_p): Make this function 425 * xfaces.c (x_supports_face_attributes_p): Make this function
363 conditional on HAVE_WINDOW_SYSTEM. 426 conditional on HAVE_WINDOW_SYSTEM.
364 (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]: Don't 427 (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]:
365 call x_supports_face_attributes_p if it was not compiled in. 428 Don't call x_supports_face_attributes_p if it was not compiled in.
366 429
3672004-06-04 Miles Bader <miles@gnu.org> 4302004-06-04 Miles Bader <miles@gnu.org>
368 431
@@ -393,6 +456,8 @@
393 456
3942004-06-01 Stefan Monnier <monnier@iro.umontreal.ca> 4572004-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
395 458
459 * eval.c (Fcondition_case): Fix usage. Simplify.
460
396 * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true. 461 * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true.
397 462
3982004-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 4632004-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@@ -401,8 +466,7 @@
401 [MAC_OSX]: Don't include QuickTime/QuickTime.h. 466 [MAC_OSX]: Don't include QuickTime/QuickTime.h.
402 [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or 467 [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or
403 TextUtils.h. 468 TextUtils.h.
404 (Fx_create_frame): Sync with xfns.c. Initialize cursor 469 (Fx_create_frame): Sync with xfns.c. Initialize cursor descriptors.
405 descriptors.
406 (Fx_display_mm_height, Fx_display_mm_width): Calculate length from 470 (Fx_display_mm_height, Fx_display_mm_width): Calculate length from
407 display height/width. 471 display height/width.
408 (compute_tip_xy, Vx_max_tooltip_size): Declare. 472 (compute_tip_xy, Vx_max_tooltip_size): Declare.
@@ -413,8 +477,7 @@
413 477
414 * macgui.h [!MAC_OSX]: Include Gestalt.h. 478 * macgui.h [!MAC_OSX]: Include Gestalt.h.
415 (Cursor, No_Cursor): New defines. 479 (Cursor, No_Cursor): New defines.
416 [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility 480 [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility macro.
417 macro.
418 [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare. 481 [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare.
419 482
420 * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort. 483 * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort.
@@ -442,11 +505,9 @@
442 (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a 505 (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a
443 scroll-bar click event. 506 scroll-bar click event.
444 (mac_define_frame_cursor): Change the pointer shape. 507 (mac_define_frame_cursor): Change the pointer shape.
445 (x_free_frame_resources): Reset tip_window to NULL when it is 508 (x_free_frame_resources): Reset tip_window to NULL when it is disposed.
446 disposed.
447 [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable. 509 [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable.
448 [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize 510 [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize arrow_cursor.
449 arrow_cursor.
450 (do_window_update): Don't do anything if the updated window is the 511 (do_window_update): Don't do anything if the updated window is the
451 tooltip window. 512 tooltip window.
452 (do_mouse_moved): Handle mouse movement events here (previously in 513 (do_mouse_moved): Handle mouse movement events here (previously in
@@ -454,8 +515,8 @@
454 dpyinfo->mouse_face_hidden is set. 515 dpyinfo->mouse_face_hidden is set.
455 (do_os_event, do_events): Remove (now in XTread_socket). 516 (do_os_event, do_events): Remove (now in XTread_socket).
456 (XTread_socket): Immediately return if interrupt_input_blocked. 517 (XTread_socket): Immediately return if interrupt_input_blocked.
457 Loop until all the events in the queue are processed. Rearrange 518 Loop until all the events in the queue are processed.
458 codes for mouse grabbing. Add tooltip support. Include the 519 Rearrange codes for mouse grabbing. Add tooltip support. Include the
459 contents of do_os_event and do_events. Remove mouse movement 520 contents of do_os_event and do_events. Remove mouse movement
460 handling (now in do_mouse_moved). Add the case where 521 handling (now in do_mouse_moved). Add the case where
461 Vmouse_highlight has an integer value. 522 Vmouse_highlight has an integer value.
@@ -464,8 +525,8 @@
464 excess initializations. 525 excess initializations.
465 (make_mac_terminal_frame): Previous initializations in 526 (make_mac_terminal_frame): Previous initializations in
466 make_mac_frame are moved here. 527 make_mac_frame are moved here.
467 (mac_initialize_display_info): Initialize 528 (mac_initialize_display_info):
468 dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden. 529 Initialize dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden.
469 530
470 * xdisp.c [MAC_OS] (No_Cursor): Remove variable. 531 * xdisp.c [MAC_OS] (No_Cursor): Remove variable.
471 (define_frame_cursor1): Don't treat HAVE_CARBON as a special case. 532 (define_frame_cursor1): Don't treat HAVE_CARBON as a special case.
diff --git a/src/Makefile.in b/src/Makefile.in
index 0d75221acfa..f473888cc5d 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -928,7 +928,7 @@ emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
928 for the first time, this prevents any variation between configurations 928 for the first time, this prevents any variation between configurations
929 in the contents of the DOC file. 929 in the contents of the DOC file.
930 Likewise for ${SOME_MACHINE_LISP}. */ 930 Likewise for ${SOME_MACHINE_LISP}. */
931${etc}DOC: ${libsrc}make-docfile ${obj} ${shortlisp} ${SOME_MACHINE_LISP} 931${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${shortlisp} ${SOME_MACHINE_LISP}
932 -rm -f ${etc}DOC 932 -rm -f ${etc}DOC
933 ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC 933 ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
934 ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp} 934 ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
diff --git a/src/fontset.c b/src/fontset.c
index aae6b9296ae..e99cc0ff6a3 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,4 +1,5 @@
1/* Fontset handler. 1/* Fontset handler.
2 Copyright (C) 2004 Free Software Foundation, Inc.
2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. 3 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 4 Licensed to the Free Software Foundation.
4 5
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 84aa9f46d4d..3ffba0ba745 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -248,8 +248,46 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
248{ 248{
249 GdkPixmap *gpix; 249 GdkPixmap *gpix;
250 GdkPixmap *gmask; 250 GdkPixmap *gmask;
251 GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); 251 GdkDisplay *gdpy;
252
253 /* If we are on a one bit display, let GTK do all the image handling.
254 This seems to be the only way to make insensitive and activated icons
255 look good. */
256 if (x_screen_planes (f) == 1)
257 {
258 Lisp_Object specified_file = Qnil;
259 Lisp_Object tail;
260 extern Lisp_Object QCfile;
261
262 for (tail = XCDR (img->spec);
263 NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail));
264 tail = XCDR (XCDR (tail)))
265 if (EQ (XCAR (tail), QCfile))
266 specified_file = XCAR (XCDR (tail));
267
268 if (STRINGP (specified_file))
269 {
270
271 Lisp_Object file = Qnil;
272 struct gcpro gcpro1;
273 GCPRO1 (file);
252 274
275 file = x_find_image_file (specified_file);
276 /* We already loaded the image once before calling this
277 function, so this should not fail. */
278 xassert (STRINGP (file) != 0);
279
280 if (! old_widget)
281 old_widget = GTK_IMAGE (gtk_image_new_from_file (SDATA (file)));
282 else
283 gtk_image_set_from_file (old_widget, SDATA (file));
284
285 UNGCPRO;
286 return GTK_WIDGET (old_widget);
287 }
288 }
289
290 gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
253 gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); 291 gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap);
254 gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; 292 gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0;
255 293
@@ -262,6 +300,12 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
262 } 300 }
263 else 301 else
264 { 302 {
303 /* This is a workaround to make icons look good on pseudo color
304 displays. Apparently GTK expects the images to have an alpha
305 channel. If they don't, insensitive and activated icons will
306 look bad. This workaround does not work on monochrome displays,
307 and is not needed on true color/static color displays (i.e.
308 16 bits and higher). */
265 int x, y, width, height, rowstride, mask_rowstride; 309 int x, y, width, height, rowstride, mask_rowstride;
266 GdkPixbuf *icon_buf, *tmp_buf; 310 GdkPixbuf *icon_buf, *tmp_buf;
267 guchar *pixels; 311 guchar *pixels;
@@ -308,12 +352,9 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
308 } 352 }
309 } 353 }
310 354
311 g_object_unref (G_OBJECT (gmask));
312 g_object_unref (G_OBJECT (mask_buf)); 355 g_object_unref (G_OBJECT (mask_buf));
313 } 356 }
314 357
315 g_object_unref (G_OBJECT (gpix));
316
317 if (! old_widget) 358 if (! old_widget)
318 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); 359 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
319 else 360 else
@@ -322,6 +363,9 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
322 g_object_unref (G_OBJECT (icon_buf)); 363 g_object_unref (G_OBJECT (icon_buf));
323 } 364 }
324 365
366 g_object_unref (G_OBJECT (gpix));
367 if (gmask) g_object_unref (G_OBJECT (gmask));
368
325 return GTK_WIDGET (old_widget); 369 return GTK_WIDGET (old_widget);
326} 370}
327 371
diff --git a/src/image.c b/src/image.c
index 438e132807f..4ab672ca58e 100644
--- a/src/image.c
+++ b/src/image.c
@@ -675,7 +675,7 @@ define_image_type (type, loaded)
675 success = Qt; 675 success = Qt;
676 } 676 }
677 677
678 CACHE_IMAGE_TYPE(*type->type, success); 678 CACHE_IMAGE_TYPE (*type->type, success);
679 return success; 679 return success;
680} 680}
681 681
@@ -690,7 +690,7 @@ lookup_image_type (symbol)
690 struct image_type *type; 690 struct image_type *type;
691 691
692 /* We must initialize the image-type if it hasn't been already. */ 692 /* We must initialize the image-type if it hasn't been already. */
693 if (NILP (Finit_image_library (symbol))) 693 if (NILP (Finit_image_library (symbol, Qnil)))
694 return 0; /* unimplemented */ 694 return 0; /* unimplemented */
695 695
696 for (type = image_types; type; type = type->next) 696 for (type = image_types; type; type = type->next)
@@ -7927,10 +7927,10 @@ DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "")
7927#ifdef HAVE_NTGUI 7927#ifdef HAVE_NTGUI
7928/* Image types that rely on external libraries are loaded dynamically 7928/* Image types that rely on external libraries are loaded dynamically
7929 if the library is available. */ 7929 if the library is available. */
7930#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn) \ 7930#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \
7931 define_image_type (image_type, init_lib_fn (libraries)) 7931 define_image_type (image_type, init_lib_fn (libraries))
7932#else 7932#else
7933#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn) \ 7933#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \
7934 define_image_type (image_type, TRUE) 7934 define_image_type (image_type, TRUE)
7935#endif /* HAVE_NTGUI */ 7935#endif /* HAVE_NTGUI */
7936 7936
@@ -7940,8 +7940,9 @@ Return non-nil if TYPE is a supported image type.
7940 7940
7941Image types pbm and xbm are prebuilt; other types are loaded here. 7941Image types pbm and xbm are prebuilt; other types are loaded here.
7942Libraries to load are specified in alist LIBRARIES (usually, the value 7942Libraries to load are specified in alist LIBRARIES (usually, the value
7943of `image-library-alist', which see. */) 7943of `image-library-alist', which see). */)
7944 (type, libraries) 7944 (type, libraries)
7945 Lisp_Object type, libraries;
7945{ 7946{
7946 Lisp_Object tested; 7947 Lisp_Object tested;
7947 7948
@@ -7952,36 +7953,36 @@ of `image-library-alist', which see. */)
7952 7953
7953#if defined (HAVE_XPM) || defined (MAC_OS) 7954#if defined (HAVE_XPM) || defined (MAC_OS)
7954 if (EQ (type, Qxpm)) 7955 if (EQ (type, Qxpm))
7955 return CHECK_LIB_AVAILABLE(&xpm_type, init_xpm_functions); 7956 return CHECK_LIB_AVAILABLE (&xpm_type, init_xpm_functions, libraries);
7956#endif 7957#endif
7957 7958
7958#if defined (HAVE_JPEG) || defined (MAC_OS) 7959#if defined (HAVE_JPEG) || defined (MAC_OS)
7959 if (EQ (type, Qjpeg)) 7960 if (EQ (type, Qjpeg))
7960 return CHECK_LIB_AVAILABLE(&jpeg_type, init_jpeg_functions); 7961 return CHECK_LIB_AVAILABLE (&jpeg_type, init_jpeg_functions, libraries);
7961#endif 7962#endif
7962 7963
7963#if defined (HAVE_TIFF) || defined (MAC_OS) 7964#if defined (HAVE_TIFF) || defined (MAC_OS)
7964 if (EQ (type, Qtiff)) 7965 if (EQ (type, Qtiff))
7965 return CHECK_LIB_AVAILABLE(&tiff_type, init_tiff_functions); 7966 return CHECK_LIB_AVAILABLE (&tiff_type, init_tiff_functions, libraries);
7966#endif 7967#endif
7967 7968
7968#if defined (HAVE_GIF) || defined (MAC_OS) 7969#if defined (HAVE_GIF) || defined (MAC_OS)
7969 if (EQ (type, Qgif)) 7970 if (EQ (type, Qgif))
7970 return CHECK_LIB_AVAILABLE(&gif_type, init_gif_functions); 7971 return CHECK_LIB_AVAILABLE (&gif_type, init_gif_functions, libraries);
7971#endif 7972#endif
7972 7973
7973#if defined (HAVE_PNG) || defined (MAC_OS) 7974#if defined (HAVE_PNG) || defined (MAC_OS)
7974 if (EQ (type, Qpng)) 7975 if (EQ (type, Qpng))
7975 return CHECK_LIB_AVAILABLE(&png_type, init_png_functions); 7976 return CHECK_LIB_AVAILABLE (&png_type, init_png_functions, libraries);
7976#endif 7977#endif
7977 7978
7978#ifdef HAVE_GHOSTSCRIPT 7979#ifdef HAVE_GHOSTSCRIPT
7979 if (EQ (type, Qpostscript)) 7980 if (EQ (type, Qpostscript))
7980 return CHECK_LIB_AVAILABLE(&gs_type, init_gs_functions); 7981 return CHECK_LIB_AVAILABLE (&gs_type, init_gs_functions, libraries);
7981#endif 7982#endif
7982 7983
7983 /* If the type is not recognized, avoid testing it ever again. */ 7984 /* If the type is not recognized, avoid testing it ever again. */
7984 CACHE_IMAGE_TYPE(type, Qnil); 7985 CACHE_IMAGE_TYPE (type, Qnil);
7985 return Qnil; 7986 return Qnil;
7986} 7987}
7987 7988
diff --git a/src/lisp.h b/src/lisp.h
index 44fe5affa57..deb8d6414a2 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2332,6 +2332,7 @@ extern void init_fringe P_ ((void));
2332extern void init_fringe_once P_ ((void)); 2332extern void init_fringe_once P_ ((void));
2333 2333
2334/* Defined in image.c */ 2334/* Defined in image.c */
2335EXFUN (Finit_image_library, 2);
2335extern void syms_of_image P_ ((void)); 2336extern void syms_of_image P_ ((void));
2336extern void init_image P_ ((void)); 2337extern void init_image P_ ((void));
2337 2338
diff --git a/src/macterm.c b/src/macterm.c
index 2af910c5003..43a04dc65ec 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -7018,7 +7018,7 @@ mac_get_emulated_btn ( UInt32 modifiers )
7018 int result = 0; 7018 int result = 0;
7019 if (!NILP (Vmac_emulate_three_button_mouse)) { 7019 if (!NILP (Vmac_emulate_three_button_mouse)) {
7020 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); 7020 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
7021 if (modifiers & controlKey) 7021 if (modifiers & cmdKey)
7022 result = cmdIs3 ? 2 : 1; 7022 result = cmdIs3 ? 2 : 1;
7023 else if (modifiers & optionKey) 7023 else if (modifiers & optionKey)
7024 result = cmdIs3 ? 1 : 2; 7024 result = cmdIs3 ? 1 : 2;
@@ -7038,7 +7038,7 @@ mac_event_to_emacs_modifiers (EventRef eventRef)
7038 if (!NILP (Vmac_emulate_three_button_mouse) && 7038 if (!NILP (Vmac_emulate_three_button_mouse) &&
7039 GetEventClass(eventRef) == kEventClassMouse) 7039 GetEventClass(eventRef) == kEventClassMouse)
7040 { 7040 {
7041 mods &= ~(optionKey & cmdKey); 7041 mods &= ~(optionKey | cmdKey);
7042 } 7042 }
7043 return mac_to_emacs_modifiers (mods); 7043 return mac_to_emacs_modifiers (mods);
7044} 7044}
@@ -7237,40 +7237,6 @@ is_emacs_window (WindowPtr win)
7237} 7237}
7238 7238
7239static void 7239static void
7240do_window_activate (WindowPtr win)
7241{
7242 struct frame *f;
7243
7244 if (is_emacs_window (win))
7245 {
7246 f = mac_window_to_frame (win);
7247
7248 if (f)
7249 {
7250 x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f);
7251 activate_scroll_bars (f);
7252 }
7253 }
7254}
7255
7256static void
7257do_window_deactivate (WindowPtr win)
7258{
7259 struct frame *f;
7260
7261 if (is_emacs_window (win))
7262 {
7263 f = mac_window_to_frame (win);
7264
7265 if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame)
7266 {
7267 x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), 0);
7268 deactivate_scroll_bars (f);
7269 }
7270 }
7271}
7272
7273static void
7274do_app_resume () 7240do_app_resume ()
7275{ 7241{
7276 WindowPtr wp; 7242 WindowPtr wp;
@@ -8084,6 +8050,25 @@ XTread_socket (sd, expected, hold_quit)
8084 if (!mac_convert_event_ref (eventRef, &er)) 8050 if (!mac_convert_event_ref (eventRef, &er))
8085 switch (GetEventClass (eventRef)) 8051 switch (GetEventClass (eventRef))
8086 { 8052 {
8053 case kEventClassWindow:
8054 if (GetEventKind (eventRef) == kEventWindowBoundsChanged)
8055 {
8056 WindowPtr window_ptr;
8057 GetEventParameter(eventRef, kEventParamDirectObject,
8058 typeWindowRef, NULL, sizeof(WindowPtr),
8059 NULL, &window_ptr);
8060 f = mac_window_to_frame (window_ptr);
8061 if (f && !f->async_iconified)
8062 {
8063 int x, y;
8064
8065 x_real_positions (f, &x, &y);
8066 f->left_pos = x;
8067 f->top_pos = y;
8068 }
8069 SendEventToEventTarget (eventRef, toolbox_dispatcher);
8070 }
8071 break;
8087 case kEventClassMouse: 8072 case kEventClassMouse:
8088 if (GetEventKind (eventRef) == kEventMouseWheelMoved) 8073 if (GetEventKind (eventRef) == kEventMouseWheelMoved)
8089 { 8074 {
@@ -8135,6 +8120,14 @@ XTread_socket (sd, expected, hold_quit)
8135 SInt16 part_code; 8120 SInt16 part_code;
8136 int tool_bar_p = 0; 8121 int tool_bar_p = 0;
8137 8122
8123#if USE_CARBON_EVENTS
8124 /* This is needed to send mouse events like aqua window
8125 buttons to the correct handler. */
8126 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
8127 != eventNotHandledErr)
8128 break;
8129#endif
8130
8138 if (dpyinfo->grabbed && last_mouse_frame 8131 if (dpyinfo->grabbed && last_mouse_frame
8139 && FRAME_LIVE_P (last_mouse_frame)) 8132 && FRAME_LIVE_P (last_mouse_frame))
8140 { 8133 {
@@ -8150,16 +8143,9 @@ XTread_socket (sd, expected, hold_quit)
8150 window_ptr = FrontWindow (); 8143 window_ptr = FrontWindow ();
8151 } 8144 }
8152 8145
8153#if USE_CARBON_EVENTS
8154 /* This is needed to send mouse events like aqua
8155 window buttons to the correct handler. */
8156 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
8157 != eventNotHandledErr)
8158 break;
8159
8160 if (!is_emacs_window (window_ptr)) 8146 if (!is_emacs_window (window_ptr))
8161 break; 8147 break;
8162#endif 8148
8163 part_code = FindWindow (er.where, &window_ptr); 8149 part_code = FindWindow (er.where, &window_ptr);
8164 } 8150 }
8165 8151
@@ -8306,6 +8292,18 @@ XTread_socket (sd, expected, hold_quit)
8306#else /* not TARGET_API_MAC_CARBON */ 8292#else /* not TARGET_API_MAC_CARBON */
8307 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); 8293 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
8308#endif /* not TARGET_API_MAC_CARBON */ 8294#endif /* not TARGET_API_MAC_CARBON */
8295 /* Update the frame parameters. */
8296 {
8297 struct frame *f = mac_window_to_frame (window_ptr);
8298 if (f && !f->async_iconified)
8299 {
8300 int x, y;
8301
8302 x_real_positions (f, &x, &y);
8303 f->left_pos = x;
8304 f->top_pos = y;
8305 }
8306 }
8309 break; 8307 break;
8310 8308
8311 case inGoAway: 8309 case inGoAway:
@@ -8393,24 +8391,38 @@ XTread_socket (sd, expected, hold_quit)
8393 break; 8391 break;
8394 } 8392 }
8395 8393
8394 if (!is_emacs_window (window_ptr))
8395 break;
8396
8397 f = mac_window_to_frame (window_ptr);
8398
8396 if ((er.modifiers & activeFlag) != 0) 8399 if ((er.modifiers & activeFlag) != 0)
8397 { 8400 {
8401 /* A window has been activated */
8398 Point mouse_loc = er.where; 8402 Point mouse_loc = er.where;
8399 8403
8400 do_window_activate (window_ptr); 8404 x_new_focus_frame (dpyinfo, f);
8405 activate_scroll_bars (f);
8401 8406
8402 SetPortWindowPort (window_ptr); 8407 SetPortWindowPort (window_ptr);
8403 GlobalToLocal (&mouse_loc); 8408 GlobalToLocal (&mouse_loc);
8404 /* activateEvt counts as mouse movement, 8409 /* Window-activated event counts as mouse movement,
8405 so update things that depend on mouse position. */ 8410 so update things that depend on mouse position. */
8406 note_mouse_movement (mac_window_to_frame (window_ptr), 8411 note_mouse_movement (mac_window_to_frame (window_ptr),
8407 &mouse_loc); 8412 &mouse_loc);
8408 } 8413 }
8409 else 8414 else
8410 { 8415 {
8411 do_window_deactivate (window_ptr); 8416 /* A window has been deactivated */
8417 dpyinfo->grabbed = 0;
8418
8419 if (f == dpyinfo->x_focus_frame)
8420 {
8421 x_new_focus_frame (dpyinfo, 0);
8422 deactivate_scroll_bars (f);
8423 }
8424
8412 8425
8413 f = mac_window_to_frame (window_ptr);
8414 if (f == dpyinfo->mouse_face_mouse_frame) 8426 if (f == dpyinfo->mouse_face_mouse_frame)
8415 { 8427 {
8416 /* If we move outside the frame, then we're 8428 /* If we move outside the frame, then we're
diff --git a/src/search.c b/src/search.c
index dc1ca91e38f..169baf05d55 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1,5 +1,6 @@
1/* String search routines for GNU Emacs. 1/* String search routines for GNU Emacs.
2 Copyright (C) 1985, 86,87,93,94,97,98, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 86,87,93,94,97,98, 1999, 2004
3 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -2628,7 +2629,7 @@ match_limit (num, beginningp)
2628 CHECK_NUMBER (num); 2629 CHECK_NUMBER (num);
2629 n = XINT (num); 2630 n = XINT (num);
2630 if (n < 0) 2631 if (n < 0)
2631 args_out_of_range (num, 0); 2632 args_out_of_range (num, make_number (0));
2632 if (search_regs.num_regs <= 0) 2633 if (search_regs.num_regs <= 0)
2633 error ("No match data, because no search succeeded"); 2634 error ("No match data, because no search succeeded");
2634 if (n >= search_regs.num_regs 2635 if (n >= search_regs.num_regs
@@ -2728,10 +2729,9 @@ Return value is undefined if the last search failed. */)
2728 data[2 * i] = data [2 * i + 1] = Qnil; 2729 data[2 * i] = data [2 * i + 1] = Qnil;
2729 } 2730 }
2730 2731
2731 if (BUFFERP(last_thing_searched) 2732 if (BUFFERP (last_thing_searched) && !NILP (integers))
2732 && ! NILP (integers))
2733 { 2733 {
2734 XSETBUFFER(data[len], last_thing_searched); 2734 data[len] = last_thing_searched;
2735 len++; 2735 len++;
2736 } 2736 }
2737 2737
@@ -2808,9 +2808,16 @@ LIST should have been created by calling `match-data' previously. */)
2808 search_regs.num_regs = length; 2808 search_regs.num_regs = length;
2809 } 2809 }
2810 2810
2811 for (i = 0; i < length; i++) 2811 for (i = 0;; i++)
2812 { 2812 {
2813 marker = Fcar (list); 2813 marker = Fcar (list);
2814 if (BUFFERP (marker))
2815 {
2816 last_thing_searched = marker;
2817 break;
2818 }
2819 if (i >= length)
2820 break;
2814 if (NILP (marker)) 2821 if (NILP (marker))
2815 { 2822 {
2816 search_regs.start[i] = -1; 2823 search_regs.start[i] = -1;
@@ -2847,10 +2854,6 @@ LIST should have been created by calling `match-data' previously. */)
2847 search_regs.start[i] = -1; 2854 search_regs.start[i] = -1;
2848 } 2855 }
2849 2856
2850 if (CONSP(list) && BUFFERP(XCAR(list))) {
2851 XSETBUFFER(last_thing_searched, XCAR(list));
2852 }
2853
2854 return Qnil; 2857 return Qnil;
2855} 2858}
2856 2859
diff --git a/src/syntax.c b/src/syntax.c
index 302250c39a4..83763061d82 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1734,7 +1734,6 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
1734 if (!fastmap[*p]) 1734 if (!fastmap[*p])
1735 break; 1735 break;
1736 1736
1737 fwd_unibyte_ok:
1738 p++, pos++; 1737 p++, pos++;
1739 } 1738 }
1740 } 1739 }
@@ -1808,7 +1807,6 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
1808 if (!fastmap[p[-1]]) 1807 if (!fastmap[p[-1]])
1809 break; 1808 break;
1810 1809
1811 back_unibyte_ok:
1812 p--, pos--; 1810 p--, pos--;
1813 } 1811 }
1814 } 1812 }
diff --git a/src/w32select.c b/src/w32select.c
index 0c8849c7be6..20f7cfc457f 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -130,6 +130,8 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
130 130
131 BLOCK_INPUT; 131 BLOCK_INPUT;
132 132
133 /* Include the terminating NULL character in the source of
134 conversion. */
133 nbytes = SBYTES (string) + 1; 135 nbytes = SBYTES (string) + 1;
134 src = SDATA (string); 136 src = SDATA (string);
135 dst = src; 137 dst = src;
@@ -208,7 +210,9 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
208 { 210 {
209 string = run_pre_post_conversion_on_str (string, &coding, 1); 211 string = run_pre_post_conversion_on_str (string, &coding, 1);
210 src = SDATA (string); 212 src = SDATA (string);
211 nbytes = SBYTES (string); 213 /* Include the terminating NULL character in the source of
214 conversion. */
215 nbytes = SBYTES (string) + 1;
212 } 216 }
213 coding.src_multibyte = 1; 217 coding.src_multibyte = 1;
214 coding.dst_multibyte = 0; 218 coding.dst_multibyte = 0;
diff --git a/src/xfaces.c b/src/xfaces.c
index a5d5c97a332..ce40e053b20 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5851,7 +5851,7 @@ x_supports_face_attributes_p (f, attrs, def_face)
5851 face = FACE_FROM_ID (f, lookup_face (f, merged_attrs, 0, 0)); 5851 face = FACE_FROM_ID (f, lookup_face (f, merged_attrs, 0, 0));
5852 5852
5853 if (! face) 5853 if (! face)
5854 signal_error ("cannot make face", 0); 5854 error ("cannot make face");
5855 5855
5856 /* If the font is the same, then not supported. */ 5856 /* If the font is the same, then not supported. */
5857 if (face->font == def_face->font) 5857 if (face->font == def_face->font)
@@ -5886,7 +5886,7 @@ tty_supports_face_attributes_p (f, attrs, def_face)
5886 Lisp_Object *attrs; 5886 Lisp_Object *attrs;
5887 struct face *def_face; 5887 struct face *def_face;
5888{ 5888{
5889 int weight, i; 5889 int weight;
5890 Lisp_Object val, fg, bg; 5890 Lisp_Object val, fg, bg;
5891 XColor fg_tty_color, fg_std_color; 5891 XColor fg_tty_color, fg_std_color;
5892 XColor bg_tty_color, bg_std_color; 5892 XColor bg_tty_color, bg_std_color;
@@ -6108,7 +6108,7 @@ face for italic. */)
6108 if (def_face == NULL) 6108 if (def_face == NULL)
6109 { 6109 {
6110 if (! realize_basic_faces (f)) 6110 if (! realize_basic_faces (f))
6111 signal_error ("Cannot realize default face", 0); 6111 error ("Cannot realize default face");
6112 def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); 6112 def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
6113 } 6113 }
6114 6114