aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2006-11-07 23:22:48 +0000
committerMiles Bader2006-11-07 23:22:48 +0000
commitdbc3b08c405a7b1c0ddb0fb0c98164b355802af5 (patch)
tree00c6f28244409d14bec11e221fb3c03daef63fc6 /src
parentbbb6e8f2b6037dc1ee4ddd6cb63a1a6ddb04a591 (diff)
parent86cb14475e9e76f0b3323d2e7110a4a2bd310cdb (diff)
downloademacs-dbc3b08c405a7b1c0ddb0fb0c98164b355802af5.tar.gz
emacs-dbc3b08c405a7b1c0ddb0fb0c98164b355802af5.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 490-504) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 161-163) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-130
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog186
-rw-r--r--src/dosfns.c2
-rw-r--r--src/emacs.c2
-rw-r--r--src/eval.c2
-rw-r--r--src/fns.c4
-rw-r--r--src/frame.c4
-rw-r--r--src/gtkutil.c7
-rw-r--r--src/image.c59
-rw-r--r--src/lread.c4
-rw-r--r--src/mac.c32
-rw-r--r--src/macfns.c4
-rw-r--r--src/macmenu.c19
-rw-r--r--src/macselect.c9
-rw-r--r--src/macterm.c201
-rw-r--r--src/macterm.h13
-rw-r--r--src/s/netbsd.h5
-rw-r--r--src/s/openbsd.h4
-rw-r--r--src/unexcw.c2
-rw-r--r--src/unexmacosx.c223
-rw-r--r--src/w32fns.c25
-rw-r--r--src/w32menu.c28
-rw-r--r--src/w32proc.c3
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfns.c44
-rw-r--r--src/xmenu.c24
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c24
27 files changed, 614 insertions, 320 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 492b71baa61..601d1058b1b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,188 @@
12006-10-29 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change) 12006-11-06 Juanma Barranquero <lekktu@gmail.com>
2
3 * lread.c (syms_of_lread):
4 * xsmfns.c (syms_of_xsmfns): Fix typo in docstring.
5
62006-11-06 Martin Rudalics <rudalics@gmx.at>
7
8 * macmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
9
10 * w32menu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
11 Return nil if building without menus.
12
13 * xmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
14 Return nil if building without menus.
15
162006-11-05 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change)
17
18 * s/netbsd.h (POSIX_SIGNALS): Defined.
19
202006-11-05 Martin Rudalics <rudalics@gmx.at>
21
22 * macmenu.c (Fmenu_or_popup_active_p): New function.
23 (syms_of_macmenu): Defsubr it.
24
25 * w32menu.c (Fmenu_or_popup_active_p): New function.
26 (syms_of_w32menu): Defsubr it.
27 (popup_activated_flag, popup_activated): Remove.
28
29 * xdisp.c (note_mouse_highlight) [HAVE_NTGUI]: Don't bother to
30 check popup_activated.
31
32 * xmenu.c (Fmenu_or_popup_active_p): New function.
33 (syms_of_xmenu): Defsubr it.
34
352006-11-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
36
37 * unexmacosx.c (malloc_cookie): Remove unused variable.
38 (region_list_head, region_list_tail, lca, nlc, infile_lc_highest_addr)
39 (text_seg_lowest_offset, mh, curr_header_offset, infd, outfd)
40 (emacs_zone, data_segment_old_fileoff, data_segment_scp)
41 (num_unexec_regions, unexec_regions): Make variables static.
42 (print_regions, find_emacs_zone_regions): Make static.
43 (unexec_region_info): New typedef.
44 (unexec_regions): Change type from vm_range_t[] to unexec_region_info[].
45 All uses changed.
46 (unexec_regions_recorder): Subtract size of trailing null pages from
47 filesize. Show filesize.
48 (unexec_regions_merge): Don't merge if null pages of preceding region
49 is not too small. Use long format in printf.
50 (copy_segment, copy_data_segment): Show filesize.
51 (copy_data_segment): Write filesize bytes of region data. Adjust
52 filesize in segment command accordingly.
53 (dump_it): Use long format in printf.
54
552006-11-05 Juanma Barranquero <lekktu@gmail.com>
56
57 * dosfns.c (Finsert_startup_screen):
58 * fns.c (Ffeaturep, syms_of_fns):
59 * frame.c (syms_of_frame): Fix typos in docstrings.
60
61 * unexcw.c (unexec): Fix typo in output message.
62
632006-11-04 Ralf Angeli <angeli@caeruleus.net>
64
65 * w32fns.c (w32_createwindow): Remove code for handling -geometry
66 command line option and `initial-frame-alist' which is superfluous
67 after the last change to `w32_createwindow'.
68
692006-11-04 Slawomir Nowaczyk <slawek@cs.lth.se> (tiny change)
70
71 * w32proc.c (sys_wait): Only wait for processes with fd<0.
72 Others should be handled by sys_select instead. Fixes problems
73 with (progn (start-process "" nil "ls") (call-process "ls")).
74
752006-11-04 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
76
77 * xmenu.c (Fmenu_bar_open): Declare variable before BLOCK_INPUT to
78 avoid gcc 2.95 error.
79
802006-11-04 Chong Yidong <cyd@stupidchicken.com>
81
82 * gtkutil.c (update_frame_tool_bar): If icon image is invalid and
83 wicon is null, insert an empty button.
84
852006-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
86
87 * xterm.c (x_raise_frame): Send _NET_ACTIVE_WINDOW when raising the
88 window.
89
902006-11-02 Juanma Barranquero <lekktu@gmail.com>
91
92 * emacs.c (Fkill_emacs): Fix typo in docstring.
93
942006-11-02 Nozomu Ando <nand@mac.com>
95
96 * unexmacosx.c (mach_header, segment_command, vm_region, section)
97 [_LP64]: New defines.
98 (VM_REGION_BASIC_INFO_COUNT, VM_REGION_BASIC_INFO, LC_SEGMENT)
99 (MH_MAGIC) [_LP64]: Redefine.
100 (delta): Remove variable.
101 (curr_file_offset, pagesize): New variables.
102 (ROUNDUP_TO_PAGE_BOUNDARY): New macro.
103 (data_segment_old_fileoff): Initialize explicitly.
104 (print_region, unexec_regions_recorder, print_load_command_name)
105 (copy_segment, copy_data_segment): Use long format in printf.
106 (MAX_UNEXEC_REGIONS): Increase to 400.
107 (unexec_regions_recorder): Don't warn too many regions here.
108 (find_emacs_zone_regions): Warn too many regions here.
109 (print_load_command_name) [_LP64]: Show correct load command name.
110 (copy_segment, copy_data_segment): Use variable `curr_file_offset'.
111 Show starting virtual memory address. Don't show ending file offset.
112 (copy_symtab, copy_dysymtab, copy_twolevelhints): New argument DELTA.
113 (dump_it): Use new local variable `linkedit_delta' and pass to them.
114 Error if trying to handle multiple DATA segments.
115 (unexec): Initialize variable `pagesize'.
116
1172006-11-01 Juanma Barranquero <lekktu@gmail.com>
118
119 * eval.c (Fcatch): Doc fix.
120
1212006-10-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
122
123 * image.c [MAC_OS] (image_load_qt_1, xpm_scan, xpm_make_color_table_v)
124 (xpm_put_color_table_v, xpm_get_color_table_v, xpm_make_color_table_h)
125 (xpm_put_color_table_h, xpm_get_color_table_h, xpm_str_to_color_key)
126 (xpm_load_image): Add const qualifier to arguments.
127 [MAC_OS] (xpm_color_key_strings): Make static const.
128
129 * mac.c (create_apple_event_from_event_ref)
130 (create_apple_event_from_drag_ref, skip_white_space, parse_comment)
131 (parse_include_file, parse_binding, parse_component)
132 (parse_resource_name, parse_value, parse_resource_line)
133 (xrm_merge_string_database, xrm_get_resource)
134 (xrm_get_preference_database): Add const qualifier to arguments.
135 [MAC_OSX] (sys_select): Make variable `context' static const.
136
137 * macfns.c (mac_color_map): Make static const.
138 (mac_color_map_lookup): Add const qualifier to arguments.
139
140 * macmenu.c (install_menu_quit_handler): Make variable `typesList'
141 static const.
142 (name_is_separator): Add const qualifier to arguments.
143
144 * macselect.c (init_service_handler): Make variable `specs' static
145 const.
146
147 * macterm.c (mac_create_bitmap_from_bitmap_data): Make variable
148 `swap_nibbles' static const.
149 (atsu_get_text_layout_with_text_ptr): Make variables `lengths',
150 `tags', `sizes', `values' static const.
151 (mac_draw_string_common): Make variables `context' static. Make
152 variables `tags', `sizes', and `values' static const.
153 (pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click)
154 (xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match)
155 (mac_to_x_fontname, parse_x_font_name, add_mac_font_name)
156 (mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window)
157 (mac_store_event_ref_as_apple_event, mac_make_rdb): Add const
158 qualifier to arguments.
159 (xlfd_scalable_fields, keycode_to_xkeysym_table)
160 (fn_keycode_to_keycode_table): Make static const.
161 (mac_load_query_font): Make variables `tags', `sizes', `values',
162 `types', and `selectors' static const.
163 (mac_handle_command_event, mac_handle_window_event): Make
164 variables `names' and `types' static const.
165 (init_command_handler, install_window_handler): Make variables
166 `specs*' static const.
167 (mac_handle_font_event, mac_handle_text_input_event)
168 (mac_store_service_event): Make variables `names' and `types'
169 const. Make variables `names_*' and `types_*' static const.
170
171 * macterm.h (create_apple_event_from_event_ref)
172 (create_apple_event_from_drag_ref, xrm_merge_string_database)
173 (xrm_get_resource, xrm_get_preference_database): Add const
174 qualifier to arguments in externs.
175
1762006-10-31 Kenichi Handa <handa@m17n.org>
177
178 * xfns.c (xic_create_xfontset): Fix previous change.
179
1802006-10-30 Chong Yidong <cyd@stupidchicken.com>
181
182 * s/openbsd.h (LD_SWITCH_SYSTEM): Add /usr/pkg/lib and
183 /usr/pkg/lib to library search path.
184
1852006-10-29 Mark Davies <mark@mcs.vuw.ac.nz> (tiny change)
2 186
3 * ralloc.c (relinquish): Use a long for excess space counter to 187 * ralloc.c (relinquish): Use a long for excess space counter to
4 handle 64-bit case correctly. 188 handle 64-bit case correctly.
diff --git a/src/dosfns.c b/src/dosfns.c
index 2d5169dcf27..37085ebeb5f 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -213,7 +213,7 @@ DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0,
213} 213}
214 214
215DEFUN ("insert-startup-screen", Finsert_startup_screen, Sinsert_startup_screen, 0, 0, "", 215DEFUN ("insert-startup-screen", Finsert_startup_screen, Sinsert_startup_screen, 0, 0, "",
216 doc: /* Insert copy of screen contents prior to starting emacs. 216 doc: /* Insert copy of screen contents prior to starting Emacs.
217Return nil if startup screen is not available. */) 217Return nil if startup screen is not available. */)
218 () 218 ()
219{ 219{
diff --git a/src/emacs.c b/src/emacs.c
index 4d678696334..4e1caec3aff 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2072,7 +2072,7 @@ sort_args (argc, argv)
2072DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P", 2072DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P",
2073 doc: /* Exit the Emacs job and kill it. 2073 doc: /* Exit the Emacs job and kill it.
2074If ARG is an integer, return ARG as the exit program code. 2074If ARG is an integer, return ARG as the exit program code.
2075If ARG is a string, stuff it as keyboard input. 2075If ARG is a string, stuff it as keyboard input.
2076 2076
2077The value of `kill-emacs-hook', if not void, 2077The value of `kill-emacs-hook', if not void,
2078is a list of functions (of no args), 2078is a list of functions (of no args),
diff --git a/src/eval.c b/src/eval.c
index 4e04422d2d6..7e9b4b55d09 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1174,7 +1174,7 @@ DEFUN ("catch", Fcatch, Scatch, 1, UNEVALLED, 0,
1174TAG is evalled to get the tag to use; it must not be nil. 1174TAG is evalled to get the tag to use; it must not be nil.
1175 1175
1176Then the BODY is executed. 1176Then the BODY is executed.
1177Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'. 1177Within BODY, a call to `throw' with the same TAG exits BODY and this `catch'.
1178If no throw happens, `catch' returns the value of the last BODY form. 1178If no throw happens, `catch' returns the value of the last BODY form.
1179If a throw happens, it specifies the value to return from `catch'. 1179If a throw happens, it specifies the value to return from `catch'.
1180usage: (catch TAG BODY...) */) 1180usage: (catch TAG BODY...) */)
diff --git a/src/fns.c b/src/fns.c
index e77d8cbca7e..64223d83e8c 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2828,7 +2828,7 @@ DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0,
2828 doc: /* Returns t if FEATURE is present in this Emacs. 2828 doc: /* Returns t if FEATURE is present in this Emacs.
2829 2829
2830Use this to conditionalize execution of lisp code based on the 2830Use this to conditionalize execution of lisp code based on the
2831presence or absence of emacs or environment extensions. 2831presence or absence of Emacs or environment extensions.
2832Use `provide' to declare that a feature is available. This function 2832Use `provide' to declare that a feature is available. This function
2833looks at the value of the variable `features'. The optional argument 2833looks at the value of the variable `features'. The optional argument
2834SUBFEATURE can be used to check a specific subfeature of FEATURE. */) 2834SUBFEATURE can be used to check a specific subfeature of FEATURE. */)
@@ -5175,7 +5175,7 @@ syms_of_fns ()
5175 Fset (Qyes_or_no_p_history, Qnil); 5175 Fset (Qyes_or_no_p_history, Qnil);
5176 5176
5177 DEFVAR_LISP ("features", &Vfeatures, 5177 DEFVAR_LISP ("features", &Vfeatures,
5178 doc: /* A list of symbols which are the features of the executing emacs. 5178 doc: /* A list of symbols which are the features of the executing Emacs.
5179Used by `featurep' and `require', and altered by `provide'. */); 5179Used by `featurep' and `require', and altered by `provide'. */);
5180 Vfeatures = Fcons (intern ("emacs"), Qnil); 5180 Vfeatures = Fcons (intern ("emacs"), Qnil);
5181 Qsubfeatures = intern ("subfeatures"); 5181 Qsubfeatures = intern ("subfeatures");
diff --git a/src/frame.c b/src/frame.c
index f431dc4946d..618022b28b6 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2611,7 +2611,7 @@ extern Lisp_Object Qbox;
2611extern Lisp_Object Qtop; 2611extern Lisp_Object Qtop;
2612 2612
2613/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the 2613/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the
2614 wanted positions of the WM window (not emacs window). 2614 wanted positions of the WM window (not Emacs window).
2615 Return in *WIDTH and *HEIGHT the wanted width and height of Emacs 2615 Return in *WIDTH and *HEIGHT the wanted width and height of Emacs
2616 window (FRAME_X_WINDOW). 2616 window (FRAME_X_WINDOW).
2617 */ 2617 */
@@ -4215,7 +4215,7 @@ Setting this variable does not affect existing frames, only new ones. */);
4215 doc: /* The initial frame-object, which represents Emacs's stdout. */); 4215 doc: /* The initial frame-object, which represents Emacs's stdout. */);
4216 4216
4217 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, 4217 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
4218 doc: /* Non-nil if all of emacs is iconified and frame updates are not needed. */); 4218 doc: /* Non-nil if all of Emacs is iconified and frame updates are not needed. */);
4219 Vemacs_iconified = Qnil; 4219 Vemacs_iconified = Qnil;
4220 4220
4221 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function, 4221 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 07cc883fb83..f7b9f8c18f9 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3720,7 +3720,12 @@ update_frame_tool_bar (f)
3720 3720
3721 if (img->load_failed_p || img->pixmap == None) 3721 if (img->load_failed_p || img->pixmap == None)
3722 { 3722 {
3723 if (wicon) gtk_widget_hide (wicon); 3723 if (wicon)
3724 gtk_widget_hide (wicon);
3725 else
3726 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget),
3727 gtk_tool_button_new (NULL, ""),
3728 i);
3724 continue; 3729 continue;
3725 } 3730 }
3726 3731
diff --git a/src/image.c b/src/image.c
index 30c01702d85..f4616b626a6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2393,7 +2393,7 @@ image_load_qt_1 (f, img, type, fss, dh)
2393 struct frame *f; 2393 struct frame *f;
2394 struct image *img; 2394 struct image *img;
2395 OSType type; 2395 OSType type;
2396 FSSpec *fss; 2396 const FSSpec *fss;
2397 Handle dh; 2397 Handle dh;
2398{ 2398{
2399 ComponentResult err; 2399 ComponentResult err;
@@ -2407,8 +2407,7 @@ image_load_qt_1 (f, img, type, fss, dh)
2407 XImagePtr ximg; 2407 XImagePtr ximg;
2408 RGBColor bg_color; 2408 RGBColor bg_color;
2409 2409
2410 err = OpenADefaultComponent (GraphicsImporterComponentType, 2410 err = OpenADefaultComponent (GraphicsImporterComponentType, type, &gi);
2411 type, &gi);
2412 if (err != noErr) 2411 if (err != noErr)
2413 { 2412 {
2414 image_error ("Cannot get importer component for `%s'", img->spec, Qnil); 2413 image_error ("Cannot get importer component for `%s'", img->spec, Qnil);
@@ -4110,25 +4109,25 @@ xpm_load (f, img)
4110/* XPM support functions for Mac OS where libxpm is not available. 4109/* XPM support functions for Mac OS where libxpm is not available.
4111 Only XPM version 3 (without any extensions) is supported. */ 4110 Only XPM version 3 (without any extensions) is supported. */
4112 4111
4113static int xpm_scan P_ ((unsigned char **, unsigned char *, 4112static int xpm_scan P_ ((const unsigned char **, const unsigned char *,
4114 unsigned char **, int *)); 4113 const unsigned char **, int *));
4115static Lisp_Object xpm_make_color_table_v 4114static Lisp_Object xpm_make_color_table_v
4116 P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), 4115 P_ ((void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
4117 Lisp_Object (**) (Lisp_Object, unsigned char *, int))); 4116 Lisp_Object (**) (Lisp_Object, const unsigned char *, int)));
4118static void xpm_put_color_table_v P_ ((Lisp_Object, unsigned char *, 4117static void xpm_put_color_table_v P_ ((Lisp_Object, const unsigned char *,
4119 int, Lisp_Object)); 4118 int, Lisp_Object));
4120static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object, 4119static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object,
4121 unsigned char *, int)); 4120 const unsigned char *, int));
4122static Lisp_Object xpm_make_color_table_h 4121static Lisp_Object xpm_make_color_table_h
4123 P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), 4122 P_ ((void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
4124 Lisp_Object (**) (Lisp_Object, unsigned char *, int))); 4123 Lisp_Object (**) (Lisp_Object, const unsigned char *, int)));
4125static void xpm_put_color_table_h P_ ((Lisp_Object, unsigned char *, 4124static void xpm_put_color_table_h P_ ((Lisp_Object, const unsigned char *,
4126 int, Lisp_Object)); 4125 int, Lisp_Object));
4127static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object, 4126static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object,
4128 unsigned char *, int)); 4127 const unsigned char *, int));
4129static int xpm_str_to_color_key P_ ((char *)); 4128static int xpm_str_to_color_key P_ ((const char *));
4130static int xpm_load_image P_ ((struct frame *, struct image *, 4129static int xpm_load_image P_ ((struct frame *, struct image *,
4131 unsigned char *, unsigned char *)); 4130 const unsigned char *, const unsigned char *));
4132 4131
4133/* Tokens returned from xpm_scan. */ 4132/* Tokens returned from xpm_scan. */
4134 4133
@@ -4148,7 +4147,7 @@ enum xpm_token
4148 4147
4149static int 4148static int
4150xpm_scan (s, end, beg, len) 4149xpm_scan (s, end, beg, len)
4151 unsigned char **s, *end, **beg; 4150 const unsigned char **s, *end, **beg;
4152 int *len; 4151 int *len;
4153{ 4152{
4154 int c; 4153 int c;
@@ -4214,8 +4213,8 @@ xpm_scan (s, end, beg, len)
4214 4213
4215static Lisp_Object 4214static Lisp_Object
4216xpm_make_color_table_v (put_func, get_func) 4215xpm_make_color_table_v (put_func, get_func)
4217 void (**put_func) (Lisp_Object, unsigned char *, int, Lisp_Object); 4216 void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object);
4218 Lisp_Object (**get_func) (Lisp_Object, unsigned char *, int); 4217 Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int);
4219{ 4218{
4220 *put_func = xpm_put_color_table_v; 4219 *put_func = xpm_put_color_table_v;
4221 *get_func = xpm_get_color_table_v; 4220 *get_func = xpm_get_color_table_v;
@@ -4225,7 +4224,7 @@ xpm_make_color_table_v (put_func, get_func)
4225static void 4224static void
4226xpm_put_color_table_v (color_table, chars_start, chars_len, color) 4225xpm_put_color_table_v (color_table, chars_start, chars_len, color)
4227 Lisp_Object color_table; 4226 Lisp_Object color_table;
4228 unsigned char *chars_start; 4227 const unsigned char *chars_start;
4229 int chars_len; 4228 int chars_len;
4230 Lisp_Object color; 4229 Lisp_Object color;
4231{ 4230{
@@ -4235,7 +4234,7 @@ xpm_put_color_table_v (color_table, chars_start, chars_len, color)
4235static Lisp_Object 4234static Lisp_Object
4236xpm_get_color_table_v (color_table, chars_start, chars_len) 4235xpm_get_color_table_v (color_table, chars_start, chars_len)
4237 Lisp_Object color_table; 4236 Lisp_Object color_table;
4238 unsigned char *chars_start; 4237 const unsigned char *chars_start;
4239 int chars_len; 4238 int chars_len;
4240{ 4239{
4241 return XVECTOR (color_table)->contents[*chars_start]; 4240 return XVECTOR (color_table)->contents[*chars_start];
@@ -4243,8 +4242,8 @@ xpm_get_color_table_v (color_table, chars_start, chars_len)
4243 4242
4244static Lisp_Object 4243static Lisp_Object
4245xpm_make_color_table_h (put_func, get_func) 4244xpm_make_color_table_h (put_func, get_func)
4246 void (**put_func) (Lisp_Object, unsigned char *, int, Lisp_Object); 4245 void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object);
4247 Lisp_Object (**get_func) (Lisp_Object, unsigned char *, int); 4246 Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int);
4248{ 4247{
4249 *put_func = xpm_put_color_table_h; 4248 *put_func = xpm_put_color_table_h;
4250 *get_func = xpm_get_color_table_h; 4249 *get_func = xpm_get_color_table_h;
@@ -4257,7 +4256,7 @@ xpm_make_color_table_h (put_func, get_func)
4257static void 4256static void
4258xpm_put_color_table_h (color_table, chars_start, chars_len, color) 4257xpm_put_color_table_h (color_table, chars_start, chars_len, color)
4259 Lisp_Object color_table; 4258 Lisp_Object color_table;
4260 unsigned char *chars_start; 4259 const unsigned char *chars_start;
4261 int chars_len; 4260 int chars_len;
4262 Lisp_Object color; 4261 Lisp_Object color;
4263{ 4262{
@@ -4272,7 +4271,7 @@ xpm_put_color_table_h (color_table, chars_start, chars_len, color)
4272static Lisp_Object 4271static Lisp_Object
4273xpm_get_color_table_h (color_table, chars_start, chars_len) 4272xpm_get_color_table_h (color_table, chars_start, chars_len)
4274 Lisp_Object color_table; 4273 Lisp_Object color_table;
4275 unsigned char *chars_start; 4274 const unsigned char *chars_start;
4276 int chars_len; 4275 int chars_len;
4277{ 4276{
4278 struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); 4277 struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
@@ -4290,11 +4289,11 @@ enum xpm_color_key {
4290 XPM_COLOR_KEY_C 4289 XPM_COLOR_KEY_C
4291}; 4290};
4292 4291
4293static char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"}; 4292static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
4294 4293
4295static int 4294static int
4296xpm_str_to_color_key (s) 4295xpm_str_to_color_key (s)
4297 char *s; 4296 const char *s;
4298{ 4297{
4299 int i; 4298 int i;
4300 4299
@@ -4310,15 +4309,15 @@ static int
4310xpm_load_image (f, img, contents, end) 4309xpm_load_image (f, img, contents, end)
4311 struct frame *f; 4310 struct frame *f;
4312 struct image *img; 4311 struct image *img;
4313 unsigned char *contents, *end; 4312 const unsigned char *contents, *end;
4314{ 4313{
4315 unsigned char *s = contents, *beg, *str; 4314 const unsigned char *s = contents, *beg, *str;
4316 unsigned char buffer[BUFSIZ]; 4315 unsigned char buffer[BUFSIZ];
4317 int width, height, x, y; 4316 int width, height, x, y;
4318 int num_colors, chars_per_pixel; 4317 int num_colors, chars_per_pixel;
4319 int len, LA1; 4318 int len, LA1;
4320 void (*put_color_table) (Lisp_Object, unsigned char *, int, Lisp_Object); 4319 void (*put_color_table) (Lisp_Object, const unsigned char *, int, Lisp_Object);
4321 Lisp_Object (*get_color_table) (Lisp_Object, unsigned char *, int); 4320 Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int);
4322 Lisp_Object frame, color_symbols, color_table; 4321 Lisp_Object frame, color_symbols, color_table;
4323 int best_key, have_mask = 0; 4322 int best_key, have_mask = 0;
4324 XImagePtr ximg = NULL, mask_img = NULL; 4323 XImagePtr ximg = NULL, mask_img = NULL;
diff --git a/src/lread.c b/src/lread.c
index c263c458a12..79ccc8bd152 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -145,7 +145,7 @@ static int load_convert_to_unibyte;
145 This is set to 1 by read1 temporarily while handling #@NUMBER. */ 145 This is set to 1 by read1 temporarily while handling #@NUMBER. */
146static int load_each_byte; 146static int load_each_byte;
147 147
148/* Function to use for loading an Emacs lisp source file (not 148/* Function to use for loading an Emacs Lisp source file (not
149 compiled) instead of readevalloop. */ 149 compiled) instead of readevalloop. */
150Lisp_Object Vload_source_file_function; 150Lisp_Object Vload_source_file_function;
151 151
@@ -4243,7 +4243,7 @@ The default is nil, which means use the function `read'. */);
4243 Vload_read_function = Qnil; 4243 Vload_read_function = Qnil;
4244 4244
4245 DEFVAR_LISP ("load-source-file-function", &Vload_source_file_function, 4245 DEFVAR_LISP ("load-source-file-function", &Vload_source_file_function,
4246 doc: /* Function called in `load' for loading an Emacs lisp source file. 4246 doc: /* Function called in `load' for loading an Emacs Lisp source file.
4247This function is for doing code conversion before reading the source file. 4247This function is for doing code conversion before reading the source file.
4248If nil, loading is done without any code conversion. 4248If nil, loading is done without any code conversion.
4249Arguments are FULLNAME, FILE, NOERROR, NOMESSAGE, where 4249Arguments are FULLNAME, FILE, NOERROR, NOMESSAGE, where
diff --git a/src/mac.c b/src/mac.c
index d127422ccde..c4275caa741 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -835,8 +835,8 @@ OSStatus
835create_apple_event_from_event_ref (event, num_params, names, types, result) 835create_apple_event_from_event_ref (event, num_params, names, types, result)
836 EventRef event; 836 EventRef event;
837 UInt32 num_params; 837 UInt32 num_params;
838 EventParamName *names; 838 const EventParamName *names;
839 EventParamType *types; 839 const EventParamType *types;
840 AppleEvent *result; 840 AppleEvent *result;
841{ 841{
842 OSStatus err; 842 OSStatus err;
@@ -891,7 +891,7 @@ OSErr
891create_apple_event_from_drag_ref (drag, num_types, types, result) 891create_apple_event_from_drag_ref (drag, num_types, types, result)
892 DragRef drag; 892 DragRef drag;
893 UInt32 num_types; 893 UInt32 num_types;
894 FlavorType *types; 894 const FlavorType *types;
895 AppleEvent *result; 895 AppleEvent *result;
896{ 896{
897 OSErr err; 897 OSErr err;
@@ -1315,7 +1315,7 @@ cfproperty_list_to_lisp (plist, with_tag, hash_bound)
1315 1315
1316static void 1316static void
1317skip_white_space (p) 1317skip_white_space (p)
1318 char **p; 1318 const char **p;
1319{ 1319{
1320 /* WhiteSpace = {<space> | <horizontal tab>} */ 1320 /* WhiteSpace = {<space> | <horizontal tab>} */
1321 while (*P == ' ' || *P == '\t') 1321 while (*P == ' ' || *P == '\t')
@@ -1324,7 +1324,7 @@ skip_white_space (p)
1324 1324
1325static int 1325static int
1326parse_comment (p) 1326parse_comment (p)
1327 char **p; 1327 const char **p;
1328{ 1328{
1329 /* Comment = "!" {<any character except null or newline>} */ 1329 /* Comment = "!" {<any character except null or newline>} */
1330 if (*P == '!') 1330 if (*P == '!')
@@ -1342,7 +1342,7 @@ parse_comment (p)
1342/* Don't interpret filename. Just skip until the newline. */ 1342/* Don't interpret filename. Just skip until the newline. */
1343static int 1343static int
1344parse_include_file (p) 1344parse_include_file (p)
1345 char **p; 1345 const char **p;
1346{ 1346{
1347 /* IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace */ 1347 /* IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace */
1348 if (*P == '#') 1348 if (*P == '#')
@@ -1359,7 +1359,7 @@ parse_include_file (p)
1359 1359
1360static char 1360static char
1361parse_binding (p) 1361parse_binding (p)
1362 char **p; 1362 const char **p;
1363{ 1363{
1364 /* Binding = "." | "*" */ 1364 /* Binding = "." | "*" */
1365 if (*P == '.' || *P == '*') 1365 if (*P == '.' || *P == '*')
@@ -1377,7 +1377,7 @@ parse_binding (p)
1377 1377
1378static Lisp_Object 1378static Lisp_Object
1379parse_component (p) 1379parse_component (p)
1380 char **p; 1380 const char **p;
1381{ 1381{
1382 /* Component = "?" | ComponentName 1382 /* Component = "?" | ComponentName
1383 ComponentName = NameChar {NameChar} 1383 ComponentName = NameChar {NameChar}
@@ -1389,7 +1389,7 @@ parse_component (p)
1389 } 1389 }
1390 else if (isalnum (*P) || *P == '_' || *P == '-') 1390 else if (isalnum (*P) || *P == '_' || *P == '-')
1391 { 1391 {
1392 char *start = P++; 1392 const char *start = P++;
1393 1393
1394 while (isalnum (*P) || *P == '_' || *P == '-') 1394 while (isalnum (*P) || *P == '_' || *P == '-')
1395 P++; 1395 P++;
@@ -1402,7 +1402,7 @@ parse_component (p)
1402 1402
1403static Lisp_Object 1403static Lisp_Object
1404parse_resource_name (p) 1404parse_resource_name (p)
1405 char **p; 1405 const char **p;
1406{ 1406{
1407 Lisp_Object result = Qnil, component; 1407 Lisp_Object result = Qnil, component;
1408 char binding; 1408 char binding;
@@ -1436,7 +1436,7 @@ parse_resource_name (p)
1436 1436
1437static Lisp_Object 1437static Lisp_Object
1438parse_value (p) 1438parse_value (p)
1439 char **p; 1439 const char **p;
1440{ 1440{
1441 char *q, *buf; 1441 char *q, *buf;
1442 Lisp_Object seq = Qnil, result; 1442 Lisp_Object seq = Qnil, result;
@@ -1526,7 +1526,7 @@ parse_value (p)
1526 1526
1527static Lisp_Object 1527static Lisp_Object
1528parse_resource_line (p) 1528parse_resource_line (p)
1529 char **p; 1529 const char **p;
1530{ 1530{
1531 Lisp_Object quarks, value; 1531 Lisp_Object quarks, value;
1532 1532
@@ -1629,7 +1629,7 @@ xrm_q_put_resource (database, quarks, value)
1629void 1629void
1630xrm_merge_string_database (database, data) 1630xrm_merge_string_database (database, data)
1631 XrmDatabase database; 1631 XrmDatabase database;
1632 char *data; 1632 const char *data;
1633{ 1633{
1634 Lisp_Object quarks_value; 1634 Lisp_Object quarks_value;
1635 1635
@@ -1705,7 +1705,7 @@ xrm_q_get_resource (database, quark_name, quark_class)
1705Lisp_Object 1705Lisp_Object
1706xrm_get_resource (database, name, class) 1706xrm_get_resource (database, name, class)
1707 XrmDatabase database; 1707 XrmDatabase database;
1708 char *name, *class; 1708 const char *name, *class;
1709{ 1709{
1710 Lisp_Object key, query_cache, quark_name, quark_class, tmp; 1710 Lisp_Object key, query_cache, quark_name, quark_class, tmp;
1711 int i, nn, nc; 1711 int i, nn, nc;
@@ -1794,7 +1794,7 @@ xrm_cfproperty_list_to_value (plist)
1794 1794
1795XrmDatabase 1795XrmDatabase
1796xrm_get_preference_database (application) 1796xrm_get_preference_database (application)
1797 char *application; 1797 const char *application;
1798{ 1798{
1799#if TARGET_API_MAC_CARBON 1799#if TARGET_API_MAC_CARBON
1800 CFStringRef app_id, *keys, user_doms[2], host_doms[2]; 1800 CFStringRef app_id, *keys, user_doms[2], host_doms[2];
@@ -5129,7 +5129,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
5129 int minfd, fd; 5129 int minfd, fd;
5130 CFRunLoopRef runloop = 5130 CFRunLoopRef runloop =
5131 (CFRunLoopRef) GetCFRunLoopFromEventLoop (GetCurrentEventLoop ()); 5131 (CFRunLoopRef) GetCFRunLoopFromEventLoop (GetCurrentEventLoop ());
5132 static CFSocketContext context = {0, ofds, NULL, NULL, NULL}; 5132 static const CFSocketContext context = {0, ofds, NULL, NULL, NULL};
5133 static CFMutableDictionaryRef sources; 5133 static CFMutableDictionaryRef sources;
5134 5134
5135 if (sources == NULL) 5135 if (sources == NULL)
diff --git a/src/macfns.c b/src/macfns.c
index 036106c884b..ca55bced6c7 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -251,7 +251,7 @@ typedef struct colormap_t
251 char *name; 251 char *name;
252} colormap_t; 252} colormap_t;
253 253
254colormap_t mac_color_map[] = 254static const colormap_t mac_color_map[] =
255{ 255{
256 { RGB_TO_ULONG(255, 250, 250), "snow" }, 256 { RGB_TO_ULONG(255, 250, 250), "snow" },
257 { RGB_TO_ULONG(248, 248, 255), "ghost white" }, 257 { RGB_TO_ULONG(248, 248, 255), "ghost white" },
@@ -1009,7 +1009,7 @@ colormap_t mac_color_map[] =
1009 1009
1010Lisp_Object 1010Lisp_Object
1011mac_color_map_lookup (colorname) 1011mac_color_map_lookup (colorname)
1012 char *colorname; 1012 const char *colorname;
1013{ 1013{
1014 Lisp_Object ret = Qnil; 1014 Lisp_Object ret = Qnil;
1015 int i; 1015 int i;
diff --git a/src/macmenu.c b/src/macmenu.c
index 1a1525eafb7..d8303dbdc25 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1500,7 +1500,8 @@ install_menu_quit_handler (kind, menu_handle)
1500 MenuHandle menu_handle; 1500 MenuHandle menu_handle;
1501{ 1501{
1502#ifdef HAVE_CANCELMENUTRACKING 1502#ifdef HAVE_CANCELMENUTRACKING
1503 EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } }; 1503 static const EventTypeSpec typesList[] =
1504 {{kEventClassKeyboard, kEventRawKeyDown}};
1504 int id; 1505 int id;
1505 1506
1506 for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++) 1507 for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++)
@@ -2428,9 +2429,9 @@ mac_dialog_show (f, keymaps, title, header, error_name)
2428/* Is this item a separator? */ 2429/* Is this item a separator? */
2429static int 2430static int
2430name_is_separator (name) 2431name_is_separator (name)
2431 char *name; 2432 const char *name;
2432{ 2433{
2433 char *start = name; 2434 const char *start = name;
2434 2435
2435 /* Check if name string consists of only dashes ('-'). */ 2436 /* Check if name string consists of only dashes ('-'). */
2436 while (*name == '-') name++; 2437 while (*name == '-') name++;
@@ -2641,6 +2642,17 @@ dispose_menus (kind, id)
2641} 2642}
2642 2643
2643#endif /* HAVE_MENUS */ 2644#endif /* HAVE_MENUS */
2645
2646/* The following is used by delayed window autoselection. */
2647
2648DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
2649 doc: /* Return t if a menu or popup dialog is active. */)
2650 ()
2651{
2652 /* Always return Qnil since menu selection functions do not return
2653 until a selection has been made or cancelled. */
2654 return Qnil;
2655}
2644 2656
2645void 2657void
2646syms_of_macmenu () 2658syms_of_macmenu ()
@@ -2652,6 +2664,7 @@ syms_of_macmenu ()
2652 staticpro (&Qdebug_on_next_call); 2664 staticpro (&Qdebug_on_next_call);
2653 2665
2654 defsubr (&Sx_popup_menu); 2666 defsubr (&Sx_popup_menu);
2667 defsubr (&Smenu_or_popup_active_p);
2655#ifdef HAVE_MENUS 2668#ifdef HAVE_MENUS
2656 defsubr (&Sx_popup_dialog); 2669 defsubr (&Sx_popup_dialog);
2657#endif 2670#endif
diff --git a/src/macselect.c b/src/macselect.c
index fd72bd3cb14..7a952f88367 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -1616,10 +1616,11 @@ remove_drag_handler (window)
1616void 1616void
1617init_service_handler () 1617init_service_handler ()
1618{ 1618{
1619 EventTypeSpec specs[] = {{kEventClassService, kEventServiceGetTypes}, 1619 static const EventTypeSpec specs[] =
1620 {kEventClassService, kEventServiceCopy}, 1620 {{kEventClassService, kEventServiceGetTypes},
1621 {kEventClassService, kEventServicePaste}, 1621 {kEventClassService, kEventServiceCopy},
1622 {kEventClassService, kEventServicePerform}}; 1622 {kEventClassService, kEventServicePaste},
1623 {kEventClassService, kEventServicePerform}};
1623 InstallApplicationEventHandler (NewEventHandlerUPP (mac_handle_service_event), 1624 InstallApplicationEventHandler (NewEventHandlerUPP (mac_handle_service_event),
1624 GetEventTypeCount (specs), specs, NULL, NULL); 1625 GetEventTypeCount (specs), specs, NULL, NULL);
1625} 1626}
diff --git a/src/macterm.c b/src/macterm.c
index de9d86e7607..87419cac365 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -246,7 +246,8 @@ static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
246static void mac_focus_changed P_ ((int, struct mac_display_info *, 246static void mac_focus_changed P_ ((int, struct mac_display_info *,
247 struct frame *, struct input_event *)); 247 struct frame *, struct input_event *));
248static void x_detect_focus_change P_ ((struct mac_display_info *, 248static void x_detect_focus_change P_ ((struct mac_display_info *,
249 EventRecord *, struct input_event *)); 249 const EventRecord *,
250 struct input_event *));
250static void XTframe_rehighlight P_ ((struct frame *)); 251static void XTframe_rehighlight P_ ((struct frame *));
251static void x_frame_rehighlight P_ ((struct x_display_info *)); 252static void x_frame_rehighlight P_ ((struct x_display_info *));
252static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); 253static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
@@ -642,7 +643,7 @@ mac_create_bitmap_from_bitmap_data (bitmap, bits, w, h)
642 char *bits; 643 char *bits;
643 int w, h; 644 int w, h;
644{ 645{
645 static unsigned char swap_nibble[16] 646 static const unsigned char swap_nibble[16]
646 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ 647 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
647 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ 648 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
648 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ 649 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
@@ -828,9 +829,9 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
828 829
829 if (saved_text_layout == NULL) 830 if (saved_text_layout == NULL)
830 { 831 {
831 UniCharCount lengths[] = {kATSUToTextEnd}; 832 static const UniCharCount lengths[] = {kATSUToTextEnd};
832 ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag}; 833 static const ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag};
833 ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)}; 834 static const ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)};
834 static ATSLineLayoutOptions line_layout = 835 static ATSLineLayoutOptions line_layout =
835#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 836#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
836 kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics 837 kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics
@@ -839,7 +840,7 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
839 kATSLineIsDisplayOnly | kATSLineFractDisable 840 kATSLineIsDisplayOnly | kATSLineFractDisable
840#endif 841#endif
841 ; 842 ;
842 ATSUAttributeValuePtr values[] = {&line_layout}; 843 static const ATSUAttributeValuePtr values[] = {&line_layout};
843 844
844 err = ATSUCreateTextLayoutWithTextPtr (text, 845 err = ATSUCreateTextLayoutWithTextPtr (text,
845 kATSUFromTextBeginning, 846 kATSUFromTextBeginning,
@@ -962,11 +963,11 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width,
962 else 963 else
963 { 964 {
964 CGrafPtr port; 965 CGrafPtr port;
965 CGContextRef context; 966 static CGContextRef context;
966 float port_height = FRAME_PIXEL_HEIGHT (f); 967 float port_height = FRAME_PIXEL_HEIGHT (f);
967 ATSUAttributeTag tags[] = {kATSUCGContextTag}; 968 static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
968 ByteCount sizes[] = {sizeof (CGContextRef)}; 969 static const ByteCount sizes[] = {sizeof (CGContextRef)};
969 ATSUAttributeValuePtr values[] = {&context}; 970 static const ATSUAttributeValuePtr values[] = {&context};
970 971
971#if USE_CG_DRAWING 972#if USE_CG_DRAWING
972 context = mac_begin_cg_clip (f, gc); 973 context = mac_begin_cg_clip (f, gc);
@@ -2199,7 +2200,7 @@ pcm_init (pcm, count)
2199 2200
2200static enum pcm_status 2201static enum pcm_status
2201pcm_get_status (pcm) 2202pcm_get_status (pcm)
2202 XCharStruct *pcm; 2203 const XCharStruct *pcm;
2203{ 2204{
2204 int height = pcm->ascent + pcm->descent; 2205 int height = pcm->ascent + pcm->descent;
2205 2206
@@ -4221,7 +4222,7 @@ mac_focus_changed (type, dpyinfo, frame, bufp)
4221static void 4222static void
4222x_detect_focus_change (dpyinfo, event, bufp) 4223x_detect_focus_change (dpyinfo, event, bufp)
4223 struct mac_display_info *dpyinfo; 4224 struct mac_display_info *dpyinfo;
4224 EventRecord *event; 4225 const EventRecord *event;
4225 struct input_event *bufp; 4226 struct input_event *bufp;
4226{ 4227{
4227 struct frame *frame; 4228 struct frame *frame;
@@ -5234,7 +5235,7 @@ static void
5234x_scroll_bar_handle_click (bar, part_code, er, bufp) 5235x_scroll_bar_handle_click (bar, part_code, er, bufp)
5235 struct scroll_bar *bar; 5236 struct scroll_bar *bar;
5236 ControlPartCode part_code; 5237 ControlPartCode part_code;
5237 EventRecord *er; 5238 const EventRecord *er;
5238 struct input_event *bufp; 5239 struct input_event *bufp;
5239{ 5240{
5240 int win_y, top_range; 5241 int win_y, top_range;
@@ -6714,11 +6715,12 @@ xlfdpat_destroy (pat)
6714 6715
6715static struct xlfdpat * 6716static struct xlfdpat *
6716xlfdpat_create (pattern) 6717xlfdpat_create (pattern)
6717 char *pattern; 6718 const char *pattern;
6718{ 6719{
6719 struct xlfdpat *pat; 6720 struct xlfdpat *pat;
6720 int nblocks, i, skip; 6721 int nblocks, i, skip;
6721 unsigned char last_char, *p, *q, *anychar_head; 6722 unsigned char last_char, *p, *q, *anychar_head;
6723 const unsigned char *ptr;
6722 struct xlfdpat_block *blk; 6724 struct xlfdpat_block *blk;
6723 6725
6724 pat = xmalloc (sizeof (struct xlfdpat)); 6726 pat = xmalloc (sizeof (struct xlfdpat));
@@ -6729,9 +6731,9 @@ xlfdpat_create (pattern)
6729 anychar_head = NULL; 6731 anychar_head = NULL;
6730 q = pat->buf; 6732 q = pat->buf;
6731 last_char = '\0'; 6733 last_char = '\0';
6732 for (p = pattern; *p; p++) 6734 for (ptr = pattern; *ptr; ptr++)
6733 { 6735 {
6734 unsigned char c = *p; 6736 unsigned char c = *ptr;
6735 6737
6736 if (c == '*') 6738 if (c == '*')
6737 if (last_char == '*') 6739 if (last_char == '*')
@@ -6835,14 +6837,15 @@ xlfdpat_exact_p (pat)
6835 that the pattern in *BLK matches with its prefix. Return NULL 6837 that the pattern in *BLK matches with its prefix. Return NULL
6836 there is no such strings. STRING must be lowered in advance. */ 6838 there is no such strings. STRING must be lowered in advance. */
6837 6839
6838static char * 6840static const char *
6839xlfdpat_block_match_1 (blk, string, start_max) 6841xlfdpat_block_match_1 (blk, string, start_max)
6840 struct xlfdpat_block *blk; 6842 struct xlfdpat_block *blk;
6841 unsigned char *string; 6843 const unsigned char *string;
6842 int start_max; 6844 int start_max;
6843{ 6845{
6844 int start, infinity; 6846 int start, infinity;
6845 unsigned char *p, *s; 6847 unsigned char *p;
6848 const unsigned char *s;
6846 6849
6847 xassert (blk->len > 0); 6850 xassert (blk->len > 0);
6848 xassert (start_max + blk->len <= strlen (string)); 6851 xassert (start_max + blk->len <= strlen (string));
@@ -6899,17 +6902,17 @@ xlfdpat_block_match_1 (blk, string, start_max)
6899 ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \ 6902 ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \
6900 : xlfdpat_block_match_1 (b, s, m)) 6903 : xlfdpat_block_match_1 (b, s, m))
6901 6904
6902/* Check if XLFD pattern PAT, which is generated by `xfldpat_create', 6905/* Check if XLFD pattern PAT, which is generated by `xlfdpat_create',
6903 matches with STRING. STRING must be lowered in advance. */ 6906 matches with STRING. STRING must be lowered in advance. */
6904 6907
6905static int 6908static int
6906xlfdpat_match (pat, string) 6909xlfdpat_match (pat, string)
6907 struct xlfdpat *pat; 6910 struct xlfdpat *pat;
6908 unsigned char *string; 6911 const unsigned char *string;
6909{ 6912{
6910 int str_len, nblocks, i, start_max; 6913 int str_len, nblocks, i, start_max;
6911 struct xlfdpat_block *blk; 6914 struct xlfdpat_block *blk;
6912 unsigned char *s; 6915 const unsigned char *s;
6913 6916
6914 xassert (pat->nblocks > 0); 6917 xassert (pat->nblocks > 0);
6915 6918
@@ -7080,7 +7083,7 @@ decode_mac_font_name (name, size, coding_system)
7080 7083
7081static char * 7084static char *
7082mac_to_x_fontname (name, size, style, charset) 7085mac_to_x_fontname (name, size, style, charset)
7083 char *name; 7086 const char *name;
7084 int size; 7087 int size;
7085 Style style; 7088 Style style;
7086 char *charset; 7089 char *charset;
@@ -7127,7 +7130,8 @@ const int kDefaultFontSize = 12;
7127 7130
7128static int 7131static int
7129parse_x_font_name (xf, family, size, style, charset) 7132parse_x_font_name (xf, family, size, style, charset)
7130 char *xf, *family; 7133 const char *xf;
7134 char *family;
7131 int *size; 7135 int *size;
7132 Style *style; 7136 Style *style;
7133 char *charset; 7137 char *charset;
@@ -7210,10 +7214,10 @@ add_font_name_table_entry (char *font_name)
7210 7214
7211static void 7215static void
7212add_mac_font_name (name, size, style, charset) 7216add_mac_font_name (name, size, style, charset)
7213 char *name; 7217 const char *name;
7214 int size; 7218 int size;
7215 Style style; 7219 Style style;
7216 char *charset; 7220 const char *charset;
7217{ 7221{
7218 if (size > 0) 7222 if (size > 0)
7219 add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset)); 7223 add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset));
@@ -7515,7 +7519,7 @@ enum xlfd_scalable_field_index
7515 XLFD_SCL_LAST 7519 XLFD_SCL_LAST
7516 }; 7520 };
7517 7521
7518static int xlfd_scalable_fields[] = 7522static const int xlfd_scalable_fields[] =
7519 { 7523 {
7520 6, /* PIXEL_SIZE */ 7524 6, /* PIXEL_SIZE */
7521 7, /* POINT_SIZE */ 7525 7, /* POINT_SIZE */
@@ -7525,14 +7529,16 @@ static int xlfd_scalable_fields[] =
7525 7529
7526static Lisp_Object 7530static Lisp_Object
7527mac_do_list_fonts (pattern, maxnames) 7531mac_do_list_fonts (pattern, maxnames)
7528 char *pattern; 7532 const char *pattern;
7529 int maxnames; 7533 int maxnames;
7530{ 7534{
7531 int i, n_fonts = 0; 7535 int i, n_fonts = 0;
7532 Lisp_Object font_list = Qnil; 7536 Lisp_Object font_list = Qnil;
7533 struct xlfdpat *pat; 7537 struct xlfdpat *pat;
7534 char *scaled, *ptr; 7538 char *scaled;
7535 int scl_val[XLFD_SCL_LAST], *field, *val; 7539 const char *ptr;
7540 int scl_val[XLFD_SCL_LAST], *val;
7541 const int *field;
7536 int exact; 7542 int exact;
7537 7543
7538 if (font_name_table == NULL) /* Initialize when first used. */ 7544 if (font_name_table == NULL) /* Initialize when first used. */
@@ -7782,7 +7788,8 @@ x_compute_min_glyph_bounds (f)
7782 fields are present, none is '*'. */ 7788 fields are present, none is '*'. */
7783 7789
7784static int 7790static int
7785is_fully_specified_xlfd (char *p) 7791is_fully_specified_xlfd (p)
7792 const char *p;
7786{ 7793{
7787 int i; 7794 int i;
7788 char *q; 7795 char *q;
@@ -7859,18 +7866,21 @@ mac_load_query_font (f, fontname)
7859 if (strcmp (charset, "iso10646-1") == 0) /* XXX */ 7866 if (strcmp (charset, "iso10646-1") == 0) /* XXX */
7860 { 7867 {
7861 OSStatus err; 7868 OSStatus err;
7862 ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, 7869 static const ATSUAttributeTag tags[] =
7863 kATSUQDBoldfaceTag, kATSUQDItalicTag}; 7870 {kATSUFontTag, kATSUSizeTag,
7864 ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), 7871 kATSUQDBoldfaceTag, kATSUQDItalicTag};
7865 sizeof (Boolean), sizeof (Boolean)}; 7872 static const ByteCount sizes[] =
7873 {sizeof (ATSUFontID), sizeof (Fixed),
7874 sizeof (Boolean), sizeof (Boolean)};
7866 static Fixed size_fixed; 7875 static Fixed size_fixed;
7867 static Boolean bold_p, italic_p; 7876 static Boolean bold_p, italic_p;
7868 ATSUAttributeValuePtr values[] = {&font_id, &size_fixed, 7877 static const ATSUAttributeValuePtr values[] =
7869 &bold_p, &italic_p}; 7878 {&font_id, &size_fixed,
7870 ATSUFontFeatureType types[] = {kAllTypographicFeaturesType, 7879 &bold_p, &italic_p};
7871 kDiacriticsType}; 7880 static const ATSUFontFeatureType types[] =
7872 ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector, 7881 {kAllTypographicFeaturesType, kDiacriticsType};
7873 kDecomposeDiacriticsSelector}; 7882 static const ATSUFontFeatureSelector selectors[] =
7883 {kAllTypeFeaturesOffSelector, kDecomposeDiacriticsSelector};
7874 Lisp_Object font_id_cons; 7884 Lisp_Object font_id_cons;
7875 FMFontStyle style; 7885 FMFontStyle style;
7876 7886
@@ -8663,7 +8673,7 @@ extern void terminate_applescript();
8663 except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>) 8673 except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>)
8664 on the right of the Cmd key on laptops, and fn + `enter' (-> 8674 on the right of the Cmd key on laptops, and fn + `enter' (->
8665 <linefeed>). */ 8675 <linefeed>). */
8666static unsigned char keycode_to_xkeysym_table[] = { 8676static const unsigned char keycode_to_xkeysym_table[] = {
8667 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8677 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8668 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8678 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8669 /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8679 /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8700,7 +8710,7 @@ static unsigned char keycode_to_xkeysym_table[] = {
8700 keyboard, and they may not be the same on other types of keyboards. 8710 keyboard, and they may not be the same on other types of keyboards.
8701 If the destination is identical to the source (f1 ... f12), it 8711 If the destination is identical to the source (f1 ... f12), it
8702 doesn't map `fn' key to a modifier. */ 8712 doesn't map `fn' key to a modifier. */
8703static unsigned char fn_keycode_to_keycode_table[] = { 8713static const unsigned char fn_keycode_to_keycode_table[] = {
8704 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8714 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8705 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8715 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8706 /*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8716 /*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -9158,7 +9168,9 @@ do_apple_menu (SInt16 menu_item)
9158 Mesander and IM - Window Manager A. */ 9168 Mesander and IM - Window Manager A. */
9159 9169
9160static void 9170static void
9161do_grow_window (WindowPtr w, EventRecord *e) 9171do_grow_window (w, e)
9172 WindowPtr w;
9173 const EventRecord *e;
9162{ 9174{
9163 Rect limit_rect; 9175 Rect limit_rect;
9164 int rows, columns, width, height; 9176 int rows, columns, width, height;
@@ -9342,8 +9354,8 @@ mac_store_event_ref_as_apple_event (class, id, class_key, id_key,
9342 Lisp_Object class_key, id_key; 9354 Lisp_Object class_key, id_key;
9343 EventRef event; 9355 EventRef event;
9344 UInt32 num_params; 9356 UInt32 num_params;
9345 EventParamName *names; 9357 const EventParamName *names;
9346 EventParamType *types; 9358 const EventParamType *types;
9347{ 9359{
9348 OSStatus err = eventNotHandledErr; 9360 OSStatus err = eventNotHandledErr;
9349 Lisp_Object binding; 9361 Lisp_Object binding;
@@ -9404,10 +9416,10 @@ mac_handle_command_event (next_handler, event, data)
9404{ 9416{
9405 OSStatus result, err; 9417 OSStatus result, err;
9406 HICommand command; 9418 HICommand command;
9407 static EventParamName names[] = {kEventParamDirectObject, 9419 static const EventParamName names[] =
9408 kEventParamKeyModifiers}; 9420 {kEventParamDirectObject, kEventParamKeyModifiers};
9409 static EventParamType types[] = {typeHICommand, 9421 static const EventParamType types[] =
9410 typeUInt32}; 9422 {typeHICommand, typeUInt32};
9411 int num_params = sizeof (names) / sizeof (names[0]); 9423 int num_params = sizeof (names) / sizeof (names[0]);
9412 9424
9413 result = CallNextEventHandler (next_handler, event); 9425 result = CallNextEventHandler (next_handler, event);
@@ -9431,7 +9443,8 @@ mac_handle_command_event (next_handler, event, data)
9431static OSStatus 9443static OSStatus
9432init_command_handler () 9444init_command_handler ()
9433{ 9445{
9434 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; 9446 static const EventTypeSpec specs[] =
9447 {{kEventClassCommand, kEventCommandProcess}};
9435 static EventHandlerUPP handle_command_eventUPP = NULL; 9448 static EventHandlerUPP handle_command_eventUPP = NULL;
9436 9449
9437 if (handle_command_eventUPP == NULL) 9450 if (handle_command_eventUPP == NULL)
@@ -9591,18 +9604,18 @@ mac_handle_window_event (next_handler, event, data)
9591 case kEventWindowToolbarSwitchMode: 9604 case kEventWindowToolbarSwitchMode:
9592 result = CallNextEventHandler (next_handler, event); 9605 result = CallNextEventHandler (next_handler, event);
9593 { 9606 {
9594 static EventParamName names[] = {kEventParamDirectObject, 9607 static const EventParamName names[] = {kEventParamDirectObject,
9595 kEventParamWindowMouseLocation, 9608 kEventParamWindowMouseLocation,
9596 kEventParamKeyModifiers, 9609 kEventParamKeyModifiers,
9597 kEventParamMouseButton, 9610 kEventParamMouseButton,
9598 kEventParamClickCount, 9611 kEventParamClickCount,
9599 kEventParamMouseChord}; 9612 kEventParamMouseChord};
9600 static EventParamType types[] = {typeWindowRef, 9613 static const EventParamType types[] = {typeWindowRef,
9601 typeQDPoint, 9614 typeQDPoint,
9602 typeUInt32, 9615 typeUInt32,
9603 typeMouseButton, 9616 typeMouseButton,
9604 typeUInt32, 9617 typeUInt32,
9605 typeUInt32}; 9618 typeUInt32};
9606 int num_params = sizeof (names) / sizeof (names[0]); 9619 int num_params = sizeof (names) / sizeof (names[0]);
9607 9620
9608 err = mac_store_event_ref_as_apple_event (0, 0, 9621 err = mac_store_event_ref_as_apple_event (0, 0,
@@ -9709,18 +9722,18 @@ mac_handle_font_event (next_handler, event, data)
9709 OSStatus result, err; 9722 OSStatus result, err;
9710 Lisp_Object id_key; 9723 Lisp_Object id_key;
9711 int num_params; 9724 int num_params;
9712 EventParamName *names; 9725 const EventParamName *names;
9713 EventParamType *types; 9726 const EventParamType *types;
9714 static EventParamName names_sel[] = {kEventParamATSUFontID, 9727 static const EventParamName names_sel[] = {kEventParamATSUFontID,
9715 kEventParamATSUFontSize, 9728 kEventParamATSUFontSize,
9716 kEventParamFMFontFamily, 9729 kEventParamFMFontFamily,
9717 kEventParamFMFontSize, 9730 kEventParamFMFontSize,
9718 kEventParamFontColor}; 9731 kEventParamFontColor};
9719 static EventParamType types_sel[] = {typeATSUFontID, 9732 static const EventParamType types_sel[] = {typeATSUFontID,
9720 typeATSUSize, 9733 typeATSUSize,
9721 typeFMFontFamily, 9734 typeFMFontFamily,
9722 typeFMFontSize, 9735 typeFMFontSize,
9723 typeFontColor}; 9736 typeFontColor};
9724 9737
9725 result = CallNextEventHandler (next_handler, event); 9738 result = CallNextEventHandler (next_handler, event);
9726 if (result != eventNotHandledErr) 9739 if (result != eventNotHandledErr)
@@ -9761,10 +9774,10 @@ mac_handle_text_input_event (next_handler, event, data)
9761 OSStatus result, err = noErr; 9774 OSStatus result, err = noErr;
9762 Lisp_Object id_key = Qnil; 9775 Lisp_Object id_key = Qnil;
9763 int num_params; 9776 int num_params;
9764 EventParamName *names; 9777 const EventParamName *names;
9765 EventParamType *types; 9778 const EventParamType *types;
9766 static UInt32 seqno_uaia = 0; 9779 static UInt32 seqno_uaia = 0;
9767 static EventParamName names_uaia[] = 9780 static const EventParamName names_uaia[] =
9768 {kEventParamTextInputSendComponentInstance, 9781 {kEventParamTextInputSendComponentInstance,
9769 kEventParamTextInputSendRefCon, 9782 kEventParamTextInputSendRefCon,
9770 kEventParamTextInputSendSLRec, 9783 kEventParamTextInputSendSLRec,
@@ -9777,7 +9790,7 @@ mac_handle_text_input_event (next_handler, event, data)
9777 kEventParamTextInputSendTextServiceEncoding, 9790 kEventParamTextInputSendTextServiceEncoding,
9778 kEventParamTextInputSendTextServiceMacEncoding, 9791 kEventParamTextInputSendTextServiceMacEncoding,
9779 EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER}; 9792 EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER};
9780 static EventParamType types_uaia[] = 9793 static const EventParamType types_uaia[] =
9781 {typeComponentInstance, 9794 {typeComponentInstance,
9782 typeLongInteger, 9795 typeLongInteger,
9783 typeIntlWritingCode, 9796 typeIntlWritingCode,
@@ -9794,12 +9807,12 @@ mac_handle_text_input_event (next_handler, event, data)
9794 typeUInt32, 9807 typeUInt32,
9795 typeUInt32, 9808 typeUInt32,
9796 typeUInt32}; 9809 typeUInt32};
9797 static EventParamName names_ufke[] = 9810 static const EventParamName names_ufke[] =
9798 {kEventParamTextInputSendComponentInstance, 9811 {kEventParamTextInputSendComponentInstance,
9799 kEventParamTextInputSendRefCon, 9812 kEventParamTextInputSendRefCon,
9800 kEventParamTextInputSendSLRec, 9813 kEventParamTextInputSendSLRec,
9801 kEventParamTextInputSendText}; 9814 kEventParamTextInputSendText};
9802 static EventParamType types_ufke[] = 9815 static const EventParamType types_ufke[] =
9803 {typeComponentInstance, 9816 {typeComponentInstance,
9804 typeLongInteger, 9817 typeLongInteger,
9805 typeIntlWritingCode, 9818 typeIntlWritingCode,
@@ -9952,12 +9965,12 @@ mac_store_service_event (event)
9952 OSStatus err; 9965 OSStatus err;
9953 Lisp_Object id_key; 9966 Lisp_Object id_key;
9954 int num_params; 9967 int num_params;
9955 EventParamName *names; 9968 const EventParamName *names;
9956 EventParamType *types; 9969 const EventParamType *types;
9957 static EventParamName names_pfm[] = {kEventParamServiceMessageName, 9970 static const EventParamName names_pfm[] =
9958 kEventParamServiceUserData}; 9971 {kEventParamServiceMessageName, kEventParamServiceUserData};
9959 static EventParamType types_pfm[] = {typeCFStringRef, 9972 static const EventParamType types_pfm[] =
9960 typeCFStringRef}; 9973 {typeCFStringRef, typeCFStringRef};
9961 9974
9962 switch (GetEventKind (event)) 9975 switch (GetEventKind (event))
9963 { 9976 {
@@ -9995,7 +10008,7 @@ install_window_handler (window)
9995{ 10008{
9996 OSStatus err = noErr; 10009 OSStatus err = noErr;
9997#if USE_CARBON_EVENTS 10010#if USE_CARBON_EVENTS
9998 EventTypeSpec specs_window[] = 10011 static const EventTypeSpec specs_window[] =
9999 {{kEventClassWindow, kEventWindowUpdate}, 10012 {{kEventClassWindow, kEventWindowUpdate},
10000 {kEventClassWindow, kEventWindowGetIdealSize}, 10013 {kEventClassWindow, kEventWindowGetIdealSize},
10001 {kEventClassWindow, kEventWindowBoundsChanging}, 10014 {kEventClassWindow, kEventWindowBoundsChanging},
@@ -10013,16 +10026,18 @@ install_window_handler (window)
10013 {kEventClassWindow, kEventWindowFocusRelinquish}, 10026 {kEventClassWindow, kEventWindowFocusRelinquish},
10014#endif 10027#endif
10015 }; 10028 };
10016 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; 10029 static const EventTypeSpec specs_mouse[] =
10030 {{kEventClassMouse, kEventMouseWheelMoved}};
10017 static EventHandlerUPP handle_window_eventUPP = NULL; 10031 static EventHandlerUPP handle_window_eventUPP = NULL;
10018 static EventHandlerUPP handle_mouse_eventUPP = NULL; 10032 static EventHandlerUPP handle_mouse_eventUPP = NULL;
10019#if USE_MAC_FONT_PANEL 10033#if USE_MAC_FONT_PANEL
10020 EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed}, 10034 static const EventTypeSpec specs_font[] =
10021 {kEventClassFont, kEventFontSelection}}; 10035 {{kEventClassFont, kEventFontPanelClosed},
10036 {kEventClassFont, kEventFontSelection}};
10022 static EventHandlerUPP handle_font_eventUPP = NULL; 10037 static EventHandlerUPP handle_font_eventUPP = NULL;
10023#endif 10038#endif
10024#if USE_MAC_TSM 10039#if USE_MAC_TSM
10025 EventTypeSpec specs_text_input[] = 10040 static const EventTypeSpec specs_text_input[] =
10026 {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea}, 10041 {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
10027 {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent}, 10042 {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
10028 {kEventClassTextInput, kEventTextInputOffsetToPos}}; 10043 {kEventClassTextInput, kEventTextInputOffsetToPos}};
@@ -11215,7 +11230,7 @@ mac_initialize_display_info ()
11215 11230
11216static XrmDatabase 11231static XrmDatabase
11217mac_make_rdb (xrm_option) 11232mac_make_rdb (xrm_option)
11218 char *xrm_option; 11233 const char *xrm_option;
11219{ 11234{
11220 XrmDatabase database; 11235 XrmDatabase database;
11221 11236
diff --git a/src/macterm.h b/src/macterm.h
index edd89163e13..cac90f1fa80 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -669,11 +669,11 @@ extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
669extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object)); 669extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object));
670#if TARGET_API_MAC_CARBON 670#if TARGET_API_MAC_CARBON
671extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32, 671extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32,
672 EventParamName *, 672 const EventParamName *,
673 EventParamType *, 673 const EventParamType *,
674 AppleEvent *)); 674 AppleEvent *));
675extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32, 675extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
676 FlavorType *, 676 const FlavorType *,
677 AppleEvent *)); 677 AppleEvent *));
678extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 678extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
679extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 679extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
@@ -686,9 +686,10 @@ extern Lisp_Object cfboolean_to_lisp P_ ((CFBooleanRef));
686extern Lisp_Object cfobject_desc_to_lisp P_ ((CFTypeRef)); 686extern Lisp_Object cfobject_desc_to_lisp P_ ((CFTypeRef));
687extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int)); 687extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
688#endif 688#endif
689extern void xrm_merge_string_database P_ ((XrmDatabase, char *)); 689extern void xrm_merge_string_database P_ ((XrmDatabase, const char *));
690extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *)); 690extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, const char *,
691extern XrmDatabase xrm_get_preference_database P_ ((char *)); 691 const char *));
692extern XrmDatabase xrm_get_preference_database P_ ((const char *));
692EXFUN (Fmac_get_preference, 4); 693EXFUN (Fmac_get_preference, 4);
693 694
694/* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79 695/* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
diff --git a/src/s/netbsd.h b/src/s/netbsd.h
index 206ff55c854..c4bfddfbe5b 100644
--- a/src/s/netbsd.h
+++ b/src/s/netbsd.h
@@ -138,5 +138,10 @@
138 138
139#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS 139#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
140 140
141/* Use sigprocmask and friends instead of sigblock;
142 sigblock is considered obsolete on NetBSD. */
143
144#define POSIX_SIGNALS 1
145
141/* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81 146/* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81
142 (do not change this comment) */ 147 (do not change this comment) */
diff --git a/src/s/openbsd.h b/src/s/openbsd.h
index 39e48da39a7..baba95a2b4b 100644
--- a/src/s/openbsd.h
+++ b/src/s/openbsd.h
@@ -23,11 +23,11 @@
23 23
24/* Han Boetes <han@mijncomputer.nl> says this 24/* Han Boetes <han@mijncomputer.nl> says this
25 is necessary, otherwise Emacs dumps core on elf systems. */ 25 is necessary, otherwise Emacs dumps core on elf systems. */
26#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Z 26#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Z -L/usr/pkg/lib -L/usr/local/lib
27 27
28#else 28#else
29 29
30#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp 30#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -L/usr/pkg/lib -L/usr/local/lib
31 31
32#endif 32#endif
33 33
diff --git a/src/unexcw.c b/src/unexcw.c
index aee4f58896c..92e313c05d6 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -262,7 +262,7 @@ unexec (char *outfile, char *infile, unsigned start_data, unsigned d1,
262 if (bss_sbrk_did_unexec) 262 if (bss_sbrk_did_unexec)
263 { 263 {
264 /* can only dump once */ 264 /* can only dump once */
265 printf ("You can only dump emacs once on this platform.\n"); 265 printf ("You can only dump Emacs once on this platform.\n");
266 return (1); 266 return (1);
267 } 267 }
268 268
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index f65fd9cbc22..e95aa2f2efc 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -69,10 +69,10 @@ Boston, MA 02110-1301, USA. */
69 fact, the earliest one starts a few hundred bytes beyond the end of 69 fact, the earliest one starts a few hundred bytes beyond the end of
70 the last load command. The linker option -headerpad controls the 70 the last load command. The linker option -headerpad controls the
71 minimum size of this padding. Its setting can be changed in 71 minimum size of this padding. Its setting can be changed in
72 s/darwin.h. A value of 0x300, e.g., leaves room for about 15 72 s/darwin.h. A value of 0x690, e.g., leaves room for 30 additional
73 additional load commands for the newly created __DATA segments (at 73 load commands for the newly created __DATA segments (at 56 bytes
74 56 bytes each). Unexec fails if there is not enough room for these 74 each). Unexec fails if there is not enough room for these new
75 new segments. 75 segments.
76 76
77 The __TEXT segment contains the sections __text, __cstring, 77 The __TEXT segment contains the sections __text, __cstring,
78 __picsymbol_stub, and __const and the __DATA segment contains the 78 __picsymbol_stub, and __const and the __DATA segment contains the
@@ -112,6 +112,20 @@ Boston, MA 02110-1301, USA. */
112 112
113#include <assert.h> 113#include <assert.h>
114 114
115#ifdef _LP64
116#define mach_header mach_header_64
117#define segment_command segment_command_64
118#undef VM_REGION_BASIC_INFO_COUNT
119#define VM_REGION_BASIC_INFO_COUNT VM_REGION_BASIC_INFO_COUNT_64
120#undef VM_REGION_BASIC_INFO
121#define VM_REGION_BASIC_INFO VM_REGION_BASIC_INFO_64
122#undef LC_SEGMENT
123#define LC_SEGMENT LC_SEGMENT_64
124#define vm_region vm_region_64
125#define section section_64
126#undef MH_MAGIC
127#define MH_MAGIC MH_MAGIC_64
128#endif
115 129
116#define VERBOSE 1 130#define VERBOSE 1
117 131
@@ -123,9 +137,6 @@ Boston, MA 02110-1301, USA. */
123 mapped to dynamically loaded libraries and will not be dumped. */ 137 mapped to dynamically loaded libraries and will not be dumped. */
124#define VM_DATA_TOP (20 * 1024 * 1024) 138#define VM_DATA_TOP (20 * 1024 * 1024)
125 139
126/* Used by malloc_freezedry and malloc_jumpstart. */
127int malloc_cookie;
128
129/* Type of an element on the list of regions to be dumped. */ 140/* Type of an element on the list of regions to be dumped. */
130struct region_t { 141struct region_t {
131 vm_address_t address; 142 vm_address_t address;
@@ -137,47 +148,49 @@ struct region_t {
137}; 148};
138 149
139/* Head and tail of the list of regions to be dumped. */ 150/* Head and tail of the list of regions to be dumped. */
140struct region_t *region_list_head = 0; 151static struct region_t *region_list_head = 0;
141struct region_t *region_list_tail = 0; 152static struct region_t *region_list_tail = 0;
142 153
143/* Pointer to array of load commands. */ 154/* Pointer to array of load commands. */
144struct load_command **lca; 155static struct load_command **lca;
145 156
146/* Number of load commands. */ 157/* Number of load commands. */
147int nlc; 158static int nlc;
148 159
149/* The highest VM address of segments loaded by the input file. 160/* The highest VM address of segments loaded by the input file.
150 Regions with addresses beyond this are assumed to be allocated 161 Regions with addresses beyond this are assumed to be allocated
151 dynamically and thus require dumping. */ 162 dynamically and thus require dumping. */
152vm_address_t infile_lc_highest_addr = 0; 163static vm_address_t infile_lc_highest_addr = 0;
153 164
154/* The lowest file offset used by the all sections in the __TEXT 165/* The lowest file offset used by the all sections in the __TEXT
155 segments. This leaves room at the beginning of the file to store 166 segments. This leaves room at the beginning of the file to store
156 the Mach-O header. Check this value against header size to ensure 167 the Mach-O header. Check this value against header size to ensure
157 the added load commands for the new __DATA segments did not 168 the added load commands for the new __DATA segments did not
158 overwrite any of the sections in the __TEXT segment. */ 169 overwrite any of the sections in the __TEXT segment. */
159unsigned long text_seg_lowest_offset = 0x10000000; 170static unsigned long text_seg_lowest_offset = 0x10000000;
160 171
161/* Mach header. */ 172/* Mach header. */
162struct mach_header mh; 173static struct mach_header mh;
163 174
164/* Offset at which the next load command should be written. */ 175/* Offset at which the next load command should be written. */
165unsigned long curr_header_offset = sizeof (struct mach_header); 176static unsigned long curr_header_offset = sizeof (struct mach_header);
166 177
167/* Current adjustment that needs to be made to offset values because 178/* Offset at which the next segment should be written. */
168 of additional data segments. */ 179static unsigned long curr_file_offset = 0;
169unsigned long delta = 0;
170 180
171int infd, outfd; 181static unsigned long pagesize;
182#define ROUNDUP_TO_PAGE_BOUNDARY(x) (((x) + pagesize - 1) & ~(pagesize - 1))
172 183
173int in_dumped_exec = 0; 184static int infd, outfd;
174 185
175malloc_zone_t *emacs_zone; 186static int in_dumped_exec = 0;
187
188static malloc_zone_t *emacs_zone;
176 189
177/* file offset of input file's data segment */ 190/* file offset of input file's data segment */
178off_t data_segment_old_fileoff; 191static off_t data_segment_old_fileoff = 0;
179 192
180struct segment_command *data_segment_scp; 193static struct segment_command *data_segment_scp;
181 194
182/* Read N bytes from infd into memory starting at address DEST. 195/* Read N bytes from infd into memory starting at address DEST.
183 Return true if successful, false otherwise. */ 196 Return true if successful, false otherwise. */
@@ -286,7 +299,7 @@ static void
286print_region (vm_address_t address, vm_size_t size, vm_prot_t prot, 299print_region (vm_address_t address, vm_size_t size, vm_prot_t prot,
287 vm_prot_t max_prot) 300 vm_prot_t max_prot)
288{ 301{
289 printf ("%#10x %#8x ", address, size); 302 printf ("%#10lx %#8lx ", (long) address, (long) size);
290 print_prot (prot); 303 print_prot (prot);
291 putchar (' '); 304 putchar (' ');
292 print_prot (max_prot); 305 print_prot (max_prot);
@@ -304,7 +317,7 @@ print_region_list ()
304 print_region (r->address, r->size, r->protection, r->max_protection); 317 print_region (r->address, r->size, r->protection, r->max_protection);
305} 318}
306 319
307void 320static void
308print_regions () 321print_regions ()
309{ 322{
310 task_t target_task = mach_task_self (); 323 task_t target_task = mach_task_self ();
@@ -412,23 +425,40 @@ build_region_list ()
412} 425}
413 426
414 427
415#define MAX_UNEXEC_REGIONS 200 428#define MAX_UNEXEC_REGIONS 400
416 429
417int num_unexec_regions; 430static int num_unexec_regions;
418vm_range_t unexec_regions[MAX_UNEXEC_REGIONS]; 431typedef struct {
432 vm_range_t range;
433 vm_size_t filesize;
434} unexec_region_info;
435static unexec_region_info unexec_regions[MAX_UNEXEC_REGIONS];
419 436
420static void 437static void
421unexec_regions_recorder (task_t task, void *rr, unsigned type, 438unexec_regions_recorder (task_t task, void *rr, unsigned type,
422 vm_range_t *ranges, unsigned num) 439 vm_range_t *ranges, unsigned num)
423{ 440{
441 vm_address_t p;
442 vm_size_t filesize;
443
424 while (num && num_unexec_regions < MAX_UNEXEC_REGIONS) 444 while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
425 { 445 {
426 unexec_regions[num_unexec_regions++] = *ranges; 446 /* Subtract the size of trailing null pages from filesize. It
427 printf ("%#8x (sz: %#8x)\n", ranges->address, ranges->size); 447 can be smaller than vmsize in segment commands. In such a
448 case, trailing pages are initialized with zeros. */
449 for (p = ranges->address + ranges->size; p > ranges->address;
450 p -= sizeof (int))
451 if (*(((int *) p)-1))
452 break;
453 filesize = ROUNDUP_TO_PAGE_BOUNDARY (p - ranges->address);
454 assert (filesize <= ranges->size);
455
456 unexec_regions[num_unexec_regions].filesize = filesize;
457 unexec_regions[num_unexec_regions++].range = *ranges;
458 printf ("%#10lx (sz: %#8lx/%#8lx)\n", (long) (ranges->address),
459 (long) filesize, (long) (ranges->size));
428 ranges++; num--; 460 ranges++; num--;
429 } 461 }
430 if (num_unexec_regions == MAX_UNEXEC_REGIONS)
431 fprintf (stderr, "malloc_freezedry_recorder: too many regions\n");
432} 462}
433 463
434static kern_return_t 464static kern_return_t
@@ -438,7 +468,7 @@ unexec_reader (task_t task, vm_address_t address, vm_size_t size, void **ptr)
438 return KERN_SUCCESS; 468 return KERN_SUCCESS;
439} 469}
440 470
441void 471static void
442find_emacs_zone_regions () 472find_emacs_zone_regions ()
443{ 473{
444 num_unexec_regions = 0; 474 num_unexec_regions = 0;
@@ -449,13 +479,16 @@ find_emacs_zone_regions ()
449 (vm_address_t) emacs_zone, 479 (vm_address_t) emacs_zone,
450 unexec_reader, 480 unexec_reader,
451 unexec_regions_recorder); 481 unexec_regions_recorder);
482
483 if (num_unexec_regions == MAX_UNEXEC_REGIONS)
484 unexec_error ("find_emacs_zone_regions: too many regions");
452} 485}
453 486
454static int 487static int
455unexec_regions_sort_compare (const void *a, const void *b) 488unexec_regions_sort_compare (const void *a, const void *b)
456{ 489{
457 vm_address_t aa = ((vm_range_t *) a)->address; 490 vm_address_t aa = ((unexec_region_info *) a)->range.address;
458 vm_address_t bb = ((vm_range_t *) b)->address; 491 vm_address_t bb = ((unexec_region_info *) b)->range.address;
459 492
460 if (aa < bb) 493 if (aa < bb)
461 return -1; 494 return -1;
@@ -469,7 +502,7 @@ static void
469unexec_regions_merge () 502unexec_regions_merge ()
470{ 503{
471 int i, n; 504 int i, n;
472 vm_range_t r; 505 unexec_region_info r;
473 506
474 qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]), 507 qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]),
475 &unexec_regions_sort_compare); 508 &unexec_regions_sort_compare);
@@ -477,9 +510,11 @@ unexec_regions_merge ()
477 r = unexec_regions[0]; 510 r = unexec_regions[0];
478 for (i = 1; i < num_unexec_regions; i++) 511 for (i = 1; i < num_unexec_regions; i++)
479 { 512 {
480 if (r.address + r.size == unexec_regions[i].address) 513 if (r.range.address + r.range.size == unexec_regions[i].range.address
514 && r.range.size - r.filesize < 2 * pagesize)
481 { 515 {
482 r.size += unexec_regions[i].size; 516 r.filesize = r.range.size + unexec_regions[i].filesize;
517 r.range.size += unexec_regions[i].range.size;
483 } 518 }
484 else 519 else
485 { 520 {
@@ -500,7 +535,11 @@ print_load_command_name (int lc)
500 switch (lc) 535 switch (lc)
501 { 536 {
502 case LC_SEGMENT: 537 case LC_SEGMENT:
538#ifndef _LP64
503 printf ("LC_SEGMENT "); 539 printf ("LC_SEGMENT ");
540#else
541 printf ("LC_SEGMENT_64 ");
542#endif
504 break; 543 break;
505 case LC_LOAD_DYLINKER: 544 case LC_LOAD_DYLINKER:
506 printf ("LC_LOAD_DYLINKER "); 545 printf ("LC_LOAD_DYLINKER ");
@@ -541,14 +580,14 @@ print_load_command (struct load_command *lc)
541 int j; 580 int j;
542 581
543 scp = (struct segment_command *) lc; 582 scp = (struct segment_command *) lc;
544 printf (" %-16.16s %#10x %#8x\n", 583 printf (" %-16.16s %#10lx %#8lx\n",
545 scp->segname, scp->vmaddr, scp->vmsize); 584 scp->segname, (long) (scp->vmaddr), (long) (scp->vmsize));
546 585
547 sectp = (struct section *) (scp + 1); 586 sectp = (struct section *) (scp + 1);
548 for (j = 0; j < scp->nsects; j++) 587 for (j = 0; j < scp->nsects; j++)
549 { 588 {
550 printf (" %-16.16s %#10x %#8x\n", 589 printf (" %-16.16s %#10lx %#8lx\n",
551 sectp->sectname, sectp->addr, sectp->size); 590 sectp->sectname, (long) (sectp->addr), (long) (sectp->size));
552 sectp++; 591 sectp++;
553 } 592 }
554 } 593 }
@@ -620,7 +659,7 @@ read_load_commands ()
620 printf ("Highest address of load commands in input file: %#8x\n", 659 printf ("Highest address of load commands in input file: %#8x\n",
621 infile_lc_highest_addr); 660 infile_lc_highest_addr);
622 661
623 printf ("Lowest offset of all sections in __TEXT segment: %#8x\n", 662 printf ("Lowest offset of all sections in __TEXT segment: %#8lx\n",
624 text_seg_lowest_offset); 663 text_seg_lowest_offset);
625 664
626 printf ("--- List of Load Commands in Input File ---\n"); 665 printf ("--- List of Load Commands in Input File ---\n");
@@ -644,21 +683,23 @@ copy_segment (struct load_command *lc)
644 struct section *sectp; 683 struct section *sectp;
645 int j; 684 int j;
646 685
647 scp->fileoff += delta; 686 scp->fileoff = curr_file_offset;
648 687
649 sectp = (struct section *) (scp + 1); 688 sectp = (struct section *) (scp + 1);
650 for (j = 0; j < scp->nsects; j++) 689 for (j = 0; j < scp->nsects; j++)
651 { 690 {
652 sectp->offset += delta; 691 sectp->offset += curr_file_offset - old_fileoff;
653 sectp++; 692 sectp++;
654 } 693 }
655 694
656 printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n", 695 printf ("Writing segment %-16.16s @ %#8lx (%#8lx/%#8lx @ %#10lx)\n",
657 scp->segname, scp->fileoff, scp->fileoff + scp->filesize, 696 scp->segname, (long) (scp->fileoff), (long) (scp->filesize),
658 scp->filesize); 697 (long) (scp->vmsize), (long) (scp->vmaddr));
659 698
660 if (!unexec_copy (scp->fileoff, old_fileoff, scp->filesize)) 699 if (!unexec_copy (scp->fileoff, old_fileoff, scp->filesize))
661 unexec_error ("cannot copy segment from input to output file"); 700 unexec_error ("cannot copy segment from input to output file");
701 curr_file_offset += ROUNDUP_TO_PAGE_BOUNDARY (scp->filesize);
702
662 if (!unexec_write (curr_header_offset, lc, lc->cmdsize)) 703 if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
663 unexec_error ("cannot write load command to header"); 704 unexec_error ("cannot write load command to header");
664 705
@@ -683,14 +724,18 @@ copy_data_segment (struct load_command *lc)
683 struct segment_command *scp = (struct segment_command *) lc; 724 struct segment_command *scp = (struct segment_command *) lc;
684 struct section *sectp; 725 struct section *sectp;
685 int j; 726 int j;
686 unsigned long header_offset, file_offset, old_file_offset; 727 unsigned long header_offset, old_file_offset;
687 728
688 printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n", 729 /* The new filesize of the segment is set to its vmsize because data
689 scp->segname, scp->fileoff, scp->fileoff + scp->filesize, 730 blocks for segments must start at region boundaries. Note that
690 scp->filesize); 731 this may leave unused locations at the end of the segment data
732 block because the total of the sizes of all sections in the
733 segment is generally smaller than vmsize. */
734 scp->filesize = scp->vmsize;
691 735
692 if (delta != 0) 736 printf ("Writing segment %-16.16s @ %#8lx (%#8lx/%#8lx @ %#10lx)\n",
693 unexec_error ("cannot handle multiple DATA segments in input file"); 737 scp->segname, curr_file_offset, (long)(scp->filesize),
738 (long)(scp->vmsize), (long) (scp->vmaddr));
694 739
695 /* Offsets in the output file for writing the next section structure 740 /* Offsets in the output file for writing the next section structure
696 and segment data block, respectively. */ 741 and segment data block, respectively. */
@@ -700,7 +745,7 @@ copy_data_segment (struct load_command *lc)
700 for (j = 0; j < scp->nsects; j++) 745 for (j = 0; j < scp->nsects; j++)
701 { 746 {
702 old_file_offset = sectp->offset; 747 old_file_offset = sectp->offset;
703 sectp->offset = sectp->addr - scp->vmaddr + scp->fileoff; 748 sectp->offset = sectp->addr - scp->vmaddr + curr_file_offset;
704 /* The __data section is dumped from memory. The __bss and 749 /* The __data section is dumped from memory. The __bss and
705 __common sections are also dumped from memory but their flag 750 __common sections are also dumped from memory but their flag
706 fields require changing (from S_ZEROFILL to S_REGULAR). The 751 fields require changing (from S_ZEROFILL to S_REGULAR). The
@@ -762,21 +807,16 @@ copy_data_segment (struct load_command *lc)
762 else 807 else
763 unexec_error ("unrecognized section name in __DATA segment"); 808 unexec_error ("unrecognized section name in __DATA segment");
764 809
765 printf (" section %-16.16s at %#8x - %#8x (sz: %#8x)\n", 810 printf (" section %-16.16s at %#8lx - %#8lx (sz: %#8lx)\n",
766 sectp->sectname, sectp->offset, sectp->offset + sectp->size, 811 sectp->sectname, (long) (sectp->offset),
767 sectp->size); 812 (long) (sectp->offset + sectp->size), (long) (sectp->size));
768 813
769 header_offset += sizeof (struct section); 814 header_offset += sizeof (struct section);
770 sectp++; 815 sectp++;
771 } 816 }
772 817
773 /* The new filesize of the segment is set to its vmsize because data 818 curr_file_offset += ROUNDUP_TO_PAGE_BOUNDARY (scp->filesize);
774 blocks for segments must start at region boundaries. Note that 819
775 this may leave unused locations at the end of the segment data
776 block because the total of the sizes of all sections in the
777 segment is generally smaller than vmsize. */
778 delta = scp->vmsize - scp->filesize;
779 scp->filesize = scp->vmsize;
780 if (!unexec_write (curr_header_offset, scp, sizeof (struct segment_command))) 820 if (!unexec_write (curr_header_offset, scp, sizeof (struct segment_command)))
781 unexec_error ("cannot write header of __DATA segment"); 821 unexec_error ("cannot write header of __DATA segment");
782 curr_header_offset += lc->cmdsize; 822 curr_header_offset += lc->cmdsize;
@@ -784,8 +824,7 @@ copy_data_segment (struct load_command *lc)
784 /* Create new __DATA segment load commands for regions on the region 824 /* Create new __DATA segment load commands for regions on the region
785 list that do not corresponding to any segment load commands in 825 list that do not corresponding to any segment load commands in
786 the input file. 826 the input file.
787 */ 827 */
788 file_offset = scp->fileoff + scp->filesize;
789 for (j = 0; j < num_unexec_regions; j++) 828 for (j = 0; j < num_unexec_regions; j++)
790 { 829 {
791 struct segment_command sc; 830 struct segment_command sc;
@@ -793,23 +832,22 @@ copy_data_segment (struct load_command *lc)
793 sc.cmd = LC_SEGMENT; 832 sc.cmd = LC_SEGMENT;
794 sc.cmdsize = sizeof (struct segment_command); 833 sc.cmdsize = sizeof (struct segment_command);
795 strncpy (sc.segname, SEG_DATA, 16); 834 strncpy (sc.segname, SEG_DATA, 16);
796 sc.vmaddr = unexec_regions[j].address; 835 sc.vmaddr = unexec_regions[j].range.address;
797 sc.vmsize = unexec_regions[j].size; 836 sc.vmsize = unexec_regions[j].range.size;
798 sc.fileoff = file_offset; 837 sc.fileoff = curr_file_offset;
799 sc.filesize = unexec_regions[j].size; 838 sc.filesize = unexec_regions[j].filesize;
800 sc.maxprot = VM_PROT_READ | VM_PROT_WRITE; 839 sc.maxprot = VM_PROT_READ | VM_PROT_WRITE;
801 sc.initprot = VM_PROT_READ | VM_PROT_WRITE; 840 sc.initprot = VM_PROT_READ | VM_PROT_WRITE;
802 sc.nsects = 0; 841 sc.nsects = 0;
803 sc.flags = 0; 842 sc.flags = 0;
804 843
805 printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n", 844 printf ("Writing segment %-16.16s @ %#8lx (%#8lx/%#8lx @ %#10lx)\n",
806 sc.segname, sc.fileoff, sc.fileoff + sc.filesize, 845 sc.segname, (long) (sc.fileoff), (long) (sc.filesize),
807 sc.filesize); 846 (long) (sc.vmsize), (long) (sc.vmaddr));
808 847
809 if (!unexec_write (sc.fileoff, (void *) sc.vmaddr, sc.vmsize)) 848 if (!unexec_write (sc.fileoff, (void *) sc.vmaddr, sc.filesize))
810 unexec_error ("cannot write new __DATA segment"); 849 unexec_error ("cannot write new __DATA segment");
811 delta += sc.filesize; 850 curr_file_offset += ROUNDUP_TO_PAGE_BOUNDARY (sc.filesize);
812 file_offset += sc.filesize;
813 851
814 if (!unexec_write (curr_header_offset, &sc, sc.cmdsize)) 852 if (!unexec_write (curr_header_offset, &sc, sc.cmdsize))
815 unexec_error ("cannot write new __DATA segment's header"); 853 unexec_error ("cannot write new __DATA segment's header");
@@ -821,7 +859,7 @@ copy_data_segment (struct load_command *lc)
821/* Copy a LC_SYMTAB load command from the input file to the output 859/* Copy a LC_SYMTAB load command from the input file to the output
822 file, adjusting the file offset fields. */ 860 file, adjusting the file offset fields. */
823static void 861static void
824copy_symtab (struct load_command *lc) 862copy_symtab (struct load_command *lc, long delta)
825{ 863{
826 struct symtab_command *stp = (struct symtab_command *) lc; 864 struct symtab_command *stp = (struct symtab_command *) lc;
827 865
@@ -898,7 +936,7 @@ unrelocate (const char *name, off_t reloff, int nrel)
898/* Copy a LC_DYSYMTAB load command from the input file to the output 936/* Copy a LC_DYSYMTAB load command from the input file to the output
899 file, adjusting the file offset fields. */ 937 file, adjusting the file offset fields. */
900static void 938static void
901copy_dysymtab (struct load_command *lc) 939copy_dysymtab (struct load_command *lc, long delta)
902{ 940{
903 struct dysymtab_command *dstp = (struct dysymtab_command *) lc; 941 struct dysymtab_command *dstp = (struct dysymtab_command *) lc;
904 942
@@ -927,7 +965,7 @@ copy_dysymtab (struct load_command *lc)
927/* Copy a LC_TWOLEVEL_HINTS load command from the input file to the output 965/* Copy a LC_TWOLEVEL_HINTS load command from the input file to the output
928 file, adjusting the file offset fields. */ 966 file, adjusting the file offset fields. */
929static void 967static void
930copy_twolevelhints (struct load_command *lc) 968copy_twolevelhints (struct load_command *lc, long delta)
931{ 969{
932 struct twolevel_hints_command *tlhp = (struct twolevel_hints_command *) lc; 970 struct twolevel_hints_command *tlhp = (struct twolevel_hints_command *) lc;
933 971
@@ -964,6 +1002,7 @@ static void
964dump_it () 1002dump_it ()
965{ 1003{
966 int i; 1004 int i;
1005 long linkedit_delta = 0;
967 1006
968 printf ("--- Load Commands written to Output File ---\n"); 1007 printf ("--- Load Commands written to Output File ---\n");
969 1008
@@ -977,6 +1016,9 @@ dump_it ()
977 { 1016 {
978 /* save data segment file offset and segment_command for 1017 /* save data segment file offset and segment_command for
979 unrelocate */ 1018 unrelocate */
1019 if (data_segment_old_fileoff)
1020 unexec_error ("cannot handle multiple DATA segments"
1021 " in input file");
980 data_segment_old_fileoff = scp->fileoff; 1022 data_segment_old_fileoff = scp->fileoff;
981 data_segment_scp = scp; 1023 data_segment_scp = scp;
982 1024
@@ -984,18 +1026,26 @@ dump_it ()
984 } 1026 }
985 else 1027 else
986 { 1028 {
1029 if (strncmp (scp->segname, SEG_LINKEDIT, 16) == 0)
1030 {
1031 if (linkedit_delta)
1032 unexec_error ("cannot handle multiple LINKEDIT segments"
1033 " in input file");
1034 linkedit_delta = curr_file_offset - scp->fileoff;
1035 }
1036
987 copy_segment (lca[i]); 1037 copy_segment (lca[i]);
988 } 1038 }
989 } 1039 }
990 break; 1040 break;
991 case LC_SYMTAB: 1041 case LC_SYMTAB:
992 copy_symtab (lca[i]); 1042 copy_symtab (lca[i], linkedit_delta);
993 break; 1043 break;
994 case LC_DYSYMTAB: 1044 case LC_DYSYMTAB:
995 copy_dysymtab (lca[i]); 1045 copy_dysymtab (lca[i], linkedit_delta);
996 break; 1046 break;
997 case LC_TWOLEVEL_HINTS: 1047 case LC_TWOLEVEL_HINTS:
998 copy_twolevelhints (lca[i]); 1048 copy_twolevelhints (lca[i], linkedit_delta);
999 break; 1049 break;
1000 default: 1050 default:
1001 copy_other (lca[i]); 1051 copy_other (lca[i]);
@@ -1005,7 +1055,7 @@ dump_it ()
1005 if (curr_header_offset > text_seg_lowest_offset) 1055 if (curr_header_offset > text_seg_lowest_offset)
1006 unexec_error ("not enough room for load commands for new __DATA segments"); 1056 unexec_error ("not enough room for load commands for new __DATA segments");
1007 1057
1008 printf ("%d unused bytes follow Mach-O header\n", 1058 printf ("%ld unused bytes follow Mach-O header\n",
1009 text_seg_lowest_offset - curr_header_offset); 1059 text_seg_lowest_offset - curr_header_offset);
1010 1060
1011 mh.sizeofcmds = curr_header_offset - sizeof (struct mach_header); 1061 mh.sizeofcmds = curr_header_offset - sizeof (struct mach_header);
@@ -1024,6 +1074,7 @@ unexec (char *outfile, char *infile, void *start_data, void *start_bss,
1024 if (in_dumped_exec) 1074 if (in_dumped_exec)
1025 unexec_error ("Unexec from a dumped executable is not supported."); 1075 unexec_error ("Unexec from a dumped executable is not supported.");
1026 1076
1077 pagesize = getpagesize ();
1027 infd = open (infile, O_RDONLY, 0); 1078 infd = open (infile, O_RDONLY, 0);
1028 if (infd < 0) 1079 if (infd < 0)
1029 { 1080 {
@@ -1081,8 +1132,8 @@ ptr_in_unexec_regions (void *ptr)
1081 int i; 1132 int i;
1082 1133
1083 for (i = 0; i < num_unexec_regions; i++) 1134 for (i = 0; i < num_unexec_regions; i++)
1084 if ((vm_address_t) ptr - unexec_regions[i].address 1135 if ((vm_address_t) ptr - unexec_regions[i].range.address
1085 < unexec_regions[i].size) 1136 < unexec_regions[i].range.size)
1086 return 1; 1137 return 1;
1087 1138
1088 return 0; 1139 return 0;
diff --git a/src/w32fns.c b/src/w32fns.c
index 1381662c99c..910c395d61e 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2081,32 +2081,7 @@ w32_createwindow (f)
2081 2081
2082 if (!hprevinst) 2082 if (!hprevinst)
2083 { 2083 {
2084 Lisp_Object ifa;
2085
2086 w32_init_class (hinst); 2084 w32_init_class (hinst);
2087
2088 /* Handle the -geometry command line option and the geometry
2089 settings in the registry. They are decoded and put into
2090 initial-frame-alist by w32-win.el:x-handle-geometry. */
2091 ifa = Fsymbol_value (intern ("initial-frame-alist"));
2092 if (CONSP (ifa))
2093 {
2094 Lisp_Object lt = Fassq (Qleft, ifa);
2095 Lisp_Object tp = Fassq (Qtop, ifa);
2096
2097 if (!NILP (lt))
2098 {
2099 lt = XCDR (lt);
2100 if (INTEGERP (lt))
2101 left = lt;
2102 }
2103 if (!NILP (tp))
2104 {
2105 tp = XCDR (tp);
2106 if (INTEGERP (tp))
2107 top = tp;
2108 }
2109 }
2110 } 2085 }
2111 2086
2112 if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition) 2087 if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition)
diff --git a/src/w32menu.c b/src/w32menu.c
index 3a4dc20fc15..d5c38bee336 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -235,10 +235,6 @@ static int menu_items_n_panes;
235/* Current depth within submenus. */ 235/* Current depth within submenus. */
236static int menu_items_submenu_depth; 236static int menu_items_submenu_depth;
237 237
238/* Flag which when set indicates a dialog or menu has been posted by
239 Xt on behalf of one of the widget sets. */
240static int popup_activated_flag;
241
242static int next_menubar_widget_id; 238static int next_menubar_widget_id;
243 239
244/* This is set nonzero after the user activates the menu bar, and set 240/* This is set nonzero after the user activates the menu bar, and set
@@ -2148,7 +2144,6 @@ w32_dialog_show (f, keymaps, title, header, error)
2148 2144
2149 /* Display the menu. */ 2145 /* Display the menu. */
2150 lw_pop_up_all_widgets (dialog_id); 2146 lw_pop_up_all_widgets (dialog_id);
2151 popup_activated_flag = 1;
2152 2147
2153 /* Process events that apply to the menu. */ 2148 /* Process events that apply to the menu. */
2154 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id); 2149 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id);
@@ -2428,13 +2423,6 @@ fill_in_menu (HMENU menu, widget_value *wv)
2428 return 1; 2423 return 1;
2429} 2424}
2430 2425
2431int
2432popup_activated ()
2433{
2434 /* popup_activated_flag not actually used on W32 */
2435 return 0;
2436}
2437
2438/* Display help string for currently pointed to menu item. Not 2426/* Display help string for currently pointed to menu item. Not
2439 supported on NT 3.51 and earlier, as GetMenuItemInfo is not 2427 supported on NT 3.51 and earlier, as GetMenuItemInfo is not
2440 available. */ 2428 available. */
@@ -2537,6 +2525,21 @@ w32_free_menu_strings (hwnd)
2537 2525
2538#endif /* HAVE_MENUS */ 2526#endif /* HAVE_MENUS */
2539 2527
2528/* The following is used by delayed window autoselection. */
2529
2530DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
2531 doc: /* Return t if a menu or popup dialog is active on selected frame. */)
2532 ()
2533{
2534#ifdef HAVE_MENUS
2535 FRAME_PTR f;
2536 f = SELECTED_FRAME ();
2537 return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
2538#else
2539 return Qnil;
2540#endif /* HAVE_MENUS */
2541}
2542
2540void syms_of_w32menu () 2543void syms_of_w32menu ()
2541{ 2544{
2542 globals_of_w32menu (); 2545 globals_of_w32menu ();
@@ -2549,6 +2552,7 @@ void syms_of_w32menu ()
2549 staticpro (&Qdebug_on_next_call); 2552 staticpro (&Qdebug_on_next_call);
2550 2553
2551 defsubr (&Sx_popup_menu); 2554 defsubr (&Sx_popup_menu);
2555 defsubr (&Smenu_or_popup_active_p);
2552#ifdef HAVE_MENUS 2556#ifdef HAVE_MENUS
2553 defsubr (&Sx_popup_dialog); 2557 defsubr (&Sx_popup_dialog);
2554#endif 2558#endif
diff --git a/src/w32proc.c b/src/w32proc.c
index 29491931015..7d27172781d 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -486,7 +486,8 @@ sys_wait (int *status)
486 { 486 {
487 for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) 487 for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
488 /* some child_procs might be sockets; ignore them */ 488 /* some child_procs might be sockets; ignore them */
489 if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess) 489 if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess
490 && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0))
490 { 491 {
491 wait_hnd[nh] = cp->procinfo.hProcess; 492 wait_hnd[nh] = cp->procinfo.hProcess;
492 cps[nh] = cp; 493 cps[nh] = cp;
diff --git a/src/xdisp.c b/src/xdisp.c
index b9fd48adc96..40a1dfde5b2 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -22935,7 +22935,7 @@ note_mouse_highlight (f, x, y)
22935 struct buffer *b; 22935 struct buffer *b;
22936 22936
22937 /* When a menu is active, don't highlight because this looks odd. */ 22937 /* When a menu is active, don't highlight because this looks odd. */
22938#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) 22938#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
22939 if (popup_activated ()) 22939 if (popup_activated ())
22940 return; 22940 return;
22941#endif 22941#endif
diff --git a/src/xfns.c b/src/xfns.c
index 44f87b8d273..d1a5def4c34 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2120,27 +2120,35 @@ xic_create_xfontset (f, base_fontname)
2120 if (!xfs) 2120 if (!xfs)
2121 { 2121 {
2122 char *fontsetname = xic_create_fontsetname (base_fontname, False); 2122 char *fontsetname = xic_create_fontsetname (base_fontname, False);
2123 char *p0 = fontsetname, *p1;
2124 2123
2125 /* New fontset. */ 2124 /* New fontset. */
2126 /* FONTSETNAME contains a list of font names (specific fonts 2125 xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
2127 first, general fonts last), but giving that to XCreateFontSet 2126 fontsetname, &missing_list,
2128 at once occasionally fails (bug of X?). So, we try to call 2127 &missing_count, &def_string);
2129 XCreateFontSet for each fontname. */ 2128 if (missing_list)
2130 2129 XFreeStringList (missing_list);
2131 while (p0) 2130 if (! xfs)
2132 { 2131 {
2133 p1 = strchr (p0, ','); 2132 /* FONTSETNAME contains a list of font names (specific fonts
2134 if (p1) 2133 first, general fonts last), but giving that to
2135 *p1 = '\0'; 2134 XCreateFontSet at once occasionally fails (bug of X?).
2136 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), 2135 So, we try to call XCreateFontSet for each fontname. */
2137 p0, &missing_list, 2136 char *p0 = fontsetname, *p1;
2138 &missing_count, &def_string); 2137
2139 if (missing_list) 2138 while (p0)
2140 XFreeStringList (missing_list); 2139 {
2141 if (xfs) 2140 p1 = strchr (p0, ',');
2142 break; 2141 if (p1)
2143 p0 = p1 ? p1 + 1 : NULL; 2142 *p1 = '\0';
2143 xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
2144 p0, &missing_list,
2145 &missing_count, &def_string);
2146 if (missing_list)
2147 XFreeStringList (missing_list);
2148 if (xfs)
2149 break;
2150 p0 = p1 ? p1 + 1 : NULL;
2151 }
2144 } 2152 }
2145 xfree (fontsetname); 2153 xfree (fontsetname);
2146 } 2154 }
diff --git a/src/xmenu.c b/src/xmenu.c
index be77b9fdbd4..829a6653767 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1395,8 +1395,13 @@ If FRAME is nil or not given, use the selected frame. */)
1395 Lisp_Object frame; 1395 Lisp_Object frame;
1396{ 1396{
1397 GtkWidget *menubar; 1397 GtkWidget *menubar;
1398 FRAME_PTR f;
1399
1400 /* gcc 2.95 doesn't accept the FRAME_PTR declaration after
1401 BLOCK_INPUT. */
1402
1398 BLOCK_INPUT; 1403 BLOCK_INPUT;
1399 FRAME_PTR f = check_x_frame (frame); 1404 f = check_x_frame (frame);
1400 1405
1401 if (FRAME_EXTERNAL_MENU_BAR (f)) 1406 if (FRAME_EXTERNAL_MENU_BAR (f))
1402 set_frame_menubar (f, 0, 1); 1407 set_frame_menubar (f, 0, 1);
@@ -1409,7 +1414,7 @@ If FRAME is nil or not given, use the selected frame. */)
1409 1414
1410 gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar), 1415 gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar),
1411 GTK_WIDGET (children->data)); 1416 GTK_WIDGET (children->data));
1412 1417
1413 popup_activated_flag = 1; 1418 popup_activated_flag = 1;
1414 g_list_free (children); 1419 g_list_free (children);
1415 } 1420 }
@@ -3756,6 +3761,20 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
3756#endif /* not USE_X_TOOLKIT */ 3761#endif /* not USE_X_TOOLKIT */
3757 3762
3758#endif /* HAVE_MENUS */ 3763#endif /* HAVE_MENUS */
3764
3765
3766/* The following is used by delayed window autoselection. */
3767
3768DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
3769 doc: /* Return t if a menu or popup dialog is active. */)
3770 ()
3771{
3772#ifdef HAVE_MENUS
3773 return (popup_activated ()) ? Qt : Qnil;
3774#else
3775 return Qnil;
3776#endif /* HAVE_MENUS */
3777}
3759 3778
3760void 3779void
3761syms_of_xmenu () 3780syms_of_xmenu ()
@@ -3773,6 +3792,7 @@ syms_of_xmenu ()
3773#endif 3792#endif
3774 3793
3775 defsubr (&Sx_popup_menu); 3794 defsubr (&Sx_popup_menu);
3795 defsubr (&Smenu_or_popup_active_p);
3776 3796
3777#if defined (USE_GTK) || defined (USE_X_TOOLKIT) 3797#if defined (USE_GTK) || defined (USE_X_TOOLKIT)
3778 defsubr (&Smenu_bar_open); 3798 defsubr (&Smenu_bar_open);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index a862a07c8ee..4c250fecf00 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -561,7 +561,7 @@ See also `x-session-previous-id', `emacs-save-session-functions',
561 DEFVAR_LISP ("x-session-previous-id", &Vx_session_previous_id, 561 DEFVAR_LISP ("x-session-previous-id", &Vx_session_previous_id,
562 doc: /* The previous session id Emacs got from session manager. 562 doc: /* The previous session id Emacs got from session manager.
563If Emacs is running on a window system that has a session manager, the 563If Emacs is running on a window system that has a session manager, the
564session manager gives Emacs a session id. It is feasible for Emacs lisp 564session manager gives Emacs a session id. It is feasible for Emacs Lisp
565code to use the session id to save configuration in, for example, a file 565code to use the session id to save configuration in, for example, a file
566with a file name based on the session id. If Emacs is running when the 566with a file name based on the session id. If Emacs is running when the
567window system is shut down, the session manager remembers that Emacs was 567window system is shut down, the session manager remembers that Emacs was
diff --git a/src/xterm.c b/src/xterm.c
index ccc41810289..8849ef3dab4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8906,13 +8906,25 @@ void
8906x_raise_frame (f) 8906x_raise_frame (f)
8907 struct frame *f; 8907 struct frame *f;
8908{ 8908{
8909 Lisp_Object frame;
8910 const char *atom = "_NET_ACTIVE_WINDOW";
8911
8912 BLOCK_INPUT;
8909 if (f->async_visible) 8913 if (f->async_visible)
8910 { 8914 XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
8911 BLOCK_INPUT; 8915
8912 XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); 8916 XSETFRAME (frame, f);
8913 XFlush (FRAME_X_DISPLAY (f)); 8917 /* See Window Manager Specification/Extended Window Manager Hints at
8914 UNBLOCK_INPUT; 8918 http://freedesktop.org/wiki/Standards_2fwm_2dspec */
8915 } 8919
8920 Fx_send_client_event (frame, make_number (0), frame,
8921 make_unibyte_string (atom, strlen (atom)),
8922 make_number (32),
8923 Fcons (make_number (1),
8924 Fcons (make_number (time (NULL) * 1000),
8925 Qnil)));
8926 XFlush (FRAME_X_DISPLAY (f));
8927 UNBLOCK_INPUT;
8916} 8928}
8917 8929
8918/* Lower frame F. */ 8930/* Lower frame F. */