* PROBLEMS: Mention Ubuntu warnings about libdbusmenu.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
95c0e83b
JD
12013-03-31 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
4 f->output_data.ns.
5
876da980
PE
62013-04-07 Paul Eggert <eggert@cs.ucla.edu>
7
8 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
9 This bug was introduced by my 2013-02-25 change that simplified
10 data_start configuration. Without this change, on GNU/Linux
11 an Emacs configured with --enable-profiling fails immediately
12 due to a profiler signal.
13 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
14 with these flags. On platforms where special flags are needed
15 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
16 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
17 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
18
7452b7bd
DA
192013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
20
21 Get rid of some platform-specific functions examining window
22 system and its capabilities. This is a partial rework of the
23 2013-04-05 change.
24 * lisp.h (have_menus_p): Remove prototype. This function is
25 replaced with platform-independent window_system_available.
26 (check_window_system): Move to...
27 * frame.h (decode_window_system_frame, window_system_available):
28 ...here, add new prototypes.
29 * frame.c (window_system_available, decode_window_system_frame):
30 New functions.
31 (check_window_system): Platform-independent now.
32 * xterm.h (x_in_use): Remove declaration.
33 (check_x_frame):
34 * w32term.h (check_x_frame):
35 * nsterm.h (check_x_frame): Remove prototypes. This function
36 is replaced with platform-independent decode_window_system_frame.
37 * msdos.c (have_menus_p): Remove.
38 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
39 Remove platform-specific functions. Use check_window_system,
40 decode_window_system_frame and check_ns_display_info where
41 appropriate. Minor style and comment tweaks.
42 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
43 (check_x_frame): Likewise.
44 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
45 Likewise.
46 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
47 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
48 * xmenu.c, xselect.c: All related users changed.
49
251e9147
KH
502013-04-03 Kenichi Handa <handa@gnu.org>
51
52 The following changes is to optimize the code for reading UTF-8
53 files.
54
55 * coding.c (check_ascii): Renamed from detect_ascii. Return value
56 changed. Check EOL format. Do not call adjust_coding_eol_type
57 here.
58 (check_utf_8): New function.
59 (adjust_coding_eol_type): Do nothing if already adjusted.
60 (detect_coding): Compare the return value of check_ascii with
61 coding->src_bytes. Call adjust_coding_eol_type if necessary.
62 (decode_coding_gap): Optimize for valid UTF-8.
63
8bc369d4
KH
642013-03-21 Kenichi Handa <handa@gnu.org>
65
66 * coding.c (syms_of_coding): Cancel previous change.
67
68 * insdel.c (insert_from_gap): Fix previous change.
69
73931ad1
DA
702013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
71
72 Consistently use platform-specific function to detect window system.
73 * lisp.h (check_window_system): New prototype. This function is
74 going to replace check_x, check_w32 and check_ns.
75 (have_menus_p): Mention msdos.c in comment.
76 * fontset.c (check_window_system_func): Remove. Adjust all users.
77 * fontset.h (check_window_system_func): Remove prototype.
78 * nsterm.h (check_ns):
79 * xterm.h (check_x):
80 * w32term.h (check_w32): Likewise.
81 * menu.c (Fx_popup_menu): Use check_window_system.
82 * msdos.c (check_window_system): Define for MS-DOS.
83 * nsfns.m (check_window_system): Define for NS. Adjust all users.
84 * w32fns.c (check_window_system): Likewise for MS-Windows.
85 * xfns.c (check_window_system): Likewise for X.
86 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
87 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
88
7216e43b
PE
892013-04-02 Paul Eggert <eggert@cs.ucla.edu>
90
91 Prefer < to > in range checks such as 0 <= i && i < N.
92 This makes it easier to visualize quantities on a number line.
93 This patch doesn't apply to all such range checks,
94 only to the range checks affected by the 2013-03-24 change.
95 This patch reverts most of the 2013-03-24 change.
96 * alloc.c (xpalloc, Fgarbage_collect):
97 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
98 * character.c (string_escape_byte8):
99 * charset.c (read_hex):
100 * data.c (cons_to_unsigned):
101 * dispnew.c (update_frame_1):
102 * doc.c (Fsubstitute_command_keys):
103 * doprnt.c (doprnt):
104 * editfns.c (hi_time, decode_time_components):
105 * fileio.c (file_offset):
106 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
107 * font.c (font_intern_prop):
108 * frame.c (x_set_alpha):
109 * gtkutil.c (get_utf8_string):
110 * indent.c (check_display_width):
111 * keymap.c (Fkey_description):
112 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
113 * lread.c (read1):
114 * minibuf.c (read_minibuf_noninteractive):
115 * process.c (wait_reading_process_output):
116 * search.c (Freplace_match):
117 * window.c (get_phys_cursor_glyph):
118 * xdisp.c (redisplay_internal):
119 * xsmfns.c (smc_save_yourself_CB):
120 Prefer < to > for range checks.
121 * dispnew.c (sit_for): Don't mishandle NaNs.
122 This fixes a bug introduced in the 2013-03-24 change.
123 * editfns.c (decode_time_components): Don't hoist comparison.
124 This fixes another bug introduced in the 2013-03-24 change.
125
92759988
DA
1262013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
127
128 * frame.h (struct frame): Drop scroll_bottom_vpos
129 member becaue all real users are dead long ago.
130 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
131 * xdisp.c (redisplay_internal): Adjust user.
132
9a1971bb
GM
1332013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
134
f38ab167
JD
135 * nsmenu.m (showAtX:Y:for:): setLevel to
136 NSPopUpMenuWindowLevel (Bug#13998).
137
6d01f1fe
JD
1382013-03-30 Jan Djärv <jan.h.d@swipnet.se>
139
140 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
141 (ns_check_pending_open_menu): Declare.
142
143 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
144 (x_activate_menubar): Update the menu with title that matches
145 ns_get_pending_menu_title, and call
146 ns_check_pending_openmenu (Bug#12698).
147 (menuWillOpen:): New method.
148 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
149
150 * nsterm.m (menu_will_open_state, menu_mouse_point)
151 (menu_pending_title): New varaibles.
152 (ns_get_pending_menu_title, ns_check_menu_open)
153 (ns_check_pending_open_menu): New functions.
154
781f4782
DA
1552013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
156
157 * indent.c (current_column_bol_cache): Remove leftover which is not
158 used in Fmove_to_column any more.
159 (current_column, scan_for_column): Adjust users.
160 * keyboard.c (last_point_position_buffer, last_point_position_window):
161 Remove leftovers which are not used for recording undo any more.
162 (command_loop_1, syms_of_keyboard): Adjust users.
163 * xdisp.c (last_max_ascent): Remove leftover which is not used in
164 redisplay_window any more.
165 (move_it_to): Adjust user.
166
1921c31b
JB
1672013-03-29 Juanma Barranquero <lekktu@gmail.com>
168
169 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
170 Update dependencies.
171
717b8bcd
SM
1722013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
173
174 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
175 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
176 forward references.
177
e74aeda8
DA
1782013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
179
180 * window.h (struct window): Replace hchild, vchild and buffer slots
181 with the only contents slot. This is possible because each valid
182 window may have either the child window (in vertical or horizontal
183 combination) or buffer to display (for the leaf window). Using that,
184 a lof of operations to traverse and/or change window hierarchies may
185 be simplified. New member horizontal is used to distinguish between
186 horizontal and vertical combinations of internal windows.
187 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
188 (WINDOW_VERTICAL_COMBINATION_P): New macros.
189 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
190 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
191 Use contents slot, not buffer, where appropriate.
192 (wset_combination): New function.
193 (wset_buffer): Add eassert.
194 (Fframe_first_window): Simplify the loop reaching first window.
195 (Fwindow_buffer): Use WINDOW_LEAF_P.
196 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
197 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
198 (unshow_buffer): Convert initial debugging check to eassert.
199 (replace_window, recombine_windows, Fdelete_other_windows_internal)
200 (make_parent_window, window_resize_check, window_resize_apply)
201 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
202 (Fset_window_configuration, delete_all_child_windows, save_window_save):
203 Adjust to match struct window changes.
204 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
205 (mark_window_cursors_off, count_windows, get_leaf_windows)
206 (foreach_window_1): Simplify the loop.
207 * alloc.c (mark_object): Do not check for the leaf window because
208 internal windows has no glyph matrices anyway.
209 * dispnew.c (clear_window_matrices, showing_window_margins_p)
210 (allocate_matrices_for_window_redisplay, fake_current_matrices)
211 (allocate_matrices_for_frame_redisplay, free_window_matrices)
212 (build_frame_matrix_from_window_tree, mirror_make_current)
213 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
214 (update_window_tree, set_window_update_flags): Simplify the loop.
215 (sync_window_with_frame_matrix_rows): Enforce live window.
216 Use contents slot, not buffer, where appropriate.
217 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
218 and WINDOW_HORIZONTAL_COMBINATION_P.
219 (make_frame_visible_1): Simplify the loop.
220 Use contents slot, not buffer, where appropriate.
221 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
222 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
223 (expose_window_tree): Likewise.
224 Use contents slot, not buffer, where appropriate.
225 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
226 to avoid deleted windows. Use contents slot instead of buffer.
227 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
228 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
229 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
230 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
231
121ab1cd
EZ
2322013-03-28 Eli Zaretskii <eliz@gnu.org>
233
ef454cf7
EZ
234 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
235 identify the reasons for assertion violations in bug#14062 and
236 similar ones.
21e930f8
EZ
237 (Fx_show_tip): Fix compilation error under
238 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 239
121ab1cd
EZ
240 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
241 Reported by <rzl24ozi@gmail.com>.
242
5c89ca24
DA
2432013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
244
245 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
246 start marker...
247 (unwind_with_echo_area_buffer): ...to restore it here. This
248 is needed to ensure that...
249 (redisplay_window): ...both window markers are valid here,
250 which is verified by eassert.
251 * editfns.c (save_excursion_save): Do not assume that
252 selected_window always displays the buffer.
c7f53895
DA
253 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
254 Fix comment.
5c89ca24 255
f557c1b1
SM
2562013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
257
258 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
259 the upcase table.
260
40693bba 2612013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
262
263 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
264
c86f791f
EZ
2652013-03-27 Eli Zaretskii <eliz@gnu.org>
266
267 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
268 since MinGW's w32api headers do. This avoids compiler warnings.
269
270 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
271 if already defined.
272
c6e72e17
EZ
2732013-03-26 Eli Zaretskii <eliz@gnu.org>
274
275 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
276
54e95010
JD
2772013-03-26 Jan Djärv <jan.h.d@swipnet.se>
278
279 * gtkutil.c (style_changed_cb): Check if frame is live and an
280 X frame (Bug#14038).
281
b88b62de
EZ
2822013-03-26 Eli Zaretskii <eliz@gnu.org>
283
a18d7de6
EZ
284 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
285 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
286 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
287 MinGW64.
8f5e14c8
EZ
288 Move inclusion of time.h before sys/time.h, so that MinGW64 could
289 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 290
b88b62de
EZ
291 Fix incompatibilities between MinGW.org and MinGW64 headers.
292 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
293
294 * w32.c (REPARSE_DATA_BUFFER): Guard with
295 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
296
c074e458
JD
2972013-03-25 Jan Djärv <jan.h.d@swipnet.se>
298
299 * xterm.c: Include X11/XKBlib.h
300 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
301
908589fd
AS
3022013-03-24 Andreas Schwab <schwab@linux-m68k.org>
303
304 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
305 written backwards.
306 * blockinput.h (input_blocked_p): Likewise.
307 * bytecode.c (exec_byte_code): Likewise.
308 * callproc.c (call_process_kill, call_process_cleanup)
309 (Fcall_process): Likewise.
310 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
311 (Fccl_execute_on_string): Likewise.
312 * character.c (string_escape_byte8): Likewise.
313 * charset.c (read_hex): Likewise.
314 * cm.c (calccost): Likewise.
315 * data.c (cons_to_unsigned): Likewise.
316 * dired.c (directory_files_internal, file_name_completion):
317 Likewise.
318 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
319 (sit_for): Likewise.
320 * doc.c (Fsubstitute_command_keys): Likewise.
321 * doprnt.c (doprnt): Likewise.
322 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
323 * emacsgtkfixed.c: Likewise.
324 * fileio.c (file_offset, Fwrite_region): Likewise.
325 * floatfns.c (Fexpt, fmod_float): Likewise.
326 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
327 Likewise.
328 * font.c (font_intern_prop): Likewise.
329 * frame.c (x_set_alpha): Likewise.
330 * gtkutil.c (get_utf8_string): Likewise.
331 * indent.c (check_display_width): Likewise.
332 * intervals.c (create_root_interval, rotate_right, rotate_left)
333 (split_interval_right, split_interval_left)
334 (adjust_intervals_for_insertion, delete_node)
335 (interval_deletion_adjustment, adjust_intervals_for_deletion)
336 (merge_interval_right, merge_interval_left, copy_intervals)
337 (set_intervals_multibyte_1): Likewise.
338 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
339 * keymap.c (Fkey_description): Likewise.
340 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
341 * lread.c (openp, read_integer, read1, string_to_number):
342 Likewise.
343 * menu.c (ensure_menu_items): Likewise.
344 * minibuf.c (read_minibuf_noninteractive): Likewise.
345 * print.c (printchar, strout): Likewise.
346 * process.c (create_process, Faccept_process_output)
347 (wait_reading_process_output, read_process_output, send_process)
348 (wait_reading_process_output): Likewise.
349 * profiler.c (make_log, handle_profiler_signal): Likewise.
350 * regex.c (re_exec): Likewise.
351 * regex.h: Likewise.
352 * search.c (looking_at_1, Freplace_match): Likewise.
353 * sysdep.c (get_child_status, procfs_ttyname)
354 (procfs_get_total_memory): Likewise.
355 * systime.h (EMACS_TIME_VALID_P): Likewise.
356 * term.c (dissociate_if_controlling_tty): Likewise.
357 * window.c (get_phys_cursor_glyph): Likewise.
358 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
359 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
360 Likewise.
361 * xfns.c (Fx_window_property): Likewise.
362 * xmenu.c (set_frame_menubar): Likewise.
363 * xselect.c (x_get_window_property, x_handle_dnd_message):
364 Likewise.
365 * xsmfns.c (smc_save_yourself_CB): Likewise.
366 * xterm.c (x_scroll_bar_set_handle): Likewise.
367
2bf7d27a
DA
3682013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
369
370 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
371 to be optional or nil. Adjust comment and convert it to docstring.
372 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
373 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
374
a9ebfa0b
PE
3752013-03-24 Paul Eggert <eggert@cs.ucla.edu>
376
377 Static checking by GCC 4.8-20130319.
378 * image.c (gif_load): Assume pass < 3 to pacify GCC.
379 * process.c (Fset_process_datagram_address)
380 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
381 * xdisp.c (get_char_face_and_encoding):
382 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
383 (get_glyph_face_and_encoding): Prepare face before possibly using it.
384 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
385
4f3576ee
KB
3862013-03-24 Ken Brown <kbrown@cornell.edu>
387
789b5e9a
KB
388 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
389 fix compilation on 64-bit Cygwin, where underscores are not
390 automatically prepended.
391
4f3576ee
KB
392 * w32term.c (w32_initialize): Silence compiler warning.
393
b5b7745f
EZ
3942013-03-23 Eli Zaretskii <eliz@gnu.org>
395
cdc0d0bd
EZ
396 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
397 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
398 variables, to save and restore frame dimensions. Use
399 FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
400 after returning from a 'fullscreen' configuration. use
401 SendMessage instead of PostMessage to send the SC_RESTORE message,
402 to avoid races between the main thread and the input thread.
403
404 * w32term.h (struct w32_output): New members normal_width,
405 normal_height, normal_top, normal_left, and prev_fsmode.
406 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
407 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
408 members of a frame.
409
b5b7745f
EZ
410 * w32term.c (w32fullscreen_hook): Record last value of the frame's
411 'fullscreen' parameter. Always record previous width and height
412 of the frame, except when switching out of maximized modes, so
413 that they could be restored correctly, instead of resetting to the
414 default frame dimensions. Send SC_RESTORE command to the frame,
415 unless we are going to send SC_MAXIMIZE, to restore the frame
416 resize hints in the mouse pointer shown by the window manager.
417 (Bug#14032)
418
419 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
420
421 * lisp.h (get_frame_param): Adjust conditions for prototype
422 declaration.
423
a3454eed
KB
4242013-03-22 Ken Brown <kbrown@cornell.edu>
425
426 * unexcw.c: Drop unneeded inclusion of w32common.h.
427 (report_sheap_usage): Declare.
428 (read_exe_header): Add magic numbers for x86_64.
429 (fixup_executable): Fix printf format specifier for unsigned long
430 argument.
431
5a49b79c
DA
4322013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
433
434 * frame.h (struct frame): Put menu_bar_window under #ifdef
435 because this member is not needed when X toolkit is in use.
436 (fset_menu_bar_window):
437 * dispnew.c (clear_current_matrices, clear_desired_matrices)
438 (free_glyphs, update_frame):
439 * xdisp.c (expose_frame): Likewise.
440 (display_menu_bar): Likewise. Remove redundant eassert.
441 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
442 toolkit is in use.
443
d6723bf7
PE
4442013-03-21 Paul Eggert <eggert@cs.ucla.edu>
445
7b1123d8
PE
446 Use functions and constants to manipulate Lisp_Save_Value objects.
447 This replaces code that used macros and strings and token-pasting.
448 The change makes the C source a bit easier to follow,
449 and shrinks the Emacs executable a bit.
450 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
451 (make_save_value): Change 1st arg from string to enum. All callers
452 changed.
453 (INTX): Remove.
454 (mark_object): Use if, not #if, for GC_MARK_STACK.
455 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
456 (XSAVE_OBJECT): Now functions, not macros.
457 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
458 the constant was never used.
459 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
460 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
461 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
462 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
463 New constants.
464 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
465 type3 with a single member save_type. All uses changed.
466 (save_type, set_save_pointer, set_save_integer): New functions.
467 * print.c (PRINTX): Remove.
468
d6723bf7
PE
469 * alloc.c: Remove redundant static declarations.
470
5f24fa51
DA
4712013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
472
473 * window.h (struct window): Convert left_col, top_line, total_lines
474 and total_cols from Lisp_Objects to integers. Adjust comments.
475 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
476 Remove.
477 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
478 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
479 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
480 Adjust users where appropriate.
481
42143acd
DA
4822013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
483
484 * frame.h (struct frame): Drop resx and resy because the same data is
485 available from window system-specific output context. Adjust users.
96061a21 486 (default_pixels_per_inch_x, default_pixels_per_inch_y): New
42143acd
DA
487 functions to provide defaults when no window system available.
488 (FRAME_RES_X, FRAME_RES_Y): New macros.
489 (NUMVAL): Moved from xdisp.c.
490 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
491 (Ffont_face_attributes, Fopen_font):
492 * image.c (gs_load):
493 * w32font.c (fill_in_logfont):
494 * xdisp.c (calc_pixel_width_or_height):
495 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
496 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
497
c0a17406
KH
4982013-03-20 Kenichi Handa <handa@gnu.org>
499
500 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
501 to 1 (temporary workaround until a bug related to ASCII
502 optimization is fixed).
503
095d384d
DA
5042013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
505
506 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
507 Signal error if window is not internal. Adjust docstring.
508 (delete_all_child_windows): Use combination_limit to save the buffer.
509 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
510 * print.c (syms_of_print): Initialize debugging output not here...
511 (init_print_once): ...but in a new function here.
512 * lisp.h (init_print_once): Add prototype.
513 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 514
748fa866
DA
5152013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
516
517 * window.c (window_resize_check, window_resize_apply)
518 (window_from_coordinates, recombine_windows, set_window_buffer)
519 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
520 (Fsplit_window_internal, Fdelete_window_internal)
521 (freeze_window_starts): Use bool for booleans.
522 * window.h (window_frame_coordinates, resize_frame_windows)
523 (freeze_window_starts, set_window_buffer): Adjust prototypes.
524
81519fd2
SM
5252013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
526
527 * dispnew.c (bitch_at_user): Use `user-error'.
528
6db423a9
KB
5292013-03-17 Ken Brown <kbrown@cornell.edu>
530
531 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
532 as return type of image_background. (Bug#13981)
533 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
534
8f2906f5
JD
5352013-03-16 Jan Djärv <jan.h.d@swipnet.se>
536
960ce480 537 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 538 (ns_select): Don't return with result uninitialized.
960ce480 539
8f2906f5
JD
540 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
541 and getDirectory.
542
81519fd2
SM
543 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
544 New functions.
8f2906f5
JD
545 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
546 directories. If filename is nil, get directory name (Bug#13932).
547 Use getFilename and getDirectory.
548 (getFilename, getDirectory): New methods for EmacsSavePanel and
549 EmacsOpenPanel.
550 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
551
cded56c1
PE
5522013-03-15 Paul Eggert <eggert@cs.ucla.edu>
553
554 * coding.c (decode_coding_gap): Fix typo caught by static checking.
555
251e9147 5562013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
557
558 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
559 (adjust_after_replace): Make it back to static. Delete the third
560 arg text_at_gap_tail. Cancel the code for handling it.
561
562 * coding.h (struct coding_system): New member eol_seen.
563
564 * coding.c (detect_ascii): New function.
565 (detect_coding): Set coding->head_ascii and coding->eol_seen only
566 when the source bytes are actually scanned. On detecting for
567 coding_category_utf_8_auto, call detect_ascii instead of scanning
568 source bytes directly.
569 (produce_chars): Call insert_from_gap with the new arg 0.
570 (encode_coding): Likewise.
571 (decode_coding_gap): Control ASCII optimization by the variable
572 disable_ascii_optimization instead of #ifndef .. #endif.
573 Deccode EOL format according to coding->eol_seen.
574 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
575 variable.
576
8a44e6d1
KH
577 * lisp.h (adjust_after_replace): Cancel externing it.
578 (insert_from_gap): Adjust prototype.
579
5f795e34
EZ
5802013-03-15 Eli Zaretskii <eliz@gnu.org>
581
582 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
583 FULLSCREEN_MAXIMIZED. (Bug#13935)
584
f258b4be
DA
5852013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
586
587 * region-cache.c (find_cache_boundary, move_cache_gap)
588 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
589 Simplify debugging check and convert to eassert. Adjust comment.
590 (pp_cache): Put under ENABLE_CHECKING.
591
a5cc4dde
EZ
5922013-03-14 Eli Zaretskii <eliz@gnu.org>
593
594 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
595 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
596 and WM_ACTIVATEAPP.
597 (w32fullscreen_hook): If the frame is visible, reset
598 f->want_fullscreen flag after changing the frame size. If the
599 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
600 (Bug#13953)
601
3fc5e44a
DC
6022013-03-13 Daniel Colascione <dancol@dancol.org>
603
604 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
605 too so that these builds can use Cygwin's file conversion
606 functions. (We've been building and linking cygw32.o all along
607 and just not using it.)
608
47d7532e
PE
6092013-03-13 Paul Eggert <eggert@cs.ucla.edu>
610
611 File synchronization fixes (Bug#13944).
612 * Makefile.in (LIB_FDATASYNC): New macro.
613 (LIBES): Use it.
614 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
615 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
616 Don't worry about HAVE_FSYNC, since a substitute fsync is
617 available if the system lacks one.
618 (Fwrite_regin): Retry fsync if interrupted.
619
c7ffccaf
EZ
6202013-03-13 Eli Zaretskii <eliz@gnu.org>
621
4e2df81d 622 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
623 activated, call w32fullscreen_hook, to make sure the new frame
624 dimensions are in effect. (Bug#13937)
625
8a7debc1
DA
6262013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
627
628 * xdisp.c (init_iterator): Simplify because both character and byte
629 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
630 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
631 character and byte positions can be obtained from marker.
8a7debc1 632
7fd8c501
PE
6332013-03-13 Paul Eggert <eggert@cs.ucla.edu>
634
d9df6f40
PE
635 Static checking by Sun C 5.12.
636 * alloc.c (buffer_memory_full) [REL_ALLOC]:
637 * bytecode.c (exec_byte_code):
638 * dispnew.c (init_display):
639 * eval.c (error):
640 * fileio.c (Fsubstitute_in_file_name):
641 * keyboard.c (Fevent_convert_list):
642 * keymap.c (Fsingle_key_description):
643 * term.c (maybe_fatal, fatal):
644 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
645 * xsmfns.c (Fhandle_save_session):
646 Omit unreachable code.
647 * keymap.c (map_keymap_char_table_item): Cast void * to
648 a function pointer type; the C Standard requires this.
649
7fd8c501
PE
650 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
651 Include <sys/param.h> unconditionally, as that works elsewhere and
652 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
653 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
654 and FreeBSD now.
655
cb0290df
PE
6562013-03-11 Paul Eggert <eggert@cs.ucla.edu>
657
658 * insdel.c (adjust_after_replace): Use bool for boolean.
659
cbae07d5
SM
6602013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
661
662 * keyboard.c: Move keyboard decoding to read_key_sequence.
663 (decode_keyboard_code): Remove.
664 (tty_read_avail_input): Don't try to decode input.
665 (read_decoded_char): New function.
666 (read_key_sequence): Use it.
667
819e2da9
DC
6682013-03-10 Daniel Colascione <dancol@dancol.org>
669
670 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
671 (GUI_SDATA, guichar_t): Macros to abstract out differences between
672 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
673 w32fns.c.
674
675 * w32term.c (construct_drag_n_drop): Use the above macros to make
676 drag-and-drop work for non-ASCII filenames in cygw32 builds.
677
678 * w32fns.c (x_set_name, x_set_title): Use the above macros to
679 properly display non-ASCII frame titles in cygw32 builds.
680
681 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
682 call ShellExecute in cygw32 builds.
683
684 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
685 common file dialog code.
686
687 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
688 can just use du like other systems.
689
690 * coding.c (from_unicode_buffer): Declare.
691 * coding.c (from_unicode_buffer): Implement.
692
99ec1647
SM
6932013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
694
d2e24f92
SM
695 * lread.c: Minor cleanup.
696 (FROM_FILE_P): New macro.
697 (skip_dyn_bytes, unreadchar, read1): Use it.
698 (read_list): Consolidate duplicated code.
699
99ec1647
SM
700 * bytecode.c (struct byte_stack): Remove `constants' when unused.
701
138c0ae8
EZ
7022013-03-10 Eli Zaretskii <eliz@gnu.org>
703
704 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
705 (redisplay_internal, set_cursor_from_row, try_window)
706 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
707 (display_line, notice_overwritten_cursor)
99ec1647
SM
708 (mouse_face_from_buffer_pos, note_mouse_highlight):
709 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 710 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
711 (mouse_face_from_string_pos, fast_find_string_pos):
712 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
713
714 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
715
716 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
717
718 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
719 MATRIX_MODE_LINE_ROW.
720
721 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
722
c230dd7d
KH
7232013-03-10 handa <handa@gnu.org>
724
725 * lisp.h (adjust_after_replace): Extern it.
726
727 * coding.c (detect_coding): Cound the heading ASCII bytes in the
728 case of detection for coding_category_utf_8_auto.
99ec1647
SM
729 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
730 Skip decoding if all bytes are ASCII.
c230dd7d
KH
731
732 * insdel.c (adjust_after_replace): Make it public. New arg
733 text_at_gap_tail.
734 (adjust_after_insert): Call adjust_after_replace with the new arg
735 value 0.
736
27a98a62
SM
7372013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
738
739 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
740 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
741 from Elisp via unread-command-events.
742
743 * keyboard.c (access_keymap_keyremap): Accept nil return value from
744 functions to mean "no change".
745
457882c2
PE
7462013-03-08 Paul Eggert <eggert@cs.ucla.edu>
747
748 region-cache.c, scroll.c, search.c: Use bool for booleans.
749 * lisp.h (compile_pattern):
750 * scroll.c (do_scrolling, do_direct_scrolling):
751 * search.c (struct regexp_cache, compile_pattern_1)
752 (compile_pattern, string_match_1, search_command)
753 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
754 (search_regs_saved, Fregexp_quote):
755 Use bool for boolean.
756 * region-cache.c (region_cache_forward, region_cache_backward):
757 Fix comments to match code: these functions return int, not boolean.
758
b5426561
DA
7592013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
760
761 * search.c (find_newline): Accept start and end byte positions
762 as arguments and allow -1 if not known.
763 (find_newline_no_quit): Likewise for start position.
764 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
765 * bidi.c (bidi_find_paragraph_start): Pass byte position to
766 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
767 * editfns.c (Fconstrain_to_field): Break long line.
768 Adjust call to find_newline.
b5426561
DA
769 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
770 Use DEC_BOTH to start next search from the previous buffer
771 position, where appropriate.
772 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
773 (get_visually_first_element, move_it_vertically_backward): Likewise.
774 Obtain byte position from the display iterator, where appropriate.
775
0bce5d9e
PE
7762013-03-08 Paul Eggert <eggert@cs.ucla.edu>
777
778 print.c, process.c: Use bool for booleans.
779 * lisp.h (wait_reading_process_output):
780 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
781 (strout, debug_output_compilation_hack, float_to_string, print)
782 (print_object):
783 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
784 (decode_status, status_message, create_process, create_pty)
785 (Fmake_network_process, Fnetwork_interface_info)
786 (wait_reading_process_output, read_process_output)
787 (write_queue_push, write_queue_pop, process_send_signal)
788 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
789 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
790 Use bool for booleans.
791 * process.c (Fnetwork_interface_list): Remove unused local.
792 (connect_counter): Now EMACS_INT, not int.
793
36075a19
DA
7942013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
795
796 * bidi.c (bidi_fetch_char): Swap first and second arguments
797 to match other functions accepting character and byte positions.
798 Adjust comment.
799 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
800 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
801 when you need just to move to the previous buffer position.
802 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
803
4aae1914
EZ
8042013-03-07 Eli Zaretskii <eliz@gnu.org>
805
806 * .gdbinit (prowlims): Display the enabled_p flag of the row.
807
c54aa166
DA
8082013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
809
810 Avoid character to byte conversions in motion subroutines.
811 * indent.h (compute_motion, vmotion): Add byte position argument.
812 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
813 Add eassert.
814 (Fcompute_motion): Break long line. Adjust call to compute_motion.
815 Use list5 for return value.
816 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
817 Adjust comments, style and calls to compute_motion.
818 (Fvertical_motion): Adjust call to vmotion.
819 * window.c (Fdelete_other_windows_internal): Record window start
820 byte position and adjust call to vmotion.
821 (window_scroll_line_based): Likewise with call to compute_motion.
822 Use SET_PT_BOTH.
823 (Frecenter): Adjust calls to vmotion.
824
3de717bd
DA
8252013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
826
827 * lisp.h (list2i, list3i): New functions.
828 (list4i): Move from window.c and make LISP_INLINE.
829 * editfns.c (make_lisp_time):
830 * fns.c (Flocale_info):
831 * keyboard.c (parse_modifiers):
832 * xterm.c (x_ewmh_activate_frame): Use list2i.
833 * instel.c (signal_after_change):
834 * nsfns.m (Fx_server_version, Fxw_color_values):
835 * w32fns.c (Fxw_color_values, Fx_server_version):
836 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
837 * fileio.c (Fvisited_file_modtime):
838 * nsfns.m (Fns_display_usable_bounds):
839 * w32.c (ltime): Use list4i.
840
d26e478e
EZ
8412013-03-06 Eli Zaretskii <eliz@gnu.org>
842
a611149e
EZ
843 * search.c (find_newline_no_quit): Rename from find_next_newline.
844 Add commentary.
845
846 * lisp.h (find_newline_no_quit): Rename prototype.
847
848 * xdisp.c (back_to_previous_line_start)
849 (forward_to_next_line_start, get_visually_first_element)
850 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
851 * indent.c (vmotion): Callers of find_newline_no_quit changed.
852 * bidi.c (bidi_find_paragraph_start): Callers of
853 find_newline_no_quit changed.
854
d26e478e
EZ
855 * msdos.c: Change encoding to cp850. (Bug#13879)
856 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
857
1af1a51a
DA
8582013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
859
860 Coding system support cleanup and minor refactoring.
861 * coding.h (enum coding_result_code): Remove
862 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
863 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
864 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
865 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
866 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
867 (decode_coding_region, encode_coding_region, decode_coding_string):
868 Remove unused compatibility macros.
869 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
870 (record_conversion_result): Adjust user.
871 (syms_of_coding): Likewise.
872 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
873 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
874 (decode_coding_object): Simplify since xrealloc never returns NULL.
875 Add eassert.
876
0bafabe7 8772013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 878
9b1c3271 879 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
880 * sysdep.c (list_system_processes)
881 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 882 Make it a stub in this case; otherwise the build might fail,
0845a75c 883 and this code hasn't been tested on such hosts anyway.
725eb027 884 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
885 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
886 and analyzed by Jérémie Courrèges-Anglas in
887 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 888
ffc65bee
DA
8892013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
890
891 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
892 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
893 (get_visually_first_element, move_it_vertically_backward): Ajust users.
894 * bidi.c (bidi_find_paragraph_start): Likewise.
895 * indent.c (vmotion): Likewise.
896
70743157
PE
8972013-03-05 Paul Eggert <eggert@cs.ucla.edu>
898
899 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
900 * filelock.c: Include <c-ctype.h>.
901 (MAX_LFINFO): New top-level constant.
902 (lock_info_type): Remove members pid, boot_time. Add members at,
903 dot, colon. Change user member to be the entire buffer, not a
904 pointer. This allows us to handle the case where a foreign
905 pid or boot time exceeds the local range. All uses changed.
906 (LINKS_MIGHT_NOT_WORK): New constant.
907 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
908 (defined_WINDOWSNT): Remove.
909 (MAKE_LOCK_NAME, file_in_lock_file_name):
910 Always use .#FILE (not .#-FILE) for the file lock,
911 even if it is a regular file.
912 (rename_lock_file): New function.
913 (create_lock_file): Use it.
914 (create_lock_file, read_lock_data):
915 Prefer a symbolic link for the lock file, falling back on a
916 regular file if symlinks don't work. Do not try to create
917 symlinks on MS-Windows, due to security hassles. Stick with
918 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
919 link, rename, unlink, mkstemp) when creating locks, as a GNUish
920 host may be using a Windowsish file system, and cannot use
921 MS-Windows-only system calls. Fall back on mktemp if mkstemp
922 doesn't work. Don't fail merely because of a symlink-contents
923 length limit in the current file system; fall back on regular
924 files. Increase the symlink contents length limit to 8 KiB, this
925 should be big enough for any real use and doesn't crunch the
926 stack.
927 (create_lock_file, lock_file_1, read_lock_data):
928 Simplify allocation of lock file buffers now that they fit in 8 KiB.
929 (lock_file_1): Return error number, not bool. All callers changed.
930 (ELOOP): New macro, if not already defined.
931 (read_lock_data): Return size of lock file contents, not Lisp object.
932 All callers changed. Handle a race condition if some other process
933 replaces a regular-file lock with a symlink lock or vice versa,
934 while we're trying to read the lock.
935 (current_lock_owner): Parse contents more carefully, to help avoid
936 confusing a regular-file lock with some other application's use
937 of the file. Check for lock file contents being too long, or
938 not parsing correctly.
939 (current_lock_owner, lock_file):
940 Allow foreign pid and boot times that exceed the local range.
941 (current_lock_owner, lock_if_free, lock_file):
942 Simplify allocation of lock file contents.
943 * w32.c (sys_rename_replace): New function, containing most of
944 the contents of the old sys_rename.
945 (sys_rename): Use it.
946 (fchmod): New dummy function.
947 * w32.h (sys_rename_replace, fchmod): New decls.
948
05e193f1
EZ
9492013-03-05 Eli Zaretskii <eliz@gnu.org>
950
951 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
952 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
953 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
954 <dmantipov@yandex.ru>.
955
3bfc46eb
DA
9562013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
957
958 * composite.c (get_composition_id, fill_gstring_header):
959 Use make_uninit_vector where appropriate.
960 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
961 * xselect.c (clean_local_selection_data): Likewise.
962
84ac6f9d
PE
9632013-03-04 Paul Eggert <eggert@cs.ucla.edu>
964
965 Fix misuse of ImageMagick that caused core dump (Bug#13846).
966 * image.c (imagemagick_load_image): Calculate height and width
967 after flattening the image, not before.
968
42926ec8
DA
9692013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
970
971 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
972 * ftfont.c (ftfont_shape_by_flt): Likewise.
973 * w32uniscribe.c (uniscribe_shape): Likewise.
974
b5029e23
PE
9752013-03-02 Paul Eggert <eggert@cs.ucla.edu>
976
977 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
978 The old approach, which fell back on DIR/.#FILE.0 through
979 DIR/.#FILE.9, had race conditions that could not be easily fixed.
980 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
981 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
982 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
983 because the locking mechanism was never reliable in that case).
984 This patch fixes this and other bugs discovered by a code
985 inspection that was prompted by
986 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
987 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
988 to avoid interoperability problems between the MS-Windows and
989 non-MS-Windows implementations. MS-Windows and non-MS-Windows
990 instances of Emacs now ignore each others' locks.
991 * filelock.c (defined_WINDOWSNT): New constant.
992 (MAKE_LOCK_NAME, fill_in_lock_file_name):
993 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
994 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
995 regular files on MS-Windows hosts.
996 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
997 Use SAFE_ALLOCA to avoid problems with long file names.
998 (MAX_LFINFO): Now a local constant, not a global macro.
999 (IS_LOCK_FILE): Remove.
1000 (lock_file_1): Don't inspect errno if symlink call succeeds;
1001 that's not portable.
1002 (lock_file): Document that this function can return if lock
1003 creation fails.
2db41375 1004 (lock_file): Don't access freed storage.
b5029e23 1005
b270d116
AS
10062013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1007
1008 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1009
81c23309
PE
10102013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 * textprop.c: Use bool for booleans.
1013 (validate_interval_range, Fadd_text_properties)
1014 (Fremove_text_properties): Prefer bool to int when either works.
1015
18f2ac09
EZ
10162013-03-02 Eli Zaretskii <eliz@gnu.org>
1017
27a98a62
SM
1018 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1019 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1020 modify_region, re-do processing starting from the call to
1021 validate_interval_range. (Bug#13743)
1022
929aeac6 10232013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1024
1025 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1026 (Bug#13546).
1027
531e70ec
EZ
10282013-02-27 Eli Zaretskii <eliz@gnu.org>
1029
1030 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1031 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1032 access to the lock file until it is written and closed.
1033 (Bug#13807)
1034
6e65b9cc
PE
10352013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1036
1037 * callint.c (Qcall_interactively):
1038 * macros.c (Qexecute_kbd_macro):
1039 Now static.
1040
3b166f09
BG
10412013-02-26 Bastien Guerry <bzg@gnu.org>
1042
1043 * window.c (Frecenter): Tiny docstring enhancement.
1044
ecc0fdd4
PE
10452013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1046
1047 Minor textprop integer cleanup.
1048 * intervals.h, textprop.c (add_text_properties_from_list):
1049 Return void, not int, since nobody uses the return value.
1050 * textprop.c (validate_plist, add_properties, remove_properties)
1051 (Fadd_text_properties):
1052 Don't assume list length fits in int.
1053 (interval_has_all_properties, interval_has_some_properties)
1054 (interval_has_some_properties_list, add_properties, remove_properties)
1055 (Fadd_text_properties, Fremove_text_properties)
1056 (Fremove_list_of_text_properties, text_property_stickiness):
1057 Use bool for booleans.
1058 (Fadd_text_properties, Fremove_text_properties):
1059 (Fremove_list_of_text_properties):
1060 Reindent do-while as per GNU style.
1061
0248b0d7
EZ
10622013-02-25 Eli Zaretskii <eliz@gnu.org>
1063
343a2aef
EZ
1064 Implement CLASH_DETECTION for MS-Windows.
1065
1066 * filelock.c [WINDOWSNT]: Include w32.h.
1067 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1068 function of that name. Up-case the macro arguments.
1069 (IS_LOCK_FILE): New macro.
1070 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1071 (create_lock_file): New function, with body extracted from
1072 lock_file_1.
1073 [WINDOWSNT]: Implement lock files by writing a regular file with
1074 the lock information as its contents.
1075 (read_lock_data): New function, on Posix platforms just calls
1076 emacs_readlinkat.
1077 [WINDOWSNT]: Read the lock info from the file.
1078 (current_lock_owner): Call read_lock_data instead of calling
1079 emacs_readlinkat directly.
1080 (lock_file) [WINDOWSNT]: Run the file name through
1081 dostounix_filename.
1082
1083 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1084 just check if the process by that PID exists.
1085
1086 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1087 also present, as doing so will fail to error out if the file
1088 already exists.
1089
1090 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1091
0248b0d7
EZ
1092 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1093 (Fremove_list_of_text_properties): Skip all of the intervals in
1094 the region between START and END that already have resp. don't
27a98a62
SM
1095 have the requested properties, not just the first one.
1096 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1097 properties. (Bug#13743)
1098
b5071fc7
SM
10992013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1100
1101 * callint.c (Fcall_interactively): Use the right lexical environment
1102 for `interactive' specs (bug#13811).
1103 * eval.c (Feval): Accept a lexical environment.
1104
1ddc2bd6
PE
11052013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1106
1107 Simplify data_start configuration (Bug#13783).
1108 This is a followon simplification to the fix for Bug#13650.
1109 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1110 (START_FILES): Remove. All uses removed.
1111 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1112 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1113 (buildobj.h): Use it.
1114 ($(ALLOBJS)): Depend on globals.h.
1115 (temacs$(EXEEXT)): Use $(ALLOBJS).
1116 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1117 * deps.mk (vm-limit.o):
1118 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1119 Do not depend on mem-limits.h.
1120 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1121 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1122 [__GNUC__ && !ORDINARY_LINK]: Remove.
1123 * mem-limits.h, pre-crt0.c: Remove.
1124 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1125 * unexcoff.c (etext): New decl.
1126 (make_hdr): Use DATA_START instead of start_of_data.
1127 * vm-limit.c: Move most of mem-limits.h's contents here.
1128 (data_start): New decl. It's OK if this is approximate,
1129 so simplify-away some unnecessary exactness.
1130 (POINTER): Remove; all uses removed.
1131 (data_space_start): Now char *, to avoid casts.
1132 (exceeds_lisp_ptr): New function, replacing the old
1133 EXCEEDS_LISP_PTR macro. All uses changed.
1134 (check_memory_limits): Simplify and remove casts.
1135 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1136 (memory_warnings): Use data_start instead of start_of_data.
1137
51aa2a8b
AS
11382013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1139
1140 * xdisp.c (set_message): Only check for debug-on-message if STRING
1141 is a string. (Bug#13797)
1142
1938d88c
PE
11432013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1144
1145 Fix regression introduced by July 10 filelock.c patch.
1146 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1147 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1148 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1149 and diagnosed by Andreas Schwab in
1150 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1151
fcee5028
PE
11522013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1153
1154 Assume C89 or better.
1155 * ralloc.c (SIZE, POINTER, NIL):
1156 * vm-limit.c (POINTER):
1157 Remove, replacing all uses with C89 equivalents. These old
1158 symbols were present only for porting to pre-C89 platforms.
1159
d78cf5ed
CB
11602013-02-22 Claudio Bley <claudio.bley@gmail.com>
1161
1162 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1163 This avoids warning messages reported as part of Bug#13546.
1164
6bcd97a4
KB
11652013-02-21 Ken Brown <kbrown@cornell.edu>
1166
1167 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1168
b6c2bfff
SM
11692013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1170
e11dacb5
SM
1171 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1172
b6c2bfff
SM
1173 * keyboard.c (Qcommand_execute): New var.
1174 (command_loop_1, read_char): Use it.
1175 (Fcommand_execute): Remove, replace by an Elisp implementation.
1176 (syms_of_keyboard): Adjust accordingly.
1177
d69f1120 11782013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1179
d69f1120
DC
1180 * sheap.c (report_sheap_usage): Use message, not message1, so
1181 that we don't try to create a buffer while we're in the middle
1182 of dumping Emacs. Explain why.
b6c2bfff 1183
2a14a4f1 11842013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1185
2a14a4f1
DA
1186 * search.c (find_newline): Return byte position in bytepos.
1187 Adjust comment.
b6c2bfff
SM
1188 (find_next_newline_no_quit, find_before_next_newline):
1189 Add bytepos argument.
2a14a4f1
DA
1190 * lisp.h (find_newline, find_next_newline_no_quit)
1191 (find_before_next_newline): Adjust prototypes.
1192 * bidi.c (bidi_find_paragraph_start):
1193 * editfns.c (Fconstrain_to_field, Fline_end_position):
1194 * indent.c (compute_motion, vmotion):
1195 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1196 (get_visually_first_element, move_it_vertically_backward):
1197 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1198
872faefb 11992013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1200
1201 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1202 resources were not orderly released.
1203
fd80c659
EZ
12042013-02-17 Eli Zaretskii <eliz@gnu.org>
1205
1206 * xdisp.c (x_draw_vertical_border): For a window that is neither
1207 the leftmost nor the rightmost, redraw both the left and the right
1208 vertical borders. (Bug#13723)
1209
2f73da9c
SM
12102013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1211
1212 * xml.c (init_libxml2_functions):
1213 * sound.c (sound_warning):
1214 * sheap.c (report_sheap_usage):
1215 * process.c (wait_reading_process_output):
1216 * msdos.c (XMenuActivate):
1217 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1218 * keyboard.c (top_level_1):
1219 * editfns.c (Fmessage, Fmessage_box):
1220 * callint.c (Fcall_interactively):
1221 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1222
fd9547e8
JD
12232013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1224
1225 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1226 * frame.c (syms_of_frame): ... to here.
1227
f277993b
EZ
12282013-02-16 Eli Zaretskii <eliz@gnu.org>
1229
c7939585
EZ
1230 * w32.c (sys_chown): Remove unused function.
1231
cd91fb4b
EZ
1232 * w32term.c <input_signal_count>: Declare 'volatile'
1233 unconditionally. (Bug#9066)
1234
f277993b
EZ
1235 * w32.c (set_errno): Reset h_errno and don't set it to any other
1236 value. Set errno instead.
1237 (check_errno): Reset h_errno.
1238 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1239 (sys_gethostname, sys_getservbyname, sys_getpeername)
1240 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1241 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1242 h_errno.
1243 (sys_gethostbyname): Set h_errno only errors detected.
1244
e454145b
PE
12452013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1246
1247 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1248
bcf7fe2a
EZ
12492013-02-15 Eli Zaretskii <eliz@gnu.org>
1250
ef9c57e2
EZ
1251 * keyboard.c (read_char): Fix calculation of auto-save time out
1252 when auto-save-timeout is less than 4. (Bug#13720)
1253
ef862e20 1254 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1255 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1256
bcf7fe2a
EZ
1257 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1258 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1259 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1260 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1261 make sure errno is set to an appropriate value. (Bug#13546)
1262 (socket_to_fd): Add assertion against indexing fd_info[] with a
1263 value that is out of bounds.
1264 (sys_accept): If fd is negative, do not set up the child_process
1265 structure for reading.
1266
0063fdb1
DA
12672013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 * composite.c (fill_gstring_header): Remove useless prototype.
1270 Break long line.
1271 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1272 * print.c (PRINTDECLARE, print_object):
1273 * search.c (compile_pattern, fast_looking_at, search_buffer):
1274 (simple_search, boyer_moore, Freplace_match):
1275 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1276 (get_overlay_arrow_glyph_row, display_mode_element):
1277 (decode_mode_spec_coding, message3):
1278 * xfaces.c (face_at_string_position): Use bool for booleans.
1279 Adjust comments.
1280
648e5523 12812013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1282
35b3a27e
PE
1283 Fix AIX port (Bug#13650).
1284 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1285 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1286 was #undeffed earlier, so it cannot be used as a macro here.
1287 Use the constant and not the macro.
35b3a27e 1288
648e5523 12892013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1290
0e4e7b74
EZ
1291 * w32proc.c (new_child): If no vacant slots are found in
1292 child_procs[], make another pass looking for slots whose process
1293 has exited or died. (Bug#13546)
1294
6e432f0c
EZ
1295 * w32.c (sys_pipe): When failing due to file descriptors above
1296 MAXDESC, set errno to EMFILE.
1297 (_sys_read_ahead): Update cp->status when failing to read serial
1298 communications input, so that the status doesn't stay at
1299 STATUS_READ_IN_PROGRESS. (Bug#13546)
1300
51b3a99c
JD
13012013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1302
1303 * gtkutil.c (tb_size_cb): New function.
1304 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1305
e31560a7
SM
13062013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1307
1308 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1309 an event.
1310
fe336261
SM
13112013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1312
1313 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1314
5a655b9f
DA
13152013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1316
1317 * font.c (font_range): Add pos_byte argument. Adjust comment
1318 and break long line.
1319 * font.h (font_range): Adjust prototype.
1320 * composite.c (autocmp_chars): Pass byte position to font_range.
1321 Break long line. Remove useless prototype and format comment.
1322
1a359750
GM
13232013-02-13 Glenn Morris <rgm@gnu.org>
1324
1325 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1326
01fcc3a5 13272013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1328
f53f992a
PE
1329 Improve AIX port some more (Bug#13650).
1330 With this, it should be as good as it was in 23.3, though it's
1331 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1332 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1333 * unexaix.c (start_of_text): Remove.
1334 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1335 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1336 (orig_load_scnptr, orig_data_scnptr):
1337 Now off_t, not long, since they are file offsets.
1338 (make_hdr): Use _data, not start_of_data ().
1339 This is the key part of the fix.
1340 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1341 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1342
4458c255
PE
1343 * pre-crt0.c (data_start): Initialize to 1.
1344 This ports to compilers that optimize the external declaration
1345 'int x = 0;' as if it were 'int x;' to shrink the executable.
1346
227be86d
PE
1347 Improve AIX port (Bug#13650).
1348 This doesn't fix the bug, but it makes progress: Emacs builds now.
1349 * unexaix.c: Include inttypes.h, stdarg.h.
1350 (report_error, report_error_1): Mark as _Noreturn.
1351 (report_error): Don't report the wrong errno.
1352 (report_error_1): Now varargs. All callers changed.
1353 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1354 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1355 (write_ptr): Use %p to print address rather than %lx and a cast
1356 to unsigned long. Grow buffer a bit, to be safer.
1357
01fcc3a5 13582013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1359
1360 * bidi.c (bidi_resolve_neutral): After finding the next
1361 non-neutral character, accept NEUTRAL_ON type as well, because
1362 directional control characters, such as LRE and RLE, have their
1363 type converted to that by bidi_resolve_weak. This avoids aborts
1364 when LRE/RLE follows a run of neutrals.
1365 (bidi_move_to_visually_next): Assert that return value of
1366 bidi_peek_at_next_level is non-negative. Negative values will
1367 cause an infloop.
1368
83be8524
PE
13692013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1370
1371 Minor getenv-related fixes.
1372 * callproc.c (Fcall_process_region) [!DOS_NT]:
1373 Avoid unnecessary duplicate call to getenv.
1374 * callproc.c (init_callproc):
1375 * dispnew.c (init_display):
1376 * sysdep.c (sys_subshell):
1377 Omit unnecessary cast of getenv or egetenv.
1378
45b2b768
JB
13792013-02-13 Juanma Barranquero <lekktu@gmail.com>
1380
1381 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1382 Update dependencies.
1383
33b49d71
EZ
13842013-02-12 Eli Zaretskii <eliz@gnu.org>
1385
1386 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1387 marker's position.
1388 (display_line): Set w->region_showing to the value of
1389 it->region_beg_charpos, not to -1. This fixes redisplay
1390 optimization when cursor is moved up after M->. (Bug#13623)
1391 (Bug#13626)
c4131562
EZ
1392 (try_scrolling): Scroll text up more if point is too close to ZV
1393 and inside the scroll margin. This makes sure point is moved
1394 outside the scroll margin in these cases.
33b49d71
EZ
1395
1396 * window.h (struct window): region_showing can no longer be
1397 negative.
1398
b09a4810
PE
13992013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1400
a84b7c53
PE
1401 Tune by using memchr and memrchr.
1402 * doc.c (Fsnarf_documentation):
1403 * fileio.c (Fsubstitute_in_file_name):
1404 * search.c (find_newline, scan_newline):
1405 * xdisp.c (pos_visible_p, display_count_lines):
1406 Use memchr and memrchr rather than scanning byte-by-byte.
1407 * search.c (find_newline): Rename from scan_buffer.
1408 Omit first arg TARGET, as it's always '\n'. All callers changed.
1409
b09a4810
PE
1410 Clean up read_key_sequence a tiny bit more.
1411 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1412 (read_key_sequence): Remove unused locals.
1413
99d0d6dc
SM
14142013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1415
1416 Clean up read_key_sequence a bit; reread active keymaps after first event.
1417 * keyboard.c (read_char, read_char_x_menu_prompt)
1418 (read_char_minibuf_menu_prompt):
1419 Replace nmaps+maps with a single `map' arg.
1420 (follow_key): Operate on a single map.
1421 (active_maps): New function.
1422 (test_undefined): Also return true for nil bindings.
1423 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1424 a single (composed) keymap. Remember `first_event' to choose the right
1425 set of active keymaps. Recompute the set of keymaps after receiving
1426 the first event. Remove GOBBLE_FIRST_EVENT.
1427 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1428 * keyboard.h (read_char): Update declaration.
1429 * lread.c (read_filtered_event): Adjust call to read_char.
1430
f5e1b680
EZ
14312013-02-11 Eli Zaretskii <eliz@gnu.org>
1432
99d0d6dc
SM
1433 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1434 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1435 in the window. (Bug#13675)
1436
f74de345
DA
14372013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1438
1439 * marker.c (set_marker_internal): If desired position is passed
1440 as a marker, avoid call to buf_charpos_to_bytepos.
1441 * window.c (Fset_window_point): Omit redundant type checking.
1442 (Fset_window_start): Likewise. Format comment.
1443 (window_scroll_pixel_based): Use set_marker_restricted_both
1444 with character and byte positions obtained from an iterator.
1445 (Fset_window_configuration): Use set_marker_restricted_both.
1446 * xdisp.c (message_dolog): Likewise.
1447
a4ba3963
EZ
14482013-02-10 Eli Zaretskii <eliz@gnu.org>
1449
99d0d6dc
SM
1450 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1451 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1452 too far. This speeds up some redisplay operations. (Bug#13675)
1453
68643cde
DA
14542013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1455
1456 * syntax.c (scan_sexps_forward): Fix byte position calculation
1457 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1458
7ba11bee
PE
14592013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1462 that was not needed.
1463
eff1c190
PE
14642013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1465
1466 Minor hashing refactoring.
1467 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1468 (sxhash_float): Return EMACS_UINT, for consistency with the other
1469 hash functions.
1470 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1471 non-static inline function and therefore can't use static vars.
1472 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1473 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1474 with the other hash functions.
1475
6b48c831
EZ
14762013-02-09 Eli Zaretskii <eliz@gnu.org>
1477
4dde2087
EZ
1478 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1479 XXXXXX part of the temporary file pattern is not downcased even
1480 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1481
8549f9e8
EZ
1482 * xdisp.c (decode_mode_spec): Remove handling of %t.
1483
6b48c831
EZ
1484 * msdos.c (careadlinkatcwd): Remove.
1485
75a65c7e
SM
14862013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1487
1488 * lread.c (skip_dyn_bytes): New function (bug#12598).
1489 (read1): Use it. Use getc instead of READCHAR to read bytes.
1490 (load_each_byte): Remove. Update users.
1491
8ca30920
DA
14922013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1493
1494 * search.c (scan_buffer): Calculate end byte position just once.
1495 (scan_newline): Do not recalculate start_byte.
1496 (search_command): Use eassert.
1497 * syntax.c (struct lisp_parse_state): New member location_byte.
1498 (scan_sexps_forward): Record from_byte and avoid redundant
1499 character to byte position calculation ...
1500 (Fparse_partial_sexp): ... here. Break too long line.
1501
25721f5b
DA
15022013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1503
1504 * lisp.h (make_uninit_vector): New function.
1505 * alloc.c (Fvector, Fmake_byte_code):
1506 * ccl.c (Fregister_ccl_program):
1507 * charset.c (Fdefine_charset_internal, define_charset_internal):
1508 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1509 * composite.c (syms_of_composite):
1510 * font.c (Fquery_font, Ffont_info, syms_of_font):
1511 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1512 * ftfont.c (ftfont_shape_by_flt):
1513 * indent.c (recompute_width_table):
1514 * nsselect.m (clean_local_selection_data):
1515 * syntax.c (init_syntax_once):
1516 * w32unsubscribe.c (uniscribe_shape):
1517 * window.c (Fcurrent_window_configuration):
1518 * xfaces.c (Fx_family_fonts):
1519 * xselect.c (selection_data_to_lisp_data): Use it.
1520
9a9d91d9
DA
15212013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1522
1523 * coding.c (Fdefine_coding_system_internal): Use AREF where
1524 argument is known to be a vector.
1525 * fns.c (Flocale_info): Likewise for ASET.
1526 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1527 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1528
6871e574
JD
15292013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1530
1531 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1532 height.
1533
1534 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1535 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1536 updateCollectionBehaviour.
1537
1538 * nsterm.m (NEW_STYLE_FS): Remove.
1539 (ns_last_use_native_fullscreen): New variable.
1540 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1541 (x_set_window_size): Do not take title bar and tool bar into account
1542 if isFullscreen returns YES.
1543 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1544 (check_native_fs): New function.
1545 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1546 (ns_term_init): Remove NEW_STYLE_FS.
1547 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1548 and tool bar if isFullscreen returns NO.
1549 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1550 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1551 with HAVE_NATIVE_FS.
1552 (window:willUseFullScreenPresentationOptions:): New method.
1553 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1554 Hide toolbar if not enabled (Bug#13444).
1555 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1556 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1557 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1558 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1559 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1560 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1561 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1562 (syms_of_nsterm): Add ns-use-native-fullscreen.
1563
3f011c7f
PE
15642013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1565
1566 * fileio.c (Qchoose_write_coding_system): Now static.
1567
86f7c0fe
EZ
15682013-02-04 Eli Zaretskii <eliz@gnu.org>
1569
1570 * xdisp.c (window_buffer_changed): region_showing can be negative,
1571 which still means region is being displayed.
1572 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
1573 whole window when showing region and the mark has changed.
1574 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
1575 (display_line): If it->region_beg_charpos is non-zero, set the
1576 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1577
1578 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1579 not bitfield of 1 bit.
1580
5257b701
DC
15812013-02-03 Daniel Colascione <dancol@dancol.org>
1582
1583 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1584 daemon mode works on cygw32 when Emacs is installed and not just
1585 during development.
1586
8ea41ea9
PE
15872013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1588
1589 Avoid file time stamp bug on MS-Windows (Bug#13149).
1590 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1591 as FAT32 doesn't update time stamps when truncating them.
1592 Also, check that a file time stamp is not a multiple of 100 ns;
1593 this should catch all instances of the problem on MS-Windows,
1594 as its native file system resolution is 100 ns or worse, and
1595 checking for a non-multiple of 100 ns should impose only a small
1596 overhead on systems with ns resolution.
1597
94fbc901 15982013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 1599
e7ac588e
EZ
1600 Avoid encoding file names on MS-Windows when they need to be run
1601 through dostounix_filename.
1602 * w32.c (normalize_filename): Accept an additional argument
1603 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1604 downcase it even if w32-downcase-file-names is non-nil.
1605 (dostounix_filename): Accept an additional argument MULTIBYTE and
1606 pass it to normalize_filename.
1607 (emacs_root_dir): Adjust.
1608
1609 * msdos.h (dostounix_filename): Adjust prototype.
1610
1611 * w32.h (dostounix_filename): Adjust prototype.
1612
1613 * msdos.c (dostounix_filename): Accept an additional argument and
1614 ignore it.
1615 (init_environment): Adjust callers of dostounix_filename.
1616
1617 * fileio.c (Ffile_name_directory, file_name_as_directory)
1618 (directory_file_name, Fexpand_file_name)
1619 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1620 dostounix_filename.
1621 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1622 non-nil.
1623 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1624 variables, as egetenv is case-insensitive for DOS_NT.
1625
1626 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1627 with an encoded file name.
1628
99d0d6dc
SM
1629 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1630 Adjust calls to dostounix_filename.
e7ac588e
EZ
1631
1632 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1633
1634 * unexw32.c (unexec): Adjust call to dostounix_filename.
1635
1636 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1637
1638 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1639 dostounix_filename.
1640
1641 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1642 dostounix_filename.
1643
e7c3fb06
EZ
1644 * callproc.c (Fcall_process): Make sure program name in PATH and
1645 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1646 is passed to exec/spawnve, which fails unless the file-name
1647 encoding is UTF-8.
1648
18a80473
EZ
1649 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1650 even if w32-quote-process-args is nil.
1651
35e85499
PE
16522013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1653
1654 Fix timestamp bug when write-region appends nothing (Bug#13149).
1655 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1656 the file's time stamp doesn't change if Emacs happens to write nothing
1657 to the file, and on a buggy file system this could cause Emacs to
1658 incorrectly infer that the file system doesn't have the bug.
1659 Avoid this problem by inhibiting the inference in this case.
1660
422ff52b
DA
16612013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1662
1663 * window.h (struct window): Convert base_line_number, base_line_pos
1664 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1665 Convert region_showing member from Lisp_Object to bitfield.
1666 Remove sequence_number member. Adjust comments.
1667 * window.c (sequence_number): Remove.
1668 (make_window): Initialize column_number_displayed.
1669 * print.c (print_object): Follow the printed representation of
1670 frames and print window pointer to distinguish between windows.
1671 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1672 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1673 (wset_column_number_displayed, wset_region_showing): Remove.
1674 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1675 (try_scrolling, try_cursor_movement, redisplay_window)
1676 (try_window_reusing_current_matrix, try_window_id, display_line)
1677 (display_mode_lines, decode_mode_spec): Adjust users.
1678 * .gdbinit (pwinx): Do not print sequence_number.
1679
8654f9d7
PE
16802013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1681
1682 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1683 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1684 * dired.c: Include <fcntl.h>.
1685 (open_directory): New function, which uses open and fdopendir
1686 rather than opendir. DOS_NT platforms still use opendir, though.
1687 (directory_files_internal, file_name_completion): Use it.
1688 (file_attributes): New function, with most of the old Ffile_attributes.
1689 (directory_files_internal, Ffile_attributes): Use it.
1690 (file_attributes, file_name_completion_stat): First arg is now fd,
1691 not dir name. All uses changed. Use fstatat rather than lstat +
1692 stat.
1693 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1694 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1695 (emacs_readlinkat): New function, with much of the old
1696 Ffile_symlink_p, but with an fd argument for speed.
1697 It uses readlinkat rather than careadlinkatcwd, so that it
1698 need not assume the working directory.
1699 (Ffile_symlink_p): Use it.
1700 * filelock.c (current_lock_owner): Use emacs_readlinkat
1701 rather than emacs_readlink.
1702 * lisp.h (emacs_readlinkat): New decl.
1703 (READLINK_BUFSIZE, emacs_readlink): Remove.
1704 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1705 (emacs_norealloc_allocator, emacs_readlink): Remove.
1706 This stuff is moved to fileio.c.
1707 * w32.c (fstatat, readlinkat): New functions.
1708 (careadlinkat): Don't check that fd == AT_FDCWD.
1709 (careadlinkatcwd): Remove; no longer needed.
1710
9dbda100
GM
17112013-01-31 Glenn Morris <rgm@gnu.org>
1712
1713 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
1714 (Fwrite_region): Update for new choose_write_coding_system args.
1715 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
1716 (syms_of_fileio): Add choose-write-coding-system.
1717
3f82a88a 17182013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
1719
1720 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1721 (sys_close): Zero out the flags for the file descriptor before
1722 closing it. (Bug#13546)
1723
806fed21 1724 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
1725 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1726 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
1727 DBCS. (Bug#13553)
1728
6ee4509a
EZ
1729 * w32.c (w32_get_long_filename, init_environment, readlink):
1730 Support file names encoded in DBCS codepages.
26854e9c
EZ
1731 (readlink): Use the current file-name-coding-system, not the ANSI
1732 codepage, to decode and handle targets of symlinks.
6ee4509a 1733
cf01a359
EZ
17342013-01-28 Eli Zaretskii <eliz@gnu.org>
1735
1736 * w32.c (opendir): Now accepts a 'const char *'.
1737
6fd326b7
DA
17382013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1739
1740 Remove obsolete redisplay code. See the discussion at
1741 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1742 * dispnew.c (preemption_period, preemption_next_check): Remove.
1743 (Vredisplay_preemption_period): Likewise.
1744 (update_frame, update_single_window, update_window, update_frame_1):
1745 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1746 used, following the 2012-06-22 change.
1747
d8cd7742
EZ
17482013-01-25 Eli Zaretskii <eliz@gnu.org>
1749
1750 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1751
266fee4f
DA
17522013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1753
1754 * font.c (num_fonts): Remove the leftover from old
1755 debugging code. Adjust comment style here and there.
59e624b3
DA
1756 * insdel.c (insert_1): Remove.
1757 * lisp.h (insert_1): Remove prototype.
1758 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 1759
830e46e6 17602013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
1761
1762 * w32.c (max_filename_mbslen): New function.
1763 (normalize_filename, readdir): Use it to detect locales where ANSI
1764 encoding of file names uses a double-byte character set (DBCS).
1765 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
1766 CharNextExA, instead of incrementing a 'char *' pointer.
1767 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 1768
81abbb95
EZ
1769 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1770 request of memory reservation to 1.7GB. (Bug#13065)
1771
830e46e6 17722013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
1773
1774 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1775 at check_extra_latin label. (Bug#13505)
1776
fd3ceb09
DA
17772013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1778
1779 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1780 Avoid redundant calls to strlen.
1781
edfa7fa0
DA
17822013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Drop async_visible and async_iconified fields of struct frame.
1785 This is possible because async input is gone; for details, see
1786 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1787 * frame.h (struct frame): Remove async_visible and async_iconified
1788 members, convert garbaged to unsigned bitfield. Adjust comments.
1789 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1790 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1791 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1792 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1793 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1794 * w32term.c: Ditto.
1795 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1796 properly. Likewise for obscured.
1797 * xterm.c: Ditto.
266fee4f 1798 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
1799 properly.
1800 * nsterm.m: Ditto.
1801 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1802
5ad86e34
DA
18032013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1804
1805 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1806 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1807
b09cca6a
SM
18082013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1809
1810 * xdisp.c (message2, message2_nolog): Remove functions.
1811 (message3, message3_nolog): Extract nbytes and multibyteness directly
1812 from the string. Change all callers.
1813 (message3_nolog): Don't set message_enable_multibyte since set_message
1814 will reset it anyway.
1815 (message1, message1_nolog): Use message3.
1816 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1817 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1818 (set_message): Drop all but the second arg, which has to be a string.
1819 (set_message_1): Simplify now that we know that a1 is NULL and the
1820 second arg is a string.
1821 * frame.h (struct frame): Remove `message_buf' field.
1822 Use glyphs_initialized_p instead.
1823 (FRAME_MESSAGE_BUF): Remove macro.
1824 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1825 * lisp.h (message2, message2_nolog): Remove declarations.
1826 (message3, message3_nolog): Update declarations.
1827 * keyboard.c (read_char_minibuf_menu_text)
1828 (read_char_minibuf_menu_width): Remove vars.
1829 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1830 to correctly handle multibyte strings.
1831 * frame.c (delete_frame): Don't free message_buf any more.
1832 * editfns.c (message_text, message_length): Remove vars.
1833 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1834 * fileio.c (auto_save_error): Use message3 instead of message2.
1835 * dispnew.c (adjust_frame_message_buffer): Remove function.
1836
54ab1c5a
EZ
18372013-01-23 Eli Zaretskii <eliz@gnu.org>
1838
1839 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1840 real estate used for the tool bar and the menu bar.
1841
6c27465b
DA
18422013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1843
1844 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1845 hidden buffer is prepared to modification (Bug#13164).
1846
9d93ce29
DA
18472013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1848
1849 * window.h (struct window): Change window_end_valid member from
1850 Lisp_Object to a bitfield. Adjust comments.
1851 (wset_window_end_valid): Remove.
1852 * window.c (adjust_window_count): Clear window_end_valid.
1853 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1854 (Fwindow_line_height, set_window_buffer, Frecenter)
1855 (Fsplit_window_internal, Fdelete_other_windows_internal)
1856 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1857 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1858 * xdisp.c (check_window_end, reconsider_clip_changes)
1859 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1860 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1861 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1862
1dcb8ea2
DA
18632013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1864
1865 * xdisp.c (mark_window_display_accurate): Simplify the loop
1866 assuming that the only one of vchild, hchild or buffer window
1867 slots is non-nil. Call mark_window_display_accurate_1 for
1868 the leaf windows only.
1869 (mark_window_display_accurate_1): Always assume leaf window.
1870 Adjust comment.
1871
b41b8a7e
PE
18722013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1873
593a5f2e
PE
1874 * emacs.c (Qkill_emacs_hook): Now static.
1875
b41b8a7e
PE
1876 * fileio.c (Finsert_file_contents): Simplify.
1877 Remove unnecessary assignments and tests.
1878
84e5ed96
EZ
18792013-01-21 Eli Zaretskii <eliz@gnu.org>
1880
1881 * w32.c (acl_set_file): Don't test for errors unless
1882 set_file_security returns FALSE. Avoids spurious errors when
1883 saving files.
1884
2ef88fd4
DA
18852013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1886
1887 * fileio.c (Finsert_file_contents): Revert code introduced at
1888 2013-01-18 in favor of the simpler and generally better fix.
1889 Save stack space by removing 'buffer' and reusing 'read_buf'
1890 where appropriate.
1891
d7a0a7c9
PE
18922013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1893
1894 * lisp.h (eabs): Define unconditionally (Bug#13419).
1895 The old "#if !defined (eabs)" was an unnecessary revenant of back
1896 when this macro was called "abs". Document 'eabs' better.
1897
795e7a5b 18982013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
1899
1900 * fns.c (Frandom): Doc fix.
1901
59ac2d13
EZ
19022013-01-19 Eli Zaretskii <eliz@gnu.org>
1903
1904 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1905 segfault when there are lots of overlays.
1906
1907 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
1908 when there are lots of overlays.
1909 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
1910 for the details and a way to reproduce.
1911
b3fbb395
PE
19122013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1913
3a955a1f
PE
1914 * fileio.c: Use O_APPEND to append.
1915 This corresponds better to the natural interpretation of "append",
1916 and avoids the need to open the output file twice, or to invoke
1917 lseek when APPEND is neither nil nor a number.
1918 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1919 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1920 file possibly twice, and lseeking to its end; this avoids the
1921 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1922 at the same time: the combination is never needed and apparently
1923 it doesn't work with DOS_NT.
1924
21cd50b8
PE
1925 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1926 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1927
b3fbb395
PE
1928 Allow floating-point file offsets.
1929 Problem reported by Vitalie Spinu in
1930 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1931 * fileio.c (emacs_lseek): Remove.
1932 (file_offset): New function.
1933 (Finsert_file_contents, Fwrite_region): Use it.
1934
73c14218
CY
19352013-01-19 Chong Yidong <cyd@gnu.org>
1936
1937 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1938 aborting on Fsignal (Bug#13289).
1939
6a9465f3
EZ
19402013-01-19 Eli Zaretskii <eliz@gnu.org>
1941
1942 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1943 set_file_security as failure due to insufficient privileges.
1944 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1945 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1946
fa705c99
PE
19472013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1948
9fe43ff6
PE
1949 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1950 The bug was observed on Ubuntu operating inside a virtual machine,
1951 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1952 The workaround introduces a race condition on non-buggy hosts,
1953 but it's an unlikely race and anyway there's a nearly identical
1954 nearby race that can't be fixed.
1955 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1956 New static vars.
1957 (Fwrite_region): Test for file system time stamp bug.
1958 (init_fileio): New function.
1959 * lisp.h (init_fileio): Declare it.
1960 * emacs.c (main): Call it.
1961
fa705c99
PE
1962 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1963 and make it more consistent with other stat-failure diagnostics.
1964
e07469fa
DA
19652013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1966
99d0d6dc
SM
1967 Fix crash when inserting data from non-regular files.
1968 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1969 for the error description produced by valgrind.
1970 * fileio.c (read_non_regular): Rename to read_contents.
1971 Free Lisp_Save_Value object used to pass parameters.
1972 (read_non_regular_quit): Rename to read_contents_quit.
1973 (Finsert_file_contents): Redesign internal file reading loop to adjust
1974 gap and end positions after each read and so help make_gap to work
1975 properly. Do not signal an I/O error too early and so do not leave
1976 not yet decoded characters in a buffer, which was the reason of
1977 redisplay crash. Use list2 to build return value. Adjust comments.
1978
67722112
PE
19792013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 Close a race when statting and reading files (Bug#13149).
1982 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1983 This avoids a race if the file is renamed between stat and open.
1984 This race is not the problem originally noted in Bug#13149;
1985 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1986
468afbac
DA
19872013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1988
1989 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1990 objects, related functions and macros.
1991 (make_save_value): Adjust prototype.
1992 (make_save_pointer): New prototype.
1993 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1994 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1995 * alloc.c (format_save_value): Rename to make_save_value.
1996 (make_save_pointer): New function.
1997 (record_xmalloc): Use make_save_pointer.
1998 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1999 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2000 Change users of make_save_value to make_save_pointer.
2001 Likewise for format_save_value and make_save_value.
2002
0e70695a
DA
20032013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2004
2005 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2006 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2007 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2008 debugging stubs.
2009
963ea40f
PE
20102013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 * alloc.c (free_save_value): Now static.
2013
3346c1d0
DA
20142013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2015
2016 * keymap.c (map_keymap_internal): Use format_save_value.
2017 (map_keymap_char_table_item): Adjust accordingly.
2018 * fileio.c (non_regular_fd, non_regular_inserted)
2019 (non_regular_nbytes): Remove.
99d0d6dc
SM
2020 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2021 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2022 (read_non_regular): Use XSAVE_ macros to extract parameters.
2023 Adjust comment.
2024 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2025 format_save_value.
2026 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2027
2b30549c
DA
20282013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2029
2030 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2031 extraction from any Lisp_Save_Value slot. Add type checking.
2032 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2033 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2034 * xselect.c: All users changed.
2035
1b971ac1
DA
20362013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2037
2038 Some convenient bits to deal with Lisp_Save_Values.
2039 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2040 (allocate_misc): Remove prototype.
2041 (format_save_value): New prototype.
2042 * alloc.c (allocate_misc): Revert back to static.
2043 (format_save_value): New function to build Lisp_Save_Value
2044 object with the specified internal structure.
2045 (make_save_value): Reimplement using format_save_value.
2046 * editfns.c (save_excursion_save): Use format_save_value.
2047 (save_excursion_restore): Use XSAVE_OBJECT.
2048
c50cf2ea
PE
20492013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 Avoid needless casts with XSAVE_POINTER.
2052 * alloc.c (mark_object) [GC_MARK_STACK]:
2053 * dired.c (directory_files_internal_unwind):
2054 * fileio.c (do_auto_save_unwind):
2055 * gtkutil.c (pop_down_dialog):
2056 * keymap.c (map_keymap_char_table_item):
2057 * lread.c (load_unwind):
2058 * nsmenu.m (pop_down_menu):
2059 * print.c (print_object) [GC_MARK_STACK]:
2060 * xfns.c (clean_up_file_dialog):
2061 * xmenu.c (cleanup_widget_value_tree):
2062 Omit casts between XSAVE_POINTER and a pointer type.
2063
9d5a1260
DA
20642013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2065
2066 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2067 * eval.c (eval_sub): Protect `form' from being GCed before its
2068 car and cdr becomes protected with the backtrace entry.
2069
73ebd38f
DA
20702013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2071
2072 Make Lisp_Save_Value more versatile storage for up to four objects.
2073 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2074 (struct Lisp_Save_Value): New layout. Adjust comments.
2075 (XSAVE_POINTER): New macro.
2076 (XSAVE_INTEGER): Likewise.
2077 (allocate_misc): Add prototype.
2078 (free_misc): Likewise.
2079 * alloc.c (allocate_misc): Now global.
2080 (free_misc): Likewise. Adjust comment.
2081 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2082 (free_save_value): Likewise.
2083 (mark_object): Likewise.
2084 * editfns.c (save_excursion_save): Pack everything within
2085 Lisp_Save_Value and so avoid xmalloc.
2086 (save_excursion_restore): Adjust to match new layout. Use free_misc
2087 because we do not allocate extra memory any more. Add eassert.
2088 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2089 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2090 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2091 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2092 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2093
b826986f
JD
20942013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2095
2096 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2097 (nsfont_draw): Remove disabling of LCD smoothing.
2098 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2099 Bug#11484 with LCD smoothing on.
b826986f 2100
c0511b57 21012013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2102
b6f960a0
PE
2103 Fix SIGDANGER handlers, for AIX (Bug#13408).
2104 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2105 Move handlers here from emacs.c; they were out of place.
2106
616763d5
JD
21072013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2108
2109 * xterm.c (syms_of_xterm): Adjust documentation for
2110 scroll-bar-adjust-thumb-portion.
2111
0b59090b 21122012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2113
2114 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2115 determine whether scroll bar thumb size should be adjusted or
2116 not. Use variable for MOTIF.
2117
2118 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2119 GTK.
2120
7bc916b4
JD
21212013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2122
eac4d08f
JD
2123 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2124 event is generated.
2125 (doCommandBySelector:): Set processingCompose to NO.
2126
7bc916b4
JD
2127 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2128 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2129 (nsfont_list_family): Add block/unblock_input calls.
2130 (nsfont_open): Move block_input earlier. Add unblock_input before early
2131 return.
2132 (nsfont_draw): Add block/unblock_input calls.
2133
bdc9b756
PE
21342013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2135
2136 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2137 for old_charpos and old_bytepos.
2138
ee56a6dc
PE
21392013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2140
2141 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2142 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2143 Clear tzvalbuf_in_environ if this workaround is in effect.
2144 Problem and fix reported by Kazuhiro Ito.
2145
9fc9a531
AH
21462013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2147
99d0d6dc
SM
2148 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2149 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2150
2151 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2152 doc string cross-reference(s).
2153
2154 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2155 string cross-reference(s).
2156
6020559a
DA
21572013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2158
2159 Avoid unnecessary byte position calculation for the gap movement.
2160 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2161 anyway, all of them should use move_gap_both instead.
2162 * lisp.h (move_gap): Remove prototype.
2163 * insdel.c (move_gap): Remove.
2164 (move_gap_both): Add eassert.
2165 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2166 * xml.c (parse_region): Likewise.
2167
b8956427
PE
21682013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2169
2170 emacsclient -t should not suspend Emacs server (Bug#13387)
2171 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2172 New functions.
2173 * term.c (init_tty): Use them instead of rolling our own code.
2174 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2175 switches from 'signal' to 'pthread_sigmask', which is safer in
2176 multithreaded applications.
2177 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2178 which has already arranged for that.
2179 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2180 This is the main part of the bug fix.
2181
0b59090b 21822013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2183
2184 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2185 x_last_font_name (Bug#13403).
2186
58cc0a01
DA
21872013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2188
2189 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2190 the type of per-buffer values where appropriate.
2191 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2192 predicate, which is how it's really used now. Adjust comment.
2193 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2194 * buffer.c (buffer_slot_type_mismatch): Remove.
2195 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2196 predicate. Adjust comment.
2197 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2198 fill-column, left-margin, tab-width, buffer-saved-size,
2199 left-margin-width, right-margin-width, left-fringe-width,
2200 right-fringe-width, scroll-bar-width and buffer-display-count.
2201 Use Qstringp for default-directory, buffer-file-name,
2202 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2203 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2204 line-spacing.
2205 * data.c (store_symval_forwarding): Adjust to call the predicate.
2206
5104861e
JB
22072013-01-09 Juanma Barranquero <lekktu@gmail.com>
2208
2209 * w32.c (get_name_and_id, acl_set_file):
2210 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2211
eefd7278
DA
22122013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2213
2214 * lisp.h (make_gap_1): New prototype.
2215 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2216 gap size values.
2217 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2218 naming convention.
2219 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2220 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2221 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2222 (make_gap_1): New function to adjust the gap of any buffer.
2223 * coding.c (coding_alloc_by_making_gap): Use it.
2224 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2225 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2226
073ca75b
JL
22272013-01-08 Juri Linkov <juri@jurta.org>
2228
2229 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2230 of (supports :underline (:style wave)). (Bug#13000)
2231
3bace969
AH
22322013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2233
2234 * undo.c (Fprimitive_undo): Move to simple.el.
2235 (syms_of_undo): Remove declarations for Sprimitive_undo.
2236
63a63bd4
SM
22372013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2238
2239 * keyboard.c (echo_add_key): Rename from echo_add_char.
2240
56ed110a
CY
22412013-01-06 Chong Yidong <cyd@gnu.org>
2242
2243 * keyboard.c (echo_add_char): New function, factored out from
2244 echo_char. Don't add a space if the previous echo string was
2245 empty (Bug#13255).
2246 (echo_char): Use it.
2247 (read_key_sequence): When echoing mock input, ensure that the
2248 trailing dash is properly added.
2249
b630991b
EZ
22502013-01-05 Eli Zaretskii <eliz@gnu.org>
2251
2252 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2253 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2254 digits for buffer positions, before misalignment starts.
2255 Display "0" for integer "object" field.
b630991b
EZ
2256 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2257 Display the newline glyph more unambiguously.
2258
f032a318
YM
22592013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2260
2261 * nsterm.m (ns_draw_underwave):
2262 * w32term.c (w32_draw_underwave):
2263 * xterm.c (x_draw_underwave): Make underwave look more triangular
2264 and also degrade gracefully for small fonts. (Bug#13000)
2265
4240dd3c
YM
2266 * nsterm.m (ns_draw_text_decoration):
2267 * w32term.c (x_draw_glyph_string):
2268 * xterm.c (x_draw_glyph_string): Don't use previous underline
2269 thickness and position if previous underline type is underwave.
2270
553081a5
SM
22712013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2272
2273 * fileio.c (Ffile_acl): Undocument return format.
2274
9539d465 22752013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2276
2277 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2278
71376d4b
PE
22792013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2280
2281 Simplify via eabs.
2282 * dired.c (file_name_completion):
2283 * doc.c (get_doc_string):
2284 * floatfns.c (round2):
2285 * font.c (font_score, font_delete_unmatched):
2286 * fringe.c (compute_fringe_widths):
2287 * lread.c (read_list):
2288 * minibuf.c (Ftry_completion):
2289 * term.c (tty_ins_del_lines):
2290 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2291 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2292
a7f11948
EZ
22932012-12-31 Eli Zaretskii <eliz@gnu.org>
2294
2295 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2296 correctly.
2297 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2298 for the bug this caused.
2299
84cc1ab6
PE
23002012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2301
2302 * coding.c (Qmac): Now static.
2303
5a1d858b
JD
23042012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2305
2306 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2307 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2308 handlebox_widget. Set toolbar_in_hbox to false/true, set
2309 toolbar_is_packed to true.
2310 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2311 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2312 Show all on TOOLBAR_TOP_WIDGET.
2313 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2314 by TOOLBAR_TOP_WIDGET.
2315 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2316 Check toolbar_is_packed.
8b745d92
JD
2317 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2318 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2319 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2320 false.
2321 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2322 (xg_update_menubar): Update title only if
2323 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2324 (xg_update_submenu): Skip tearoff only if
2325 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2326 (xg_initialize): Initialize xg_detached_menus only if
2327 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2328
2329 * xterm.h (struct x_output): Surround handlebox_widget with
2330 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2331 toolbar_in_hbox is bool.
2332
d5e5e7b4 23332012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2334
2335 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2336 (LIBS_GNUSTEP): Define.
2337 (LIBES): Add $(LIBS_GNUSTEP).
2338 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2339
d5e5e7b4 23402012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2341
2342 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2343 continuation glyph on a TTY with an indication of an empty line.
2344 (Bug#13277)
2345
e7ae8039
EZ
23462012-12-29 Eli Zaretskii <eliz@gnu.org>
2347
ccad023b
EZ
2348 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2349 file's SELinux context or ACLs successfully set, nil otherwise.
2350 (Bug#13298)
8d23a331 2351 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2352
e7ae8039
EZ
2353 * w32proc.c (reader_thread): Avoid passing NULL handles to
2354 SetEvent and WaitForSingleObject.
2355
7456e13f
PE
23562012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2357
2358 Port EXTERNALLY_VISIBLE to Clang 3.2.
2359 * conf_post.h (__has_attribute): New macro.
2360 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2361
1ab0c851
GM
23622012-12-27 Glenn Morris <rgm@gnu.org>
2363
2364 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2365 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2366
82e2a1f0 23672012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2368
63a63bd4
SM
2369 * fileio.c (file_name_as_directory, directory_file_name):
2370 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2371 came from a multibyte or a unibyte Lisp string; all callers
2372 adjusted. Don't assume the input string is always multibyte.
2373 (Bug#13262)
2374 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2375 don't ENCODE_FILE them, and return a unibyte string if the input
2376 was unibyte.
2377 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2378 don't assume the input strings will always be multibyte. If the
2379 input strings are multibyte, decode strings obtained from C
2380 library functions.
2381
8847a0de
DA
23822012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2383
2384 * lisp.h (toplevel): Add two notices to the comment about
2385 defining a new Lisp data type.
6cda572a
DA
2386 * print.c (print_object): If Lisp_Save_Value object's pointer
2387 is the address of a memory area containing Lisp_Objects, try
2388 to print them.
2389 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2390
4b298d5a
DA
23912012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2392
2393 * keyboard.c (record_asynch_buffer_change): Initialize an event
2394 only if it's really needed.
2395 * frame.h (enum output_method): Remove output_mac member since
2396 it's a leftover from the deleted code.
2397 * frame.c (Fframep): Adjust user here ...
2398 * terminal.c (Fterminal_live_p): ... and here.
2399 * coding.c (Qmac): Now here because it's only used to denote
2400 end-of-line encoding type.
2401 (syms_of_coding): DEFSYM it.
2402 * frame.h (Qmac): Remove duplicated declaration.
2403
12384b01
PE
24042012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2405
2406 * window.c (select_window_1): Now static, since it's used only here.
2407
f1665bdc
EZ
24082012-12-25 Eli Zaretskii <eliz@gnu.org>
2409
2410 * window.c (window_body_cols): Subtract display margins from the
2411 window body width on TTYs as well. See
2412 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2413 for the original report.
2414
9a0d4f34
DA
24152012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2416
2417 * xdisp.c (redisplay_window): Remove inner local variable
2418 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2419 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2420 set but never used.
2421 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2422 (xg_create_tool_bar): Adjust users.
9a0d4f34 2423
f9e7c67e
DA
24242012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2425
2426 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2427 * buffer.c (Fget_buffer_create): Use it to set compact field of
2428 struct buffer_text to avoid accessing an uninitialized value
2429 when compact_buffer is called for the first time.
2430 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2431 (Fset_buffer_modified_p): Use buffer_window_count to check
2432 whether the buffer is displayed in some window.
2433 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2434
299614f3
EZ
24352012-12-23 Eli Zaretskii <eliz@gnu.org>
2436
40ff07a5
EZ
2437 * w32.c (acl_set_file): If setting the file security descriptor
2438 fails, and the new DACL is identical to the existing one, silently
2439 return success. This fixes problems for users backing up their
2440 own files without having the necessary privileges for setting
2441 security descriptors.
2442
299614f3
EZ
2443 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2444 values.
2445 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2446 after WaitForSingleObject returns normally. This expedites reader
2447 thread shutdown when delete_child triggers it.
2448 (reap_subprocess): More accurate commentary for why we call
2449 delete_child only when cp->fd is negative.
2450
2451 * w32.c (sys_close): Do not call delete_child on a subprocess
2452 whose handle is not yet closed. Instead, set its file descriptor
2453 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2454 delete_child on that subprocess when its SIGCHLD arrives.
2455 This avoids closing handles used for communications between sys_select
299614f3
EZ
2456 and reader_thread, which doesn't give sys_select a chance to
2457 notice that the process exited and invoke the SIGCHLD handler for
2458 it.
2459
cf162aee
JD
24602012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2461
2462 * nsfns.m (Fns_do_applescript): Run event loop until script has
2463 been executed (Bug#12969).
2464 (ns_run_ascript): Chech as_script for nil, set to nil after
2465 executing script.
2466
94900bfe
MR
24672012-12-22 Martin Rudalics <rudalics@gmx.at>
2468
2469 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2470
b2faf49c
EZ
24712012-12-22 Eli Zaretskii <eliz@gnu.org>
2472
2473 * w32term.c (w32fullscreen_hook): New function.
2474 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2475
7efa3fb3
EZ
24762012-12-21 Eli Zaretskii <eliz@gnu.org>
2477
bb085aed
EZ
2478 * fileio.c (Finsert_file_contents): Doc fix.
2479
7efa3fb3
EZ
2480 * w32proc.c (new_child, delete_child, find_child_pid): For a
2481 subprocess, consider its slot being in use as long as its process
2482 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2483 slot when a new process is started immediately after killing
2484 another one, without waiting enough time for the first process to
2485 be reaped and resources allocated for it be orderly freed.
2486 (Bug#13086)
2487 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2488
c1f02afa
CY
24892012-12-21 Chong Yidong <cyd@gnu.org>
2490
2491 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2492
5bec25eb
CY
2493 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2494
a4b0cca1 24952012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2496
2497 * w32.c (get_name_and_id): Always pass NULL as the first argument
2498 of lookup_account_sid. Avoids crashes with UNC file names that
2499 refer to DFS domains, not to specific machine names. (Bug#12621)
2500 Remove now unused argument FNAME; all callers changed.
2501 (get_file_owner_and_group): Remove now unused argument FNAME; all
2502 callers changed.
2503
34b4b7eb
CY
25042012-12-21 Chong Yidong <cyd@gnu.org>
2505
2506 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2507 error for invalid chars, don't check for a nil return value.
2508
13002885
DA
25092012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2510
2511 Avoid calls to CHAR_TO_BYTE if byte position is known.
2512 * editfns.c (make_buffer_string_both): Use move_gap_both.
2513 (Fbuffer_string): Use make_buffer_string_both.
2514 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2515 Adjust comment.
2516 (buf_bytepos_to_charpos): Likewise.
2517 (charpos_to_bytepos): Remove.
2518 * fileio.c (Finsert_file_contents): Use move_gap_both.
2519 * search.c (Freplace_match): Likewise.
9a0d4f34 2520 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2521 names for byte positions.
2522 * lisp.h (charpos_to_bytepos): Remove prototype.
2523 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2524 * insdel.c (move_gap): Likewise.
2525
99e9311c
PE
25262012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2527
2528 * xdisp.c (redisplay_internal): Remove now-unused local.
2529
e02230bf
SM
25302012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2531
2532 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2533 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2534 proper value of frame-local variables (bug#13225).
e02230bf 2535
1687fb14
DA
25362012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2537
2538 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2539 Rename 4th argument since it may be buffer or string. Adjust comment.
2540 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2541
a2f07cd2
DA
25422012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 * coding.c (Fdetect_coding_region): Do not check start and end with
2545 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2546 (code_convert_region): Likewise.
2547
474d441e
EZ
25482012-12-18 Eli Zaretskii <eliz@gnu.org>
2549
2550 * w32.c (acl_get_file, acl_set_file): Run the file name through
2551 map_w32_filename, and resolve any symlinks in the file name, like
2552 Posix platforms do.
2553 (acl_set_file): Call revert_to_self, if any privileges were
2554 enabled.
2555
8725c076
JB
25562012-12-17 Juanma Barranquero <lekktu@gmail.com>
2557
2558 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2559 ($(BLD)/w32.$(O)): Update dependencies.
2560
1e101a4b
SM
25612012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2562
2563 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2564 propagate redisplay's scrolling (if any) to the right window.
2565 (redisplay_internal): Use ensure_selected_frame.
2566 (display_mode_lines): Complete last fix.
2567 * window.c (select_window_1): New func, extracted from select_window.
2568 (select_window): Use it.
2569 * window.h (select_window_1): Declare.
2570
66447e07
EZ
25712012-12-17 Eli Zaretskii <eliz@gnu.org>
2572
2573 Emulate Posix ACL APIs on MS-Windows.
2574 * w32.c: Include sddl.h and sys/acl.h.
2575 (SDDL_REVISION_1): Define if not already defined.
2576 (g_b_init_get_security_descriptor_dacl)
2577 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2578 (g_b_init_is_valid_security_descriptor)
2579 (g_b_init_set_file_security): New static flags.
2580 (globals_of_w32): Initialize them to zero.
2581 (SetFileSecurity_Name): New string constant.
2582 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2583 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2584 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2585 (IsValidSecurityDescriptor_Proc): New typedefs.
2586 (get_file_security, get_security_descriptor_owner)
2587 (get_security_descriptor_group): Set errno to ENOTSUP.
2588 (set_file_security, get_security_descriptor_dacl)
2589 (is_valid_security_descriptor, convert_sd_to_sddl)
2590 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2591 (acl_free, acl_get_file, acl_set_file): New functions.
2592
2593 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2594
207a7ef0
PE
25952012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2596
2597 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2598 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2599 for some of that bug's symptoms can now cause Emacs to abort.
2600 Remove the workaround.
2601 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2602 The bug that caused SIGCHLD to get lost has been fixed, and the
2603 workaround for it can now cause Emacs to abort.
2604
17fdfc15
PE
26052012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2606
2607 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2608 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2609 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2610
7c3d167f
RF
26112012-12-16 Romain Francoise <romain@orebokech.com>
2612
2613 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2614 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 2615 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
2616 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2617
2618 * Makefile.in (LIBACL_LIBS): New macro.
2619 (LIBES): Use it.
2620
7d80ea23
PE
26212012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2622
2623 * fileio.c (internal_delete_file): Use bool for boolean.
2624
b0728617
EZ
26252012-12-15 Eli Zaretskii <eliz@gnu.org>
2626
2627 Fix bug #13079 on MS-Windows with temp files not being deleted.
2628 * w32.h (_child_process): New members input_file and
2629 pending_deletion.
2630 (register_child): First argument is now pid_t.
2631 (record_infile, record_pending_deletion): New prototypes.
2632
2633 * w32proc.c (new_child): Initialize input_file and
2634 pending_deletion members of the child.
2635 (delete_child): Delete the child's temporary input file, if any,
2636 that is pending deletion.
2637 (register_child): First argument is now pid_t.
2638 (record_infile, record_pending_deletion): New functions.
2639 (reap_subprocess): Fix a typo in DebPrint string.
2640 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2641
2642 * fileio.c (internal_delete_file): Return an int again: non-zero
2643 if delete-file succeeds, zero otherwise.
2644
2645 * lisp.h (internal_delete_file): Adjust prototype.
2646
2647 * callproc.c (Fcall_process): Don't overwrite infile with result
2648 of DECODE_FILE.
2649 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2650 asynchronous subprocess, record the name of the input file name,
2651 if any.
2652 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2653 delete the file, record it as pending deletion when the subprocess
2654 exits.
2655
7e90af26
EZ
26562012-12-14 Eli Zaretskii <eliz@gnu.org>
2657
2658 * editfns.c [HAVE_PWD_H]: Include grp.h.
2659
2660 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2661
97976f9f
PE
26622012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2663
2664 Fix permissions bugs with setgid directories etc. (Bug#13125)
2665 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2666 to mark it as a placeholder. The old value was often wrong.
2667 The only user of this attribute has been changed to use
2668 file-ownership-preserved-p instead, with its new group arg.
2669 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2670
26ec1f49
SM
26712012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2672
ad966fe7
SM
2673 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2674 Keep selected_window and selected_frame in sync.
26ec1f49 2675
5c207910
EZ
26762012-12-14 Eli Zaretskii <eliz@gnu.org>
2677
2678 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2679 try to get accurate owner and group information from NT file
2680 security APIs. This is to make most callers of 'stat' and
2681 'lstat', which don't need that information, much faster.
2682
26ec1f49
SM
2683 * dired.c (Ffile_attributes) [WINDOWSNT]:
2684 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
2685 owner and group information from 'lstat'.
2686
893f52d8
PE
26872012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2688
4c95c9a5
PE
2689 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2690 as that confuses set-auto-coding, so insist on the head-read
2691 returning the full 1024 bytes. Let lseek compute the tail offset;
2692 less work for us. Do not ignore I/O errors when reading the tail.
2693
893f52d8
PE
2694 * xdisp.c: Minor style fixes.
2695 (init_iterator): Hoist assignment out of if-expression.
2696 (markpos_of_region): Callers now test for sign, not for -1.
2697
40d1e434
DA
26982012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2699
2700 Minor redisplay optimization when the region length is zero.
2701 * xdisp.c (markpos_of_region): New function.
2702 (init_iterator): Do not highlight the region of zero length.
2703 (redisplay_window): Check whether the region is of non-zero length.
2704 (try_cursor_movement): Allow if the region length is zero.
2705 (try_window_reusing_current_matrix, try_window_id): Likewise.
2706
727f9739 27072012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
2708
2709 * search.c (search_buffer): Check the inverse translations of each
2710 character in pattern when the buffer being searched is unibyte.
2711 (Bug#13084)
2712
727f9739 27132012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
2714
2715 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2716 files, fixing a regression from 24.2.
645c6a30 2717 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 2718
d20704ef
PE
27192012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2720
2721 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2722 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2723 Remove unnecessary S_ISLNK test, as (contra the comments) this
2724 function can't copy symlinks. Improve quality of error message
2725 when attempting to copy files that are neither regular files nor
2726 directories.
2727
2dd61a9b
DA
27282012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2729
2730 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2731 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2732 * window.c (Frecenter):
2733 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2734 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2735
cc98b684
DC
27362012-12-12 Daniel Colascione <dancol@dancol.org>
2737
1e101a4b 2738 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
2739 the dumped Emacs is not a sparse file, greatly improving Cygwin
2740 "make bootstrap" performance.
2741
38e791fd
MA
27422012-12-11 Michael Albinus <michael.albinus@gmx.de>
2743
2744 * inotify.c (inotify_callback): Generate an Emacs event for every
2745 incoming inotify event.
2746
f9d1448f
EZ
27472012-12-11 Eli Zaretskii <eliz@gnu.org>
2748
2749 * xdisp.c (handle_face_prop): Fix logic of computing
2750 it->start_of_box_run_p.
2751 (append_space_for_newline): If the glyph row is R2L, reset the
2752 iterator's end_of_box_run_p flag before prepending the space glyph.
2753 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2754 iterator's start_of_box_run_p flag before prepending the stretch.
2755 (append_glyph, produce_image_glyph, append_composite_glyph)
2756 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2757 left_box_line_p and right_box_line_p flags of the glyph for R2L
2758 glyph rows. (Bug#13011)
2759
c6afe371
DA
27602012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2761
2762 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2763 if changed buffer is not shown in a window.
2764 * insdel.c (prepare_to_modify_buffer): Likewise.
2765 * window.c (replace_buffer_in_windows_safely): Do nothing
2766 if buffer is not shown in a window.
2767 (Fforce_window_update): Likewise if string or buffer argument
2768 is passed.
2769
1b47babd
EZ
27702012-12-11 Eli Zaretskii <eliz@gnu.org>
2771
2772 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2773 encoded_file_name, which is what it is.
2774
4c1acb95
DA
27752012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2776
2777 Consistently use marker_position and marker_byte_position.
2778 * fringe.c (Ffringe_bitmaps_at_pos):
2779 * indent.c (Fvertical_motion):
2780 * insdel.c (prepare_to_modify_buffer):
2781 * keyboard.c (make_lispy_position):
2782 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2783 (window_scroll_pixel_based, displayed_window_lines)
2784 (Fset_window_configuration):
2785 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2786 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2787 Replace direct access to marker fields with calls
2788 to marker_position and/or marker_byte_position.
2789
0eeb69fe
JB
27902012-12-11 Juanma Barranquero <lekktu@gmail.com>
2791
2792 * makefile.w32-in (SIG2STR_H): New macro.
2793 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2794 ($(BLD)/w32notify.$(O)): Update dependencies.
2795
1cf1bbd5
DC
27962012-12-10 Daniel Colascione <dancol@dancol.org>
2797
8db4b52f
DC
2798 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2799 Windows file notification functionality unless WINDOWSNT.
2800
1cf1bbd5
DC
2801 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2802 declarations.
2803
2804 * w32fns.c (cache_system_info): Initialize the global hinst
2805 variable here so various initialization calls DTRT.
2806
1e101a4b 2807 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
2808 (hinst): Remove unneeded extern declaration.
2809 (_start): Remove initialization of above variables; remove
2810 initialization of hinst, as cache_system_info now does that.
2811
2812 * emacs.c (main): Call cache_system_info early in startup; we
2813 previously weren't calling it in Cygwin builds.
2814
26ec1f49
SM
2815 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2816 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
2817 and link it to Emacs.
2818
98a07056
DA
28192012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2820
2821 Per-buffer window counters.
2822 * buffer.h (struct buffer): New member window_count.
2823 (buffer_window_count): New function.
2824 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2825 Initialize window_count.
2826 (Fkill_buffer): Verify window_count for the buffer being killed.
2827 (modify_overlay): Do not force redisplay if buffer is not shown
2828 in any window.
2829 (init_buffer_once): Initialize window_count for buffer_defaults
2830 and buffer_local_symbols.
2831 * window.h (buffer_shared): Remove declaration.
2832 (wset_buffer): Convert from inline ...
2833 * window.c (wset_buffer): ... to an ordinary function.
2834 (adjust_window_count): New function.
2835 (make_parent_window): Use it.
2836 * xdisp.c (buffer_shared): Remove.
2837 (redisplay_internal, redisplay_window): Adjust users.
2838 (buffer_shared_and_changed): Use per-buffer window counter.
2839
2b8c9064
EZ
28402012-12-10 Eli Zaretskii <eliz@gnu.org>
2841
2842 Support for filesystem notifications on MS-Windows.
2843 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2844 and this is a TTY frame, signal the caller that keyboard input is
2845 available.
2846
2847 * w32xfns.c (drain_message_queue): Now returns an int: an
2848 indication whether any WM_EMACS_FILENOTIFY messages were found in
2849 the queue.
2850
2851 * w32inevt.c (handle_file_notifications): New function.
2852 (w32_console_read_socket): Call it to process file notifications.
2853
2854 * w32console.c (initialize_w32_display): Record the main thread ID
2855 in dwMainThreadId.
2856
2857 * deps.mk (inotify.o): New dependency list.
2858
2859 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2860
2861 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2862 (WM_EMACS_END): Bump value by 1.
2863 (notification_buffer_in_use, file_notifications)
2864 (notifications_size, notifications_desc): Declare.
2865 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2866 Add prototypes.
2867
2868 * w32term.c (lispy_file_action, queue_notifications): New functions.
2869 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2870 <Qrenamed_to>: New symbols.
2871 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2872
2873 * w32notify.c: New file, implements file event notifications for
2874 MS-Windows.
2875
2876 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2877 by posting it to the w32_read_socket queue.
2878
1e101a4b 2879 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
2880
2881 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2882 (GLOBAL_SOURCES): Add w32notify.c
2883 ($(BLD)/w32notify.$(O)): New set of dependencies.
2884
2885 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2886
1e101a4b
SM
2887 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2888 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
2889 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2890 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2891 w32notify-handle-event by default.
2892
2893 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2894 syms_of_w32notify.
2895
81606b10
RS
28962012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2897
2b8c9064 2898 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 2899 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
2900
2901 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2902
2903 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2904 (syms_of_keyboard): DEFSYM it.
2905 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2906 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2907 Qfile_inotify events.
2908 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2909 special-event-map to inotify-handle-event.
2910
2911 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2912
2913 * Makefile.in (base_obj): Add inotify.o.
2914
2915 * inotify.c: New file.
2916
265c2fbf 29172012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
2918
2919 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2920
265c2fbf 29212012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
2922
2923 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2924 DWORD_PTR, for compatibility with 64-bit builds.
2925
a06ae17d 2926 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
2927 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2928 (system_process_attributes): Use SIZE_T rather than DWORD, for
2929 compatibility with 64-bit builds.
2930
265c2fbf 29312012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
2932
2933 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2934
265c2fbf 29352012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
2936
2937 * indent.c (Fvertical_motion): If a display string will be
2938 displayed on the left or the right margin, don't consider it as a
2939 factor in cursor positioning. (Bug#13108)
2940
265c2fbf 29412012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
2942
2943 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2944
5f460827
PE
29452012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2946
2947 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2948 for string length.
2949
a16e75cd
EZ
29502012-12-08 Eli Zaretskii <eliz@gnu.org>
2951
2952 * w32.c (unsetenv): Return 0 if the input string is too long.
2953
5745a7df
PE
29542012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2955
2956 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2957 * alloc.c (xputenv): New function.
2958 * dbusbind.c (Fdbus_init_bus):
2959 * emacs.c (main):
2960 * xterm.c (x_term_init):
2961 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2962 * editfns.c (initial_tz): Move static var decl up.
2963 (tzvalbuf_in_environ): New static var.
2964 (init_editfns): Initialize these two static vars.
2965 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2966 Save old TZ value on stack, if it's small.
2967 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2968 instead, use xputenv+unsetenv to set and restore TZ.
2969 (environbuf): Remove static var. All uses removed.
2970 (Fset_time_zone_rule): Do not save TZ and environ;
2971 no longer needed here.
2972 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2973 Move to inside set_time_zone_rule; they don't need file scope any more.
2974 (set_time_zone_rule): Maintain the TZ=value string separately.
2975 (syms_of_editfns): Don't initialize initial_tz;
2976 init_editfns now does it.
2977 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2978 * lisp.h (xputenv): New decl.
2979
c56efa40
FP
29802012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2981
2982 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2983
75ceee05
EZ
29842012-12-08 Eli Zaretskii <eliz@gnu.org>
2985
2986 * w32.c (unsetenv, sys_putenv): New functions.
2987
1b6dbfeb
CY
29882012-12-08 Chong Yidong <cyd@gnu.org>
2989
2990 * editfns.c (Finsert_char): Make the error message more
2991 informative (Bug#12992).
2992
d983a10b
PE
29932012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2994
7be78020
PE
2995 Simplify get_lim_data.
2996 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2997 Remove USG and vlimit methods; no longer used these days.
2998 Add #error catchall just in case.
2999
d983a10b
PE
3000 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3001 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3002 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3003 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3004 (deleted_pid_list, Fdelete_process, create_process)
3005 (record_child_status_change, handle_child_signal, deliver_child_signal)
3006 (init_process_emacs, syms_of_process):
3007 Assume SIGCHLD is defined.
3008 (parse_signal): Remove. All uses removed.
3009 (abbr_to_signal): New static function.
3010 (Fsignal_process): Use it to convert signal names to ints.
3011 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3012 kill (getpgrp (), ...).
3013 (emacs_sigaction_init): Assume SIGCHLD is defined.
3014 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3015 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3016 * syssignal.h (EMACS_KILLPG): Remove.
3017 All uses replaced by 'kill' with a negative pid.
3018 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3019 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3020
9cdde1e2
PE
30212012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3022
3023 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3024 This will cause a production Emacs to dump core instead of
3025 infinite-looping.
3026
822995f8
DA
30272012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3028
3029 * frame.c (make_frame): Do not set window's buffer to t.
3030 * window.c (Fsplit_window_internal): Likewise. Previously it was
3031 used to indicate that the window is being set up. Now we use
3032 set_window_buffer for all new windows, so the condition in ...
3033 (Fset_window_buffer): ... is always true and can be removed.
3034
ed08365b
DA
30352012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3036
3037 Convenient macro to check whether the buffer is hidden.
3038 * buffer.h (BUFFER_HIDDEN_P): New macro.
3039 * frame.c (make_frame): Use it. Adjust comment.
3040 * buffer.c (candidate_buffer): New function.
3041 (Fother_buffer, other_buffer_safely): Use it.
3042
e86f5134
EZ
30432012-12-06 Eli Zaretskii <eliz@gnu.org>
3044
3045 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3046 if the child process is still running. Instead, exit the wait
3047 loop and return zero. (Bug#13086)
3048
1700db3c
DA
30492012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3050
3051 * frame.h (x_char_width, x_char_height): Remove prototypes.
3052 * w32term.h (x_char_width, x_char_height): Likewise.
3053 * xfns.c (x_char_width, x_char_height): Remove.
3054 * w32fns.c (x_char_width, x_char_height): Likewise.
3055 * nsfns.c (x_char_width, x_char_height): Likewise.
3056 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3057 all window frames.
3058 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3059 * keyboard.c (command_loop_1): Remove prototype.
3060 (command_loop_2, top_level_1): Add static to match prototype.
3061
35fb8050
PE
30622012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3063
3064 Fix a recently-introduced delete-process race condition.
3065 * callproc.c, process.h (record_kill_process):
3066 New function, containing part of the old call_process_kill.
3067 (call_process_kill): Use it.
3068 This does not change call_process_kill's behavior.
3069 * process.c (Fdelete_process): Use record_kill_process to fix a
3070 race condition that could cause Emacs to lose track of a child.
3071
565212e5
DA
30722012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3073
3074 Avoid code duplication between prev_frame and next_frame.
3075 * frame.c (candidate_frame): New function. Add comment.
3076 (prev_frame, next_frame): Use it. Adjust comment.
3077
d8ad4d3f 30782012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3079
3080 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3081 fails, signal an error instead of continuing with an empty
3082 string. (Bug#13079)
7c2fcf9b
EZ
3083 Encode expanded temp file pattern before passing it to mkstemp or
3084 mktemp.
d3cefd13 3085
2e7cddd3
EZ
3086 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3087 Encode the file name before passing it to dostounix_filename, in
3088 case it will downcase it (under w32-downcase-file-names).
3089 (Bug#12933)
3090
644d3f0d
PE
30912012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3092
3093 Minor call-process cleanups.
3094 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3095 at the same time as other platforms, to simplify analysis.
3096 No need for fd0_volatile since we have synch_process_fd.
3097 Avoid needless emacs_close; arg is always negative.
3098
396376f1
AS
30992012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3100
3101 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3102 processes.
3103
350f51ad
DA
31042012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3105
3106 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3107 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3108 and mouse_face_hidden members to a bitfields.
3109 * frame.h (struct frame): Remove set-but-not-used space_width member.
3110 (FRAME_SPACE_WIDTH): Remove.
3111 * nsterm.m, w32term.c, xterm.c: Adjust users.
3112 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3113 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3114 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3115 members to a bitfields.
3116
bc9dbce6
PE
31172012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3118
bb5f74ee
PE
3119 Don't let call-process be a zombie factory (Bug#12980).
3120 Fixing this bug required some cleanup of the signal-handling code.
3121 As a side effect, this change also fixes a longstanding rare race
3122 condition whereby Emacs could mistakenly kill unrelated processes,
3123 and it fixes a bug where a second C-g does not kill a recalcitrant
3124 synchronous process in GNU/Linux and similar platforms.
3125 The patch should also fix the last vestiges of Bug#9488,
3126 a bug which has mostly been fixed on the trunk by other changes.
3127 * callproc.c, process.h (synch_process_alive, synch_process_death)
3128 (synch_process_termsig, sync_process_retcode):
3129 Remove. All uses removed, to simplify analysis and so that
3130 less consing is done inside critical sections.
3131 * callproc.c (call_process_exited): Remove. All uses replaced
3132 with !synch_process_pid.
3133 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3134 These take the role of what used to be in unwind-protect arg.
3135 All uses changed.
3136 (block_child_signal, unblock_child_signal):
3137 New functions, to avoid races that could kill innocent-victim processes.
3138 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3139 (call_process_kill): Record killed processes as deleted, so that
3140 zombies do not clutter up the system. Do this inside a critical
3141 section, to avoid a race that would allow the clutter.
3142 (call_process_cleanup): Fix code so that the second C-g works again
3143 on common platforms such as GNU/Linux.
3144 (Fcall_process): Create the child process in a critical section,
3145 to fix a race condition. If creating an asynchronous process,
3146 record it as deleted so that zombies do not clutter up the system.
3147 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3148 light of these changes. Omit unnecessary call to emacs_close
3149 before failure, as the unwind-protect code does that.
3150 * callproc.c (call_process_cleanup):
3151 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3152 * process.c (record_deleted_pid): New function, containing
3153 code refactored out of Fdelete_process.
3154 (Fdelete_process): Use it.
3155 (process_status_retrieved): Remove. All callers changed to use
3156 child_status_change.
3157 (record_child_status_change): Remove, folding its contents into ...
3158 (handle_child_signal): ... this signal handler. Now, this
3159 function is purely a handler for SIGCHLD, and is not called after
3160 a synchronous waitpid returns; the synchronous code is moved to
3161 wait_for_termination. There is no need to worry about reaping
3162 more than one child now.
3163 * sysdep.c (get_child_status, child_status_changed): New functions.
3164 (wait_for_termination): Now takes int * status and bool
3165 interruptible arguments, too. Do not record child status change;
3166 that's now the caller's responsibility. All callers changed.
3167 Reimplement in terms of get_child_status.
3168 (wait_for_termination_1, interruptible_wait_for_termination):
3169 Remove. All callers changed to use wait_for_termination.
3170 * syswait.h: Include <stdbool.h>, for bool.
3171 (record_child_status_change, interruptible_wait_for_termination):
3172 Remove decls.
3173 (record_deleted_pid, child_status_changed): New decls.
3174 (wait_for_termination): Adjust to API changes noted above.
3175
bc9dbce6
PE
3176 * bytecode.c, lisp.h (Qbytecode): Remove.
3177 No longer needed after 2012-11-20 interactive-p changes.
3178
3cf3c607
EZ
31792012-12-03 Eli Zaretskii <eliz@gnu.org>
3180
3181 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3182 the scroll margin, move point outside the margin. (Bug#13055)
3183
005c8d13
JD
31842012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3185
3186 * gtkutil.c (my_log_handler): New function.
3187 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3188
20edc1c9
DA
31892012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3190
3191 * lisp.h (modify_region): Rename to...
3192 (modify_region_1): ...new prototype.
3193 * textprop.c (modify_region): Now static. Adjust users.
3194 * insdel.c (modify_region): Rename to...
3195 (modify_region_1): ...new function to work with current buffer.
3196 Adjust comment and users. Use true and false for booleans.
3197
62c2e5ed
DA
31982012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3199
3200 * alloc.c (free_save_value): New function.
3201 (safe_alloca_unwind): Use it.
3202 * lisp.h (free_save_value): New prototype.
3203 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3204 Add comment.
3205 (save_excursion_restore): Adjust to match saved data structure.
3206 Use free_save_value to offload some work from GC. Drop obsolete
3207 #if 0 code.
3208
c5bc2d1d 32092012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3210
3211 * fileio.c (Vauto_save_list_file_name): Doc fix.
3212
c5bc2d1d 32132012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3214
3215 * w32fns.c: Remove prototype of atof.
1e101a4b 3216 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3217 builds.
1e101a4b 3218 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3219
3220 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3221 with 64-bit builds.
3222
3223 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3224 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3225 defined.
3226
c5bc2d1d 32272012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3228
a9de9f0c 3229 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3230
21e54a94
PE
32312012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3232
2dd2e622
PE
3233 Fix xpalloc confusion after memory is exhausted.
3234 * alloc.c (xpalloc): Comment fix.
3235 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3236 and signals an error, do not clear charset_table_size, as
3237 charset_table is still valid.
3238 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3239
21e54a94
PE
3240 Use execve to avoid need to munge environ (Bug#13054).
3241 * callproc.c (Fcall_process):
3242 * process.c (create_process):
3243 Don't save and restore environ; no longer needed.
3244 * callproc.c (child_setup):
3245 Use execve, not execvp, to preserve environ.
3246
3e5490f7
PE
32472012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3248
3249 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3250
75b4f59c
YM
32512012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3252
3253 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3254 display for sliced images (Bug#10500).
3255
3256 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3257
f8aff4c6
JB
32582012-11-30 Juanma Barranquero <lekktu@gmail.com>
3259
3260 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3261 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3262
3940b924
DA
32632012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3264
3265 * xdisp.c (window_outdated): Remove eassert since it hits
3266 some suspicious corner cases (see Bug#13007 and Bug#13012).
3267 (mode_line_update_needed): New function.
3268 (redisplay_internal, redisplay_window): Use it.
3269 (ensure_selected_frame): New function.
3270 (redisplay_internal, unwind_redisplay): Use it.
3271 (redisplay_internal): Move comment about buffer_shared...
3272 (buffer_shared_and_changed): ...near to its real use.
3273
4a9204fe
PE
32742012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3275
3276 * callproc.c (Fcall_process): Don't misreport vfork failure.
3277
60aeceb8
PE
32782012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3279
3280 * callproc.c (Fcall_process): Fix vfork portability problems.
3281 Do not assume that fd[0], count, filefd, and save_environ survive
3282 vfork. Fix bug whereby wrong errno value could be reported for
3283 pipe failure. Some minor cleanups, too, as follows. Move buf and
3284 bufsize to the context where they're needed. Change new_argv to
3285 be of type char **, as this is more convenient and avoids casts.
3286 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3287 Now local constants, not macros.
3288
00dc3ead
KH
32892012-11-18 Kenichi Handa <handa@gnu.org>
3290
3291 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3292 for the variable "f".
3293
e1bf05c1
KH
32942012-11-13 Kenichi Handa <handa@gnu.org>
3295
3296 * font.c (font_unparse_xlfd): Exclude special characters from the
3297 generating XLFD name.
3298
22626a85
PE
32992012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3300
350e0088
PE
3301 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3302 * dired.c (stat_uname, stat_gname):
3303 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3304
22626a85
PE
3305 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3306 * dired.c (directory_files_internal, file_name_completion):
3307 Assume EAGAIN and EINTR are defined.
350e0088 3308
22626a85
PE
3309 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3310 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3311 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3312 * lread.c (readbyte_from_file): Assume EINTR is defined.
3313 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3314 Assume EIO and EAGAIN are defined.
3315 * unexcoff.c (write_segment): Assume EFAULT is defined.
3316
5c9cf0a3 33172012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3318
3319 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3320 (Bug#11964)
3321
22294a56
EZ
3322 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3323 highlighting on the frame was cleared. Prevents assertion
3324 violations when repeatedly clicking on the "Top" link of the
3325 "bread-crumbs" in Info buffers.
3326
5fbab051
PE
33272012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3330
bcd77a2b
KB
33312012-11-24 Ken Brown <kbrown@cornell.edu>
3332
3333 * keyboard.c (HAVE_MOUSE):
3334 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3335 were always defined.
3336
d125ca15 33372012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3338
24becea4
EZ
3339 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3340 between bpos_covered and bpos_max. This fixes cursor display when
3341 several display strings follow each other.
3342
8654a41b
EZ
3343 * .gdbinit (pgx): If the glyph's object is a string, display the
3344 pointer to string data, rather than the value of the string object
3345 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3346
cb5867b1
EZ
3347 * indent.c (Fvertical_motion): If the starting position is covered
3348 by a display string, return to one position before that, to avoid
3349 overshooting it inside move_it_to. (Bug#12930)
3350
f418b22e
DA
33512012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3352
3353 * frame.h (struct frame): Remove display_preempted member
3354 since all users are dead long ago.
3355 * nsterm.h (struct x_output): Use the only dummy member.
3356 * w32menu.c (pending_menu_activation): Remove since not
3357 really used.
3358 (set_frame_menubar): Adjust user.
3359 * w32term.h (struct x_output): Drop outdated #if 0 code.
3360 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3361 asked_for_visible and menubar_active members.
3362 Drop unused pending_menu_activation member.
f418b22e
DA
3363 * xterm.h (struct x_output): Drop outdated #if 0 code.
3364 Use bitfields for explicit_parent, asked_for_visible,
3365 has_been_visible and net_wm_state_hidden_seen members.
3366
a879f0ea
EZ
33672012-11-23 Eli Zaretskii <eliz@gnu.org>
3368
3369 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3370 of a literal "/". (Bug#12955)
3371 (gl-stamp): Invoke fc.exe directly, not through cmd.
3372
95ef7787
PE
33732012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3374
3375 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3376 * dired.c: Assume HAVE_DIRENT_H.
3377 (NAMLEN): Remove, replacing with ...
3378 (dirent_namelen): New function. All uses changed. Use the GNU macro
3379 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3380 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3381 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3382 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3383 $(NT_INC)/dirent.h.
3384 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3385 * ndir.h: Rename to ../nt/inc/dirent.h.
3386 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3387 Do not include <dirent.h>; no longer needed.
3388 * w32.c: Include <dirent.h> rather than "ndir.h".
3389
12645ae6
CY
33902012-11-23 Chong Yidong <cyd@gnu.org>
3391
3392 * xftfont.c (xftfont_open): Remove duplicate assignment.
3393
5c747675
DA
33942012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3395
3396 * alloc.c (Fgarbage_collect): Unblock input after clearing
3397 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3398 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3399 * msdos.c (IT_frame_up_to_date): Use it here...
3400 * w32term.c (w32_frame_up_to_date): ...here...
3401 * xterm.c (XTframe_up_to_date): ...and here...
3402 * nsterm.m (ns_frame_up_to_date): ...but not here.
3403 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3404 Adjust users.
3405 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3406 Do not check whether GC is in progress.
3407
6ceeb5f1
DA
34082012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3409
3410 * xdisp.c (window_buffer_changed): New function.
3411 (update_menu_bar, update_tool_bar): Use it to
3412 simplify large 'if' statements.
3413 (redisplay_internal): Generalize commonly used
3414 'tail' and 'frame' local variables.
3415
ec84768f
EZ
34162012-11-22 Eli Zaretskii <eliz@gnu.org>
3417
3418 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3419 with Windows system header.
3420
9239d970
PE
34212012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3422
3423 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3424 * alloc.c: Assume unistd.h exists.
3425 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3426 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3427 (getwd) [USG]: Remove; no longer needed.
3428 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3429 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3430 * w32.h (getcwd): Remove decl.
3431
954bba56
SM
34322012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3433
3434 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3435 Make it set selected_window as well.
3436 (update_tool_bar): Use it.
3437
6ef2e5ef 34382012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3439
3440 * emacs.c (main): Set the G_SLICE environment variable for all
3441 Cygwin builds, not just GTK builds. See
3442 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3443
6ef2e5ef 34442012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3445
3446 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3447 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3448 Define for the MSVC compiler.
3449
6ef2e5ef 3450 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3451
3452 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3453 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3454 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3455 dostounix_filename assumes it gets a unibyte string.
3456 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3457 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3458
eadf1faa
SM
34592012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3460
3461 Conflate Qnil and Qunbound for `symbol-function'.
3462 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3463 * lread.c (init_obarray): Set `function' fields to Qnil.
3464 * eval.c (Fcommandp): Ignore Qunbound.
3465 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3466 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3467 Test NILP rather than Qunbound.
3468 (Ffmakunbound): Set to Qnil.
3469 (Fsymbol_function): Never signal an error.
3470 (Finteractive_form): Ignore Qunbound.
3471
b83fdfa9
PE
34722012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3473
3474 * eval.c (interactive_p): Remove no-longer-used decl.
3475
952580c5
DA
34762012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3477
3478 * xdisp.c (buffer_shared): Adjust comment.
3479 (buffer_shared_and_changed): New function.
3480 (prepare_menu_bars, redisplay_internal): Use it to
3481 decide whether all windows or frames should be updated.
ea6de9b1
DA
3482 (window_outdated): New function.
3483 (text_outside_line_unchanged_p, redisplay_window): Use it.
3484 (redisplay_internal): Likewise. Fix indentation.
952580c5 3485
23ba2705
SM
34862012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3487
3488 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3489 (syms_of_eval): Remove corresponding defsubr.
3490 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3491
6e9f7997
DC
34922012-11-19 Daniel Colascione <dancol@dancol.org>
3493
3494 * w32fns.c (Fx_file_dialog):
3495 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3496 cygwin_convert_file_name*.
3497
3498 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3499 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3500
552a1590
PE
35012012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3502
3503 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3504
2ac9538d 35052012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3506
3507 * w32select.c: Include w32common.h before w32term.h, so that
3508 windows.h gets included before w32term.h uses some of its
3509 features, see below.
3510
23ba2705
SM
3511 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3512 New typedefs.
3513 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3514 New prototypes.
d8715cdf
EZ
3515 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3516
2ac9538d 35172012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3518
3519 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3520 (ns_select): Return at once if events are held (Bug#12834).
3521
2ac9538d 35222012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3523
3524 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3525 Needed following 2012-10-20 change. (Bug#12902)
3526
c1f7ba3a
JB
35272012-11-18 Juanma Barranquero <lekktu@gmail.com>
3528
3529 * w32proc.c (waitpid): Remove unused label get_result.
3530
a75ce9d3
JB
35312012-11-17 Juanma Barranquero <lekktu@gmail.com>
3532
3533 * makefile.w32-in (SYSWAIT_H): New macro.
3534 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3535 ($(BLD)/sysdep.$(O)): Update dependencies.
3536
49cdacda
PE
35372012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3538
3539 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3540 * callproc.c (relocate_fd): Assume F_DUPFD.
3541 * emacs.c, term.c (O_RDWR): Remove.
3542 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3543 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3544 * nsterm.m: Assume <fcntl.h> exists.
3545 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3546 (create_pty, Fmake_network_process, server_accept_connection)
3547 (wait_reading_process_output, init_process_emacs):
3548 Assume O_NONBLOCK.
3549 (wait_reading_process_output): Put in a special case for WINDOWSNT
3550 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3551 It's not clear this is needed, but it's a more-conservative change.
3552 (create_process): Assume FD_CLOEXEC.
3553 (create_process, create_pty): Assume O_NOCTTY.
3554 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3555 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3556 Omit if not DOS_NT, since F_GETFL is not defined there.
3557 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3558 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3559 (O_NOCTTY): Remove.
3560 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3561 lack it, since gnulib guarantees this.
3562 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3563
22bae83f
EZ
35642012-11-17 Eli Zaretskii <eliz@gnu.org>
3565
6ad30855
EZ
3566 * w32.c (faccessat): Pretend that directories have the execute bit
3567 set. Emacs expects that, e.g., in files.el:cd-absolute.
3568
22bae83f
EZ
3569 * w32proc.c (create_child): Don't clip the PID of the child
3570 process to fit into an Emacs integer, as this is no longer a
3571 restriction.
3572 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3573 reaping only the process specified by PID argument, if that is
3574 positive. Use PID instead of dead_child to know which process to
3575 reap. Wait for the child to die only if WNOHANG is not in
3576 OPTIONS.
3577 (sys_select): Don't set dead_child.
3578
3579 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3580 as it is no longer needed.
3581
3582 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3583 no longer needed.
3584 (record_child_status_change): Remove the setting of
3585 record_at_most_one_child for the !WNOHANG case.
3586
a631d0e0
PE
35872012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3588
3589 Fix problems in ns port found by static checking.
3590 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3591 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3592 not to process group.
3593 (ns_select): Use emacs_write, not write, as that's more robust
3594 in the presence of signals.
3595 (fd_handler:): Check for read errors.
3596
d56f2e49
GM
35972012-11-16 Glenn Morris <rgm@gnu.org>
3598
3599 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3600
96e05507 36012012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
3602
3603 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3604
96e05507 36052012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
3606
3607 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3608 use the same value of thread handle.
3609 (start_timer_thread): If the timer thread exited (due to error),
3610 clean up by closing the two handles it used. Duplicate the caller
3611 thread's handle here, so it gets duplicated only once, when
3612 launching the timer thread. Set priority of the timer thread, not
3613 the caller thread.
3614 (getitimer): Don't duplicate the caller thread's handle here.
3615 (Bug#12832)
3616
96e05507 36172012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
3618
3619 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3620 called (Bug#12834).
3621
3d082a26
PE
36222012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3623
3624 Remove no-longer-used pty_max_bytes variable.
3625 * process.c (pty_max_bytes): Remove; unused.
3626 (send_process): Do not set it.
3627
b72c161c
JB
36282012-11-15 Juanma Barranquero <lekktu@gmail.com>
3629
3630 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3631 Update dependencies.
3632
bf20ea80
PE
36332012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3634
3635 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3636 This follows up on the 2012-09-29 patch that removed indirection
3637 for the 'function' field. Reported by Sergey Vinokurov in
3638 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3639
14f20728
EZ
36402012-11-14 Eli Zaretskii <eliz@gnu.org>
3641
3642 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3643 different name, as the MS runtime does not have such a function,
3644 and probably never will.) All callers changed. Ignore DIRFD
3645 value if PATH is an absolute file name, to match Posix spec
3646 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3647 symlinks.
3648
77731919
DA
36492012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3650
3651 * xdisp.c (echo_area_display, redisplay_internal):
3652 Omit redundant check whether frame_garbaged is set.
3653
73dcdb9f
PE
36542012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 Use faccessat, not access, when checking file permissions (Bug#12632).
3657 This fixes a bug that has been present in Emacs since its creation.
3658 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3659 which must set some sort of record. (Torek's bug report was against
3660 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3661 same common flaw.) See Torek's Usenet posting
3662 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3663 Posted: Fri Apr 8 14:18:56 1983.
3664 * Makefile.in (LIB_EACCESS): New macro.
3665 (LIBES): Use it.
3666 * callproc.c (init_callproc):
3667 * charset.c (init_charset):
3668 * fileio.c (check_existing, check_executable, check_writable)
3669 (Ffile_readable_p):
3670 * lread.c (openp, load_path_check):
3671 * process.c (allocate_pty):
3672 * xrdb.c (file_p):
3673 Use effective UID when checking permissions, not real UID.
3674 * callproc.c (init_callproc):
3675 * charset.c (init_charset):
3676 * lread.c (load_path_check, init_lread):
3677 Test whether directories are accessible, not merely whether they exist.
3678 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3679 * fileio.c (check_existing, check_executable, check_writable)
3680 (Ffile_readable_p):
3681 Use symbolic names instead of integers for the flags, as they're
3682 portable now.
3683 (check_writable): New arg AMODE. All uses changed.
3684 Set errno on failure.
3685 (Ffile_readable_p): Use faccessat, not stat + open + close.
3686 (Ffile_writable_p): No need to call check_existing + check_writable.
3687 Just call check_writable and then look at errno. This saves a syscall.
3688 dir should never be nil; replace an unnecessary runtime check
3689 with an eassert. When checking the parent directory of a nonexistent
3690 file, check that the directory is searchable as well as writable, as
3691 we can't create files in unsearchable directories.
3692 (file_directory_p): New function, which uses 'stat' on most platforms
3693 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3694 (Ffile_directory_p, Fset_file_times): Use it.
3695 (file_accessible_directory_p): New function, which uses a single
3696 syscall for efficiency.
3697 (Ffile_accessible_directory_p): Use it.
3698 * xrdb.c (file_p): Use file_directory_p.
3699 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3700 * lread.c (openp): When opening a file, use fstat rather than
3701 stat, as that avoids a permissions race. When not opening a file,
3702 use file_directory_p rather than stat.
3703 (dir_warning): First arg is now a usage string, not a format.
3704 Use errno. All uses changed.
3705 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3706 that merely introduced a race.
3707 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3708 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3709 and similarly for the other O_* flags.
3710 * w32.c (sys_faccessat): Rename from sys_access and switch to
3711 faccessat's API. All uses changed.
3712 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3713 (magic_db): Rename from magic_file_p.
3714 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3715 char *, so that we don't have to test for file existence
3716 separately from opening the file for reading. This removes a race
3717 fixes a permission-checking problem, and simplifies the code.
3718 All uses changed.
3719 (file_p): Remove; no longer needed.
3720
2a14f83b
DA
37212012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 Omit glyphs initialization at startup.
3724 * dispnew.c (glyphs_initialized_initially_p): Remove.
3725 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3726 (Fredraw_frame): Move actual code from here...
c7085245 3727 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
3728 (Fredraw_display): Use redraw_frame.
3729 * xdisp.c (clear_garbaged_frames): Likewise.
3730
f78ee6af 37312012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
3732
3733 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3734 passed to pint2str and pint2hrstr to be at most the size of the
3735 frame's decode_mode_spec_buffer. This avoids crashes with very
3736 large values of FIELD_WIDTH argument to decode_mode_spec.
3737 (Bug#12867)
3738
b95a9c0c
PE
37392012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3740
3741 Fix a race with verify-visited-file-modtime (Bug#12863).
3742 Since at least 1991 Emacs has ignored an mtime difference of no
3743 more than one second, but my guess is that this was to work around
3744 file system bugs that were fixed long ago. Since the race is
3745 causing problems now, let's remove that code.
3746 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3747 whose time stamp is off by no more than a second. Insist that the
3748 file time stamps match exactly.
3749
be49ba74
DA
37502012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3751
3752 * frame.h (struct frame): Convert external_tool_bar member to
3753 1-bit unsigned bitfield.
3754 * termhooks.h (struct terminal): Remove mouse_moved member since
3755 all users are long dead. Adjust comment on mouse_position_hook.
3756
5b04e9f9
DA
37572012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3758
3759 Simplify by using FOR_EACH_FRAME here and there.
3760 * frame.c (next_frame, prev_frame, other_visible_frames)
3761 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3762 * w32term.c (x_window_to_scroll_bar): Likewise.
3763 * window.c (window_list): Likewise.
3764 * xdisp.c (x_consider_frame_title): Likewise.
3765 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3766 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3767 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3768 * xmenu.c (menubar_id_to_frame): Likewise.
3769 * xselect.c (frame_for_x_selection): Likewise.
3770 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3771 (x_window_to_menu_bar): Likewise.
3772 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3773
76ae24d7
PE
37742012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3775
12cc4337
PE
3776 * data.c (Qdefalias_fset_function): Now static.
3777
76ae24d7
PE
3778 Another tweak to vectorlike_header change.
3779 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3780 Remove, and replace all uses with ...
3781 (next_in_free_list, set_next_in_free_list):
3782 New functions, which respect C's aliasing rules better.
3783
1479c557
PE
37842012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3785
3786 * window.c (list4i): Rename from 'quad'. All uses changed.
3787 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3788
11235c03
JB
37892012-11-11 Juanma Barranquero <lekktu@gmail.com>
3790
3791 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3792 warning about mixing declarations and code in ISO C90.
3793
6baf66d5 37942012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
3795
3796 * window.c (Fsplit_window_internal): Set combination limit of
3797 new parent window to t iff Vwindow_combination_limit is t;
3798 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 3799 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 3800
6baf66d5 38012012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
3802
3803 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3804 amount when the scroll margins are too large. When scrolling
3805 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
3806 scroll margin within a reasonable number of screen lines.
3807 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
3808 point is positioned many lines beyond the window top/bottom.
3809 (Bug#12811)
3810
508f51f5
EZ
3811 * ralloc.c (relinquish): If real_morecore fails to return memory
3812 to the system, don't crash; instead, leave the last heap
3813 unchanged and return. (Bug#12774)
3814
32e5c58c
SM
38152012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3816
3817 * lisp.h (AUTOLOADP): New macro.
3818 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3819 * data.c (Ffset): Remove special ad-advice-info handling.
3820 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3821 (Fsubr_arity): CSE.
3822 (Finteractive_form): Simplify.
3823 (Fquo): Don't insist on having at least 2 arguments.
3824 (Qdefalias_fset_function): New var.
3825
719b0aa5
JD
38262012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3827
4ab15c3e
JD
3828 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3829
719b0aa5
JD
3830 * nsfont.m (Qcondensed, Qexpanded): New variables.
3831 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3832 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3833
535cc8e9
DA
38342012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3835
3836 Fix recently introduced crash on MS-Windows (Bug#12839).
3837 * w32term.h (struct scroll_bar): Use convenient header.
3838 (SCROLL_BAR_VEC_SIZE): Remove.
3839 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3840
7d377c48
DA
38412012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3842
3843 Tweak last vectorlike_header change.
3844 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3845 vectorlike object on the free list. This is introduced to avoid
3846 some (but not all) pointer casting and aliasing problems, see
3847 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3848 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3849 objects.
3850 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3851
7ad27466
JD
38522012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3853
32e5c58c 3854 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
3855 been removed, so remove them here also.
3856
57618ecf
SM
38572012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3858
3859 * doc.c (Fdocumentation): Handle new property
3860 dynamic-docstring-function to replace the old ad-advice-info.
3861
53371430
PE
38622012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3863
3864 * fns.c (Qeql, hashtest_eq): Now static.
3865
61ddb1b9
SM
38662012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3867
3868 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3869 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3870 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3871 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3872
04a2d0d3
PE
38732012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3874
3875 Use same hash function for hashfn_profiler as for hash_string etc.
3876 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3877 * lisp.h (sxhash_combine): New inline function, with the contents
3878 of the old SXHASH_COMBINE.
3879 * profiler.c (hashfn_profiler): Use it, instead of having a
3880 special hash function containing a comparison that always yields 1.
3881
de5ef41a
SM
38822012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3883
3884 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3885 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3886 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3887 Remove unused vars.
3888
a23c4171
JD
38892012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3890
3891 * image.c (xpm_make_color_table_h): Fix compiler error because
3892 make_hash_table changed.
3893
0b59090b 38942012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
3895
3896 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3897
b7432bb2
SM
38982012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3899
3900 Use ad-hoc comparison function for the profiler's hash-tables.
3901 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3902 (make_log): Use them.
3903 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3904 call Fequal any more.
3905 (Ffunction_equal): New function.
3906 (cmpfn_profiler, hashfn_profiler): New functions.
3907 (syms_of_profiler): Initialize them.
3908 * lisp.h (struct hash_table_test): New struct.
3909 (struct Lisp_Hash_Table): Use it.
3910 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3911 * fns.c (make_hash_table): Take a struct to describe the test.
3912 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3913 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3914 (hash_lookup, hash_remove_from_table): Move assertion checking of
3915 hashfn result here. Check hash-equality before calling cmpfn.
3916 (Fmake_hash_table): Adjust call to make_hash_table.
3917 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3918 (syms_of_fns): Initialize them.
3919 * emacs.c (main): Move syms_of_fns earlier.
3920 * xterm.c (syms_of_xterm):
3921 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3922 * print.c (print_object): Adjust to new hash-table struct.
3923 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3924
88002743
EZ
39252012-11-08 Eli Zaretskii <eliz@gnu.org>
3926
3927 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3928 value of w32-scroll-lock-modifier is neither nil nor one of the
3929 known key modifiers. (Bug#12806)
3930
914adc42
DA
39312012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3932
3933 Shrink struct vectorlike_header to the only size field.
3934 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3935 Adjust comment.
3936 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3937 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3938 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3939 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3940 information from the vector header. Adjust comment.
3941 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3942 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3943 layout.
3944 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3945 (struct vectorlike_header): Remove next member. Adjust comment.
3946 (struct Lisp_Subr): Add convenient header. Adjust comment.
3947 (allocate_pseudovector): Adjust prototype.
3948 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3949 (sweep_string, lisp_malloc): Remove useless prototypes.
3950 (enum mem_type): Adjust comment.
3951 (NEXT_IN_FREE_LIST): New macro.
3952 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3953 (Fmake_bool_vector): Likewise.
3954 (struct large_vector): New type to represent allocation unit for
3955 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3956 (large_vectors): Change type to struct large_vector.
3957 (allocate_vector_from_block): Simplify.
3958 (PSEUDOVECTOR_NBYTES): Replace with...
3959 (vector_nbytes): ...new function. Adjust users.
3960 (sweep_vectors): Adjust processing of large vectors.
3961 (allocate_vectorlike): Likewise.
3962 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3963 Add easserts. Adjust XSETPVECTYPESIZE usage.
3964 (allocate_buffer): Use BUFFER_PVEC_INIT.
3965 (live_vector_p): Adjust to match large vector.
3966 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3967 * buffer.h (struct buffer): Add next member.
3968 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3969 New macros.
3970 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3971 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3972 (copy_hash_table): Adjust to match vector header change.
3973 * lread.c (defsubr): Use XSETPVECTYPE.
3974 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3975 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3976 (xvecsize): New command.
3977
c66f21ea
DA
39782012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3979
3980 * keyboard.c (event_to_kboard): Do not dereference
3981 frame_or_window field of SELECTION_REQUEST_EVENT
3982 and SELECTION_CLEAR_EVENT events (Bug#12814).
3983 * xterm.h (struct selection_input_event): Adjust comment.
3984
eb147960
EZ
39852012-11-07 Eli Zaretskii <eliz@gnu.org>
3986
dab72075
EZ
3987 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3988 such as Scroll Lock, if the respective keys are treated as
3989 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3990 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3991
5890e400
DA
39922012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3993
3994 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3995
b6b3b294
PE
39962012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3997
3998 Restore some duplicate definitions (Bug#12814).
3999 This undoes part of the 2012-11-03 changes. Some people build
4000 with plain -g rather than with -g3, and they need the duplicate
4001 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4002 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4003 Define as macros, as well as as enums or as constants.
4004
e770aad5
JD
40052012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4006
4007 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4008 to keypad keys (Bug#12816).
4009
68f8f1c0
PE
40102012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4011
4012 Minor adjustments of recently-changed frame functions.
4013 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4014 known to be a frame (we're in the FRAMEP branch).
4015 * lisp.h (Qframep): Remove decl. frame.h declares this.
4016 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4017 since they're meant for Lisp fixnum values.
4018
72f94d4b
DA
40192012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4020
4021 * window.c (Fwindow_combination_limit): Revert to the only
4022 required argument and adjust docstring as suggested in
4023 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4024 by Martin Rudalics <rudalics@gmx.at>.
4025
d9f07150
DA
40262012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4027
4028 Widely used frame validity and checking functions.
4029 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4030 * frame.c (decode_live_frame, decode_any_frame): New functions.
4031 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4032 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4033 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4034 (Fframe_pointer_visible_p): Use decode_any_frame.
4035 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4036 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4037 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4038 (Fframe_focus): Likewise. Allow zero number of arguments.
4039 Adjust docstring.
4040 (frame_buffer_list, frame_buffer_predicate): Remove.
4041 * lisp.h (frame_buffer_predicate): Remove prototype.
4042 * buffer.c (Fother_buffer): Use decode_any_frame.
4043 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4044 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4045 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4046 (Fclose_font, Ffont_info): Use decode_live_frame.
4047 * fontset.c (check_fontset_name): Likewise.
4048 * terminal.c (Fframe_terminal): Likewise.
4049 * w32fns.c (check_x_frame): Likewise.
4050 * window.c (Fminibuffer_window, Fwindow_at)
4051 (Fcurrent_window_configuration): Likewise.
4052 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4053 Likewise. Allow zero number of arguments. Adjust docstring.
4054 * dispnew.c (Fredraw_frame): Likewise.
4055 * xfaces.c (frame_or_selected_frame): Remove.
4056 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4057 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4058 (Fframe_face_alist): Use decode_live_frame.
4059 * xfns.c (check_x_frame): Likewise.
4060
89bc0592
DA
40612012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4062
4063 * window.c (quad): New function.
4064 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4065 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4066 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4067 (Fwindow_line_height): Use it.
4068 (Fwindow_fringes): Use list3.
4069 (Fwindow_scroll_bars): Use list4.
4070 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4071 (Fwindow_combination_limit): Allow zero number of arguments.
4072
c8e3a9c3
EZ
40732012-11-05 Eli Zaretskii <eliz@gnu.org>
4074
4075 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4076
8e2417bf 4077 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4078 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4079 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4080
209c6a58
CY
40812012-11-05 Chong Yidong <cyd@gnu.org>
4082
4083 * process.c (wait_reading_process_output): Revert previous change.
4084
8148369c
PE
40852012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4086
dd0333b6
PE
4087 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4088 This removes code that has been obsolete since around 1990.
4089 * callproc.c (Fcall_process):
4090 * emacs.c (main):
4091 * process.c (create_process):
4092 * term.c (dissociate_if_controlling_tty):
4093 Assume setsid exists.
4094 * callproc.c (child_setup): Assume setpgid exists and behaves as
4095 per POSIX.1-1988 or later.
4096 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4097 * emacs.c (shut_down_emacs):
4098 * sysdep.c (sys_suspend, init_foreground_group):
4099 Assume getpgrp behaves as per POSIX.1-1998 or later.
4100 * msdos.c (setpgrp): Remove.
4101 (tcgetpgrp, setpgid, setsid): New functions.
4102 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4103 * term.c (no_controlling_tty): Remove; unused.
4104 * w32proc.c (setpgrp): Remove.
4105 (setsid, tcgetpgrp): New functions.
4106
8148369c
PE
4107 Simplify by assuming __fpending.
4108 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4109 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4110 Do not assume that __fpending's result fits in int.
4111
76abf5e5
PE
41122012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4113
06b63c9b
PE
4114 Remove EMACS_OUTQSIZE+sleep hack.
4115 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4116 than 2400 bps, which throttled Emacs by having it sleep.
4117 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4118 was added, and anyway those old terminals are long dead.
4119 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4120 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4121
76abf5e5
PE
4122 Fix data-loss with --version (Bug#9574).
4123 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4124 as we can't assume that emacs_strerror is initialized, and strerror
4125 is good enough here.
4126 (main): Invoke atexit earlier, to catch earlier instances of
4127 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4128
8f31e74b
MM
41292012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4130
4131 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4132 (keyDown): Remap keypad keys to X11 virtual key codes.
4133
0d879dca
PE
41342012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4135
7ccfb720
PE
4136 Fix data-loss with --batch (Bug#9574).
4137 * emacs.c: Include <close-stream.h>.
4138 (close_output_streams): New function.
4139 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4140 and handles errors appropriately.
4141 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4142 does that now.
4143
0b3d4a47
PE
4144 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4145 The symptom is a diagnostic "GLib-WARNING **: In call to
4146 g_spawn_sync(), exit status of a child process was requested but
4147 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4148 waitpid(), so exit status can't be returned." The diagnostic
4149 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4150 The real bug is a race condition between Emacs and glib: Emacs
4151 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4152 so that glib can't find it. Work around the bug by invoking
4153 waitpid only on subprocesses that Emacs itself creates.
4154 * process.c (create_process, record_child_status_change):
4155 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4156 know the pid rather than having the callee infer it.
4157 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4158 (create_process): Set new 'alive' member if child is created.
4159 (process_status_retrieved): New function.
4160 (record_child_status_change): Use it.
4161 Accept negative 1st argument, which means to wait for the
4162 processes that Emacs already knows about. Move special-case code
4163 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4164 processes that have already been waited for, by testing and
4165 clearing new 'alive' member.
4166 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4167 now does this internally.
4168 (handle_child_signal): Let record_child_status_change do all
4169 the work, since we do not want to reap all exited child processes,
4170 only the child processes that Emacs itself created.
4171 * process.h (Lisp_Process): New boolean member 'alive'.
4172
0d879dca
PE
4173 Omit duplicate definitions no longer needed with gcc -g3.
4174 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4175 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4176 Define only as macros. There's no longer any need to also define
4177 these symbols as enums or as constants, since we now assume
4178 gcc -g3 when debugging.
4179
3478f4b5
EZ
41802012-11-03 Eli Zaretskii <eliz@gnu.org>
4181
4182 * lisp.mk: Adjust comments to the fact that term/internal is now
4183 loaded from loadup.el.
4184
4185 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4186 (msdos_fatal_signal): New function.
4187 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4188 its argument list.
4189
4190 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4191 for GCC versions before 4.
4192 (emacs_raise): Define to call msdos_fatal_signal.
4193
4194 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4195 iterator when starting in the middle of a display or overlay
4196 string. (Bug#12745)
4197
85fabcb7
CY
41982012-11-03 Chong Yidong <cyd@gnu.org>
4199
4200 * process.c (wait_reading_process_output): Clean up the last
4201 change.
4202
893cc455
CY
42032012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4204
4205 * process.c (wait_reading_process_output): Avoid a race condition
4206 with SIGIO delivery (Bug#11536).
4207
0f7b074f
CY
42082012-11-03 Chong Yidong <cyd@gnu.org>
4209
4210 * buffer.c (cursor_type): Untabify docstring.
4211
3737fee7
DA
42122012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4213
4214 * frame.h (struct frame): Drop can_have_scroll_bars member
4215 which is meaningless for a long time. Adjust comments.
4216 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4217 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4218
b6a9e8b1
DA
42192012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4220
4221 * window.c (decode_next_window_args): Update window arg after
4222 calling decode_live_window and so fix crash reported at
4223 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4224 by Juanma Barranquero <lekktu@gmail.com>.
4225 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4226 * font.c (Ffont_at): Likewise.
4227
600d4768
JD
42282012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4229
4230 * widget.c (resize_cb): New function.
4231 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4232 (EmacsFrameResize): Check if all is up to date before changing frame
4233 size.
4234
1005b4b9
EZ
42352012-11-02 Eli Zaretskii <eliz@gnu.org>
4236
4237 Implement backtrace output for fatal errors on MS-Windows.
4238 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4239 (BACKTRACE_LIMIT_MAX): New macro.
4240 (w32_backtrace): New function.
4241 (emacs_abort): Use w32_backtrace when the user chooses not to
4242 attach a debugger. Update the text of the abort dialog.
4243
b9e9df47
DA
42442012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4245
4246 Window-related stuff cleanup here and there.
4247 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4248 Use decode_any_window.
4249 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4250 * xdisp.c (Fformat_mode_line): Likewise.
4251 * font.c (Ffont_at): Use decode_live_window.
4252 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4253 * window.c (decode_next_window_args): Likewise.
4254 (decode_any_window): Remove static.
4255 * window.h (decode_any_window): Add prototype.
4256 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4257 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4258 respectively.
4259
2b371ff7
DA
42602012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4261
4262 Remove pad from struct input_event.
4263 * termhooks.h (struct input_event): Remove padding field.
4264 Adjust comment.
4265 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4266 member is never cons for a long time. Adjust comment.
4267 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4268 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4269 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4270 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4271
7e8b50d9
EZ
42722012-11-01 Eli Zaretskii <eliz@gnu.org>
4273
4274 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4275
322aea6d
PE
42762012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4277
4278 Fix crash when using Emacs as commit editor for git (Bug#12697).
4279 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4280 and it is configured in conf_post.h.
4281 (Fcall_process): Don't invoke both setsid and setpgid; the former
4282 is enough, if it exists.
4283 * callproc.c (Fcall_process, child_setup):
4284 * process.c (create_process): Use setpgid.
4285 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4286 for the real thing.
4287 * dispnew.c (init_display): Initialize the foreground group
4288 if we are running a tty display.
4289 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4290 * lisp.h (init_foreground_group): New decl.
4291 * sysdep.c (inherited_pgroup): New static var.
4292 (init_foreground_group, tcsetpgrp_without_stopping)
4293 (narrow_foreground_group, widen_foreground_group): New functions.
4294 (init_sys_modes): Narrow foreground group.
4295 (reset_sys_modes): Widen foreground group.
4296
220cb2bd
MA
42972012-10-31 Michael Albinus <michael.albinus@gmx.de>
4298
4299 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4300
218e997a
MR
43012012-10-31 Martin Rudalics <rudalics@gmx.at>
4302
4303 * minibuf.c (read_minibuf): Restore current buffer since
4304 choose_minibuf_frame calling Fset_frame_selected_window may
4305 change it (Bug#12766).
4306
02615da0
JD
43072012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4308
4309 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4310
aee5b18e
KH
43112012-10-30 Kenichi Handa <handa@gnu.org>
4312
4313 * font.c (Ffont_at): If WINDOW is specified and it is not
4314 displaying the current buffer, signal an error.
4315
ba116008
DC
43162012-10-29 Daniel Colascione <dancol@dancol.org>
4317
de5ef41a
SM
4318 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4319 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4320 here...
4321
4322 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4323 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4324 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4325
640bf8ad
EZ
43262012-10-28 Eli Zaretskii <eliz@gnu.org>
4327
4328 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4329 (timer_loop, getitimer, setitimer): Use it instead of
4330 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4331 'clock'.
4332 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4333 literal 10000.
4334
64ccff5f
JD
43352012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4336
4337 * nsterm.m (NO_APPDEFINED_DATA): New define.
4338 (last_appdefined_event_data): New variable
4339 (last_appdefined_event): Remove.
4340 (ns_select): Initialize t from last_appdefined_event_data instead
4341 of [last_appdefined_event data1].
4342 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4343 remove last_appdefined_event (Bug#12698).
4344
e483264c
SM
43452012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4346
4347 * frame.c (x_set_font): Catch internal error.
4348
6c16c13e
EZ
43492012-10-27 Eli Zaretskii <eliz@gnu.org>
4350
e483264c
SM
4351 Avoid overflow in w32 implementation of interval timers.
4352 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4353 actually executes.
4354 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4355 'volatile ULONGLONG' types. All the other data which was
4356 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4357 (GetThreadTimes_Proc): New typedef.
4358 (w32_get_timer_time): New function, returns a suitable time value
4359 for the timer.
4360 (timer_loop): Enter critical section when accessing ULONGLONG
4361 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4362 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4363 Remove unused variable.
6c16c13e
EZ
4364 (init_timers): Initialize s_pfn_Get_Thread_Times.
4365 (start_timer_thread): Don't assign itimer->caller_thread here.
4366 (getitimer): Assign itimer->caller_thread here.
4367 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4368 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4369
ccc83f50
EZ
43702012-10-26 Eli Zaretskii <eliz@gnu.org>
4371
4372 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4373 mouse movement events if the menu bar is active. This avoids
4374 producing a busy "hour-glass" cursor by Windows if the mouse
4375 pointer is positioned over a tooltip shown for some menu item.
4376
69deda53
PE
43772012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4378
4379 Don't assume process IDs fit in int.
4380 * emacs.c (shut_down_emacs) [!DOS_NT]:
4381 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4382 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4383 Use pid_t, not int, to store process IDs, as 'int'
4384 is not wide enough on a few platforms (e.g., AIX and IRIX).
4385
7e70a152
KH
43862012-10-23 Kenichi Handa <handa@gnu.org>
4387
4388 The following change is to make face-font-rescale-alist work
4389 correctly for non-ASCII fonts.
4390
4391 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4392 (font_open_for_lface): Handle Vface_font_rescale_alist.
4393
49238e7f
CY
43942012-10-23 Chong Yidong <cyd@gnu.org>
4395
4396 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4397
5ec86886
JD
43982012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4399
ef446959
JD
4400 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4401 for screen font.
4402 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4403
5ec86886
JD
4404 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4405 event (Bug#12681).
4406
ee7a418d
GM
44072012-10-21 Glenn Morris <rgm@gnu.org>
4408
4409 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4410
4973679b
PE
44112012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4412
4413 Port to OpenBSD 5.1.
4414 * frame.c (Fmouse_position, Fmouse_pixel_position):
4415 * xdisp.c (produce_stretch_glyph):
4416 Declare local vars only when they're needed.
4417 This is clearer and avoids a warning on OpenBSD about unused vars.
4418 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4419 This is safer, and avoids OpenBSD warnings about unused vars.
4420 * keyboard.c (record_menu_key): Remove unnecessary decl.
4421 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4422 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4423 as our definition clashes with OpenBSD's.
4424 * xfaces.c (load_face_colors, check_lface_attrs)
4425 (get_lface_attributes_no_remap, get_lface_attributes)
4426 (lface_fully_specified_p, x_supports_face_attributes_p)
4427 (tty_supports_face_attributes_p, face_fontset, realize_face)
4428 (realize_x_face, realize_tty_face):
4429 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4430 merely Lisp_Object *. This is more informative and avoids
4431 a warning on OpenBSD about accessing beyond an object's size.
4432
c664f463
CY
44332012-10-20 Chong Yidong <cyd@gnu.org>
4434
4435 * lread.c (Fload): Doc fix (Bug#12592).
4436
6ec83f92 44372012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4438
4439 * font.c (Ffont_at): Fix previous change.
4440
d2824928
EZ
44412012-10-19 Eli Zaretskii <eliz@gnu.org>
4442
e483264c
SM
4443 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4444 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4445 for the reasons.
4446
d2824928
EZ
4447 * alloc.c (NSTATICS): Decrease to 0x800.
4448
f60d391f
SM
44492012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4450
4a0e1924 4451 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4452 error (bug#12677).
4453
1a9327d5
JD
44542012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4455
4456 * nsterm.m (ns_select): Check writefds before call to
4457 FD_ISSET (Bug#12668).
4458
14145a1e
DC
44592012-10-18 Daniel Colascione <dancol@dancol.org>
4460
4461 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4462 (staticpro): If we run out of staticpro slots, die with an
4463 informative error instead of just calling emacs_abort.
4464
1f76f6f5
MR
44652012-10-18 Martin Rudalics <rudalics@gmx.at>
4466
4467 Fix two flaws reported by Dmitry Antipov.
4468 * window.c (Ftemp_output_buffer_show): Remove.
4469 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4470 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4471
fcf14875
EZ
44722012-10-17 Eli Zaretskii <eliz@gnu.org>
4473
1f76f6f5
MR
4474 * makefile.w32-in ($(BLD)/w32.$(O)):
4475 ($(BLD)/vm-limit.$(O)):
4476 ($(BLD)/term.$(O)):
4477 ($(BLD)/unexw32.$(O)):
4478 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4479 ($(BLD)/dispnew.$(O)): Update dependencies.
4480
4481 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4482 Add prototypes.
4483
4484 * w32proc.c: Include ctype.h.
4485
4486 * w32.h (init_environment, check_windows_init_file)
4487 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4488 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4489 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4490 (sys_link): Add prototypes.
4491
4492 * w32.c: Include w32select.h.
4493 (sys_access, e_malloc, sys_select): Add prototypes.
4494 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4495
4496 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4497
4498 * unexw32.c: Include lisp.h and w32.h.
4499
4500 * term.c [WINDOWSNT]: Include w32term.h.
4501
4502 * process.c [WINDOWSNT]: Add prototype of sys_select.
4503
4504 * fileio.c [WINDOWSNT]: Include w32.h.
4505
4506 * dispnew.c [WINDOWSNT]: Include w32.h.
4507
fcf14875
EZ
4508 * cygw32.c (Fcygwin_convert_path_to_windows)
4509 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4510 Lisp_Object values. (Bug#12661)
4511
4512 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4513 to Lisp_Object. (Bug#12661)
4514
fe0b1ec4
KH
45152012-10-17 Kenichi Handa <handa@gnu.org>
4516
4517 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4518 invalidate.
4519
d556ebf9
DA
45202012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4521
4522 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4523 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4524
f0863a54
DA
45252012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Do not verify indirection counters of killed buffers (Bug#12579).
4528 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4529 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4530
12fbe755
DA
45312012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4532
4533 * alloc.c (Fmake_byte_code): Fix typo in comment.
4534 * print.c (print_interval): Define as static to match prototype.
4535 * indent.c (disptab_matches_widthtab, recompute_width_table):
4536 Convert to eassert.
4537
61655b89
DA
45382012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4539
4540 * editfns.c (get_system_name): Remove.
4541 * lisp.h (get_system_name): Remove prototype.
4542 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4543 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4544
9520f2f2
DC
45452012-10-15 Daniel Colascione <dancol@dancol.org>
4546
4547 * dbusbind.c: Add comment explaining reason for previous change.
4548
dca778d5
MR
45492012-10-15 Martin Rudalics <rudalics@gmx.at>
4550
4551 * window.c (Fwindow_end): Rewrite check whether cached position
4552 can be used (Bug#12600).
4553 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4554 Set windows_or_buffers_changed.
4555
3e0341b0
DC
45562012-10-15 Daniel Colascione <dancol@dancol.org>
4557
4558 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4559 enabled by undefining the symbol "interface", which the platform
4560 headers define to something incompatible.
4561
33d4113c
DC
45622012-10-14 Daniel Colascione <dancol@dancol.org>
4563
4564 * image.c (init_tiff_functions, init_imagemagick_functions)
4565 (init_svg_functions): Fix cygw32 build break by using these
4566 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4567
a36fb15e
JD
45682012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4569
4570 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4571
537f336d
JD
45722012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4573
4574 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4575
0ba06a77
KH
45762012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4577
4578 * coding.c (detect_coding): Set coding->id before calling
4579 this->detector.
4580
ce2fe65a
AS
45812012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4582
4583 * fileio.c: Formatting fixes.
4584
d6453ce4
PE
45852012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4586
4587 Fix some stat-related races.
4588 * fileio.c (Fwrite_region): Avoid race condition if a file is
4589 removed or renamed by some other process immediately after Emacs
4590 writes it but before Emacs stats it. Do not assume that stat (or
4591 fstat) succeeds.
4592 * image.c (slurp_file): Resolve the file name with fopen + fstat
4593 rather than stat + fopen.
4594 (pbm_read_file) [0]: Remove unused code with stat race.
4595 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4596 Remove ineffective code with stat race.
4597
06485aa8
SM
45982012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4599
4600 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4601
167e3640
JD
46022012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4603
4604 * nsterm.m (hold_event_q): New static variable.
4605 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4606 ! q_event_ptr.
4607 (hold_event): New function.
4608 (ns_read_socket): If hold_event_q have events, store them and
4609 return (Bug#12384).
4610 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4611 is zero (Bug#12384).
4612
c40239df
JB
46132012-10-12 Juanma Barranquero <lekktu@gmail.com>
4614
4615 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4616
bb385a92
EZ
46172012-10-12 Eli Zaretskii <eliz@gnu.org>
4618
2a9f1099
EZ
4619 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4620
bb385a92
EZ
4621 * fileio.c (check_existing): New function.
4622 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4623 instead of calling 'stat', when what's needed is to check whether
4624 a file exists. This avoids expensive system calls on MS-Windows.
4625 (Bug#12587)
4626
8599b23a 4627 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
4628
4629 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4630 determine whether a file exists and is not a directory.
4631
4632 * lisp.h (check_existing): Add prototype.
4633
2b9c2e68
JD
46342012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4635
4636 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4637
81749a23
GM
46382012-10-12 Glenn Morris <rgm@gnu.org>
4639
4640 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4641
5253a5fd
SM
46422012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4643
389a94a5
SM
4644 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4645
5253a5fd
SM
4646 * eval.c (Fautoload): Remember previous autoload status in load-history.
4647
7cded46f
PE
46482012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4651 * lread.c (load_each_byte, new_backquote_flag, readchar)
4652 (read_filtered_event, lisp_file_lexically_bound_p)
4653 (safe_to_load_version, Fload, complete_filename_p, openp)
4654 (build_load_history, readevalloop, read_escape, read1)
4655 (string_to_number, read_vector, read_list):
4656 * macros.c (Fstart_kbd_macro):
4657 * marker.c (CONSIDER):
4658 * menu.c (parse_single_submenu, digest_single_submenu)
4659 (find_and_return_menu_selection, Fx_popup_menu):
4660 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4661 (Ftry_completion):
4662 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4663 (ns_menu_show):
4664 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4665 (xmenu_show, xdialog_show):
4666 Use bool for booleans.
4667 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4668 as it's not a predicate. All uses changed. Omit unnecessary
4669 buffer termination.
4670
549c3414
DA
46712012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4672
4673 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4674 (save_excursion_restore): Do not restore mark if it was not saved.
4675
e85aafe7
PE
46762012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4677
fd2f90cf
PE
4678 * marker.c (cached_modiff): EMACS_INT, not int.
4679
c1af190b
PE
4680 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4681 instead of having a wrong decl.
e85aafe7
PE
4682 * nsmenu.m (waiting_for_input): Remove wrong decl.
4683
e738ca56
PE
46842012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4685
9fa1de30
PE
4686 keyboard.c, keymap.c: Use bool for booleans.
4687 * dispnew.c (sit_for): Distinguish between 3-way display_option
4688 and boolean do_display.
4689 * keyboard.c (single_kboard, this_command_key_count_reset)
4690 (waiting_for_input, echoing, immediate_quit, input_pending)
4691 (interrupt_input, interrupts_deferred, pop_kboard)
4692 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4693 (command_loop_1, adjust_point_for_property)
4694 (safe_run_hooks_error, input_polling_used, read_char):
4695 (help_char_p, readable_events, kbd_buffer_events_waiting)
4696 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4697 (lucid_event_type_list_p, get_input_pending):
4698 (gobble_input, menu_separator_name_p, menu_bar_item)
4699 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4700 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4701 (keyremap_step, test_undefined, read_key_sequence)
4702 (detect_input_pending, detect_input_pending_ignore_squeezables)
4703 (detect_input_pending_run_timers, requeued_events_pending_p)
4704 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4705 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4706 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4707 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4708 (accessible_keymaps_1, Fkey_description, push_key_description):
4709 (shadow_lookup, struct where_is_internal_data)
4710 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4711 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4712 (describe_map, describe_vector):
4713 * menu.c (single_menu_item):
4714 * nsmenu.m (ns_update_menubar):
4715 * process.c (wait_reading_process_output):
4716 * search.c (scan_buffer, scan_newline):
4717 Use bool for boolean.
4718 * keyboard.c (timers_run, swallow_events)
4719 (detect_input_pending_run_timers):
4720 * process.c (wait_reading_process_output):
4721 Use unsigned for counter where wraparound-on-overflow is desired,
4722 since unsigned is guaranteed to have that behavior and signed is not.
4723 (read_char): Use ptrdiff_t for string length.
4724 (get_input_pending): Remove first argument, since it was always
4725 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4726 and behave as if it had that value. Return new value of
4727 input_pending. All callers changed.
4728 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4729 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4730 a string length.
4731 * keymap.c (push_key_description): Omit last arg, which was always 1.
4732 All callers changed.
4733
e738ca56
PE
4734 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4735
29f21cdf
JB
47362012-10-10 Juanma Barranquero <lekktu@gmail.com>
4737
4738 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4739 ($(BLD)/term.$(O)): Update dependencies.
4740
6aea7528
DA
47412012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4742
4743 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4744 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4745 initializer for PVEC_NORMAL_VECTOR.
4746
5f3f57be
PE
47472012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 Clean out old termopts cruft.
4750 * termopts.h (flow_control, meta_key): Remove unused decls.
4751 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4752 Don't include termopts.h.
4753
3e98c68e
DA
47542012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4755
4756 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4757
77e344e5
PE
47582012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4759
4760 * commands.h (immediate_quit): Remove duplicate decl.
4761
5683d7cd
JD
47622012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4763
4764 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4765 caching.
4766 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 4767 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 4768
cf5fc6db
EZ
47692012-10-09 Eli Zaretskii <eliz@gnu.org>
4770
b15736e6
EZ
4771 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4772 match what GetLastError returns. Explain why the function is
4773 needed.
4774
cf5fc6db
EZ
4775 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4776 'is_tooltip_frame', to avoid confusion with its global namesake.
4777
f99714ce
DC
47782012-10-08 Daniel Colascione <dancol@dancol.org>
4779
4780 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
4781 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4782 build that caused Emacs to display the hourglass cursor forever.
f99714ce 4783
fd59cb29
GM
4784 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4785 which is broken under remote desktop, calculate the number of
4786 colors available for a display based on the display's number of
4787 planes and number of bits per pixel per plane. (bug#10397).
4788
62c480c9 47892012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 4790
62c480c9
JD
4791 * nsfont.m (Vfonts_in_cache): New variable.
4792 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4793 are used. Add cached fonts to Vfonts_in_cache.
4794 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4795
607446ba
JB
47962012-10-08 Juanma Barranquero <lekktu@gmail.com>
4797
fd5125ad
JB
4798 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4799 in nt/config.nt.
46979e0b
JB
4800 (FONT_H): Define after FRAME_H.
4801 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4802 Update dependencies.
fd5125ad 4803
607446ba
JB
4804 * w32term.c: Remove leftover declaration of keyboard_codepage.
4805
b6f4e300
EZ
48062012-10-08 Eli Zaretskii <eliz@gnu.org>
4807
c54ebba4
EZ
4808 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4809 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4810 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4811 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
4812 ($(BLD)/unexw32.$(O)):
4813 ($(BLD)/w32.$(O)):
4814 ($(BLD)/w32console.$(O)):
4815 ($(BLD)/w32fns.$(O)):
4816 ($(BLD)/w32heap.$(O)):
4817 ($(BLD)/w32menu.$(O)):
15c720a3 4818 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 4819
b6f4e300
EZ
4820 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4821 'const char *'.
4822 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4823
501199a3
DC
48242012-10-08 Daniel Colascione <dancol@dancol.org>
4825
4826 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4827 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4828 accidental message numbering hole. Change other messages to
4829 match.
4830
4831 * w32select.h (HAVE_W32SELECT): Remove.
4832
4833 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 4834 w32common.h instead of w32heap.h.
501199a3
DC
4835
4836 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4837 (get_allocation_unit, get_processor_type, get_w32_major_version)
4838 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4839 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4840 (OS_NT, os_subtype, cache_system_info): Move declarations to
4841 w32common.
4842
4843 * w32heap.c: Include w32common.h.
4844 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
4845 (w32_minor_version, w32_build_number, w32_subtype):
4846 Remove duplicate definitions.
501199a3
DC
4847
4848 * w32fns.c: Include w32common.h; include w32heap.h only in
4849 WINDOWSNT.
4850
4851 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4852 Use `report_file_error' instead of `error' in order to better
4853 inform users of what went wrong. Increase NTGUI_UNICODE file
4854 dialog box file name length to 32k, the maximum allowed by the NT
4855 kernel.
4856
4857 * w32common.h: New file.
4858 (ROUND_UP, ROUND_DOWN, get_page_size)
4859 (get_allocation_unit, get_processor_type, get_w32_major_version)
4860 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4861 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4862 (OS_NT, os_subtype, cache_system_info): Move here.
4863
4864 * unexw32.c, unexcw.c: Include w32common.h.
4865
4866 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4867 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4868 to call syms_of_w32select.
4869
4870 * cygw32.h: Remove obsolete EXFUN declarations.
4871
4872 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4873
4874 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4875 of w32inevt.o from SOME_MACHINE_OBJECTS.
4876
93aa5c81
DC
48772012-10-08 Daniel Colascione <dancol@dancol.org>
4878
4879 * image.c: Permanent fix for JPEG compilation issue --- limit
4880 jpeglib `boolean' redefinition to Cygwin builds.
4881
d424f3d8
EZ
48822012-10-08 Eli Zaretskii <eliz@gnu.org>
4883
8ee4c6ce
EZ
4884 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4885
d424f3d8
EZ
4886 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4887 Cygwin.
4888
e08348a0
DC
48892012-10-08 Daniel Colascione <dancol@dancol.org>
4890
4891 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4892 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4893 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4894 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4895 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4896 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4897 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4898 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4899 now a supported configuration.
4900
4901 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 4902 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
4903
4904 * conf_post.h:
4905 (_DebPrint) declare tracing facility for W32 debugging. We need
4906 to unify tracing later.
4907
4908 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4909 unconditional use of W32 Unicode functions. Cygwin runs only on
4910 100% Unicode operating systems.
4911
4912 * cygw32.c: New file. Define Cygwin-specific facilities.
4913 (Fcygwin_convert_path_to_windows)
4914 (Fcygwin_convert_path_from_windows): New user functions for
4915 accessing Cygwin path-munging routines.
4916
4917 * cygw32.h: New file.
4918 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4919 UTF-16LE strings temporarily inside non-Lisp-visible string
4920 objects.
4921
4922 (w32_strerror): Just what it says on the tin.
4923
4924 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4925 also run for Cygwin; both systems have the same problem with using
4926 GUI facilities in a forked child. Also call syms_of_cygw32,
4927 syms_of_w32select in correct places.
4928
4929 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4930 needs fork-then-exec for daemon launching.
4931
4932 * font.h: Include frame.h.
4933
4934 * image.c: Use the image library cache machinery only when we're
4935 compiling for native WINDOWSNT; Cygwin can use shared libraries
4936 like any other Unixlike system.
4937
4938 * keyboard.c: Clarify a comment regarding the input loop.
4939
4940 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4941 functions directly instead of trying to detect at runtime that our
4942 host operating system supports them. We make this change for two
4943 reasons: Cygwin lacks support for the multibyte character
4944 conversion functions used by the legacy menu code, and Cygwin
4945 never needs to rely on non-Unicode APIs.
4946
4947 * unexw32.c (hinst): Declare extern.
4948
4949 * w32.c: Change header order;
4950 (w32_strerror): Move to w32fns.c because we need it for
4951 non-WINDOWSNT builds.
4952
4953 * w32.h: Add #error macro to make sure we don't include w32.h for
4954 Cygwin builds. Remove w32select declarations.
4955
4956 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4957 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4958
4959 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4960 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4961 POSIXy alternative.
4962 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4963 (w32_major_version, w32_minor_version, w32_build_number)
4964 (os_subtype, sound_type): Define here
4965 (w32_defined_color): Make color parameter const for consistency
4966 with other _defined_color functions.
4967 (w32_createwindow): Unconditionally call w32_init_class instead of
4968 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4969 through the code is complex and unnecessary because class
4970 registration is practically free.
4971 (w32_name_of_message): New EMACSDEBUG-only function.
4972 (Fset_message_beep): Move here
4973 (Fx_open_connection): Require that the display name for Windows be
4974 "w32" for consistency, emacsclient disambiguation, and maybe, one
4975 day, multi-window-system support.
4976 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4977 Cygwin files for W32 GUI facilities, since these clearly don't
4978 expect Cygwin names.
4979 (_DebPrint): Define.
4980 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4981 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4982 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4983 (w32_last_error): Remove.
4984
4985 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4986
4987 * w32heap.c (syspage_mask): Declare here.
4988 (cache_system_info): Remove.
4989
4990 * w32inevt.c (faked_key): Define globally, not statically.
4991 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4992 (w32_console_toggle_lock_key): Move to w32fns.c.
4993
4994 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4995
4996 * w32proc.c (_DebPrint): Move to w32fns.c.
4997 * w32select.c: Include string.h, stdio.h for Cygwin.
4998 * w32select.h: New File.
4999
5000 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5001 get_osfhandle.
5002 (w32_message_fd): New variable. Under Cygwin, holds the file
5003 descriptor the system used to tell us about pending thread
5004 messages.
5005
5006 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5007 that prevented compilation under non-WINDOWSNT systems.
5008
5009 (w32_initialize): Open /dev/windows and assign it to
5010 w32_message_fd. Provide w32 feature.
5011
5012 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5013 (WM_EMACS_INPUT_READY): add.
5014 (prepend_msg, w32_message_fd): Declare globally.
5015
5016 * w32xfns.c:
5017 (keyboard_handle): Use only when WINDOWSNT.
5018 (notify_msg_ready): New function. Posts a message to the main
5019 thread's message queue under CYGWIN, which wakes up the main
5020 thread from select(2) by making the /dev/windows file descriptor
5021 ready. Under WINDOWSNT, it sets an event the same way the old
5022 code did.
5023
5024 (post, prepend_msg): Actually call notify_msg_ready instead of
5025 setting the input event directly.
5026
98daa893
EZ
50272012-10-07 Eli Zaretskii <eliz@gnu.org>
5028
5029 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5030 but it still has blocs in it, don't return it to the system,
5031 instead of aborting. (Bug#12402)
5032
3bc0a2f7
JD
50332012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5034
8ad5b73b 5035 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5036
335f5ae4
JD
5037 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5038 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5039 (syms_of_nsterm): Remove comment about Panther and above for
5040 ns-antialias-text.
335f5ae4
JD
5041 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5042 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5043 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5044
5045 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5046 MAC_OS_X_VERSION_10_4.
5047
8ad5b73b
JD
5048 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5049 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5050
5051 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5052
5053 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5054 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5055
3bc0a2f7
JD
5056 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5057 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5058 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5059 Remove ns_in_resize check.
3bc0a2f7
JD
5060 (ns_clear_frame_area): Remove resize handle code.
5061
5062 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5063 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5064 Remove ns_in_resize check.
3bc0a2f7 5065
c622b48f
PE
50662012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5067
5068 Improve sys_siglist detection.
5069 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5070 defined as a macro, as is done in Solaris.
5071 (sys_siglist_entries): New macro.
5072 (save_strsignal): Use it.
5073 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5074 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5075
04fafa46
JD
50762012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5077
5078 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5079 fullscreen/Fullscreen.
5080
5081 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5082 tobar_height is new.
5083
5084 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5085 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5086 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5087 (windowDidResize:): Check for correct window if old style fullscreen.
5088 Capitalize word in comment. Remove incorrect comment.
5089 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5090 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5091 error in drawing background.
1f9f395d 5092 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5093 Set toolbar values to zero, save old height in tobar_height.
5094 Restore tool bar height when leaving fullscreen.
5095 (canBecomeMainWindow): New function.
5096
c6e21c03
PE
50972012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5098
5099 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5100
0d9f584b
EZ
51012012-10-05 Eli Zaretskii <eliz@gnu.org>
5102
a65fbb5f
EZ
5103 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5104
0d9f584b 5105 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5106 that time stamps of directories could also be changed.
5107 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5108 FILE_WRITE_ATTRIBUTES access rights.
5109
5110 * fileio.c (Fset_file_times): Special-case ignoring errors for
5111 directories only on MSDOS, not on MS-Windows.
5112
e8757f09 51132012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5114
5115 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5116
7604f298
EZ
51172012-10-04 Eli Zaretskii <eliz@gnu.org>
5118
5119 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5120 see whether CreateFile failed.
5121
88d69b7d
PE
51222012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5123
5124 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5125 to avoid similar races.
5126 * keyboard.c (pending_signals): Now bool, not int.
5127
7509f454
PE
5128 Port timers to OpenBSD, plus check for timer failures.
5129 OpenBSD problem reported by Han Boetes.
5130 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5131 and/or setitimer.
5132 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5133 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5134 like OpenBSD, which has timer_settime but does not declare it.
5135 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5136 whether to use itimerspec-related primitives. All uses of
5137 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5138
a3c5c0c5
PE
51392012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5140
5141 * profiler.c (handle_profiler_signal): Fix a malloc race
5142 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5143
914e743b
JD
51442012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5145
5146 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5147
d8ab37a8
EZ
51482012-10-02 Eli Zaretskii <eliz@gnu.org>
5149
5150 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5151 consistent with the change in return value of 'safe_strsignal'.
5152
b3ecad33
PE
51532012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5154
0a99eee1
PE
5155 Prefer plain 'static' to 'static inline' (Bug#12541).
5156 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5157 (bidi_set_sor_type, bidi_push_embedding_level)
5158 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5159 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5160 (bidi_cache_search, bidi_cache_ensure_space)
5161 (bidi_cache_iterator_state, bidi_cache_find)
5162 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5163 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5164 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5165 Now 'static', not 'static inline'.
5166
b3ecad33
PE
5167 Count overruns when profiling; change units to ns.
5168 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5169 Give extra weight to samples after overruns, to attempt to count
5170 the time more accurately.
5171 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5172 the underlying primitives nominally do ns.
5173 (Fprofiler_cpu_start): Document the change. Mention that
5174 the sampling intervals are only approximate.
5175
090cf9db
SM
51762012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5177
5178 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5179
5180 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5181 case for the special 0 coding-system.
5182
5183 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5184 (Fmake_overlay): Remove redundant tests.
64edc777 5185 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5186
81550bf4
JB
51872012-10-02 Juanma Barranquero <lekktu@gmail.com>
5188
5189 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5190 Update dependencies.
5191
aa1ba90e
PE
51922012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5193
5194 Fix a malloc race condition involving strsignal.
5195 A signal can arrive in the middle of a malloc, and Emacs's signal
5196 handler can invoke strsignal, which can invoke malloc, which is
5197 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5198 Fix it by altering the signal handler so that it does not invoke
5199 strsignal.
5200 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5201 * process.c (status_message): Use const pointer, in case strsignal
5202 is #defined to safe_strsignal.
5203 * sysdep.c (sys_siglist, init_signals): Always define and
5204 initialize a substitute sys_siglist if the system does not define
5205 one, even if HAVE_STRSIGNAL.
5206 (safe_strsignal): Rename from strsignal. Always define,
5207 using sys_siglist. Return a const pointer.
5208 * syssignal.h (safe_strsignal): New decl.
5209 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5210
ace917bd
EZ
52112012-10-01 Eli Zaretskii <eliz@gnu.org>
5212
5213 * w32proc.c (timer_loop): Fix code that waits for timer
5214 expiration, to avoid high CPU usage.
5215
9eb71b9c
SM
52162012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5217
5218 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5219 (sweep_weak_table): Remove redundant prototypes.
5220
b3317662
FP
52212012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5222
5223 * emacs.c: Move the inclusion of TERM_HEADER after including
5224 windows.h on WINDOWSNT. This avoids compilation problems with
5225 MSVC.
5226
f0e5f225
EZ
52272012-10-01 Eli Zaretskii <eliz@gnu.org>
5228
2d7d1608
EZ
5229 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5230 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5231 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5232 as the previous version used 'void *'.
5233
5234 * ralloc.c (ROUNDUP): Fix last change.
5235 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5236 'size_t'.
5237
f0e5f225
EZ
5238 * w32proc.c <disable_itimers>: New static flag.
5239 (init_timers): Initialize it to zero, after creating the critical
5240 sections used by the timer threads.
5241 (term_timers): Set to 1 before deleting the critical sections.
5242 (getitimer, setitimer): If disable_itimers is non-zero, return an
5243 error indication without doing anything. Reported by Fabrice
5244 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5245 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5246 return results.
5247 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5248 support timers.
f0e5f225
EZ
5249
5250 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5251 term_ntproc after all the other bookkeeping, to get timers working
5252 as long as possible.
5253
82ef37c1
PE
52542012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5255
b3a4c387
PE
5256 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5257 Suggested by Juri Linkov in
5258 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5259
b0ab8123
PE
5260 Prefer plain 'static' to 'static inline' (Bug#12541).
5261 With static functions, modern compilers inline pretty well by
5262 themselves; advice from programmers often hurts as much as it helps.
5263 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5264 this change shrinks the text size of the Emacs executable by 1.1%
5265 without affecting CPU significantly in my benchmark.
5266 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5267 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5268 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5269 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5270 (bset_auto_fill_function, bset_auto_save_file_format)
5271 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5272 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5273 (bset_cache_long_line_scans, bset_case_fold_search)
5274 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5275 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5276 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5277 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5278 (bset_header_line_format, bset_indicate_buffer_boundaries)
5279 (bset_indicate_empty_lines, bset_invisibility_spec)
5280 (bset_left_fringe_width, bset_major_mode, bset_mark)
5281 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5282 (bset_name, bset_overwrite_mode, bset_pt_marker)
5283 (bset_right_fringe_width, bset_save_length)
5284 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5285 (bset_scroll_up_aggressively, bset_selective_display)
5286 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5287 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5288 (set_buffer_overlays_after):
5289 * category.c (bset_category_table):
5290 * charset.c (read_hex):
5291 * coding.c (produce_composition, produce_charset)
5292 (handle_composition_annotation, handle_charset_annotation)
5293 (char_encodable_p):
5294 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5295 (assign_row, set_frame_matrix_frame, make_current)
5296 (add_row_entry):
5297 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5298 * fns.c (maybe_resize_hash_table):
5299 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5300 * gmalloc.c (register_heapinfo):
5301 * image.c (lookup_image_type):
5302 * intervals.c (set_interval_object, set_interval_left)
5303 (set_interval_right, copy_interval_parent, rotate_right)
5304 (rotate_left, balance_possible_root_interval):
5305 * keyboard.c (kset_echo_string, kset_kbd_queue)
5306 (kset_keyboard_translate_table, kset_last_prefix_arg)
5307 (kset_last_repeatable_command, kset_local_function_key_map)
5308 (kset_overriding_terminal_local_map, kset_real_last_command)
5309 (kset_system_key_syms, clear_event, set_prop):
5310 * lread.c (digit_to_number):
5311 * marker.c (attach_marker, live_buffer, set_marker_internal):
5312 * nsterm.m (ns_compute_glyph_string_overhangs):
5313 * process.c (pset_buffer, pset_command)
5314 (pset_decode_coding_system, pset_decoding_buf)
5315 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5316 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5317 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5318 * syntax.c (bset_syntax_table, dec_bytepos):
5319 * terminal.c (tset_param_alist):
5320 * textprop.c (interval_has_some_properties)
5321 (interval_has_some_properties_list):
5322 * window.c (wset_combination_limit, wset_dedicated)
5323 (wset_display_table, wset_hchild, wset_left_fringe_width)
5324 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5325 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5326 (wset_right_fringe_width, wset_right_margin_cols)
5327 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5328 (wset_vertical_scroll_bar_type, wset_window_parameters):
5329 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5330 (wset_column_number_displayed, wset_region_showing)
5331 (window_box_edges, run_window_scroll_functions)
5332 (append_glyph_string_lists, prepend_glyph_string_lists)
5333 (append_glyph_string, set_glyph_string_background_width)
5334 (append_glyph, append_composite_glyph)
5335 (take_vertical_position_into_account):
5336 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5337 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5338 (lface_hash, lface_same_font_attributes_p, lookup_face):
5339 * xml.c (libxml2_loaded_p):
5340 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5341 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5342 Now 'static', not 'static inline'.
5343
05584c31
PE
5344 * bidi.c: Tune.
5345 (bidi_copy_it): Do the whole copy with a single memcpy.
5346 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5347
86ec63ba
PE
5348 Revert the FOLLOW-SYMLINKS change for file-attributes.
5349 Doing it right would require several changes to Tramp, and there's
5350 not enough time to get that tested before the freeze today.
5351 * dired.c (directory_files_internal, Ffile_attributes):
5352 Undo last change.
5353
82ef37c1
PE
5354 * frame.c (x_report_frame_params): Port better to wider ints.
5355 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5356 or that pointers can be printed in 15 decimal digits.
5357 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5358
62aba0d4
FP
53592012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5360
5361 Support x64 build on MS-Windows.
5362 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5363 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5364 compatibility with x64.
5e4daaf3 5365 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5366
5367 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5368 defining an XRectangle structure.
5369
5370 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5371 arithmetics for compatibility with x64.
5372
5373 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5374 compatibility with x64.
5375
5376 * w32heap.h: Adjust prototypes and declarations.
5377
5378 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5379 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5380 DWORD, long, and unsigned long, for compatibility with x64.
5381 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5382 (sbrk): Argument is now of type ptrdiff_t.
5383
5384 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5385 less than 0x0500.
5386 (w32_msg_pump): Use WPARAM type for 'result'.
5387
5388 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5389 architecture.
5390 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5391 compatibility with x64.
5392
5393 * vm-limit.c (lim_data): Now size_t.
5394 (check_memory_limits): Adjust prototypes of real_morecore and
5395 __morecore to receive argument of type ptrdiff_t. Use size_t for
5396 five_percent and data_size.
5397
5398 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5399 variables, for compatibility with x64.
5400 (rva_to_section, offset_to_section, relocate_offset)
5401 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5402 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5403 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5404 for compatibility with x64.
5405
5406 * sysdep.c (STDERR_FILENO): Define if not already defined.
5407
5408 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5409 (__morecore): Argument type is now ptrdiff_t.
5410 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5411 (relinquish): Use ptrdiff_t type for 'excess'.
5412 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5413
5414 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5415 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5416 instead of a literal number.
5417
5418 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5419 (min): Define only if not already defined.
5420
5421 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5422 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5423 hosts.
5424
5425 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5426 'bitmaps' is a pointer.
5427
5428 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5429
5430 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5431
e7a2937b
PE
54322012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5433
5434 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5435 * dired.c (directory_files_internal, Ffile_attributes):
5436 New arg follow_symlinks. All uses changed.
5437
b43d62ae
SM
54382012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5439
5440 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5441
c06c382a
EZ
54422012-09-30 Eli Zaretskii <eliz@gnu.org>
5443
5444 Support atimers and CPU profiler via profile.c on MS-Windows.
5445 * w32proc.c (sig_mask, crit_sig): New static variables.
5446 (sys_signal): Support SIGALRM and SIGPROF.
5447 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5448 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5449 sigfillset, and sigprocmask are no longer no-ops.
5450 (sigismember): New function.
5451 (struct itimer_data): New definition.
5452 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5453 (crit_prof): New static variables.
5454 (MAX_SINGLE_SLEEP): New definition.
5455 (timer_loop, stop_timer_thread, term_timers, init_timers)
5456 (start_timer_thread, getitimer, setitimer): New functions.
5457 (alarm): No longer a no-op, calls setitimer.
5458
5459 * w32.c (term_ntproc): Call term_timers.
5460 (init_ntproc): Make sure all signals are unblocked at startup, to
5461 erase any traces of dumping. Call init_timers.
5462
5463 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5464 Windows-specific code to display the hourglass mouse pointer is no
5465 longer used.
5466 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5467 to hourglass timer expiration.
5468 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5469 Remove, no longer used.
b43d62ae
SM
5470 (w32_note_current_window, show_hourglass, hide_hourglass):
5471 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5472 window systems.
5473 (syms_of_w32fns): Don't initialize hourglass_timer.
5474
5475 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5476 WINDOWSNT as well.
5477 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5478
5479 * w32.h (init_timers, term_timers): Add prototypes.
5480
95402d5f
KH
54812012-09-30 Kenichi Handa <handa@gnu.org>
5482
5483 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5484 to the buffer relocation which may be caused by ccl_driver.
5485
dd946752
JD
54862012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5487
d7e642cc
JD
5488 * xfns.c (Fx_file_dialog): Update comment.
5489
5490 * w32fns.c (Fx_file_dialog): Update comment.
5491
5492 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5493 Initialize panel name field if OSX >= 10.6.
5494
5495 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5496
dd946752
JD
5497 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5498
5499 * nsterm.m (NEW_STYLE_FS): New define.
5500 (ns_fullscreen_hook, windowWillEnterFullScreen)
5501 (windowDidEnterFullScreen, windowWillExitFullScreen)
5502 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5503 (setFSValue): New functions.
5504 (EmacsFSWindow): New implementation.
5505 (canBecomeKeyWindow): New function for EmacsFSWindow.
5506 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5507 (dealloc): Release nonfs_window if in fullscreen.
5508 (updateFrameSize:): Call windowDidMove to update top/left.
5509 (windowWillResize:toSize:): Check if frame is still maximized.
5510 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5511 next_maximized, maximized_width, maximized_height and nonfs_window.
5512 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5513 tbar_height.
5514 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5515 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5516
5517 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5518 (EmacsView): Add variables for fullscreen.
5519 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5520 (EmacsFSWindow): New interface for fullscreen.
5521
427730eb
JB
55222012-09-30 Juanma Barranquero <lekktu@gmail.com>
5523
5524 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5525
48de8b12
CY
55262012-09-30 Chong Yidong <cyd@gnu.org>
5527
5528 * fns.c (Frandom): Doc fix.
5529
5938d519
MR
55302012-09-30 Martin Rudalics <rudalics@gmx.at>
5531
5532 * window.c (Vwindow_combination_limit): New default value.
5533 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5534
cb5b0266
PE
55352012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5536
5537 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5538 Suggested by Eli Zaretskii in
5539 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5540
84f72efd
EZ
55412012-09-30 Eli Zaretskii <eliz@gnu.org>
5542
5543 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5544 HAVE_TIMER_SETTIME is defined.
5545
9d4dcdc9
PE
55462012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5547
d89460ed
PE
5548 Profiler improvements: more-accurate timers, overflow checks.
5549 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5550 signal.h, setjmp.h. Include systime.h instead.
5551 (saturated_add): New function.
5552 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5553 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5554 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5555 New static vars.
84f72efd 5556 (enum profiler_cpu_running): New enum.
d89460ed
PE
5557 (profiler_cpu_running): Now of that enum type, not bool.
5558 All uses changed to store the new value.
5559 (handle_profiler_signal): Rename from sigprof_handler_1,
5560 for consistency with other handlers. Do not check whether
5561 cpu_log is a hash-table if garbage collecting, since it
5562 doesn't matter in that case.
5563 (deliver_profiler_signal): Rename from sigprof_handler,
5564 for consistency with other handlers.
5565 (setup_cpu_timer): New function, with much of what used to be in
5566 Fprofiler_cpu_start. Check for out-of-range argument.
5567 Prefer timer_settime if available, and prefer
5568 thread cputime clocks, then process cputime clocks, then
5569 monotonic clocks, to the old realtime clock. Use make_timeval
5570 to round more-correctly when falling back to setitimer.
5571 (Fprofiler_cpu_start): Use it.
5572 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5573 Don't assume that passing NULL as the 2nd argument of setitimer
5574 is the same as passing a pointer to all-zero storage.
5575 Ignore SIGPROF afterwards.
5576 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5577 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5578 non-fatal signal handlers. Ignore SIGPROF on startup.
5579 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5580 in profiler.c, since sysdep.c now uses it.
5581
9d4dcdc9
PE
5582 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5583 Suggested by Eli Zaretskii in
5584 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5585
8e5691a0
JB
55862012-09-29 Juanma Barranquero <lekktu@gmail.com>
5587
5588 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5589
e7c1b6ef
SM
55902012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5591
5592 * lisp.h (struct backtrace): Remove indirection for `function' field.
5593 * xdisp.c (redisplay_internal):
5594 * profiler.c (record_backtrace, sigprof_handler_1):
5595 * alloc.c (Fgarbage_collect):
5596 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5597 (Fbacktrace_frame): Adjust accordingly.
5598
e61d39cd 55992012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
5600
5601 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5602 (Frun_hook_with_args_until_failure): Doc fixes.
5603
404043ea
EZ
56042012-09-28 Eli Zaretskii <eliz@gnu.org>
5605
5606 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5607 Qautomatic_redisplay and change the symbol name. All users changed.
5608
704d3f45
TM
56092012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5610
5611 * profiler.c (sigprof_handler): Fix race condition.
5612
757140ff
GM
56132012-09-28 Glenn Morris <rgm@gnu.org>
5614
5615 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5616
a615a3ae
PE
56172012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 Check more robustly for timer_settime.
89d17fd0
PE
5620 * Makefile.in (LIB_TIMER_TIME): New macro.
5621 (LIBES): Add it.
a615a3ae
PE
5622 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5623 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5624 call timer_settime.
5625
3670daf7
TM
56262012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5627
5628 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5629
6a586b7f
JB
56302012-09-26 Juanma Barranquero <lekktu@gmail.com>
5631
5632 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5633
41c8bfcf
PE
56342012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5635
5636 * character.h (MAYBE_UNIFY_CHAR): Remove.
5637 * charset.c, charset.h (maybe_unify_char): Now static.
5638 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5639 Since this stuff is now private to charset.c, there's no need for
5640 a public macro and no need to inline by hand.
5641
3a880af4 56422012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
5643 Stefan Monnier <monnier@iro.umontreal.ca>
5644 Juanma Barranquero <lekktu@gmail.com>
611b7507 5645
3a880af4
SM
5646 * profiler.c: New file.
5647 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5648 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5649 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5650 * emacs.c (main): Call syms_of_profiler.
5651 * alloc.c (Qautomatic_gc): New constant.
5652 (MALLOC_PROBE): New macro.
5653 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5654 (total_bytes_of_live_objects): New function.
5655 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5656 Call malloc_probe for the memory profiler.
5657 (syms_of_alloc): Define Qautomatic_gc.
5658 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5659 race condition.
5660 (struct backtrace): Move definition...
5661 * lisp.h (struct backtrace): ..here.
5662 (Qautomatic_gc, profiler_memory_running): Declare vars.
5663 (malloc_probe, syms_of_profiler): Declare functions.
5664 * xdisp.c (Qautomatic_redisplay): New constant.
5665 (redisplay_internal): Record itself in backtrace_list.
5666 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 5667
5938d519 56682012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
56692012-09-25 Juanma Barranquero <lekktu@gmail.com>
5670
5671 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5672
e26fd2e4
PE
56732012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5674
5675 Prefer POSIX timers if available.
5676 They avoid a race if the timer is too close to the current time.
5677 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5678 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 5679 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 5680
eedec3ee
EZ
56812012-09-25 Eli Zaretskii <eliz@gnu.org>
5682
5683 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5684 CHAR_STRING_ADVANCE.
5685 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5686 STRING_CHAR_ADVANCE.
5687
aa15c6bb
JB
56882012-09-25 Juanma Barranquero <lekktu@gmail.com>
5689
5690 Move Vlibrary_cache to emacs.c and reset before dumping.
5691
5692 * lisp.h (reset_image_types): Declare.
5693 [WINDOWSNT] (Vlibrary_cache): Declare.
5694
5695 * image.c (reset_image_types): New function.
5696
5697 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5698 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5699 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5700
5701 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5702 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5703
5704 * w32.h (Vlibrary_cache): Do not declare.
5705
54d629be
EZ
57062012-09-25 Eli Zaretskii <eliz@gnu.org>
5707
16b22fef
EZ
5708 * w32proc.c (sys_signal): Handle all signals defined by the
5709 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5710 handlers for signals supported by Windows. Don't override
5711 term_ntproc as the handler for SIGABRT.
5712 (sigaction): Rewrite to call sys_signal instead of duplicating its
5713 code.
5714 (sys_kill): Improve commentary.
5715
5716 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5717 consistency with a signature of a signal handler. All callers
5718 changed.
5719 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5720 install term_ntproc as a signal handler for SIGABRT, as that
5721 should be done by the dumped Emacs.
5722
5723 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5724
5725 * w32select.c (term_w32select): Protect against repeated
5726 invocation by setting clipboard_owner to NULL after calling
5727 DestroyWindow.
5728
5729 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5730 and term_ntproc to their modified signatures.
5731
54d629be
EZ
5732 * character.c (char_string, string_char): Remove calls to
5733 MAYBE_UNIFY_CHAR. See the discussion starting at
5734 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5735 for the details.
5736
59f7af81
CY
57372012-09-25 Chong Yidong <cyd@gnu.org>
5738
5739 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5740
22e8cf4a
SM
57412012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5742
5743 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5744 when encountering an unknown bytecode.
5745
578098f3
PE
57462012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 image.c, indent.c: Use bool for booleans.
5749 * dispextern.h (struct image_type): Members valid_p, load, init
5750 now return bool, not int. All uses changed.
5751 * image.c: Omit unnecessary static decls.
5752 (x_create_bitmap_mask, x_build_heuristic_mask):
5753 Return void, not int, since callers don't care about the return value.
5754 (x_create_bitmap_mask, define_image_type, valid_image_p)
5755 (struct image_keyword, parse_image_spec, image_spec_value)
5756 (check_image_size, image_background)
5757 (image_background_transparent, x_clear_image_1)
5758 (postprocess_image, lookup_image, x_check_image_size)
5759 (x_create_x_image_and_pixmap, xbm_image_p)
5760 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5761 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5762 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5763 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5764 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5765 (png_image_p, init_png_functions, png_load_body, png_load)
5766 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5767 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5768 (init_gif_functions, gif_load, imagemagick_image_p)
5769 (imagemagick_load_image, imagemagick_load, svg_image_p)
5770 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5771 (gs_load):
5772 * nsimage.m (ns_load_image):
5773 * nsterm.m (ns_defined_color):
5774 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5775 * xfns.c (x_defined_color):
5776 * xterm.c (x_alloc_lighter_color_for_widget)
5777 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5778 (x_alloc_lighter_color):
5779 * indent.c (disptab_matches_widthtab, current_column)
5780 (scan_for_column, string_display_width, indented_beyond_p)
5781 (compute_motion, vmotion, Fvertical_motion):
5782 Use bool for booleans.
5783
a5f2b6ec
CY
57842012-09-24 Chong Yidong <cyd@gnu.org>
5785
5786 * chartab.c (Fset_char_table_default): Obsolete function removed.
5787
18e27ea8
PE
57882012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5789
afea8a8a
PE
5790 Move pid_t related decls out of lisp.h.
5791 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5792 (interruptible_wait_for_termination):
5793 Move these decls from lisp.h to syswait.h, since they use pid_t.
5794 Needed on FreeBSD; see Herbert J. Skuhra in
5795 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5796 * callproc.c: Include syswait.h.
5797
18e27ea8
PE
5798 gnutls.c, gtkutil.c: Use bool for boolean.
5799 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5800 (emacs_gnutls_handle_error):
5801 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5802 (xg_hide_tooltip, xg_create_frame_widgets)
5803 (create_dialog, xg_uses_old_file_dialog)
5804 (xg_get_file_with_chooser, xg_get_file_with_selection)
5805 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5806 (xg_item_label_same_p, xg_update_menubar)
5807 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5808 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5809 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5810 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5811 (update_frame_tool_bar, free_frame_tool_bar):
5812 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5813 * nsmenu.m (ns_update_menubar):
5814 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5815 * xfns.c (Fx_show_tip) [USE_GTK]:
5816 Use bool for boolean.
5817 * gtkutil.c (xg_update_frame_menubar):
5818 * xmenu.c (update_frame_menubar):
5819 Return void, not int, since caller ignores return value.
5820 * gtkutil.c (xg_change_toolbar_position):
5821 Return void, not 1.
5822
af0e9f75
JB
58232012-09-23 Juanma Barranquero <lekktu@gmail.com>
5824
5825 * makefile.w32-in (BLOCKINPUT_H): Remove.
5826 (SYSSIGNAL_H): New macro.
5827 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5828 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5829 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5830 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5831 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5832 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5833 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5834 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5835 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5836 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5837 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5838 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5839 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5840 ($(BLD)/w32xfns.$(O)): Update dependencies.
5841
5101529e
EZ
58422012-09-23 Eli Zaretskii <eliz@gnu.org>
5843
5844 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5845 fatal_error_backtrace.
5846
5847 * w32proc.c (sys_kill): Undo last change: don't do anything when
5848 invoked to deliver SIGABRT to our own process. This is now
5849 handled by emacs_raise.
5850
2c3ee0ad
JB
58512012-09-23 Juanma Barranquero <lekktu@gmail.com>
5852
5853 * w32term.c (w32_read_socket): Remove leftover reference to
5854 interrupt_input_pending.
5855
62a1d661
PE
58562012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5857
5858 Do not use SA_NODEFER.
5859 Problem reported by Dani Moncayo in
5860 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5861 * alloc.c (die):
5862 * sysdep.c (emacs_abort): Do not reset signal handler.
5863 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5864 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5865 wanted even on POSIXish hosts, and it doesn't work on Windows.
5866
a0942b9a
JD
58672012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5868
5869 * xterm.c (x_term_init): Call fixup_locale before and after calling
5870 gtk_init (Bug#12392).
5871
d07ff9db
CY
58722012-09-23 Chong Yidong <cyd@gnu.org>
5873
5874 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5875 Vdynamic_library_alist.
5876
5877 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5878 (Fgnutls_available_p): Caller changed.
5879
5880 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5881 (Flibxml_parse_xml_region): Likewise.
5882
5883 * dispextern.h (struct image_type): Remove arg from init function.
5884
5885 * image.c (Finit_image_library, lookup_image_type)
5886 (define_image_type): Remove now-unneeded second arg.
5887 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5888 (init_tiff_functions, init_gif_functions, init_svg_functions):
5889 Arglist and w32_delayed_load calling convention changed.
5890 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 5891 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 5892
4d7e6e51
PE
58932012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5894
5895 Simplify and avoid signal-handling races (Bug#12471).
5896 * alloc.c (die):
5897 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5898 Avoid recursive loop if there's a fatal error in the function itself.
5899 * atimer.c (pending_atimers):
5900 * blockinput.h: Don't include "atimer.h"; no longer needed.
5901 (interrupt_input_pending): Remove. All uses removed.
5902 pending_signals now counts both atimers and ordinary interrupts.
5903 This is less racy than having three separate pending-signal flags.
5904 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5905 (input_blocked_p):
5906 Rename from their upper-case counterparts BLOCK_INPUT,
5907 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5908 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5909 This makes it easier to access volatile variables more accurately.
5910 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5911 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5912 that's more reliable if the code is buggy and sets
5913 interrupt_input_blocked to a negative value. All uses changed.
5914 * atimer.c (deliver_alarm_signal):
5915 Remove. No need to deliver this to the parent; any thread can
5916 handle this signal now. All uses replaced by underlying handler.
5917 * atimer.c (turn_on_atimers):
5918 * dispnew.c (handle_window_change_signal):
5919 * emacs.c (handle_danger_signal):
5920 * keyboard.c (kbd_buffer_get_event):
5921 Don't reestablish signal handler; not needed with sigaction.
5922 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5923 (UNBLOCK_INPUT_TO):
5924 Rework to avoid unnecessary accesses to volatile variables.
5925 (UNBLOCK_INPUT_TO): Now a function.
5926 (totally_unblock_input, unblock_input): New decls.
5927 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5928 (init_data): Remove. Necessary stuff now done in init_signal.
5929 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5930 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5931 (fatal_error_code): Remove; no longer needed.
5932 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5933 it doesn't always backtrace. All uses changed. No need to reset
5934 signal to default, since sigaction and/or die does that for us now.
5935 Use emacs_raise (FOO), not kill (getpid (), FOO).
5936 (main): Check more-accurately whether we're dumping.
5937 Move fatal-error setup to sysdep.c
5938 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5939 * gtkutil.c (xg_get_file_name, xg_get_font):
5940 Remove no-longer-needed signal-mask manipulation.
5941 * keyboard.c, process.c (POLL_FOR_INPUT):
5942 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5943 * keyboard.c (read_avail_input): Remove.
5944 All uses replaced by gobble_input.
5945 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5946 (kbd_buffer_store_event_hold, gobble_input):
5947 (record_asynch_buffer_change) [USABLE_SIGIO]:
5948 (store_user_signal_events):
5949 No need to mess with signal mask.
5950 (gobble_input): If blocking input and there are terminals, simply
5951 set pending_signals to 1 and return. All hooks changed to not
5952 worry about whether input is blocked.
5953 (process_pending_signals): Clear pending_signals before processing
5954 them, in case a signal comes in while we're processing.
5955 By convention callers now test pending_signals before calling us.
5956 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5957 New functions, to support changes to blockinput.h.
5958 (handle_input_available_signal): Now extern.
5959 (reinvoke_input_signal): Remove. All uses replaced by
5960 handle_async_input.
5961 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5962 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5963 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5964 Clear sigmask reliably, even if Fsignal returns, which it can.
5965 Omit unnecessary accesses to volatile var.
5966 (quit_throw_to_read_char): No need to restore sigmask.
5967 * keyboard.c (gobble_input, handle_user_signal):
5968 * process.c (wait_reading_process_output):
5969 Call signal-handling code rather than killing ourselves.
5970 * lisp.h: Include <float.h>, for...
5971 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5972 (pending_signals): Now volatile.
5973 (syms_of_data): Now const if IEEE floating point.
5974 (handle_input_available_signal) [USABLE_SIGIO]:
5975 (terminate_due_to_signal, record_child_status_change): New decls.
5976 * process.c (create_process): Avoid disaster if memory is exhausted
5977 while we're processing a vfork, by tightening the critical section
5978 around the vfork.
5979 (send_process_frame, process_sent_to, handle_pipe_signal)
5980 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5981 ignores SIGPIPE.
5982 (send_process): No need for setjmp/longjmp any more, since the
5983 SIGPIPE stuff is now gone. Instead, report an error if errno
5984 is EPIPE.
5985 (record_child_status_change): Now extern. PID and W are now args.
5986 Return void, not bool. All callers changed.
5987 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5988 Remove. All uses removed. This bug should be fixed now in a
5989 different way.
5990 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5991 and record the child status change directly. This avoids the
5992 need to futz with the signal mask.
5993 (process_fatal_action): Move here from emacs.c.
5994 (emacs_sigaction_flags): New function, containing
5995 much of what used to be in emacs_sigaction_init.
5996 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5997 caught by emacs, to make races less likely.
5998 (deliver_process_signal): Rename from handle_on_main_thread.
5999 All uses changed.
6000 (BACKTRACE_LIMIT_MAX): Now at top level.
6001 (thread_backtrace_buffer, threadback_backtrace_pointers):
6002 New static vars.
6003 (deliver_thread_signal, deliver_fatal_thread_signal):
6004 New functions, for more-accurate delivery of thread-specific signals.
6005 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6006 (deliver_arith_signal): Handle in this thread, not
6007 in the main thread, since it's triggered by this thread.
6008 (maybe_fatal_sig): New function.
6009 (init_signals): New arg DUMPING so that we can be more accurate
6010 about whether we're dumping. Caller changed.
6011 Treat thread-specific signals differently from process-general signals.
6012 Block all signals while handling fatal error; that's safer.
6013 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6014 on IEEE hosts.
6015 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6016 Ignore SIGPIPE unless batch.
6017 (emacs_backtrace): Output backtrace for the appropriate thread,
6018 which is not necessarily the main thread.
6019 * syssignal.h: Include <stdbool.h>.
6020 (emacs_raise): New macro.
6021 * xterm.c (x_connection_signal): Remove; no longer needed
6022 now that we use sigaction.
6023 (x_connection_closed): No need to mess with sigmask now.
6024 (x_initialize): No need to reset SIGPIPE handler here, since
6025 init_signals does this for us now.
6026
8f4635e9
JD
60272012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6028
6029 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6030 background rect may be larger (Bug#12245).
8f4635e9 6031
3296976d
CY
60322012-09-23 Chong Yidong <cyd@gnu.org>
6033
6034 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6035
d41e491e
PE
60362012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6037
6038 * .gdbinit: Just stop at fatal_error_backtrace.
6039 See Stefan Monnier's request in
6040 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6041 Remove no-longer-used query of system type.
6042
c88b867f
CY
60432012-09-22 Chong Yidong <cyd@gnu.org>
6044
6045 * search.c (Freplace_match): Doc fix (Bug#12325).
6046
6047 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6048
6049 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6050 (Fline_end_position): Doc fix.
6051
6052 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6053
bb4d86b4
CY
60542012-09-22 Chong Yidong <cyd@gnu.org>
6055
6056 * dispextern.h (struct image_type): Add new slot, storing a type
6057 initialization function.
6058
6059 * image.c (define_image_type): Call the image initializer function
6060 if it is defined. Arguments and return value changed.
6061 (valid_image_p, make_image): Callers changed.
6062 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6063 (gif_type, imagemagick_type, svg_type, gs_type):
6064 Add initialization functions.
bb4d86b4
CY
6065 (Finit_image_library): Call lookup_image_type.
6066 (CHECK_LIB_AVAILABLE): Macro deleted.
6067 (lookup_image_type): Call define_image_type here, rather than via
6068 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6069 (syms_of_image): Move define_image_type calls for xbm_type and
6070 pbm_type to lookup_image_type.
6071
df9685f3
EZ
60722012-09-22 Eli Zaretskii <eliz@gnu.org>
6073
6074 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6075 'idle_timers' from here ...
6076 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6077 lists, to avoid infloops when the timer does something stupid,
6078 like reinvoke itself with the same or smaller time-out.
6079 (Bug#12447)
6080
8e17c9ba
MR
60812012-09-22 Martin Rudalics <rudalics@gmx.at>
6082
6083 * window.c (Fsplit_window_internal): Handle only Qt value of
6084 Vwindow_combination_limit separately.
6085 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6086 (Vwindow_combination_limit): New default value.
6087 Rewrite doc-string.
8e17c9ba 6088
589bd69b
EZ
60892012-09-22 Eli Zaretskii <eliz@gnu.org>
6090
6091 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6092 the new overlay string. (Bug#10159)
6093
01108e3f
PE
60942012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6095
6096 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6097 or that fprintf is async-signal-safe. POSIX doesn't require
6098 either assumption.
6099
82f8cd94
CY
61002012-09-22 Chong Yidong <cyd@gnu.org>
6101
6102 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6103 (Bug#8207).
6104
3cccbd87
KH
61052012-09-22 Kenichi Handa <handa@gnu.org>
6106
6107 * composite.c (composition_reseat_it): Handle the case that a
6108 grapheme cluster is not covered by a single font (Bug#12352).
6109
09c01941
CY
61102012-09-21 Chong Yidong <cyd@gnu.org>
6111
6112 * image.c (define_image_type): Avoid adding duplicate types to
6113 image_types (Bug#12463). Suggested by Jörg Walter.
6114
acfa068f 61152012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6116
6117 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6118 (print_load_command_name): Add case LC_DATA_IN_CODE.
6119 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6120
acfa068f 61212012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6122
6123 * eval.c (Frun_hook_with_args_until_success)
6124 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6125
acfa068f 61262012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6127
6128 * fileio.c (Ffile_selinux_context): Only call freecon when
6129 lgetfilecon succeeded.
6130 (Fset_file_selinux_context): Likewise. (Bug#12444)
6131
acfa068f 61322012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6133
6134 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6135 reordering, locate the cursor by calling set_cursor_from_row; if
6136 that fails, clear the desired glyph matrix before returning a
6137 failure indication to the caller. Fixes leaving garbled display
6138 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6139 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6140 scrolling through multibyte text.
aa36e4d2 6141
e99f70c8
SM
61422012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6143
6144 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6145 calling mark_vectorlike since that's the one that marks the window.
6146 (mark_discard_killed_buffers): Mark the final cdr.
6147 * window.h (struct window): Move prev/next_buffers to the
6148 non-standard fields.
6149 * window.c (make_window): Initialize prev/next_buffers manually.
6150
f75beb47
PE
61512012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 Omit unused arg EXPECTED from socket hooks.
6154 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6155 * nsterm.m (ns_term_init):
6156 * termhooks.h (struct terminal.read_socket_hook):
6157 * w32inevt.c (w32_console_read_socket):
6158 * w32term.c (w32_read_socket):
6159 * xterm.c (XTread_socket):
6160 Omit unused arg EXPECTED. All callers changed.
6161 (store_user_signal_events): Return void, not int, since callers no
6162 longer care about the return value. All uses changed.
6163
b019b76a
JB
61642012-09-20 Juanma Barranquero <lekktu@gmail.com>
6165
6166 * w32gui.h (XParseGeometry): Do not declare.
6167
05642592
PE
61682012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6169
e4bce92a 6170 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6171 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6172 <http://bugs.gnu.org/12471#8> (last line).
6173
05642592
PE
6174 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6175 (XParseGeometry): Now static. Substitute extremal values for
6176 values that are out of range.
6177
e543ae91
JD
61782012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6179
6180 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6181
6182 * nsfns.m (XParseGeometry): Remove.
6183 (Fx_create_frame): Call x_set_offset to correctly interpret
6184 top_pos in geometry.
6185
3a880af4 6186 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6187 (Fx_parse_geometry): If there is a space in string, call
6188 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6189
45ba16c7
EZ
61902012-09-17 Eli Zaretskii <eliz@gnu.org>
6191
c8b9f1bc
EZ
6192 * search.c (scan_buffer): Use character positions in calls to
6193 region_cache_forward and region_cache_backward, not byte
6194 positions. (Bug#12196)
6195
b4c932a2
EZ
6196 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6197 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6198
45ba16c7
EZ
6199 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6200 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6201 emacs_blocked_malloc, now deleted.
6202
eeceac93
PE
62032012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6204
6205 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6206 The workaround was for improving performance on Solaris 2.4, but
6207 is getting in the way now. Emacs will still work if someone is
6208 still running Solaris 2.4 in a museum somewhere; Sun dropped
6209 support for Solaris 2.4 in 2003.
6210 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6211 * process.c (create_process) [HAVE_WORKING_VFORK]:
6212 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6213 since Emacs no longer uses vfork on that platform.
6214
78f83752
GM
62152012-09-17 Glenn Morris <rgm@gnu.org>
6216
6217 * emacs.c: Use COPYRIGHT.
6218
634b8cac
PE
62192012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6220
0caaedb1
PE
6221 Remove configure's --without-sync-input option (Bug#12450).
6222 When auditing signal-handling in preparation for cleaning it up,
6223 I found that SYNC_INPUT has race conditions and would be a real
6224 pain to fix. Since it's an undocumented and deprecated
6225 configure-time option, now seems like a good time to remove it.
6226 Also see <http://bugs.gnu.org/11080#16>.
6227 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6228 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6229 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6230 (malloc_hysteresis):
6231 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6232 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6233 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6234 (dont_register_blocks, bytes_used_when_reconsidered)
6235 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6236 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6237 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6238 Remove. All uses removed.
0caaedb1
PE
6239 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6240 implementation, one that depends on whether the new macro
6241 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6242 is defined.
6243 * atimer.c (run_timers, handle_alarm_signal):
6244 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6245 (handle_async_input, process_pending_signals)
6246 (handle_input_available_signal, init_keyboard):
6247 * nsterm.m (ns_read_socket):
6248 * process.c (wait_reading_process_output):
6249 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6250 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6251 (emacs_write):
6252 * xterm.c (XTread_socket):
6253 Assume SYNC_INPUT.
6254 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6255 * eval.c (handling_signal): Remove. All uses removed.
6256 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6257 All uses replaced with the SYNC_INPUT version.
6258 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6259 Remove decls.
6260 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6261 Now static.
6262
634b8cac
PE
6263 * font.c (Ffont_shape_gstring): Remove unused local.
6264
83da1b55
GM
62652012-09-16 Glenn Morris <rgm@gnu.org>
6266
518650a5
GM
6267 * Makefile.in (clean): No longer run nextstep's clean.
6268
83da1b55
GM
6269 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6270 (ns_frag): Remove.
6271 (ns-app): Move here from ns.mk, and simplify.
6272 (clean): Simplify nextstep entry.
6273 * ns.mk: Remove file.
6274
85a43e2e
KH
62752012-09-17 Kenichi Handa <handa@gnu.org>
6276
6277 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6278 not covert the last few charactes.
6279
ba13e616 62802012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6281
6282 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6283 here, but just check the validity of glyphs in the glyph-string.
6284
a8c729af
MR
62852012-09-16 Martin Rudalics <rudalics@gmx.at>
6286
3a880af4
SM
6287 * window.c (Fwindow_parameter, Fset_window_parameter):
6288 Accept any window as argument (Bug#12452).
a8c729af 6289
c077c059
JD
62902012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6291
6292 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6293 to ns_term_init to avoid memory leak.
6294
6295 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6296 explicit retain/release.
6297 (ns_term_init): Only allow one display. Initialize outerpool and
6298 ns_*_types.
6299
39a57ad0
PE
63002012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6303 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6304 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6305 the Microsoft problem in a different way, by altering ../nt/config.nt.
6306
7105c8cb
EZ
63072012-09-15 Eli Zaretskii <eliz@gnu.org>
6308
6309 * w32xfns.c:
6310 * w32uniscribe.c:
6311 * w32term.c:
6312 * w32select.c:
6313 * w32reg.c:
6314 * w32proc.c:
6315 * w32menu.c:
6316 * w32inevt.c:
6317 * w32heap.c:
6318 * w32font.c:
6319 * w32fns.c:
6320 * w32console.c:
6321 * w32.c:
6322 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6323 by lisp.h. This completes removal of setjmp.h inclusion
6324 erroneously announced in the previous commit. (Bug#12446)
6325
6326 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6327 more accurate.
6328
6329 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6330 not defined as a macro. The latter happens on MS-Windows.
6331 (Bug#12446)
6332
0328b6de
PE
63332012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6336 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6337 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6338 only reason for the instance was because "lisp.h" was included.
6339 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6340 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6341 and _longjmp with the new symbols. Emacs already uses _setjmp if
6342 available, so this change affects only POSIXish hosts that have
6343 sigsetjmp but not _setjmp, such as some versions of Solaris and
6344 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6345 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6346 (png_load_body) [HAVE_PNG]:
6347 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6348 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6349 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6350 since PNG requires jmp_buf. This is the only exception to the
6351 general rule that we now use sys_setjmp and sys_longjmp.
6352 This exception is OK since this code does not change the signal
6353 mask or longjmp out of a signal handler.
6354
2af03429
PE
63552012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6356
6357 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6358 Include "syssignal.h", for 'main_thread'.
6359
2f294edf
DA
63602012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6361
6362 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6363 * insdel.c (replace_range, replace_range_2):
6364 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6365 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6366 Remove redundant check before calling offset_intervals.
6367
6b533e9c
MR
63682012-09-14 Martin Rudalics <rudalics@gmx.at>
6369
6370 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6371 current buffer (Bug#12387).
6372
2a7931e3
JB
63732012-09-14 Juanma Barranquero <lekktu@gmail.com>
6374
6375 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6376
c18e885b
PE
63772012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6378
6379 Use a more backwards-compatible timer format (Bug#12430).
6380 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6381 vector element, not from the 4th, since PSECS is now at the end.
6382 (Fcurrent_idle_time): Doc fix.
6383
d59a1afb
DA
63842012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6385
6386 Function to mark objects and remove killed buffers at once.
6387 * alloc.c (discard_killed_buffers): Rename to ...
6388 (mark_discard_killed buffers) ... new name. Add marking
6389 of remaining objects. Fix comment. Adjust users.
6390 (mark_object): Do not touch frame buffer lists here.
6391 * frame.c (delete_frame): Reset frame buffer lists here.
6392
5f0cb45a
PE
63932012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6394
8ea47e3a
PE
6395 Better workaround for GNOME bug when --enable-gcc-warnings.
6396 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6397 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6398 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6399
4a4bbad2
PE
6400 Simplify SIGIO usage (Bug#12408).
6401 The code that dealt with SIGIO was crufty and confusing, e.g., it
6402 played tricks like "#undef SIGIO" but these tricks were not used
6403 consistently. Simplify mostly by not #undeffing standard symbols,
6404 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6405 or not as we please) rather than "defined SIGIO" (standard symbol
6406 that we probably shouldn't #undef).
6407 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6408 Modules that need it can include it.
6409 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6410 * dispextern.h (ignore_sigio): New decl.
6411 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6412 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6413 * emacs.c (shut_down_emacs):
6414 * keyboard.c (kbd_buffer_store_event_hold):
6415 Use ignore_sigio rather than invoking 'signal' directly.
6416 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6417 for FIONREAD.
6418 (FIONREAD, SIGIO): Do not #undef.
6419 (tty_read_avail_input): Use #error rather than a syntax error.
6420 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6421 for I_PIPE, used by SETUP_SLAVE_PTY.
6422 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6423 * sysdep.c (croak): Remove; no longer needed. This bit of
6424 temporary code, with Fred N. Fish's comment that it's temporary,
6425 has been in Emacs since at least 1992!
6426 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6427 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6428 * syssignal.h (croak): Remove decl.
6429 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6430 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6431 now that we're termios-only.
6432 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6433 * term.c (dissociate_if_controlling_tty): Use #error rather than
6434 a run-time error.
6435
5f0cb45a
PE
6436 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6437 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6438 to work around GNOME bug 683906.
6439 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6440 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6441 This works around GCC bug 54561.
6442
40bce90b
PE
64432012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6444
6445 More fixes for 'volatile' and setjmp/longjmp.
6446 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6447 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6448 (png_load_body) [HAVE_PNG]:
6449 (jpeg_load_body) [HAVE_JPEG]:
6450 New function, with most of the old parent function's body.
6451 (png_load) [HAVE_PNG]:
6452 (jpeg_load) [HAVE_JPEG]:
6453 Invoke the new function, to avoid longjmp munging our locals.
6454 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6455 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6456 longjmp is passed 2, as the C standard doesn't guarantee this.
6457 Instead, store the failure code into mgr->failure_code.
6458
bfeae2cf
SM
64592012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6460
6461 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6462 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6463 (syms_of_keyboard): Remove support for unread-command-char.
6464
8099e36b
EZ
64652012-09-12 Eli Zaretskii <eliz@gnu.org>
6466
6467 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6468 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6469 violation. (Bug#12426)
6470
92547ff9
PE
64712012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6474
45b82ad0
SM
64752012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6476
6477 * eval.c: Add `inhibit-debugger'.
6478 (Qinhibit_debugger): New symbol.
6479 (call_debugger): Bind it instead of Qdebug_on_error.
6480 (maybe_call_debugger): Test Vinhibit_debugger.
6481 (syms_of_eval): Define inhibit-debugger.
6482 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6483 (syms_of_xdisp): Remove inhibit-debug-on-message.
6484
5779a1dc
PE
64852012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6486
50f2e553
PE
6487 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6488 If a nonvolatile local variable is written before a _longjmp to
6489 the frame containing the variable, and is read after the _longjmp,
6490 the value read is indeterminate. Some local variables of type
6491 'struct handler' and 'struct catchtag' are used in this way, so
6492 mark each of their slots as volatile if the slot can be set before
6493 _longjmp and read afterwards.
6494 * lisp.h (struct handler): var and chosen_clause are now volatile.
6495 (struct catchtag): val, next, and pdlcount are now volatile.
6496
ae1d87e2
PE
6497 * bidi.c (bidi_push_it, bidi_pop_it):
6498 * fns.c (copy_hash_table):
6499 * image.c (define_image_type):
6500 * keyboard.c (kbd_buffer_store_event_hold):
6501 * process.c (Fprocess_send_eof):
6502 * xfaces.c (x_create_gc) [HAVE_NS]:
6503 * xgselect.c (xg_select):
6504 Prefer assignment to memcpy when either will do.
6505
5779a1dc
PE
6506 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6507 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6508 time an item is removed. No need to mark this function 'inline';
6509 the compiler knows better than we do.
6510
c4c9756b
JD
65112012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6512
6513 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6514 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6515 to change_frame_size (Bug#12388).
6516 (windowDidResize:): Pass YES to updateFrameSize.
6517
6518 * nsterm.h: Add delay parameter to updateFrameSize.
6519
d73e321c
DA
65202012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6521
6522 Discard killed buffers from deleted window and frame objects.
6523 This reduces an amount of references to killed buffers and
6524 helps GC to reclaim them faster.
6525 * alloc.c (discard_killed_buffers): New function.
6526 (mark_object): Use it for deleted windows and frames.
6527 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6528 or deleted frame, restore its global binding.
d73e321c
DA
6529 * data.c (swap_in_global_binding): Add GC notice.
6530 (swap_in_symval_forwarding): Use convenient set_blv_where.
6531 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6532 * window.h: ... to here.
6533
e578f381
DA
65342012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6535
6536 Convenient macro to check whether the buffer is live.
6537 * buffer.h (BUFFER_LIVE_P): New macro.
6538 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6539 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6540
3057e615
YM
65412012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6542
6543 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6544 composition cases (Bug#12364).
6545
6546 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6547 overhang of succeeding glyphs overlapping box cursor.
6548
6549 * w32term.c (x_draw_glyph_string): Likewise.
6550
6fda35f2
PE
65512012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6552
c990426a
PE
6553 Simplify, document, and port floating-point (Bug#12381).
6554 The porting part of this patch fixes bugs on non-IEEE platforms
6555 with frexp, ldexp, logb.
6556 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6557 Now static.
6558 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6559 support, by removing commented-out code and briefly listing the
6560 C89 functions excluded. The commented-out stuff was confusing
6561 maintenance, e.g., we thought we needed cbrt but it was commented out.
6562 (logb): Remove decl; no longer needed.
6563 (isfinite): New macro, if not already supplied.
6564 (isnan): Don't replace any existing macro.
6565 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6566 are present on all C89 platforms.
6567 (Ffrexp): Do not special-case zero, as frexp does the right thing
6568 for that case.
6569 (Flogb): Do not use logb, as it doesn't have the desired meaning
6570 on hosts that use non-base-2 floating point. Instead, stick with
6571 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6572 frexp, to avoid getting an unspecified result.
6573
6fda35f2
PE
6574 * xdisp.c (Qinhibit_debug_on_message): Now static.
6575
16130a58
JD
65762012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6577
6578 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6579 NSBezierPath (Bug#12131).
6580
d105a573
CY
65812012-09-10 Chong Yidong <cyd@gnu.org>
6582
6583 * fns.c (Fdelq, Fdelete): Doc fix.
6584
ff55dfe8
PE
65852012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6586
6587 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6588 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6589
e7032e7c
SM
65902012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6591
6592 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6593 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6594 Use it.
6595
e9957956
EZ
65962012-09-09 Eli Zaretskii <eliz@gnu.org>
6597
aba05ce9
EZ
6598 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6599 left fringe if the window has a left margin. This avoids leaving
6600 traces of the cursor because its leftmost pixel is not drawn over.
6601
e9957956
EZ
6602 * dispnew.c (update_window_line): When the left margin area of a
6603 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6604 that screen line. (Bug#12277)
6605
f6196b87
PE
66062012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6607
6608 Assume C89 or later for math functions (Bug#12381).
6609 This simplifies the code, and makes it a bit smaller and faster,
6610 and (most important) makes it easier to clean up signal handling
6611 since we can stop worring about floating-point exceptions in
6612 library code. That was a problem before C89, but the problem
6613 went away many years ago on all practical Emacs targets.
6614 * data.c, image.c, lread.c, print.c:
6615 Don't include <math.h>; no longer needed.
6616 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6617 might be autoconfigured, as that never happens.
6618 * data.c (fmod):
6619 * doprnt.c (DBL_MAX_10_EXP):
6620 * print.c (DBL_DIG):
6621 Remove. C89 or later always defines these.
6622 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6623 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6624 (arith_error, domain_error, domain_error2):
6625 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6626 no longer needed -- we simply return what C returns. All uses removed.
6627 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6628 the wrapped code.
6629 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6630 Remove. All uses expanded, as these macros are no longer used
6631 more than once and are now more trouble than they're worth.
6632 (Ftan): Use tan, not sin / cos.
6633 (Flogb): Assume C89 frexp.
6634 (fmod_float): Assume C89 fmod.
6635 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6636 (init_floatfns): Remove. All uses removed.
6637
9d7f1863
JD
66382012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6639
6640 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6641 compositeToPoint for OSX < 10.6 (Bug#12390).
6642
eabf0404
PE
66432012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6644
6645 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6646 This produces more-accurate results.
6647
0b3b1d23
JD
66482012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6649
6650 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6651 changes (Bug#12088).
6652
6dcef6ec
CY
66532012-09-08 Chong Yidong <cyd@gnu.org>
6654
6655 * syntax.c (Fstring_to_syntax): Doc fix.
6656
aa7d57c5
JD
66572012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6658
6659 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6660 in the internal border.
6661 (x_set_window_size): Remove static variables and their usage.
6662 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
6663 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6664 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
6665 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6666 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6667 (ns_fix_rect_ibw): Remove.
6668 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6669 (ns_dumpglyphs_box_or_relief): Ditto.
6670 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6671 adjustment.
6672 (ns_dumpglyphs_image): Ditto.
fc0c31f8 6673 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
6674 border adjustment.
6675 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6676 their usage. Add fringe_extended_p and its use as in other terms.
6677 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6678 scroll bar was removed.
6679 (updateFrameSize): New function.
6680 (windowDidResize): Move code to updateFrameSize and call it.
6681
6682 * nsterm.h (EmacsView): Add updateFrameSize.
6683
1a5432bc
CY
66842012-09-07 Chong Yidong <cyd@gnu.org>
6685
b4f5313e
CY
6686 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6687
1a5432bc
CY
6688 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6689
1a4f1e9b
PE
66902012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
6693 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6694 Problem introduced when merging patches. Noted by Eli Zaretskii in
6695 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
6696 * floatfns.c: Comment fix.
6697 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6698 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6699 and anyway the declaration is harmless even if SIGDANGER is not defined.
6700 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6701 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6702 source files not surprisingly expected syssignal.h to define, or
6703 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6704 Include <sys/ioctl.h>, for FIONREAD.
6705 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6706 This eliminates a problem whereby other files mysteriously had
6707 to include "syssignal.h" before including "systty.h" if they
6708 wanted to use "#ifdef SIGIO".
6709
bc8000ff
EZ
67102012-09-07 Eli Zaretskii <eliz@gnu.org>
6711
3e6d6928
EZ
6712 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6713
6714 * w32.c (sigemptyset): Empty the set.
6715 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6716
bc8000ff
EZ
6717 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6718
b4fa72f2
DA
67192012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6720
6721 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6722 (mark_object): Likewise for frame objects.
6723
30730c93
PE
67242012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6725
6726 * syssignal.h (handle_on_main_thread): Always declare,
6727 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6728 This ports to platforms without HAVE_PTHREAD.
6729
2fe28299
PE
67302012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 Signal-handler cleanup (Bug#12327).
6733 Emacs's signal handlers were written in the old 4.2BSD style with
6734 sigblock and sigmask and so forth, and this led to some
6735 inefficiencies and confusion. Rewrite these to use
6736 pthread_sigmask etc. without copying signal sets around. Also,
6737 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6738 'signal', and instead use functions that do not attempt to take
6739 over the system name space. This patch causes Emacs's text
6740 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6741 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6742 Do not include <signal.h> or "syssignal.h", as these
6743 modules do not use signals.
6744 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6745 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6746 Do not include <signal.h>, as "syssignal.h" does that for us now.
6747 * atimer.c (sigmask_atimers): New function.
6748 (block_atimers, unblock_atimers): New functions,
6749 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6750 All uses replaced.
6751 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6752 no longer needed here.
6753 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 6754 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
6755 * sysdep.c (struct save_signal): New member 'action', replacing
6756 old member 'handler'.
6757 (save_signal_handlers, restore_signal_handlers):
6758 Use sigaction instead of 'signal' to save and restore.
6759 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6760 New function. All users of 'signal' modified to use set_sighandler
6761 if they're writeonly, and to use sys_signal if they're read+write.
6762 (emacs_sigaction_init, forwarded_signal): New functions.
6763 (sys_signal): Remove. All uses replaced by calls to sigaction
6764 and emacs_sigaction_init, or by direct calls to 'signal'.
6765 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6766 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6767 all uses replaced by pthread_sigmask etc. calls.
6768 * syssignal.h: Include <signal.h>.
6769 (emacs_sigaction_init, forwarded_signal): New decls.
6770 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6771 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6772 (sigmask, sys_sigmask): Remove; no longer needed.
6773 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6774 (sigblock, sigunblock, sigfree):
6775 (sigsetmask) [!defined sigsetmask]:
6776 Remove. All uses replaced by pthread_sigmask.
6777 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6778 no longer need to be replaced, and its typical old uses
6779 are now done via emacs_sigaction_init and sigaction.
6780 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6781 (sys_sigdel): Remove; unused.
6782 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6783
0216c128
EZ
67842012-09-06 Eli Zaretskii <eliz@gnu.org>
6785
6786 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6787 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6788
c752cfa9
DA
67892012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6790
6791 Explicitly mark buffer_defaults and buffer_local_symbols.
6792 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6793 mark_local_symbols here.
6794 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6795 since special buffers aren't marked here any more.
6796 (allocate_buffer): Chain new buffer with all_buffers here...
6797 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6798 not here.
6799 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6800 (syms_of_buffer): Remove staticpro of the above.
6801 (init_buffer_once): Set names for buffer_defaults and
6802 buffer_local_symbols.
6803
a864ef14
PE
68042012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6805
6806 Use bool for booleans in font-related modules.
6807 * font.c (font_intern_prop, font_style_to_value)
6808 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6809 (generate_otf_features, font_check_otf_features, font_check_otf)
6810 (font_match_p, font_list_entities, font_at):
6811 * fontset.c (fontset_id_valid_p, reorder_font_vector
6812 (fontset_find_font, Fset_fontset_font)
6813 (face_suitable_for_char_p) [0]:
6814 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6815 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6816 (m17n_flt_initialized, ftfont_shape_by_flt):
6817 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6818 * nsfont.m (nsfont_draw):
6819 * w32font.c (w32font_draw):
6820 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6821 Use bool for booleans.
6822 * font.h: Adjust to above API changes.
6823 (struct font, struct font_driver, struct font_driver_list):
6824 Use bool for booleans.
6825 (struct font): Remove useless member encoding_type.
6826 All users removed.
6827 * fontset.c, xftfont.c: Omit unnecessary static decls.
6828
0699fc18
DA
68292012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6830
6831 * alloc.c (mark_object): Revert window marking code
6832 since it's unsafe for the Fset_window_configuration.
6833
20ef56db
PE
68342012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6835
2fe28299 6836 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
6837 Be more systematic about preserving errno whenever a signal
6838 handler returns, even if it's not in the main thread. Do this by
6839 renaming signal handlers to distinguish between signal delivery
6840 and signal handling. All uses changed.
6841 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6842 * data.c (deliver_arith_signal): Rename from arith_error.
6843 * dispnew.c (deliver_window_change_signal): Rename from
6844 window_change_signal.
6845 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6846 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6847 * keyboard.c (deliver_input_available_signal): Rename from
6848 input_available_signal.
6849 (deliver_user_signal): Rename from handle_user_signal.
6850 (deliver_interrupt_signal): Rename from interrupt_signal.
6851 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6852 (deliver_child_signal): Rename from sigchld_handler.
6853 * atimer.c (handle_alarm_signal):
6854 * data.c (handle_arith_signal):
6855 * dispnew.c (handle_window_change_signal):
6856 * emacs.c (handle_fatal_signal, handle_danger_signal):
6857 * keyboard.c (handle_input_available_signal):
6858 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6859 * process.c (handle_pipe_signal, handle_child_signal):
6860 New functions, with the actual signal-handling code taken from the
6861 original respective signal handlers, sans the sporadic attempts to
6862 preserve errno, since that's now done by handle_on_main_thread.
6863 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6864 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6865 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6866 Move to sysdep.c.
6867 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6868 Move initialization of main_thread to sysdep.c's init_signals.
6869 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6870 our usage, and simplifies the mainline code.
6871 (record_child_status_change): New static function, as a helper
6872 for handle_child_signal, and with most of the old child handler's
6873 contents.
6874 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6875 (handle_child_signal): Use the above.
6876 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6877 Moved here from emacs.c.
6878 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6879 code moved here from emacs.c's main function.
6880 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
6881 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6882 This lets callers save and restore errno properly.
20ef56db 6883
e3ccf108
DA
68842012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6885
6886 Remove redundant or unused things here and there.
6887 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6888 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6889 * editfns.c (Fcompare_buffer_substrings): Likewise.
6890 * frame.h (struct terminal, struct font_driver_list):
6891 Remove redundant declarations.
6892 * window.h (Qleft, Qright): Likewise.
6893
697e1e39
DA
68942012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6895
6896 Do not mark objects from deleted buffers, windows and frames.
6897 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6898 (mark_object): Likewise for windows and frames.
6899
c1ca42ca
DA
69002012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6901
6902 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6903 buffer_defaults and buffer_local_symbols as valid objects.
6904 Return special value to denote them.
6905
014d93be
PE
69062012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6907
f75d7a91
PE
6908 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6909 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6910 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6911 (file_name_absolute_p, Fsubstitute_in_file_name):
6912 (check_executable, check_writable, Ffile_accessible_directory_p)
6913 (Fset_file_selinux_context, Fdefault_file_modes)
6914 (Finsert_file_contents, choose_write_coding_system)
6915 (Fwrite_region, build_annotations, a_write, e_write)
6916 (Fdo_auto_save):
6917 * filelock.c (boot_time_initialized, get_boot_time)
6918 (get_boot_time_1, lock_file_1, within_one_second):
6919 * floatfns.c (in_float):
6920 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6921 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6922 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6923 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6924 * window.c (compare_window_configurations):
6925 Use bool for booleans.
6926 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6927 (Fdefault_file_modes): Now mode_t, not int, for modes.
6928 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6929 (internal_delete_file): Now returns void, not a (boolean) int,
6930 since nobody was looking at the return value.
6931 * lisp.h, window.h: Adjust to above API changes.
6932
014d93be
PE
6933 * xdisp.c (set_message): Simplify and reindent last change.
6934
776f29e1
JB
69352012-09-05 Juanma Barranquero <lekktu@gmail.com>
6936
6937 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6938
7f7e0167
LI
69392012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6940
6941 * eval.c (call_debugger): Make the function non-static so that we
6942 can call it from set_message.
6943
6944 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6945 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6946
cf29dd84
PE
69472012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6948
6949 Give more-useful info on a fatal error (Bug#12328).
6950 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6951 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6952 of doing the work ourselves.
6953 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6954 do most of the work.
6955 (fatal_error_backtrace): New function, taken from the guts
6956 of the old fatal_error_signal, but with a new option to output
6957 a backtrace.
6958 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6959 info about the signal than just its number.
6960 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6961 * sysdep.c: Include <execinfo.h>
6962 (emacs_backtrace): New function, taken partly from the previous
6963 code of the 'die' function.
6964 (emacs_abort): Call fatal_error_backtrace rather than abort.
6965
972debf2
SM
69662012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6967
6968 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6969 eager (load-time) macro-expansion.
6970 * lisp.mk (lisp): Add macroexp.
6971
1088b922
PE
69722012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6973
6974 Simplify redefinition of 'abort' (Bug#12316).
6975 Do not try to redefine the 'abort' function. Instead, redo
6976 the code so that it calls 'emacs_abort' rather than 'abort'.
6977 This removes the need for the NO_ABORT configure-time macro
6978 and makes it easier to change the abort code to do a backtrace.
6979 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6980 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6981 Remove; sysdep.c's emacs_abort now takes its place.
6982 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6983 'abort' changed to use 'emacs_abort'.
6984 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6985 (abort) [!defined abort]: Rename to ...
6986 (emacs_abort): ... new name.
6987 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6988 the place of the old 'abort' in emacs.c.
6989 * w32.c, w32fns.c (abort): Do not #undef.
6990 * w32.c (emacs_abort): Rename from w32_abort.
6991
30934d33
EZ
69922012-09-04 Eli Zaretskii <eliz@gnu.org>
6993
6994 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6995 offsets[j].dv, since the y axis of the screen coordinates points
6996 down, while the y axis of the font definition coordinates points
6997 up. This fixes display of Arabic diacritics such as KASRA and
6998 KASRATAN. (Bug#11860)
6999
af26b72c
PE
70002012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7001
7002 Be more systematic about _setjmp vs setjmp.
7003 * alloc.c (test_setjmp, mark_stack):
7004 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7005 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7006 (png_load, my_error_exit, jpeg_load):
7007 * process.c (send_process_trap, send_process):
7008 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7009 The underscored versions are up to 30x faster on some hosts.
7010 Formerly, the code used setjmp+longjmp sometimes and
7011 _setjmp+_longjmp at other times, with no particular reason to
7012 prefer setjmp+longjmp.
7013
26d4541d
PE
70142012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7015
d42f4f0f 7016 Fix minor problem found by static checking.
26d4541d 7017 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7018
c5e28e39
MR
70192012-09-03 Martin Rudalics <rudalics@gmx.at>
7020
7021 * buffer.c (Fdelete_all_overlays): New function.
7022
3eab3ca9
CY
70232012-09-03 Chong Yidong <cyd@gnu.org>
7024
7025 * gtkutil.c: Add extern decl for Qxft.
7026
c04889f8
PE
70272012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7028
1882aa38
PE
7029 * emacs.c, eval.c: Use bool for boolean.
7030 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7031 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7032 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7033 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7034 (main, decode_env_path, Fdaemon_initialized):
7035 * eval.c (call_debugger, Finteractive_p, interactive_p):
7036 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7037 (maybe_call_debugger, Fbacktrace):
7038 * process.c (read_process_output, exec_sentinel):
7039 Use bool for booleans.
7040 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7041 All callers changed.
7042 * eval.c (interactive_p): Omit always-true boolean argument
7043 EXCLUDE_SUBRS_P. All callers changed.
7044 * dispextern.h, lisp.h: Reflect above API changes.
7045 * firstfile.c (dummy): Use the address of 'main', whose signature
7046 won't change, instead of the address of 'initialize', whose
7047 signature just changed from int to bool.
7048 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7049 * msdos.c (fatal_error_in_progress): ... from here.
7050 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7051 of incrementing it.
7052 (redisplay_internal, unwind_redisplay): Simply clear
7053 REDISPLAYING_P when unwinding, instead of saving its previous,
7054 always-false value and then restoring it.
7055
a411ac43
PE
7056 Clean up some extern decls.
7057 Mostly, this hoists extern decls out of .c files and into .h files.
7058 That way, we're more likely to catch errors if the interfaces change.
7059 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7060 declare xg_mark_data.
7061 * dispextern.h (x_frame_parm_handlers):
7062 * font.h (Qxft):
7063 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7064 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7065 (Qultra_bold, Qoblique, Qitalic):
7066 Move extern decl here from .c file.
7067 * alloc.c (xg_mark_data) [USE_GTK]:
7068 * doc.c (Qclosure):
7069 * eval.c (Qlexical_binding):
7070 * fns.c (time) [!HAVE_UNISTD_H]:
7071 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7072 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7073 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7074 * lread.c (Qinternal_interpreter_environment):
7075 * minibuf.c (Qbuffer):
7076 * process.c (QCfamily, QCfilter):
7077 * widget.c (free_frame_faces):
7078 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7079 * xfont.c (x_clear_errors):
7080 * xterm.c (x_frame_parm_handlers):
7081 Remove now-redundant extern decls.
7082 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7083 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7084 Now static.
7085 * xfaces.c: Remove unnecessary static decls.
7086 * xterm.c (updating_frame): Remove decl of nonexistent object.
7087
c04889f8
PE
7088 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7089 when building globals.h, as the objects that are not built on
7090 this host are not needed to compile C files on this host.
7091
8b339673
JD
70922012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7093
7094 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7095
7096 * frame.h: Add missing prototype for x_wm_set_size_hint.
7097
a08d4ba7
PE
70982012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7101 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7102 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7103 (Fsubstitute_command_keys):
7104 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7105 (save_excursion_save, save_excursion_restore)
7106 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7107 (format_time_string, general_insert_function)
7108 (make_buffer_string, make_buffer_string_both)
7109 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7110 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7111 (copy_text, insert_1, insert_1_both, insert_from_string)
7112 (insert_from_string_before_markers, insert_from_string_1)
7113 (insert_from_buffer, insert_from_buffer_1, replace_range)
7114 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7115 (del_range_2, modify_region):
7116 * intervals.c (intervals_equal, balance_possible_root_interval)
7117 (adjust_intervals_for_insertion, merge_properties_sticky)
7118 (graft_intervals_into_buffer, lookup_char_property)
7119 (adjust_for_invis_intang, set_point_both)
7120 (get_property_and_range, compare_string_intervals)
7121 (set_intervals_multibyte_1, set_intervals_multibyte):
7122 * keyboard.c (decode_timer):
7123 Use bool for boolean.
7124 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7125 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7126
48c948de
CY
71272012-09-02 Chong Yidong <cyd@gnu.org>
7128
7129 * keymap.c (push_key_description): Print M-TAB as C-M-i
7130 (Bug#11758).
7131
6c49a40b
JB
71322012-09-02 Juanma Barranquero <lekktu@gmail.com>
7133
7134 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7135 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7136 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7137 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7138 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7139 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7140 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7141
4dfbd238
EZ
71422012-09-01 Eli Zaretskii <eliz@gnu.org>
7143
7e510e28
EZ
7144 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7145 more than one grapheme cluster passed to the shaper: compute the
7146 offset adjustment values separately for each cluster. (Bug#11860)
7147
4dfbd238
EZ
7148 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7149 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7150 about implicit conversions from integer to pointer.
7151
86571ae0
DC
71522012-09-01 Daniel Colascione <dancol@dancol.org>
7153
7154 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7155 system used too early.
7156
0e23ef9d
PE
71572012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7158
7159 Better seed support for (random).
7160 * emacs.c (main): Call init_random.
7161 * fns.c (Frandom): Set the seed from a string argument, if given.
7162 Remove long-obsolete Gentzel cruft.
7163 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7164 (init_random): New function.
7165
17a2cbbd
DC
71662012-09-01 Daniel Colascione <dancol@dancol.org>
7167
7168 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7169 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7170 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7171 x_wm_set_size_hint, x_query_colors, x_real_positions,
7172 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7173 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7174 all of which have been moved to common code.
7175
7176 * xfaces.c: Include TERM_HEADER instead of listing all possible
7177 window-system headers.
7178
7179 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7180 to match header.
7181
7182 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7183 directly accessing frame internals.
7184
f18cbb28 7185 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7186 globals_of_w32font.
7187
7188 * process.c: Include TERM_HEADER instead of listing all possible
7189 window-system headers.
7190
3a880af4
SM
7191 * nsterm.h: Remove declarations now in frame.h.
7192 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7193
7194 * menu.c: Include TERM_HEADER instead of listing all possible
7195 window-system headers.
7196
7197 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7198 window system.
7199
7200 * keyboard.c: Include TERM_HEADER instead of listing all possible
7201 window-system headers.
7202
7203 * image.c: Include TERM_HEADER instead of listing all possible
7204 window-system headers. Declare Vlibrary_cache when compiling for
7205 Windows.
7206
7207 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7208 window system declarations.
7209
7210 * frame.h: Move common functions here: set_frame_menubar,
7211 x_set_window_size, x_sync, x_get_focus_frame,
7212 x_set_mouse_position, x_set_mouse_pixel_position,
7213 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7214 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7215 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7216 x_activate_menubar, x_real_positions, x_bitmap_icon,
7217 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7218 and x_query_colors.
7219
7220 * frame.c: Include TERM_HEADER instead of listing all possible
7221 window-system headers.
7222
7223 * font.c: Include TERM_HEADER instead of listing all possible
7224 window-system headers.
7225
7226 * emacs.c: Include TERM_HEADER.
7227
f18cbb28
EZ
7228 * dispnew.c: Include TERM_HEADER instead of listing all possible
7229 window-system headers.
17a2cbbd 7230
f18cbb28 7231 * ccl.h: Include character.h.
17a2cbbd
DC
7232
7233 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7234 the current window system; include in list of objects to link into
7235 Emacs.
7236
c650a5de
DA
72372012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7238
7239 Remove mark_ttys function and fix tty_display_info initialization.
7240 * lisp.h (mark_ttys): Remove prototype.
7241 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7242 to mark_ttys because all possible values of 'top_frame' slot are
7243 the frames which are reachable from Vframe_list.
7244 * term.c (mark_ttys): Remove.
7245 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7246
4e0f6479
DA
72472012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7248
7249 Change struct frame bitfields from unsigned char to unsigned.
7250 * frame.h (struct frame): Change type of 'display_preempted',
7251 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7252 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7253 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7254 bitfields from unsigned char to unsigned.
7255
8b96a52c
DA
72562012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7257
7258 Remove unused member of struct x_output and struct w32_output.
7259 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7260 * w32term.h (struct w32_output): Likewise.
7261
b4444c8a
JD
72622012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7263
7264 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7265 does not become zero (Bug#12234).
7266
b98521db
PE
72672012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7270 for GCC 4.7.1 x86-64.
7271
31d02438
GM
72722012-08-30 Glenn Morris <rgm@gnu.org>
7273
7274 * lread.c (init_lread): For out-of-tree builds, only add the
7275 source directory's site-lisp dir to the load-path if it exists,
7276 consistent with in-tree builds. (Bug#12302)
7277
7f8941d8
JD
72782012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7279
7280 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7281 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7282 (windowShouldClose:): Set window_closed.
7283 (dealloc): New member, free button_values.
fc0c31f8
JB
7284 (process_dialog:): Make member function. Remove window argument,
7285 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7286 in button_values.
7287 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7288 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7289 (addString:row:): Remove return self, declare return value as void.
7290 (addSplit): Remove return self, declare return value as void.
7291 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7292 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7293 (initFromContents:isQuestion:): Adjust call to process_dialog.
7294 Code formatting change.
7295 (timeout_handler:): Set timer_fired to YES.
7296 (runDialogAt:): Set timer_fired to NO.
7297 Handle click on close button as quit.
7298
7299 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7300 Add window_closed and button_values. Add void as return value for
7301 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7302 Add process_dialog as new member.
7303
eada0861 73042012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7305
eada0861
GM
7306 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7307 is not one of the heaps we manage. (Bug#12242)
7308
73092012-08-28 Glenn Morris <rgm@gnu.org>
7310
7311 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7312
457294dd
MR
73132012-08-28 Martin Rudalics <rudalics@gmx.at>
7314
7315 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7316 auto-buffer-name window parameter. Install revision of reverted
7317 fix.
457294dd 7318
4f2daf31
DA
73192012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7320
7321 Do not allow to set major mode for a dead buffer.
7322 * buffer.c (Fset_buffer_major_mode): Signal an error
7323 if the buffer is dead.
7324 (Fother_buffer, other_buffer_safely): Remove redundant
7325 nested declaration.
7326
66322887
DA
73272012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7328
7329 Always use set_buffer_if_live to restore original buffer at unwind.
7330 * buffer.h (record_unwind_current_buffer): New function.
7331 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7332 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7333 * undo.c, window.c: Adjust users.
7334 * buffer.c (set_buffer_if_live): Fix comment.
7335
a3d794a1
DA
73362012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7337
7338 Fix usage of set_buffer_internal.
7339 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7340 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7341 * coding.c (decode_coding): Omit redundant test.
7342 * fileio.c (decide_coding_unwind): Likewise.
7343 * fns.c (secure_hash): Likewise.
7344 * insdel.c (modify_region): Likewise.
7345 * keyboard.c (command_loop_1): Likewise.
7346 * print.c (PRINTFINISH): Likewise.
7347 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7348
59ea14cd
PE
73492012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7350
7351 * dispnew.c: Use bool for boolean.
7352 (frame_garbaged, display_completed, delayed_size_change)
7353 (fonts_changed_p, add_window_display_history)
7354 (add_frame_display_history, verify_row_hash)
7355 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7356 (row_equal_p, realloc_glyph_pool)
7357 (allocate_matrices_for_frame_redisplay)
7358 (showing_window_margins_p)
7359 (adjust_frame_glyphs_for_frame_redisplay)
7360 (build_frame_matrix_from_leaf_window, make_current)
7361 (mirrored_line_dance, mirror_line_dance, update_frame)
7362 (update_window_tree, update_single_window)
7363 (check_current_matrix_flags, update_window, update_text_area)
7364 (update_window_line, set_window_update_flags, scrolling_window)
7365 (update_frame_1, scrolling, buffer_posn_from_coords)
7366 (do_pending_window_change, change_frame_size)
7367 (change_frame_size_1, sit_for):
7368 Use bool for boolean.
7369 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7370 and remove last int (actually boolean) argument, which was always 0.
7371 All callers changed.
7372 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7373 * dispextern.h (struct composition_it): Use bool for boolean.
7374 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7375 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7376 * dired.c (file_name_completion):
7377 Use bool for boolean. (This was missed in an earlier change.)
7378
95072a94
MR
73792012-08-27 Martin Rudalics <rudalics@gmx.at>
7380
7381 * window.c (Fset_window_configuration): Revert first part of
7382 last change.
7383
0f19feff
JD
73842012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7385
7386 * nsterm.h (NSPanel): New class variable dialog_return.
7387
3a880af4
SM
7388 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7389 Initialize dialog_return.
0f19feff
JD
7390 (windowShouldClose:): Use stop instead of stopModalWithCode.
7391 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7392 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7393 event.
7394 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7395 modal loop returns.
7396
f10fe38f
PE
73972012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7398
de1339b0
PE
7399 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7400 * composite.c (find_composition, composition_gstring_p)
7401 (composition_reseat_it, find_automatic_composition):
7402 * data.c (let_shadows_buffer_binding_p)
7403 (let_shadows_global_binding_p, set_internal, make_blv)
7404 (Fmake_variable_buffer_local, Fmake_local_variable)
7405 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7406 (cons_to_signed, arith_driver):
7407 * dbusbind.c (xd_in_read_queued_messages):
7408 * dired.c (directory_files_internal, file_name_completion):
7409 Use bool for booleans.
7410 * dired.c (file_name_completion):
7411 * process.h (fd_callback):
7412 Omit int (actually boolean) argument. It wasn't being used.
7413 All uses changed.
7414 * composite.h, lisp.h: Reflect above API changes.
7415
f10fe38f
PE
7416 * cmds.c, coding.c: Use bool for booleans.
7417 * cmds.c (move_point, Fself_insert_command):
7418 * coding.h (struct composition status, struct coding_system):
7419 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7420 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7421 (emacs_mule_char, decode_coding_emacs_mule)
7422 (encode_coding_emacs_mule, detect_coding_iso_2022)
7423 (decode_coding_iso_2022, encode_invocation_designation)
7424 (encode_designation_at_bol, encode_coding_iso_2022)
7425 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7426 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7427 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7428 (encode_coding_raw_text, detect_coding_charset)
7429 (decode_coding_charset, encode_coding_charset, detect_eol)
7430 (detect_coding, get_translation_table, produce_chars)
7431 (consume_chars, reused_workbuf_in_use)
7432 (make_conversion_work_buffer, code_conversion_save)
7433 (decode_coding_object, encode_coding_object)
7434 (detect_coding_system, char_encodable_p)
7435 (Funencodable_char_position, code_convert_region)
7436 (code_convert_string, code_convert_string_norecord)
7437 (Fset_coding_system_priority):
7438 * fileio.c (Finsert_file_contents):
7439 Use bool for booleans.
7440 * coding.h, lisp.h: Reflect above API changes.
7441 * coding.c: Remove unnecessary static function decls.
7442 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7443 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7444 not a boolean 'int', since callers never look at the return value.
7445 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7446 * coding.h (decoding_buffer_size, encoding_buffer_size)
7447 (emacs_mule_string_char): Remove unused extern decls.
7448 (struct iso_2022_spec, struct coding_system):
7449 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7450 (struct emacs_mule_spec): Remove unused field 'full_support'.
7451 All initializations removed.
7452 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7453
5474c384
DA
74542012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7455
f10fe38f 7456 Fix spare memory change (Bug#12286).
5474c384
DA
7457 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7458 (valid_lisp_object_p): Likewise.
7459
c4b6914d
MR
74602012-08-27 Martin Rudalics <rudalics@gmx.at>
7461
7462 * window.c (Fset_window_configuration): Record any window's old
7463 buffer if it's replaced (see Bug#8789). If the new current
7464 buffer doesn't appear in the selected window, go to its old
7465 point (Bug#12208).
7466
35aaa1ea
DA
74672012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7468
7469 Special MEM_TYPE_SPARE to denote reserved memory.
7470 * alloc.c (enum mem_type): New memory type.
7471 (refill_memory_reserve): Use new type for spare memory.
7472 This prevents live_cons_p and live_string_p from incorrect
7473 detection of uninitialized objects from spare memory as live.
7474
6af64513
PE
74752012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7476
8b2e00a3
PE
7477 Spelling fixes.
7478 * Makefile.in (.PHONY): versioclean -> versionclean.
7479
b52d6985
PE
7480 Remove unused external symbols.
7481 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7482 * window.c (Qwindow_valid_p, decode_valid_window):
7483 Now static, not extern.
7484 * data.c (Qinterval): Remove; unused.
7485 (syms_of_data): Do not define 'interval'.
7486 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7487 * window.h (decode_valid_window):
7488 Remove decls.
7489
d5172d4f
PE
7490 * character.c, charset.c, chartab.c: Use bool for booleans.
7491 * character.c (lisp_string_width, string_count_byte8)
7492 (string_escape_byte8):
7493 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7494 (load_charset_map_from_file, map_charset_chars)
7495 (Fdefine_charset_internal, define_charset_internal)
7496 (Fdeclare_equiv_charset, find_charsets_in_text)
7497 (Ffind_charset_region, char_charset, Fiso_charset):
7498 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7499 (sub_char_table_set, sub_char_table_set_range)
7500 (char_table_set_range, optimize_sub_char_table)
7501 (map_sub_char_table):
7502 Use bool for boolean.
7503 * character.c (str_to_unibyte): Omit last boolean argument; it was
7504 always 0. All callers changed.
7505 * character.h, charset.h: Adjust to match previous changes.
7506 * character.h (char_printable_p): Remove decl of nonexistent function.
7507 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7508 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7509 are all boolean, so make them single-bit bitfields.
7510
6af64513
PE
7511 * lisp.h (ASET): Remove attempt to detect side effects.
7512 It was meant to be temporary and it often doesn't work,
7513 because when IDX has side effects the behavior of IDX==IDX
7514 is undefined. See Stefan Monnier in
7515 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7516
e1f29348
BR
75172012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7518
7519 * lisp.h (functionp): New function (extracted from Ffunctionp).
7520 (FUNCTIONP): Use it.
7521 * eval.c (Ffunctionp): Use it.
7522
17c05d74
PE
75232012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7524
0f46bc75
PE
7525 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7526 as that's faster and simpler than static storage. Don't bother
7527 with the g_main_context_query overhead if g_main_context_pending
7528 says no events are pending.
7529 (gfds, gfds_size): Remove these static vars.
7530 (xgselect_initialize): Remove; no longer needed.
7531 All uses and decls removed.
7532
ee4c0f69
PE
7533 * emacs.c (fatal_error_signal_hook): Remove.
7534 All uses removed. This leftover from old code was always 0.
7535
17c05d74
PE
7536 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7537 * casefiddle.c (casify_object, casify_region):
7538 * casetab.c (set_case_table):
7539 * category.c, category.h (word_boundary_p):
7540 * category.h (CHAR_HAS_CATEGORY):
7541 Use bool for booleans, instead of int.
7542
391ceac5
EZ
75432012-08-25 Eli Zaretskii <eliz@gnu.org>
7544
7545 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7546
2f221583
PE
75472012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7548
f4a681b0
PE
7549 On assertion failure, print backtrace if available.
7550 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7551 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7552 * Makefile.in (LIB_EXECINFO): New macro.
7553 (LIBES): Use it.
7554
2f221583
PE
7555 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7556 * bytecode.c (exec_byte_code):
7557 * callint.c (check_mark, Fcall_interactively):
7558 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7559 (getenv_internal, sync_process_alive, call_process_exited):
7560 * lisp.h (USE_SAFE_ALLOCA):
7561 Use bool for booleans, instead of int.
7562 * lisp.h, process.h: Adjust prototypes to match above changes.
7563 * callint.c (Fcall_interactively): Don't assume the mark's
7564 offset fits in 'int'.
7565
37ef52bb
PE
75662012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 * buffer.c, buffer.h: Use bool for boolean.
7569 * buffer.c (reset_buffer_local_variables)
7570 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7571 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7572 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7573 (overlay_touches_p, overlay_strings, Foverlay_put)
7574 (report_overlay_modification, call_overlay_mod_hooks):
7575 (mmap_enlarge, mmap_set_vars):
7576 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7577 Use bool for booleans, instead of int.
7578 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7579 since the 1-or-0 return value is always ignored anyway.
7580 (mmap_initialized_p):
7581 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7582 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7583
2cc21167
PE
75842012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7585
7586 * bidi.c: Use bool for boolean.
7587 This is a bit more readable, and makes the text segment of bidi.o
7588 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7589 Presumably it's faster too.
7590 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7591 Now bool.
7592 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7593 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7594 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7595 (bidi_explicit_dir_char, bidi_level_of_next_char)
7596 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7597 Use bool for booleans, instead of int.
7598 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7599 (bidi_unshelve_cache): Adjust decls to match code.
7600
7db4ddf4
MR
76012012-08-23 Martin Rudalics <rudalics@gmx.at>
7602
7603 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7604 argument.
7605
b1bb8011
PE
76062012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7607
7608 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7609 * atimer.h: Include <stdbool.h>.
7610
ff687885
DN
76112012-08-22 Dan Nicolaescu <dann@gnu.org>
7612
7613 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7614 compile time tests instead of run time tests on systems that do
7615 not use them.
7616 (FRAME_MAC_P): Remove leftover from deleted code.
7617 * frame.c (syms_of_frame): Remove leftover from deleted code.
7618
4ce7a138
JD
76192012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7620
7621 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7622
d733ec6d
PE
76232012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7626 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 7627 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
7628 (fontset_add): Return void, for FONTSET_ADD.
7629
d0d2d26f
PE
76302012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7631
fce31d69
PE
7632 * alloc.c: Use bool for booleans.
7633 (gc_in_progress, abort_on_gc)
7634 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7635 (dont_register_blocks) [GC_MALLOC_CHECK]:
7636 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7637 (check_string_bytes, make_specified_string, memory_full)
7638 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7639 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7640 (mark_stack, valid_pointer_p, make_pure_string)
7641 (Fgarbage_collect, survives_gc_p, gc_sweep):
7642 Use bool for booleans, instead of int.
7643 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7644 Remove unused local.
7645 * alloc.c (PURE_POINTER_P):
7646 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7647 * editfns.c (Fformat):
7648 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7649 (Fdo_auto_save):
7650 * fns.c (sweep_weak_table):
7651 * lisp.h (suppress_checking, push_message, survives_gc_p)
7652 (make_pure_string, gc_in_progress, abort_on_gc):
7653 * lread.c (readchar, read1):
7654 * print.c (Fprin1_to_string):
7655 * xdisp.c (push_message):
7656 Use bool for booleans affected directly or indirectly by
7657 alloc.c's changes.
7658
d0d2d26f
PE
7659 Make recently-introduced setters macros.
7660 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7661 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7662 (set_fontset_default, set_fontset_fallback): Rename from their
7663 upper-case counterparts, and make them functions rather than macros.
7664 This is more consistent with the other recently-introduced setters.
7665 These don't need to be inline, since they're local.
7666
d18e2bb6
JD
76672012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7668
7669 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7670 the loop (Bug#12247).
7671
1b9d9d16
PE
76722012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7673
7674 * lisp.h (vcopy): Use memcpy rather than our own loop.
7675 This fixes a performance regression introduced by the recent
7676 addition of vcopy. This means 'vcopy' will need to be modified
7677 for a copying collector, but that's OK. Also, tighten the
7678 checking in the assertion.
7679
b2f09701
EZ
76802012-08-21 Eli Zaretskii <eliz@gnu.org>
7681
7682 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7683 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7684 non-base glyph for the width of the base character, according to
e1f29348
BR
7685 what x_draw_composite_glyph_string_foreground expects.
7686 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
7687 expectations, to produce correct width of the composed character.
7688 Reverse the sign of the DU offset produced by ScriptPlace.
7689
9b994fed
PE
76902012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7691
7692 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7693
086ca913
DA
76942012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7695
7696 Avoid direct writes to contents member of struct Lisp_Vector.
7697 * lisp.h (vcopy): New function to copy data into vector.
7698 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7699 * fns.c (Ffillarray): Use ASET.
7700 * keyboard.c (timer_check_2): Use AREF and ASET.
7701 (append_tool_bar_item, Frecent_keys): Use vcopy.
7702 * lread.c (read_vector): Use ASET.
7703 * msdos.c (Frecent_doskeys): Use vcopy.
7704 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7705 (Finternal_merge_in_global_face): Use ASET and vcopy.
7706 * xfont.c (xfont_list_pattern): Likewise.
7707
5481664a
MR
77082012-08-21 Martin Rudalics <rudalics@gmx.at>
7709
7710 * window.c (Fwindow_point): For the selected window always return
7711 the position of its buffer's point.
7712 (Fset_window_point): For the selected window always go in its
7713 buffer to the specified position.
7714
6d470bdd
DA
77152012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7716
7717 Setter macros for fontsets.
7718 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7719 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7720 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7721 Adjust users.
7722
24564fe1
GM
77232012-08-20 Glenn Morris <rgm@gnu.org>
7724
7725 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7726 Don't assume that `ln -f' works.
7727
0a05a035
EZ
77282012-08-20 Eli Zaretskii <eliz@gnu.org>
7729
7730 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7731 and later about non-assignments with no effect. See discussion at
7732 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7733 details.
7734
e46f2325
DA
77352012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7736
7737 Inline setter functions for Lisp_Objects slots of struct specbinding.
7738 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7739 Adjust users.
7740
734fbd86
MR
77412012-08-20 Martin Rudalics <rudalics@gmx.at>
7742
7743 * window.c (select_window): Always make selected window's buffer
7744 current.
7745
f1a95992
DA
77462012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7747
7748 Use AREF and ASET for docstrings of category tables.
7749 * category.h (CATEGORY_DOCSTRING): Use AREF.
7750 (SET_CATEGORY_DOCSTRING): Use ASET.
7751 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7752
e83064be
DA
77532012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7754
7755 Inline setter functions for hash table members.
7756 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7757 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7758 (set_hash_key_and_value, set_hash_index, set_hash_next)
7759 (set_hash_hash): New functions.
7760 * charset.c, fns.c: Adjust users.
7761
4ce60d2e
DA
77622012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7763
7764 Inline getter and setter functions for per-buffer values.
7765 * buffer.h (per_buffer_default, set_per_buffer_default)
7766 (per_buffer_value, set_per_buffer_value): New functions.
7767 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7768 * buffer.c, data.c: Adjust users.
7769
c06c9690
JB
77702012-08-20 Juanma Barranquero <lekktu@gmail.com>
7771
7772 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7773
32bd4250
PE
77742012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7775
bad03192 7776 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
7777 as gnulib does this if the system doesn't.
7778 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
7779 Remove declaration. MS-Windows declares it on stdlib.h which is
7780 included by conf_post.h.
b69a6d22
PE
7781 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7782 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7783 * vm-limit.c: Include <unistd.h>, for 'environ'.
7784
22d7feb2
PE
7785 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7786 (start_of_data): Remove decl; mem-limits.h provides it.
7787
32bd4250
PE
7788 * xdisp.c (handle_invisible_prop): Make it a bit faster
7789 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7790
450809af
CY
77912012-08-19 Chong Yidong <cyd@gnu.org>
7792
7793 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7794 ends (Bug#3874).
7795
9e677988
AS
77962012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7797
6b1319ce
AS
7798 * .gdbinit: Use call instead of set when calling a function in the
7799 inferior.
7800
9e677988
AS
7801 * data.c (set_internal): Don't use set_blv_found.
7802 (Fkill_local_variable): Likewise.
7803
d7191076
AA
78042012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7805
7806 * nsfont.m (ns_ascii_average_width): Ensure the string
7807 ascii_printable is initialized with a null-terminated character
7808 array. Otherwise, it can contain undesired extra characters.
7809
e757f1c6
PE
78102012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7811
7812 port new setting code to Sun C 5.8 2005/10/13
7813 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7814 Return void, not Lisp_Object. Otherwise, the compiler
7815 complains about (A?B:C) where B is void and C is Lisp_Object
7816 when compiling CHAR_TABLE_SET, due to the recent change to
7817 the API of sub_char_table_set_contents.
7818
a999ce26
CY
78192012-08-18 Chong Yidong <cyd@gnu.org>
7820
7821 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7822 for the string case (Bug#3874).
7823
3f22b86f
PE
78242012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7825
39eb03f1
PE
7826 * buffer.h (BSET): Remove (Bug#12215).
7827 Replace all uses with calls to new setter functions.
7828 (bset_bidi_paragraph_direction, bset_case_canon_table)
7829 (bset_case_eqv_table, bset_directory, bset_display_count)
7830 (bset_display_time, bset_downcase_table)
7831 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7832 (bset_last_selected_window, bset_local_var_alist)
7833 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7834 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7835 (bset_width_table):
7836 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7837 (bset_auto_fill_function, bset_auto_save_file_format)
7838 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7839 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7840 (bset_cache_long_line_scans, bset_case_fold_search)
7841 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7842 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7843 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7844 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7845 (bset_header_line_format, bset_indicate_buffer_boundaries)
7846 (bset_indicate_empty_lines, bset_invisibility_spec)
7847 (bset_left_fringe_width, bset_major_mode, bset_mark)
7848 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7849 (bset_name, bset_overwrite_mode, bset_pt_marker)
7850 (bset_right_fringe_width, bset_save_length)
7851 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7852 (bset_scroll_up_aggressively, bset_selective_display)
7853 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7854 (bset_word_wrap, bset_zv_marker):
7855 * category.c (bset_category_table):
7856 * syntax.c (bset_syntax_table):
7857 New setter functions.
7858
6a09a33b
PE
7859 * process.h (PSET): Remove (Bug#12215).
7860 Replace all uses with calls to new setter functions.
7861 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7862 (PROCESS_INLINE): New macro.
7863 (pset_childp): New setter function.
7864 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7865 * process.c (PROCESS_INLINE):
7866 Define to EXTERN_INLINE, so that the corresponding functions
7867 are compiled into code.
7868 (pset_buffer, pset_command, pset_decode_coding_system)
7869 (pset_decoding_buf, pset_encode_coding_system)
7870 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7871 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7872 (pset_type, pset_write_queue): New setter functions.
7873
e8c17b81
PE
7874 * window.h (WSET): Remove (Bug#12215).
7875 Replace all uses with calls to new setter functions.
7876 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7877 (WINDOW_INLINE): New macro.
7878 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7879 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7880 (wset_total_lines, wset_vertical_scroll_bar)
7881 (wset_window_end_pos, wset_window_end_valid)
7882 (wset_window_end_vpos): New setter functions.
7883 * window.c (WINDOW_INLINE):
7884 Define to EXTERN_INLINE, so that the corresponding functions
7885 are compiled into code.
7886 (wset_combination_limit, wset_dedicated, wset_display_table)
7887 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7888 (wset_new_normal, wset_new_total, wset_next_buffers)
7889 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7890 (wset_prev_buffers, wset_right_fringe_width)
7891 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7892 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7893 (wset_window_parameters):
7894 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7895 (wset_column_number_displayed, wset_region_showing):
7896 New setter functions.
7897
3f22b86f
PE
7898 * termhooks.h (TSET): Remove (Bug#12215).
7899 Replace all uses with calls to new setter functions.
7900 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7901 (TERMHOOKS_INLINE): New macro.
7902 (tset_charset_list, tset_selection_alist): New setter functions.
7903 * terminal.c (TERMHOOKS_INLINE):
7904 Define to EXTERN_INLINE, so that the corresponding functions
7905 are compiled into code.
7906 (tset_param_alist): New setter function.
7907
742af32f
PE
79082012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7909
15dbb4d6
PE
7910 * keyboard.h (KSET): Remove (Bug#12215).
7911 Replace all uses with calls to new setter functions.
7912 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7913 (KEYBOARD_INLINE): New macro.
7914 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7915 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7916 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7917 New setter functions.
7918 * keyboard.c (KEYBOARD_INLINE):
7919 Define to EXTERN_INLINE, so that the corresponding functions
7920 are compiled into code.
7921 (kset_echo_string, kset_kbd_queue)
7922 (kset_keyboard_translate_table, kset_last_prefix_arg)
7923 (kset_last_repeatable_command, kset_local_function_key_map)
7924 (kset_overriding_terminal_local_map, kset_real_last_command)
7925 (kset_system_key_syms): New setter functions.
7926
f00af5b1
PE
7927 * frame.h (FSET): Remove (Bug#12215).
7928 Replace all uses with calls to new setter functions.
7929 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7930 (FRAME_INLINE): New macro.
7931 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7932 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7933 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7934 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7935 (fset_param_alist, fset_root_window, fset_scroll_bars)
7936 (fset_selected_window, fset_title, fset_tool_bar_items)
7937 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7938 * frame.c (FRAME_INLINE):
7939 Define to EXTERN_INLINE, so that the corresponding functions
7940 are compiled into code.
7941 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7942
0c94c8d6
PE
7943 A few more naming-convention fixes for getters and setters.
7944 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7945 and rename from buffer_overlays_set_before.
7946 (set_buffer_overlays_after): Move here from buffer.h, and rename
7947 from buffer_overlays_set_after.
7948 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7949 All uses changed.
7950 (set_buffer_intervals): Rename from buffer_set_intervals.
7951 * intervals.c (set_interval_object): Move here from intervals.h,
7952 and rename from interval_set_object.
7953 (set_interval_left): Move here from intervals.h, and rename from
7954 interval_set_left.
7955 (set_interval_right): Move here from intervals.h, and rename from
7956 interval_set_right.
7957 (copy_interval_parent): Move here from intervals.h, and rename from
7958 interval_copy_parent.
7959 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7960 (set_interval_plist): Rename from interval_set_plist.
7961 Return void, not Lisp_Object, since no caller uses the result.
7962 * lisp.h (string_intervals): Rename from string_get_intervals.
7963 (set_string_intervals): Rename from string_set_intervals.
7964
34dabdb7
PE
7965 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7966 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7967 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7968 All uses changed. See the end of
7969 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7970
742af32f
PE
7971 * lisp.h (CSET): Remove (Bug#12215).
7972 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7973 (set_char_table_purpose): New functions,
7974 replacing CSET. All uses changed. For example, replace
7975 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7976 "set_char_table_parent (char_table, parent);".
742af32f
PE
7977 The old version was confusing because it used the same name
7978 'parent' for two different things.
7979
a04e2c62
DA
79802012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7981
7982 Functions to get and set Lisp_Object fields of buffer-local variables.
7983 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7984 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7985 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7986 * data.c, eval.c, frame.c: Adjust users.
7987
383dcbf9
CY
79882012-08-17 Chong Yidong <cyd@gnu.org>
7989
7990 * xfaces.c (merge_face_vectors): If the target font specfies a
7991 font spec, make the font's attributes take precedence over
7992 directly-specified attributes.
7993 (merge_face_ref): Recognize :font.
7994
44386687
DA
79952012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7996
7997 Do not use memcpy for copying intervals.
7998 * intervals.c (reproduce_interval): New function.
7999 (reproduce_tree, reproduce_tree_obj): Use it.
8000 (reproduce_tree_obj): Remove prototype.
8001
927c7216
PE
80022012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8003
8004 * lisp.h (duration_to_sec_usec): Remove unused decl.
8005
93044f7b
AA
80062012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8007
8008 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8009 to an allocated instance of NSString, not to the class itself.
8010
9851e4a5
JB
80112012-08-17 Juanma Barranquero <lekktu@gmail.com>
8012
8013 * makefile.w32-in (C_CTYPE_H): New macro.
8014 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8015 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8016 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8017
620f13b0
PE
80182012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8019
8020 Use ASCII tests for character types.
8021 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8022 * xfns.c, xterm.c:
8023 Don't include <ctype.h>; was not needed.
8024 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8025 * sysdep.c, xfaces.c:
8026 Include <c-ctype.h> instead of <ctype.h>.
8027 * nsterm.m: Include <c-ctype.h>.
8028 * charset.c (read_hex):
8029 * doc.c (Fsnarf_documentation):
8030 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8031 (DRIVE_LETTER) [DOS_NT]:
8032 (Ffile_name_directory, Fexpand_file_name)
8033 (Fsubstitute_in_file_name):
8034 * font.c (font_parse_xlfd, font_parse_fcname):
8035 * frame.c (x_set_font_backend):
8036 * gtkutil.c (xg_get_font):
8037 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8038 * nsimage.m (hexchar):
8039 * nsterm.m (ns_xlfd_to_fontname):
8040 * sysdep.c (system_process_attributes):
8041 * xfaces.c (hash_string_case_insensitive):
8042 Use C-locale tests instead of locale-specific tests for character
8043 types, since we want the ASCII interpretation here, not the
8044 interpretation suitable for whatever happens to be the current locale.
8045
52162052
MR
80462012-08-16 Martin Rudalics <rudalics@gmx.at>
8047
8048 Consistently check windows for validity/liveness
8049 (Bug#11984, Bug#12025, Bug#12026).
8050 * lisp.h (CHECK_VALID_WINDOW): New macro.
8051 * window.c (decode_window): Rename to decode_live_window.
8052 (decode_valid_window, Fwindow_valid_p): New functions.
8053 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8054 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8055 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8056 (Fwindow_prev_sibling, Fwindow_combination_limit)
8057 (Fset_window_combination_limit, Fwindow_use_time)
8058 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8059 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8060 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8061 (Fwindow_hscroll, Fset_window_hscroll)
8062 (Fwindow_redisplay_end_trigger)
8063 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8064 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8065 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8066 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8067 (Fwindow_end, Fset_window_point, Fset_window_start)
8068 (Fpos_visible_in_window_p, Fwindow_line_height)
8069 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8070 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8071 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8072 (Fset_window_parameter, Fwindow_display_table)
8073 (Fset_window_display_table, Fdelete_other_windows_internal)
8074 (Fset_window_buffer, Fset_window_new_total)
8075 (Fset_window_new_normal, Fdelete_window_internal)
8076 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8077 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8078 (Fwindow_scroll_bars): Check whether argument window is a valid or
8079 live window. Update doc-strings.
8080 (syms_of_window): New symbol Qwindow_valid_p.
8081 * keyboard.c (Fposn_at_x_y): Check whether argument
8082 frame_or_window denotes a valid window.
8083
2751c80f
DA
80842012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8085
8086 Fix previous char table change.
8087 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8088 * chartab.c (optimize_sub_char_table): Likewise.
8089
032a42c8
CY
80902012-08-16 Chong Yidong <cyd@gnu.org>
8091
a2d19368
CY
8092 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8093
032a42c8
CY
8094 * xfont.c (xfont_open):
8095 * xftfont.c (xftfont_open): Set the font's max_width field.
8096
8097 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8098 min_width to space_width and average_width to the average over
8099 printable ASCII characters.
8100 (ns_char_width): Code cleanup.
8101 (ns_ascii_average_width): New utility function.
8102
8103 * font.h (struct font): Update comments.
8104
a098c930
DA
81052012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8106
032a42c8 8107 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8108 * lisp.h (CSET): New macro.
8109 (char_table_set_extras, char_table_set_contents)
8110 (sub_char_table_set_contents): New function.
8111 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8112 * syntax.c: Adjust users.
8113
8be3a09c
SM
81142012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8115
8116 * eval.c (eval_sub): Bind lexical-binding.
8117 * lread.c (Qlexical_binding): Make non-static.
8118
ac4845a6
JD
81192012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8120
ddee6515
JD
8121 * nsmenu.m (popupSession): Remove.
8122 (pop_down_menu): Remove endModalSession.
8123 (timeout_handler:): New method.
8124 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8125 Call runModalForWindow. Check timer_fired when it returns.
8126 If not set, cancel timer and break out of loop.
8127 Otherwise loop again, with a new timeout.
8128
8129 * nsterm.m: Include fcntl.h if present.
8130 (fd_entry, t_readfds, inNsSelect): Remove.
8131 (select_writefds, select_valid, select_timeout, selfds)
8132 (select_mutex, apploopnr): Add.
8133 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8134 Otherwise call kbd_buffer_store_event.
8135 (ns_send_appdefined): Remove release of fd_entry.
8136 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8137 Increment and decrement apploopnr.
8138 (ns_select): If no file descriptors, just do a NSTimer.
8139 Otherwise copy read/write masks and start select thread (fd_handler).
8140 Start main loop and wait for application defined event.
8141 Inform select thread to stop selecting after main loop is exited.
8142 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8143 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8144 (fd_handler:): Loop forever, wait for info from the main thread
8145 to either start or stop selecting. When select returns, send
8146 and appdefined event.
8147 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8148 If not call kbd_buffer_store_event.
8149
8150 * nsterm.h (EmacsApp): fd_handler takes id argument.
8151 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8152
ac4845a6
JD
8153 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8154
eb424fe3
EZ
81552012-08-15 Eli Zaretskii <eliz@gnu.org>
8156
8157 * region-cache.c (move_cache_gap): Update gap_len using the actual
8158 growth of the boundaries array. Do not change cache_len.
8159 (Bug#12196)
8160
4e6a86c6
DA
81612012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8162
8163 Generalize and cleanup font subsystem checks.
8164 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8165 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8166 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8167
5bf192ca
DA
81682012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8169
8170 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8171
f2045622
CY
81722012-08-15 Chong Yidong <cyd@gnu.org>
8173
8be3a09c
SM
8174 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8175 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8176 extract the font descriptor instead of just the font name.
8177 In that case, return a font spec instead of a string.
f2045622
CY
8178 (x_last_font_name): Move to this file from xfns.c.
8179
8180 * xfns.c (Fx_select_font): The return value can also be a font
8181 spec. Move x_last_font_name management to gtkutil.c.
8182
8183 * xfaces.c: Make font weight and style symbols non-static.
8184
7f6feb56
SM
81852012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8186
8187 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8188 (bug#12117).
8189
fecbd8ff
SM
81902012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8191
8192 * alloc.c (Fgarbage_collect): Use plural form consistently.
8193
9b8d5165
EZ
81942012-08-14 Eli Zaretskii <eliz@gnu.org>
8195
8196 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8197 iteration through the command loop. Fixes a problem whereby mouse
8198 movements are ignored until the first mouse click.
8199
f5d9e83a
PE
82002012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8201
8202 Use bool, not int, for Lisp booleans.
8203 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8204 makes Emacs a bit smaller and presumably a bit faster.
8205 * lisp.h: Include <stdbool.h>.
8206 (struct Lisp_Boolfwd, defvar_bool):
8207 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8208 * regex.c [!emacs]: Include <stdbool.h>.
8209 (false, true): Remove; <stdbool.h> does this for us now.
8210
55802e4a
CY
82112012-08-14 Chong Yidong <cyd@gnu.org>
8212
4abcdac8
CY
8213 * character.c (Fcharacterp): Doc fix (Bug#12076).
8214
8215 * data.c (Findirect_variable): Doc fix (Bug#11040).
8216
55802e4a
CY
8217 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8218
8219 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8220 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8221
8e99d072
BR
82222012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8223
8224 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8225 (bug#12022).
8226
08908aca
MR
82272012-08-14 Martin Rudalics <rudalics@gmx.at>
8228
8229 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8230 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8231 * minibuf.c (choose_minibuf_frame, read_minibuf):
8232 * w32fns.c (x_create_tip_frame):
8233 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8234 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8235
56120d6f
PE
82362012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8237
8238 * intervals.c (offset_intervals): Remove obsolete comment.
8239
67b77c0b
AS
82402012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8241
8242 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8243
f48b82fd
GR
82442012-08-14 Gergely Risko <gergely@risko.hu>
8245
8246 * coding.c (decode_coding): Record buffer modification before
8247 disabling undo_list (Bug#11773).
8248
fd318b54
DA
82492012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8250
8251 Revert and cleanup some recent overlay changes.
8252 * buffer.h (enum overlay_type): Remove.
8253 (buffer_get_overlays, buffer_set_overlays): Likewise.
8254 (buffer_set_overlays_before, buffer_set_overlays_after):
8255 New function. Adjust users.
8256 (unchain_both): Add eassert.
8257
41a62dd9
DA
82582012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8259
8260 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8261
5884c324
PE
82622012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 * gtkutil.c (xg_mark_data): Don't assume C99.
8265
ca06f160
JD
82662012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8267
8268 * gtkutil.c (xg_frame_tb_info): New struct.
8269 (TB_INFO_KEY): New define.
8270 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8271 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8272 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8273 if not present.
8274 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8275 is up to date. Otherwise store new data.
ca06f160
JD
8276 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8277
7864a3f7
DA
82782012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8279
8280 Use KSET for write access to Lisp_Object members of struct kboard.
8281 * keyboard.h (KSET): New macro.
8282 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8283 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8284 * xterm.c: Adjust users.
8285
4c31be61
DA
82862012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8287
8288 Use BSET for write access to Lisp_Object members of struct buffer.
8289 * buffer.h (BSET): New macro.
8290 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8291 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8292 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8293 * window.c, xdisp.c, xfns.c: Adjust users.
8294
14ae4239
BT
82952012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8296
8297 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8298
32bcadb4
JD
82992012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8300
3d29b2ce 8301 * nsterm.m (not_in_argv): New function.
fc0c31f8 8302 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8303 (application:openFileWithoutUI:, application:openFiles:): Open file
8304 if not_in_argv returns non-zero (bug#12171).
8305
32bcadb4 8306 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8307 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8308 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8309 (xg_get_font_name): Use those functions/macros here.
8310 Reported by Frans Oilinki <moilinki@gmail.com>.
8311
9ff9402d 83122012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8313
8314 * unexmacosx.c (copy_data_segment): Copy initialized data in
8315 statically linked libraries from input file rather than memory.
8316
db74a5fc
YM
8317 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8318 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8319 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8320
25e65510
GM
83212012-08-10 Glenn Morris <rgm@gnu.org>
8322
8323 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8324 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8325
7961135c
DA
83262012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8327
8328 Fix last change to allow compilation with low optimization levels.
8329 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8330 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8331
42b3a444
DA
83322012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8333
8334 Use common inline syntax in intervals.h.
8335 * intervals.h (INTERVALS_INLINE): New macro.
8336 Change all users from LISP_INLINE.
8337
9fb0c957
DA
83382012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8339
8340 Define Qnone once for all platforms.
8341 * frame.c (Qnone): Define here.
8342 (syms_of_frame): DEFSYM it.
8343 * lisp.h (Qnone): New declaration.
8344 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8345 * xfns.c: Remove duplication. Adjust users.
8346
65e8ee52
DA
83472012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8348
8349 Remove unused macros from intervals.h.
8350 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8351 * intervals.c: Adjust comment.
8352
9b855fd6
EZ
83532012-08-10 Eli Zaretskii <eliz@gnu.org>
8354
8355 * w32fns.c <w32_unicode_gui>: New static variable.
8356 (globals_of_w32fns): Initialize it according to os_subtype.
8357 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8358 testing os_subtype.
8359
39cb9e56 83602012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8361 Eli Zaretskii <eliz@gnu.org>
8362
8363 Fix bug #10299 with Unicode characters sent by customized
8364 keyboards created by MSKLC.
8365 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8366 (w32_init_class): Use it to initialize the Emacs class with either
8367 ANSI or Unicode API calls.
8368 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8369 later.
8370 (w32_wnd_proc): If the character code sent by WM_CHAR or
8371 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8372 original message. Call DefWindowProcW on NT and later.
8373
9374581a
GM
83742012-08-10 Glenn Morris <rgm@gnu.org>
8375
4b94e8cf
GM
8376 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8377
9374581a
GM
8378 * lisp.h (DIRECTORY_SEP): Let configure set it.
8379
a2752828
DA
83802012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8381
8382 Use TSET for write access to Lisp_Object slots of struct terminal.
8383 * termhooks.h (TSET): New macro.
8384 * coding.c, terminal.c, xselect.c: Adjust users.
8385
cc92c454
SM
83862012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8387
8388 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8389 the failing expression, include them in the error message.
8390 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8391 * lisp.h (internal_condition_case_n): Update declaration.
8392
4cb3e6b3
DA
83932012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8394
8395 Inline functions to examine and change buffer overlays.
8396 * buffer.c (unchain_both): New function.
8397 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8398 (buffer_has_overlays): New function.
8399 (enum overlay_type): New enum.
8400 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8401 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8402
8707c1e5
DA
84032012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8404
8405 Inline functions to examine and change buffer intervals.
8406 * alloc.c (mark_interval_tree): Remove.
8407 (MARK_INTERVAL_TREE): Simplify.
8408 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8409 * intervals.c (buffer_balance_intervals): New function.
8410 (graft_intervals_into_buffer): Adjust indentation.
8411 (set_intervals_multibyte): Simplify.
8412 * buffer.h (BUF_INTERVALS): Remove.
8413 (buffer_get_intervals, buffer_set_intervals): New function.
8414 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8415 * intervals.c, textprop.c: Adjust users.
8416
ad8c997f
DA
84172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8418
8419 Inline functions to examine and change string intervals.
8420 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8421 (string_get_intervals, string_set_intervals): New function.
8422 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8423 * lread.c, print.c, textprop.c: Adjust users.
8424
32ac3a6b
GM
84252012-08-08 Glenn Morris <rgm@gnu.org>
8426
8427 * lisp.mk (lisp): Remove language/persian.elc.
8428
77c7bcb1
DA
84292012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8430
8431 Cleanup intervals.
8432 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8433 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8434 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8435 Adjust comment. Move under #if 0.
77c7bcb1
DA
8436 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8437 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8438
9c08a8d4
DA
84392012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8440
8441 Check total length of intervals with eassert.
8442 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8443 * intervals.c: Change all users to eassert.
8444
26d16b35
EZ
84452012-08-07 Eli Zaretskii <eliz@gnu.org>
8446
14ae4239
BT
8447 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8448 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8449 INTERNAL_FIELD in Lisp_Cons.
8450
c644523b
DA
84512012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8452
8453 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8454 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8455 name since all xname users are fixed long time ago. Do not
8456 use INTERNAL_FIELD.
8457 (set_symbol_name, set_symbol_function, set_symbol_plist):
8458 (set_symbol_next, set_overlay_plist): New function.
8459 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8460 (struct Lisp_Overlay): Likewise.
8461 (CVAR, MVAR, SVAR): Remove.
8462 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8463 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8464 * xterm.c: Adjust users.
8465 * .gdbinit: Change to use name field of struct Lisp_Symbol
8466 where appropriate.
8467
6a3d20cc
DA
84682012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8469
8470 Basic functions to set Lisp_Object and pointer slots of intervals.
8471 * intervals.h (interval_set_parent, interval_set_object):
8472 (interval_set_left, interval_set_right, interval_set_plist):
8473 (interval_copy_parent): New function.
8474 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8475 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8476 Adjust indentation.
6a3d20cc
DA
8477 (INTERVAL_SIZE): Remove. Adjust users.
8478 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8479
4d2b044c
DA
84802012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8481
8482 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8483 * process.h (PGET): Remove.
8484 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8485 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8486
d3d50620
DA
84872012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8488
8489 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8490 * window.h (WGET): Remove.
8491 (struct window): Do not use INTERNAL_FIELD.
8492 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8493 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8494 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8495 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8496 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8497 Adjust users.
8498
d10a51dc
CY
84992012-08-07 Chong Yidong <cyd@gnu.org>
8500
8501 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8502 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8503 (Fdelete_window_internal): Signal an error if the window is not on
8504 a live frame (Bug#12025).
8505
e69b0960
DA
85062012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8507
8508 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8509 * frame.h (FGET): Remove.
8510 (struct frame): Do not use INTERNAL_FIELD.
8511 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8512 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8513 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8514 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8515
25a20a3a
JB
85162012-08-06 Juanma Barranquero <lekktu@gmail.com>
8517
8518 * w32.c: Silence compiler warnings.
8519 (map_w32_filename): Remove unused variable `is_fat'.
8520 (chase_symlinks): Add parentheses around expression.
8521
1c6f11f4
GM
85222012-08-06 Glenn Morris <rgm@gnu.org>
8523
1db4583a
GM
8524 * sysdep.c: Respect BROKEN_GETWD.
8525
1c6f11f4
GM
8526 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8527 Let configure handle it.
8528 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8529
2b90362b
DA
85302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8531
8532 Use GCALIGNMENT where appropriate.
8533 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8534 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8535 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8536
5f50daf2
EZ
85372012-08-06 Eli Zaretskii <eliz@gnu.org>
8538
14ae4239
BT
8539 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8540 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8541
cbcc7007
SM
85422012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8543
8544 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8545 that should be sufficient for everyone.
8546
4d365fa4
JD
85472012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8548
8549 * keyboard.c (timer_check_2): Add break so timer_check returns next
8550 timeout.
8551
dd86bd82
DA
85522012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8553
8554 Fix Windows build errors introduced after converting to WGET and WSET.
8555 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8556 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8557
054e1668
JD
85582012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8559
8560 * nsterm.m (ns_frame_rehighlight): Use FSET.
8561
8562 * nsmenu.m (ns_update_menubar): Use FSET.
8563
21238f11
DA
85642012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8565
8566 Separate read and write access to Lisp_Object slots of Lisp_Process.
8567 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8568 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8569
077288cf
DA
85702012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8571
8572 Separate read and write access to Lisp_Object slots of struct window.
8573 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8574 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8575 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8576 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8577 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8578 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8579 Adjust users.
8580
71688bd7
DA
85812012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8582
8583 Fix Windows build errors introduced after converting to FGET and FSET.
8584 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8585 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8586 (w32_judge_scroll_bars): Change to use FSET.
8587 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8588
f99bac93
DA
85892012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8590
8591 Fix replacement typo.
8592 * window.c (replace_window): Set root_window instead of
8593 selected_window. This fixes a total window subsystem
8594 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8595
8c2a0f2d
GM
85962012-08-06 Glenn Morris <rgm@gnu.org>
8597
8598 * lisp.mk (lisp): Add language/persian.elc.
8599
edd74c35
DA
86002012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8601
8602 Separate read and write access to Lisp_Object slots of struct frame.
8603 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8604 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8605 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8606 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8607 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8608
8671676c
AS
86092012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8610
8611 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8612
663e2b3f
DA
86132012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8614
8615 Generalize common compile-time constants.
8616 * lisp.h (header_size, bool_header_size, word_size): Now here.
8617 (struct Lisp_Vector): Add comment.
8618 (struct Lisp_Bool_Vector): Move up to define handy constants.
8619 (VECSIZE, PSEUDOVECSIZE): Simplify.
8620 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8621 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8622 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8623 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8624 * xfont.c, xmenu.c: Use word_size where appropriate.
8625
d32e47af
LM
86262012-08-05 Lawrence Mitchell <wence@gmx.li>
8627
8628 * search.c (Freplace_match): Treat \? in the replacement text
8629 literally (Bug#8161).
8630
e5d9c0d1
CY
86312012-08-05 Chong Yidong <cyd@gnu.org>
8632
8633 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8634 * frame.c (Vdelete_frame_functions):
8635 * emacs.c (Vkill_emacs_hook): Doc fix.
8636
8da0576b
EZ
86372012-08-04 Eli Zaretskii <eliz@gnu.org>
8638
8639 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8640 --with-x-toolkit=no builds.
8641 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8642
02676e5d
CY
86432012-08-04 Chong Yidong <cyd@gnu.org>
8644
8645 * syntax.c (Fmodify_syntax_entry): Doc fix.
8646
97147da9
EZ
86472012-08-04 Eli Zaretskii <eliz@gnu.org>
8648
76151e2c
EZ
8649 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8650 * w32.c (init_environment): Change the default values of many
8651 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8652 them into environment when they were not already defined.
8653 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8654 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8655 (check_windows_init_file): Now external, not static.
8656 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8657 called when Vload_path is already set up.
8658
8659 * w32.h (check_windows_init_file): Add prototype.
8660
8661 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8662 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8663 compatibility with Posix platforms.
8664 (main): Move the call to check_windows_init_file to here from
8665 w32.c.
8666 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8667 any, in the DEFALT argument into the root of the Emacs build or
8668 installation tree, as appropriate.
8669
8670 * callproc.c (init_callproc_1): Call decode_env_path instead of
8671 doing its equivalent by hand.
8672 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8673 the code that sets Vexec_path run on MS-Windows.
8674
8675 * lread.c (init_lread): Add comments to #ifdef's.
8676
97147da9
EZ
8677 * msdos.c (dos_set_window_size, IT_update_begin)
8678 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8679 instead of direct references.
8680
185ee146
PE
86812012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8682
8683 Export DEFAULT_REHASH_* to GDB.
8684 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8685 Now constants, not macros.
8686
8834c57a
PE
86872012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8688
98c6f1e3
PE
8689 Remove unnecessary casts involving pointers.
8690 These casts are no longer needed now that we assume C89 or later,
8691 since they involve casting to or from void *.
8692 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8693 (make_pure_float, make_pure_vector):
8694 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8695 * macros.c (Fstart_kbd_macro):
8696 * menu.c (find_and_return_menu_selection):
8697 * minibuf.c (read_minibuf_noninteractive):
8698 * sysdep.c (closedir):
8699 * xdisp.c (x_produce_glyphs):
8700 * xfaces.c (compare_fonts_by_sort_order):
8701 * xfns.c (x_real_positions, select_visual):
8702 * xselect.c (x_stop_queuing_selection_requests)
8703 (x_get_window_property, x_get_window_property_as_lisp_data):
8704 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8705 Remove unnecessary pointer casts.
8706 * alloc.c (record_xmalloc): New function.
8707 * lisp.h (record_xmalloc): New decl.
8708 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8709 more like a function. This is because the pointer cast is not
8710 needed. All uses changed.
8711 * print.c (print_string, print_error_message): Avoid length recalc.
8712
8834c57a
PE
8713 Improve fix for macroexp crash with debugging (Bug#12118).
8714 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8715 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8716 not supposed to be invoked from the garbage collector.
8717 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8718 (gc_aset): New function, which is like ASET but can be
8719 used in the garbage collector.
8720 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8721 (set_hash_index): Use it instead of ASET.
8722
6dad7178
EZ
87232012-08-03 Eli Zaretskii <eliz@gnu.org>
8724
8725 Support symlinks on latest versions of MS-Windows.
8726 * w32.c: Include winioctl.h and aclapi.h.
8727 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8728 (revert_to_self): Forward declarations of static functions.
8729 <static BOOL g_b_init_get_security_info>:
8730 <g_b_init_create_symbolic_link>: New static flags.
8731 (globals_of_w32): Initialize them to zero.
8732 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8733 (map_w32_filename): Improve commentary. Simplify switch.
8734 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8735 headers (most versions of MinGW w32api don't).
8736 (get_security_info, create_symbolic_link)
8737 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8738 New functions.
8739 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8740 in the argument file name.
8741 (sys_access): Call unc_volume_file_attributes only if
8742 GetFileAttributes fails with network-related error codes.
8743 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8744 have the required privileges.
14ae4239 8745 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
8746 get_file_security_desc.
8747 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
8748 with addition of handling of symlinks and support for 'lstat'.
8749 If possible, get file's attributes and security information by
6dad7178
EZ
8750 handle, not by name. Produce S_IFLNK bit for symlinks, when
8751 called from 'lstat'.
8752 (stat, lstat): New functions, call 'stat_worker'.
8753 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8754 symlinks when the underlying filesystem supports them.
8755
f162bcc3
PE
87562012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8757
79ea6c20
PE
8758 Fix macroexp crash on Windows with debugging (Bug#12118).
8759 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8760 checking subscripts; problem introduced with the recent
8761 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8762 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8763 since it's used in non-static inline functions now.
8764
c0ce93fd
PE
8765 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8766 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 8767
f162bcc3
PE
8768 Use C99-style 'extern inline' if available.
8769 * buffer.h (BUFFER_INLINE):
8770 * category.h (CATEGORY_INLINE):
8771 * character.h (CHARACTER_INLINE):
8772 * charset.h (CHARSET_INLINE):
8773 * composite.h (COMPOSITE_INLINE):
8774 * dispextern.h (DISPEXTERN_INLINE):
8775 * lisp.h (LISP_INLINE):
8776 * systime.h (SYSTIME_INLINE):
8777 New macro, replacing 'static inline' in this header.
8778 * buffer.h, category.h, character.h, charset.h, composite.h:
8779 * dispextern.h, lisp.h, systime.h:
8780 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8781 * alloc.c (LISP_INLINE):
8782 * buffer.c (BUFFER_INLINE):
8783 * category.c (CATEGORY_INLINE):
8784 * character.c (CHARACTER_INLINE):
8785 * charset.c (CHARSET_INLINE):
8786 * composite.c (COMPOSITE_INLINE):
8787 * dispnew.c (DISPEXTERN_INLINE):
8788 * sysdep.c (SYSTIME_INLINE):
8789 Define to EXTERN_INLINE, so that the corresponding functions
8790 are compiled into code.
8791 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8792 (INLINE_HEADER_END): New macros.
8793 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8794 since it's used in non-static inline functions now.
a8333d03 8795 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 8796
837b365b
GM
87972012-08-02 Glenn Morris <rgm@gnu.org>
8798
d66b744d
GM
8799 * s/: Remove empty directory.
8800
837b365b
GM
8801 * s/ms-w32.h: Move to ../nt/inc.
8802 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8803 Update for new ms-w32.h location.
8804
13294f95
PE
88052012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 Port to Solaris 8.
8808 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8809
90df0db3
GM
88102012-08-02 Glenn Morris <rgm@gnu.org>
8811
8812 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8813 hard-coding the path separator.
8814
4939150c
PE
88152012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8816
8817 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8818 This how ASET and AREF are supposed to work, and makes
8819 it easier to think about future improvements. See
8820 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8821 * charset.h (set_charset_attr): New function.
8822 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8823 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8824 (aref_addr): New function. All uses of &AREF(...) changed.
8825 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8826 (set_hash_index): New functions. All lvalue-style uses of
8827 HASH_KEY etc. changed.
8828 * keyboard.c (set_prop): New function. All lvalue-style uses
8829 of PROP changed.
8830
947b2afd
AA
88312012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8832
8833 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8834 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 8835 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
8836 * nsfns.m (ns_set_name_as_filename): Likewise.
8837 * nsmenu.m (ns_update_menubar): Likewise.
8838 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8839
4f5d0325
EZ
88402012-08-01 Eli Zaretskii <eliz@gnu.org>
8841
2008beae
EZ
8842 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8843 Adapt to latest changes in field names of the corresponding Lisp
288479f6 8844 objects.
2008beae 8845
4f5d0325
EZ
8846 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8847
fe3cc771
GM
88482012-08-01 Glenn Morris <rgm@gnu.org>
8849
8850 * s/msdos.h: Remove file.
8851 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8852 * Makefile.in (S_FILE): Remove.
8853 (config_h): Remove S_FILE.
8854
c90acc54
JB
88552012-08-01 Juanma Barranquero <lekktu@gmail.com>
8856
8857 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8858 Remove; moved to nt/config.nt.
8859
d8a05828
DA
88602012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8861
8862 Use INTERNAL_FIELD for conses and overlays.
8863 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8864 Remove obsolete comment.
8865 (MVAR): New macro.
8866 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8867 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8868
8271d590
DA
88692012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8870
8871 Use INTERNAL_FIELD for symbols.
8872 * lisp.h (SVAR): New macro. Adjust users.
8873 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8874 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8875
3193acd2
DA
88762012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8877
8878 Use INTERNAL_FIELD for processes.
8879 * process.h (PVAR): New macro. Adjust style.
8880 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8881 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8882
3a45383a
DA
88832012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8884
8885 Use INTERNAL_FIELD for windows.
8886 * window.h (WVAR): New macro.
8887 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8888 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8889 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8890 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8891 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8892 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8893
c1dbc63c
PE
88942012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8895
8896 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8897
5c0c0e8a
GM
88982012-08-01 Glenn Morris <rgm@gnu.org>
8899
8900 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8901 Move to configure.ac.
8902
552a99b4
JB
89032012-08-01 Juanma Barranquero <lekktu@gmail.com>
8904
8905 * makefile.w32-in (CONFIG_H): Update dependencies.
8906 (CONF_POST_H): New macro.
8907
8908 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8909
8d8e2dfe
GM
89102012-07-31 Glenn Morris <rgm@gnu.org>
8911
bc96620a
GM
8912 * Makefile.in (S_FILE): No longer set by configure.
8913
476b1b2d
GM
8914 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8915 is available.
8916 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8917
b2c7a106
GM
8918 * process.h (NULL_DEVICE):
8919 * emacs.c (SEPCHAR):
8920 * editfns.c (USER_FULL_NAME): Let configure set them.
8921
d53d062a
GM
8922 * s/README, s/template.h: Remove files.
8923
4515017f
GM
8924 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8925
8d8e2dfe
GM
8926 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8927 Move to configure.ac.
8928
5b20b3cc
EZ
89292012-07-31 Eli Zaretskii <eliz@gnu.org>
8930
1e0afd9a
EZ
8931 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8932 resulting renaming of 'struct frame' members.
8933
5b20b3cc
EZ
8934 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8935
8936 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8937 after introduction of FVAR.
8938
f1310128
JD
89392012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8940
79e721e0
JD
8941 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8942
8943 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8944 instead of compositeToPoint.
8945 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8946
8d7c7eed 8947 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8948
e34f7f79
DA
89492012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8950
8951 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8952 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8953 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8954 (BVAR): Change to use INTERNAL_FIELD.
8955 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8956 (KVAR): Change to use INTERNAL_FIELD.
8957 * frame.h (FVAR): New macro.
8958 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8959 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8960 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8961 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8962 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8963
c09bfb2f
DA
89642012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8965
8966 Miscellaneous fixes for non-default X toolkits.
8967 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8968 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8969 Move under #ifdef USE_LUCID.
8970 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8971 definition and usage to avoid warnings.
8972
14c114ae
JD
89732012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8974
8975 * nsterm.m (openFiles): Fix previous checkin.
8976
3bd21e82
PE
89772012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8978
8979 * indent.c (compute_motion): Remove unused local.
8980
c1529ded
GM
89812012-07-31 Glenn Morris <rgm@gnu.org>
8982
400d5621
GM
8983 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8984
268e2432
GM
8985 * conf_post.h [USG5_4]:
8986 Move remaining contents of s/usg5-4-common.h here.
8987 * s/usg5-4-common.h: Remove file.
8988
7552f3ee
GM
8989 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8990 * s/irix6-5.h: Remove file.
8991
6a381852
GM
8992 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8993 * s/darwin.h: Remove file.
8994
c1529ded
GM
8995 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8996 * s/hpux10-20.h: Remove file, which is now empty.
8997
b429a4ee
GM
89982012-07-30 Glenn Morris <rgm@gnu.org>
8999
9000 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9001 * Makefile.in (config_h): Add conf_post.h.
9002 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9003
adff3182
JD
90042012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9005
9006 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9007 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9008 (openFile, openTempFile, openFileWithoutUI, openFiles):
9009 Open files only if ns_do_open_file.
adff3182 9010
c32af1e4
PE
90112012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9012
7393bcbb
PE
9013 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9014 This no-op macro hasn't been needed for many years.
9015 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9016
c32af1e4
PE
9017 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9018 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9019 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9020 gdb_make_enums_visible.
9021 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9022 (DIRECTORY_SEP): Now a constant, not a macro.
9023
302fc036
EZ
90242012-07-30 Eli Zaretskii <eliz@gnu.org>
9025
9026 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9027 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9028
9029 * w32term.c <w32_keyboard_codepage>: Renamed from
9030 keyboard_codepage and now external. All users changed.
9031
9032 * w32term.h: Add declaration of w32_keyboard_codepage.
9033
9034 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9035 the codepage to translate keys to Unicode. If this argument is
9036 -1, use the value returned by GetConsoleCP. All callers changed.
9037
88fb40b4
PE
90382012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9039
0aee6912
PE
9040 Update .PHONY listings in makefiles.
9041 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9042 bootstrap-clean, distclean, maintainer-clean, versioclean,
9043 extraclean, frc.
9044
88fb40b4
PE
9045 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9046 This is a bit clearer. Fix some commentary typos.
9047
0a763bd1
GM
90482012-07-30 Glenn Morris <rgm@gnu.org>
9049
32bac6d6
GM
9050 * s/netbsd.h: Let configure include signal.h if needed.
9051 Remove file, which is now empty.
9052
b65e7c46
GM
9053 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9054 Let configure set them.
9055 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9056 No more need to undefine.
0a763bd1 9057
169304bd
AS
90582012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9059
9060 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9061 non-single-byte char when adding meta modifier. (Bug#12090)
9062
6cd7a139
DA
90632012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9064
9065 Convert safe_call to use variable number of arguments.
9066 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9067 (safe_call2): Fix comment.
9068 * lisp.h (safe_call): Adjust prototype.
9069 * coding.c (encode_coding_object): Change to use safe_call2.
9070 * xfaces.c (merge_face_heights): Change to use safe_call1.
9071
d34d6ffc
GM
90722012-07-30 Glenn Morris <rgm@gnu.org>
9073
7b8a48e4 9074 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9075 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9076
d34d6ffc
GM
9077 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9078 Remove empty files.
9079
03a660a6
PE
90802012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 Export to GDB most of lisp.h's remaining object-like macros.
9083 * lisp.h (min, max): Move earlier, because they're used earlier now.
9084 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9085 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9086 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9087 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9088 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9089 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9090 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9091 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9092 Now constants, for GDB. They need not be macros.
9093 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9094 Now constants, for GDB, as well as macros, for static initializers.
9095 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9096 Move to after the definition of struct Lisp_Char_Table,
9097 since the former now needs that type defined.
9098 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9099 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9100 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9101 New enums, for gdb_make_enums_visible.
9102 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9103 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9104 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9105 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9106 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9107 enum maxargs, enum MAX_ALLOCA.
9108 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9109 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9110 no longer needed, now that they are done in lisp.h.
9111
e499d0ee
DA
91122012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9113
9114 Cleanup string bytes checking.
9115 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9116 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9117 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9118 (check_sblock, compact_small_strings): Simplify.
9119
d5040d2d
PE
91202012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9123 These macros are confusing and no longer need to be defined, as
9124 the enum values now suffice. All uses replaced with definiens.
9125 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9126
7f259ae6
JB
91272012-07-29 Juanma Barranquero <lekktu@gmail.com>
9128
9129 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9130 ($(BLD)/w32console.$(O)): Update dependencies.
9131
7e63e0c3
DA
91322012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9133
9134 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9135 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9136 time. Adjust users.
9137 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9138
ffd817eb
JD
91392012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9140
9141 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9142 setting sitelisp (Bug#12010).
9143
417a7a0e
EZ
91442012-07-29 Eli Zaretskii <eliz@gnu.org>
9145
14ae4239 9146 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9147
9148 * w32heap.c (cache_system_info):
9149 * w32.c (sys_rename):
9150 * w32proc.c (find_child_console, sys_kill): All users changed.
9151
387d4d92
PE
91522012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9153
9154 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9155
55a6cca6
EZ
91562012-07-29 Eli Zaretskii <eliz@gnu.org>
9157
9158 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9159
dbcf001c
DA
91602012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9161
9162 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9163 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9164 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9165
e2688e4a
DA
91662012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9167
9168 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9169 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9170 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9171 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9172 (replace_range, replace_range_2, del_range_2): Change to eassert.
9173 * marker.c (byte_char_debug_check): Adjust style.
9174
b46a6a83
PE
91752012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9176
9177 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9178 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9179 long-ago-commented-out code that talks about "WIN32".
9180 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9181 All uses changed.
9182
e32a5799
PE
91832012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9184
9185 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9186 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9187 Simplify by using alignof.
9188 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9189 * lisp.h: Include <stdalign.h>.
9190 (GCALIGNMENT): New macro and constant.
9191 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9192 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9193 (stdalign): New macro, if not already defined.
9194
df81cd29
EZ
91952012-07-28 Eli Zaretskii <eliz@gnu.org>
9196
01bd1b0d
EZ
9197 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9198 * w32inevt.c: Include w32inevt.h.
9199 (w32_read_console_input): New inline function, calls either
9200 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9201 w32_console_unicode_input.
9202 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9203 (w32_kbd_patch_key, key_event): Use the codepage returned by
9204 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9205 (key_event): use uChar.UnicodeChar only if
9206 w32_console_unicode_input is non-zero.
9207
9208 * w32console.c: Include w32heap.h.
9209 <w32_console_unicode_input>: New global variable.
9210 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9211 family of Windows, zero otherwise.
9212
9213 * w32inevt.h: Declare w32_console_unicode_input.
9214
df81cd29
EZ
9215 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9216 --without-x. (Bug#11742)
9217
c20fdd9e
PE
92182012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9219
9220 Adjust GDB to reflect pvec_type changes (Bug#12036).
9221 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9222 2012-07-04 changes to pseudovector representation.
9223 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9224
32770973 92252012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9226
9227 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9228 bus address.
9229 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9230
3438fe21
EZ
92312012-07-27 Eli Zaretskii <eliz@gnu.org>
9232
bcfbc9de
EZ
9233 * alloc.c (listn): Fix the order the arguments are consed onto the
9234 list.
9235
3438fe21
EZ
9236 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9237 enumeration constants, as PURE and HEAP are too general, and clash
9238 with other headers and sources, such as gmalloc.c and the
9239 MS-Windows system headers. All users changed.
9240
eeaea515
DA
92412012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9242
9243 Revert last save_excursion_save and save_excursion_restore changes.
9244 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9245 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9246
073c88c2
DA
92472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9248
9249 Fix recently-introduced typos in Windows port.
9250 Reported by Martin Rudalics <rudalics@gmx.at>.
9251 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9252 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9253
4706125e
PE
92542012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9255
9256 Improve GDB symbol export (Bug#12036).
9257 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9258 arms of an 'if', not using conditional expressions; otherwise GDB
9259 complains about the types in the unevaluated arm when the argument
9260 is an integer literal.
9261 (xgetint): Simplify expression.
9262 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9263 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9264 Zaretskii in <http://bugs.gnu.org/12036#13>.
9265 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9266 needed now that we have gdb_make_enums_visible.
9267 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9268 (enum enum_USE_LSB_TAG):
9269 New enum types, packaging up enums that need to be exported to GDB.
9270
694b6c97
DA
92712012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9272
9273 Utility function to make a list from specified amount of objects.
9274 * lisp.h (enum constype): New datatype.
9275 (listn): New prototype.
9276 * alloc.c (listn): New function.
9277 (Fmemory_use_count, syms_of_alloc): Use it.
9278 * buffer.c (syms_of_buffer): Likewise.
9279 * callint.c (syms_of_callint): Likewise.
9280 * charset.c (define_charset_internal): Likewise.
9281 * coding.c (syms_of_coding): Likewise.
9282 * keymap.c (syms_of_keymap): Likewise.
9283 * search.c (syms_of_search): Likewise.
9284 * syntax.c (syms_of_syntax): Likewise.
9285 * w32.c (init_environment): Likewise.
9286 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9287 * xdisp.c (syms_of_xdisp): Likewise.
9288 * xfns.c (syms_of_xfns): Likewise.
9289
6195f384
DA
92902012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9291
9292 Fast save_excursion_save and save_excursion_restore.
9293 * lisp.h (struct Lisp_Excursion): New data type.
9294 (PVEC_EXCURSION): New pseudovector type.
9295 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9296 to deal with it. Adjust comments.
9297 (init_marker, attach_marker): New prototype.
9298 (unchain_marker): Adjust prototype.
9299 * marker.c (attach_marker): Change to global.
9300 (init_marker): New function.
9301 * alloc.c (Fmake_marker, build_marker): Use it.
9302 (build_marker): More easserts.
9303 (mark_object): Handle struct Lisp_Excursion.
9304 * editfns.c (save_excursion_save, save_excursion_restore):
9305 Reimplement to use struct Lisp_Excursion. Add comments.
9306
5eceb8fb
PE
93072012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 Fix export of symbols to GDB (Bug#12036).
9310 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9311 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9312 emacs.c, as this is a more-suitable home. Had this been done earlier
9313 the fix for 12036 would have avoided some of the problems noted in
9314 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9315 would have been more obvious.
562157c8
PE
9316 * emacs.c: Do not include <verify.h>; no longer needed.
9317 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9318 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9319 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9320 Remove; now done in lisp.h.
9321 * lisp.h (PUBLISH_TO_GDB): New macro.
9322 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9323 (DATA_SEG_BITS): Use it.
9324 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9325 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9326 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9327 not be usable in #if. This simplifies things.
9328
d6749401
JB
93292012-07-26 Juanma Barranquero <lekktu@gmail.com>
9330
9331 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9332
1781b9e9
PE
93332012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9334
d89518db 9335 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9336 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9337 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9338 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9339 Adjust to changes in lisp.h and emacs.c, by using
9340 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9341 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9342 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9343 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9344 instead of gdb_valbits.
9345 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9346 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9347 instead of gdb_array_mark_flag.
9348 (xboolvector): Get size from $->size, not $->header.size.
9349 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9350 (xreload, hook-run, hookpost-run): Remove.
9351 * emacs.c: Include <verify.h>.
9352 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9353 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9354 Remove.
9355 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9356 (gdb_USE_LSB_TAG): New enum constants.
9357 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9358 Also define these as enum constants, so they're visible to GDB.
9359 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9360 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9361 as constants, so they're visible to GDB.
9362 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9363 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9364 Now enum constants, not macros, so they're visible to GDB.
9365 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9366 more convenient now. All uses changed.
9367 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9368 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9369
3628596a
DA
93702012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9371
9372 Explicitly free restriction data that are not needed anymore.
9373 * editfns.c (save_restriction_restore): Free restriction data.
9374
7abaf5cc
SM
93752012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9376
9377 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9378 add argument, tune behavior, and adjust all callers.
9379
71f88e00
PE
93802012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9381
9382 Use typedef for EMACS_INT, EMACS_UINT.
9383 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9384 than macros. This simplifies debugging in the usual case, since
9385 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9386 and it allows expressions involving EMACS_INT casts.
9387 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9388
57ec3034
JD
93892012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9390
9391 * nsterm.m (ns_read_socket): Return early if there is a modal
9392 window (Bug#12043).
9393
8137e7b3
MR
93942012-07-25 Martin Rudalics <rudalics@gmx.at>
9395
9396 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9397 that FOCUS-FRAME can be omitted.
9398
04e9897c
DA
93992012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9400
9401 Adjust buffer text indirection counters at the end of Fkill_buffer.
9402 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9403 buffer is definitely dead. This should really fix an issue reported
9404 by Christoph Scholtes again. (Bug#12007).
9405 (init_buffer_once): Initialize indirection counters of
9406 buffer_defaults and buffer_local_symbols (for sanity and safety).
9407
8a0484e1
EZ
94082012-07-24 Eli Zaretskii <eliz@gnu.org>
9409
9410 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9411 and continuation glyphs on tooltip frames, leave them at zero.
9412 Avoids continued lines in tooltips. (Bug#11832)
9413
fa691a83
DA
94142012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9415
9416 Simplify copy_overlay.
04e9897c 9417 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9418 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9419
436bc8e0
EZ
94202012-07-23 Eli Zaretskii <eliz@gnu.org>
9421
9422 * print.c (print_object): Don't crash when a frame's name is nil
9423 or invalid. (Bug#12025)
9424
9425 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9426 it signals an error when a tooltip frame is being created.
9427
d7a7fda3
DA
94282012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9429
9430 Cleanup miscellaneous objects allocation and initialization.
9431 * alloc.c (allocate_misc): Change to static. Add argument to
9432 specify the subtype. Adjust comment and users.
9433 (build_overlay): New function.
9434 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9435 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9436 (allocate_misc): Remove prototype.
9437 (build_overlay): Add prototype.
9438
94392012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9440
9441 Swap buffer text indirection counters in Fbuffer_swap_text.
9442 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9443 This avoids crash reported by Christoph Scholtes at
9444 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9445
9d7fa573
JD
94462012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9447
9448 * nsmenu.m (Popdown_data): New struct.
9449 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9450 free Popdown_data.
9451 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9452 (initWithContentRect): Make imgView and contentView non-static
9453 and autorelease them. Also autorelease img and matrix (Bug#12005).
9454 (dealloc): Remove (Bug#12005).
9455
0dd6d66d
DA
94562012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9457
9458 Adjust consing_since_gc when objects are explicitly freed.
9459 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9460 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9461 (free_cons, free_misc): Subtract object size from consing_since_gc.
9462
d36d71df
DA
94632012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9464
9465 Simplify and cleanup markers positioning code.
9466 * marker.c (attach_marker): More useful eassert.
9467 (live_buffer, set_marker_internal): New function.
9468 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9469 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9470
fb9ea40f
PE
94712012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9472
9473 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9474 as it's limited by the amount of memory, not by INT_MAX.
9475
2d5c5f7d
EZ
94762012-07-21 Eli Zaretskii <eliz@gnu.org>
9477
07fb592e
EZ
9478 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9479 in special-event-map. See the discussion at
9480 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9481 for the reasons.
9482
37a9eac8 9483 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9484 info.dwItemData. Fixes crashes on 64-bit Windows.
9485 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9486
c4328746
JD
94872012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9488
fc0c31f8 9489 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9490 (conversationIdentifier): Return value is NSInteger.
784051c4 9491 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9492
6e5d1c12
CY
94932012-07-21 Chong Yidong <cyd@gnu.org>
9494
9495 * window.c (decode_any_window): Signal an error if the window is
9496 on a dead frame (Bug#11984).
9497
9928463d
DA
94982012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9499
9500 Add indirection counting to speed up Fkill_buffer.
9501 * buffer.h (struct buffer): New member.
9502 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9503 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9504 base buffer indirection counter.
9505 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9506 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9507 through buffer list if indirection counter is 0.
9508
f8643a6b
DA
95092012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9510
9511 Extend the value returned by Fgarbage_collect with heap statistics.
9512 * alloc.c (Qheap): New symbol.
9513 (syms_of_alloc): DEFSYM it.
9514 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9515 (Fmemory_free): Remove.
9516 (syms_of_alloc): Don't defsubr it.
9517 * buffer.c (Fcompact_buffer): Remove.
9518 (syms_of_buffer): Don't defsubr it.
9519
dac616ff
DA
95202012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9521
9522 Make maybe_gc inline.
9523 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9524 * lisp.h (consing_since_gc, gc_relative_threshold)
9525 (memory_full_cons_threshold): Revert declaration.
9526 (maybe_gc): Remove prototype, define as inline.
9527 * alloc.c: Remove old commented-out code.
9528 (consing_since_gc, gc_relative_threshold)
9529 (memory_full_cons_threshold): Revert to global.
9530 (maybe_gc): Remove.
9531
d7ea76b4
DA
95322012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9533
9534 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9535 * lisp.h (build_unibyte_string): New function.
9536 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9537 * sysdep.c, w32fns.c, xfns.c: Use it.
9538 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9539 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9540 Adjust users accordingly.
9541 * font.h (font_open_by_name): Adjust prototype.
9542
765e61e3
DA
95432012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9544
9545 Cleanup calls to Fgarbage_collect.
9546 * lisp.h (maybe_gc): New prototype.
9547 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9548 Remove declarations.
9549 * alloc.c (maybe_gc): New function.
9550 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9551 Make them static.
9552 * bytecode.c (MAYBE_GC): Use maybe_gc.
9553 * eval.c (eval_sub, Ffuncall): Likewise.
9554 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9555 to avoid dependency from auto-save feature.
9556
52b852c7
PE
95572012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9558
9559 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9560 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9561 'for_each_per_buffer_object_at'.
9562 All uses changed. It's better to use upper-case for macros that
9563 cannot be implemented as functions, to give the reader a clue
9564 that they're special.
9565
5db81e33
SM
95662012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9567
9568 * alloc.c (Fgarbage_collect): Tweak docstring.
9569
5b835e1d
DA
95702012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9571
9572 Tweak the value returned from Fgarbage_collect again.
9573 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9574 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9575 Adjust documentation.
9576 (total_vector_bytes): Rename to total_vector_slots, adjust
9577 accounting.
9578 (total_free_vector_bytes): Rename to total_free_vector_slots,
9579 adjust accounting.
9580 (Qstring_bytes, Qvector_slots): New symbols.
9581 (syms_of_alloc): DEFSYM them.
9582
9cd47b72
DA
95832012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9584
9585 Buffer compaction primitive which may be used from Lisp.
9586 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9587 (syms_of_buffer): Register Fcompact_buffer.
9588 * alloc.c (Fgarbage_collect): Use compact_buffer.
9589 * buffer.h (compact_buffer): New prototype.
9590 (struct buffer_text): New member.
9591
d17337e5
DA
95922012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9593
9594 New macro to iterate over all buffers, miscellaneous cleanups.
9595 * lisp.h (all_buffers): Remove declaration.
9596 * buffer.h (all_buffers): Add declaration, with comment.
9597 (for_each_buffer): New macro.
9598 * alloc.c (Fgarbage_collect, mark_object): Use it.
9599 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9600 (init_buffer): Likewise.
9601 * data.c (Fset_default): Likewise.
9602 * coding.c (code_conversion_restore): Remove redundant check
9603 for dead buffer.
9604 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9605
60cfd278
AS
96062012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9607
9608 Fix bug that created negative-length intervals.
9609 * intervals.c (merge_interval_right, merge_interval_left):
9610 Do not zero out this interval if it is absorbed by its children,
9611 as this interval's total length doesn't change in that case. See
9612 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9613
d06714cb
PE
96142012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9615
83713154
PE
9616 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9617 when invoking (make-bool-vector N t) and N is a positive
9618 multiple of 8 -- the last 8 bits were mistakenly cleared.
9619
d06714cb
PE
9620 Remove some struct layout assumptions in bool vectors.
9621 * alloc.c (bool_header_size): New constant.
9622 (header_size, word_size): Move earlier, as they're now used earlier.
9623 Use 'word_size' in a few more places, where it's appropriate.
9624 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9625 padding before the data member of a bool vector.
9626 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9627 than doing the check by hand with an abort ().
9628
464d5a5e
SM
96292012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9630
5fbc0409
SM
9631 * eval.c (Fdefvar): Don't check constants since we only set the var if
9632 it's not yet defined anyway (bug#11904).
9633
464d5a5e
SM
9634 * lisp.h (last_undo_boundary): Declare new var.
9635 * keyboard.c (command_loop_1): Set it.
9636 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9637 were auto-added by the command loop (bug#11774).
9638
8dc2e44a
AS
96392012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9640
9641 * w32font.c (Qsymbol): Remove local definition.
9642 (syms_of_w32font): Don't DEFSYM it.
9643
169925ec
DA
96442012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9645
9646 Fix sweep_vectors to handle large bool vectors correctly.
9647 * alloc.c (sweep_vectors): Account total_vector_bytes for
9648 bool vectors larger than VBLOCK_BYTES_MAX.
9649
5fbfb018
CY
96502012-07-18 Chong Yidong <cyd@gnu.org>
9651
9652 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9653 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9654
3ab6e069
DA
96552012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9656
9657 Return more descriptive data from Fgarbage_collect.
9658 Suggested by Stefan Monnier in
9659 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9660 * alloc.c (bounded_number): New function.
9661 (total_buffers, total_vectors): New variable.
9662 (total_string_size): Rename to total_string_bytes, adjust users.
9663 (total_vector_size): Rename to total_vector_bytes, adjust users.
9664 (sweep_vectors): Account total_vectors and total_vector_bytes.
9665 (Fgarbage_collect): New return value. Adjust documentation.
9666 (gc_sweep): Account total_buffers.
9667 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9668 (VECTOR_SIZE): Remove.
9669 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9670 (Qinterval, Qmisc): New symbols.
9671 (syms_of_data): Initialize them.
9672 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9673 (Qcons, Qbuffer): New declarations.
9674
6d02fe5b
PE
96752012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9678 Round up, not down. Improve doc.
9679
b7ffe040
DA
96802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9681
9682 Restore old code in allocate_string_data to avoid Faset breakage.
9683 Reported by Julien Danjou <julien@danjou.info> in
9684 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9685 * alloc.c (allocate_string_data): Restore old code with minor
9686 adjustments, fix comment to explain this subtle issue.
9687
4dc7c8d5
SM
96882012-07-17 Eli Zaretskii <eliz@gnu.org>
9689
9690 Remove FILE_SYSTEM_CASE.
9691 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9692
9693 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9694 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9695 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9696 call-process-region passes it through expand-file-name.
9697
9698 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9699
97002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9701
9702 Fix crash when creating indirect buffer (Bug#11917)
9703 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9704 Don't handle unbound variables specially if non-zero.
9705 (Fbuffer_local_variables): Pass zero.
9706 (clone_per_buffer_values): Pass non-zero.
9707
97082012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9709
9710 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9711 to make the loop interruptible.
9712
97132012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9714
9715 * gnutls.c (emacs_gnutls_handshake): Only retry if
9716 GNUTLS_E_INTERRUPTED.
9717
cce7fefc
DA
97182012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9719
9720 Cleanup and convert miscellaneous checks to eassert.
9721 * alloc.c (mark_interval): Fix comment, partially rephrase
9722 old comment from intervals.h (see below).
9723 * intervals.c (find_interval, adjust_intervals_for_insertion)
9724 (delete_interval, adjust_intervals_for_deletion)
9725 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9726 Convert to eassert.
9727 (adjust_intervals_for_insertion, make_new_interval):
9728 Remove obsolete and unused code.
9729 * intervals.h (struct interval): Remove obsolete comment.
9730 * textprotp.c (erase_properties): Remove unused code.
9731 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9732 (Fremove_list_of_text_properties): Convert to eassert.
9733
9ea10cc3
CY
97342012-07-17 Chong Yidong <cyd@gnu.org>
9735
9736 * editfns.c (Finsert_char): Doc fix.
9737
3900d5de
DA
97382012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9739
9740 Fix previous change to make Fmemory_free always accurate.
9741 * alloc.c (make_interval): Update total_free_intervals.
9742 (make_float): Likewise for total_free_floats.
9743 (free_cons, Fcons): Likewise for total_free_conses.
9744 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9745 Likewise for total_free_vector_bytes.
9746 (Fmake_symbol): Likewise for total_free_symbols.
9747 (bytes_free): Remove.
9748
7098646f
DA
97492012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9750
9751 Simple free memory accounting feature.
9752 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9753 (sweep_vectors): Accumulate size of free vectors.
9754 (Fgarbage_collect): Setup bytes_free.
9755 (Fmemory_free): New function.
9756 (syms_of_alloc): Register it.
9757
22657b40
DA
97582012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9759
9760 Cleanup overlays checking.
9761 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9762 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9763 eassert and OVERLAYP.
9764 (sort_overlays): Change to use OVERLAYP.
9765
ddfc8813
RK
97662012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9767
9768 * editfns.c (Finsert_char): Make it interactive, and make the
9769 second arg optional. Copy interactive spec and docstring from
9770 ucs-insert.
9771
7c26cf3c
PE
97722012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9773
9774 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9775 Unlike the other wrapped functions, fabs has an unspecified
9776 effect on errno.
9777
5d127af9
JD
97782012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9779
9780 * nsterm.m (keyDown): Interpret flags without left/right bits
9781 as the left key (Bug#11670).
9782
6a0dd1d7
DA
97832012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9784
9785 Remove empty and useless init functions.
9786 * lisp.h (init_character_once, init_fns, init_image)
9787 (init_filelock, init_sound): Remove prototype.
9788 * character.c (init_character_once): Remove.
9789 * filelock.c (init_filelock): Likewise.
9790 * fns.c (init_fns): Likewise.
9791 * image.c (init_image): Likewise.
9792 * sound.c (init_sound): Likewise.
9793 * emacs.c (main): Adjust accordingly.
9794
7a6136fd
DA
97952012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9796
9797 * gtkutil.h: Tiny cleanups.
9798 (use_old_gtk_file_dialog): Remove useless declaration.
9799 (xg_uses_old_file_dialog): Add suggested const attribute.
9800
ce811ad9
EZ
98012012-07-15 Eli Zaretskii <eliz@gnu.org>
9802
9803 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9804 (bidi_paragraph_init): Use it to limit search forward for a strong
9805 directional character in abnormally large paragraphs full of
9806 neutral or weak characters. (Bug#11943)
9807
c9adfeaa
SF
98082012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9809
9810 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9811 the toolbar (Bug#9451).
9812 (xg_make_tool_item): Give the widget event box a transparent
9813 background.
9814
fff62aa9
DA
98152012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9816
9817 Cleanup basic allocation variables and functions.
9818 * alloc.c (ignore_warnings, init_intervals, init_float)
9819 (init_cons, init_symbol, init_marker): Remove.
9820 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9821 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9822 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9823 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9824 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9825 (staticidx, init_alloc_once, init_strings, free_ablock):
9826 Remove redundant initialization.
9827 * fns.c (init_weak_hash_tables): Remove.
9828 * lisp.h (init_weak_hash_tables): Remove prototype.
9829
9730daca
DA
98302012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9831
9832 Use zero_vector where appropriate.
9833 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9834 accordingly.
9835 * lisp.h (zero_vector): New declaration.
9836 * font.c (null_vector): Remove.
9837 (syms_of_font): Remove initialization and staticpro.
9838 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9839 * keymap.c (Faccessible_keymaps): Likewise.
9840
2e2d2a13
LL
98412012-07-15 Leo Liu <sdl.web@gmail.com>
9842
9843 * fringe.c: Fix typo in comments.
9844
cd276f6e
LL
98452012-07-14 Leo Liu <sdl.web@gmail.com>
9846
9847 * fringe.c: Add a new bitmap exclamation-mark.
9848
5a1131d9
EZ
98492012-07-14 Eli Zaretskii <eliz@gnu.org>
9850
9851 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9852
9853 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9854 (HAVE_MENUS): Don't define, defined by editing config.in with
9855 msdos/sed2v2.inp.
9856 (GMALLOC_INHIBIT_VALLOC): Don't define.
9857 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9858
22e983b7
JB
98592012-07-14 Juanma Barranquero <lekktu@gmail.com>
9860
9861 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9862
5b3f250f
GM
98632012-07-14 Glenn Morris <rgm@gnu.org>
9864
9865 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9866 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9867 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9868
33d63ff4
GM
98692012-07-13 Glenn Morris <rgm@gnu.org>
9870
5b633342
GM
9871 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9872
33d63ff4
GM
9873 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9874 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9875
b55b9f85
JD
98762012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9877
0dc8cf50
JD
9878 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9879 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9880 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9881 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9882 where appropriate.
9883 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9884 as boolean expression.
9885 (x_set_window_size): Remove unused variable toolbar.
9886 (ns_get_color_default, ns_mod_to_lisp): Remove.
9887 (ns_mouse_position): Remove unused variables xchar and ychar.
9888 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9889 (ns_set_vertical_scroll_bar): Remove unused variable count.
9890 (ns_delete_terminal): Remove unused variable i.
9891 (ns_term_init): Remove unused variables r, g and b.
9892 (mouseDown): Remove unused variable window.
9893 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9894 (initFrameFromEmacs): Remove unused variable vbextra.
9895 (mouseEntered): Remove unused variables p and dpyinfo.
9896 (mouseExited): Remove unused variables p and r.
9897 (ns_define_frame_cursor, ns_clear_frame_area)
9898 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9899 (menuDown): Assign [sender tag] to variable and cast the variable.
9900
9901 * nsterm.h (menuDown): Add id as type to argument sender.
9902 (ns_display_info_for_name): Add Lisp_Object argument.
9903 (ns_term_init): Add Lisp_Object argument.
9904 (ns_map_event_to_object): Add void argument.
9905 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9906 prototype with arguments and only declare if __OBJC__.
9907 (nxatoms_of_nsselect): Add void argument.
9908 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9909 (ns_alloc_autorelease_pool): Add void argument.
9910 (ns_release_autorelease_pool): Add void* argument.
9911 (ns_get_defaults_value): Add const char* argument.
9912
9913 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9914 (initFromContents): Use SSDATA where appropriate.
9915 (ns_update_menubar): Add braces to ambigous if-else.
9916 (initWithTitle): Put () around assignment in if statement.
9917 (ns_menu_show): Remove unused variables window and keymap.
9918 (update_frame_tool_bar): Remove unused variable selected_p.
9919 (initWithContentRect): Remove unused variable this_cmd_name.
9920
9921 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9922 appropriate.
9923 (setXBMColor): Remove unused variable len.
9924 (setPixmapData): Put () around assignment in loop statement.
9925
9926 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9927 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9928 where appropriate.
9929 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9930 around assignment in loop statement.
9931 (nsfont_open): Remove unused variable i.
9932 (nsfont_open): Remove unused variable len.
9933 (nsfont_draw): Remove unused variable cs.
9934
9935 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9936 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9937 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9938 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9939 (Fns_font_name, Fns_perform_service)
9940 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9941 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9942 (ns_set_name): Remove unused variable view.
9943 (x_set_menu_bar_lines): Remove unused variable olines.
9944 (x_set_tool_bar_lines): Remove unused variable root_window.
9945 (Fns_list_colors): Put () around assignment in while statement.
9946 (Fns_perform_service): Remove unused variable len.
9947 (Fns_display_usable_bounds): Remove unused variable top.
9948 (syms_of_nsfns): Remove unused variable i.
9949
b55b9f85
JD
9950 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9951 memcpy (Bug#11907).
9952
ed9265fc 99532012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9954
9955 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9956 and free it with DestroyExceptionInfo (Bug#11558).
9957
ef099b57
JB
99582012-07-13 Juanma Barranquero <lekktu@gmail.com>
9959
9960 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9961 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9962 Set here, not in nt/config.nt.
9963
ea814a5d
EZ
99642012-07-13 Eli Zaretskii <eliz@gnu.org>
9965
9966 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9967 cursor overflow into the last glyph on display line when the right
9968 fringe is off. (Bug#11832)
9969
1a952767
PE
99702012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9971
9972 * xdisp.c (produce_special_glyphs): Now static.
9973 * dispextern.h (produce_special_glyphs): Remove decl.
9974
983188fd
GM
99752012-07-13 Glenn Morris <rgm@gnu.org>
9976
8d7c7eed 9977 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9978 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9979
983188fd
GM
9980 * s/usg5-4-common.h (USG, USG5):
9981 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9982 * s/sol2-6.h (SOLARIS2):
9983 * s/irix6-5.h (IRIX6_5):
9984 * s/hpux10-20.h (USG, USG5, HPUX):
9985 * s/gnu-linux.h (USG, GNU_LINUX):
9986 * s/freebsd.h (BSD_SYSTEM):
9987 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9988 * s/cygwin.h (CYGWIN):
9989 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9990 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9991
d1e68667 99922012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9993
9994 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 9995
6de0e799
GM
99962012-07-13 Glenn Morris <rgm@gnu.org>
9997
739ae010
GM
9998 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9999
dbee5793
GM
10000 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10001
6de0e799
GM
10002 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10003 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10004
b82da769
GM
100052012-07-12 Glenn Morris <rgm@gnu.org>
10006
4fae5a7a 10007 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10008
10009 * process.c (init_process_emacs): Rename from init_process.
10010 The old name is also the name of a Mach system call.
10011 * lisp.h, emacs.c: Update for this name change.
10012 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10013 longer needed.
10014
5a979817
EZ
100152012-07-12 Eli Zaretskii <eliz@gnu.org>
10016
10017 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10018 memmove call that removes glyphs covered by the left truncation
10019 glyph. Improve commentary.
10020 (display_line): Fix display of continuation glyphs on GUI frames
10021 when the right fringe is turned off and variable-size fonts are
10022 used in the window. Move the code that appends a stretch glyph to
10023 produce_special_glyphs, so that it could be used for truncation
10024 and continuation glyphs alike.
10025 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10026 glyph of a suitably computed width, to align the special glyphs at
10027 the window margin. Code moved from display_line. (Bug#11832)
10028
3e91a053
GM
100292012-07-12 Glenn Morris <rgm@gnu.org>
10030
ba9e4b84
GM
10031 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10032
10033 * s/gnu-linux.h, s/hpux10-20.h:
10034 Do not unconditionally define HAVE_XRMSETDATABASE.
10035
3e91a053
GM
10036 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10037
b300b1f4
PE
100382012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10039
10040 Fix typos that broke OS X build.
10041 Reported by Randal L. Schwartz in
10042 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10043 * nsterm.m (ns_timeout): Add missing local decl.
10044 (ns_get_color): snprintf -> sprintf, to fix typo.
10045
6e777848
GM
100462012-07-12 Glenn Morris <rgm@gnu.org>
10047
3f922c37
GM
10048 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10049 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10050 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10051 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10052
0ab7b23a
GM
10053 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10054 Move PTY_OPEN to configure.
10055
6e777848
GM
10056 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10057 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10058 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10059
4a7edc24
DA
100602012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10061
10062 Use empty_unibyte_string where applicable.
10063 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10064 * lread.c (read1): Likewise.
10065 * xsettings.c (syms_of_xsettings): Likewise.
10066
308aab79
GM
100672012-07-12 Glenn Morris <rgm@gnu.org>
10068
42bd1719
GM
10069 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10070 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10071 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10072 * s/hpux10-20.h (RUN_TIME_REMAP):
10073 * s/bsd-common.h (TABDLY): Move to configure.
10074
10075 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10076
10077 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10078
ea0bbd17 10079 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10080 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10081
10082 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10083
308aab79
GM
10084 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10085 * s/template.h: Move NARROWPROTO to configure.
10086
ee1cf5cf
GM
100872012-07-11 Glenn Morris <rgm@gnu.org>
10088
30fe9bf4
GM
10089 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10090 unused since 2011-01-17 change to systty.h.
10091
ee1cf5cf
GM
10092 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10093 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10094 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10095
63e47e07
PE
100962012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10097
10098 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10099
c43fb4c3
GM
101002012-07-11 Glenn Morris <rgm@gnu.org>
10101
10102 * s/darwin.h, s/gnu-linux.h, s/template.h:
10103 Move INTERRUPT_INPUT to configure.
10104
e8df9267
DA
101052012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10106
10107 Minor adjustments to interning code.
10108 * lisp.h (intern, intern_c_string): Redefine as static inline
10109 wrappers for intern_1 and intern_c_string_1, respectively.
10110 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10111 * lread.c (intern_1, intern_c_string_1, oblookup):
10112 Simplify Vobarray checking.
e8df9267
DA
10113 * font.c (font_intern_prop): Likewise. Adjust comment.
10114 * w32font.c (intern_font_name): Likewise.
10115
34348bd4
AS
101162012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10117
d96a1e0c
AS
10118 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10119
34348bd4
AS
10120 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10121 of Fcar/Fcdr if possible.
10122 * font.c (check_otf_features): Likewise.
10123 * fontset.c (Fnew_fontset): Likewise.
10124 * gnutls.c (Fgnutls_boot): Likewise.
10125 * minibuf.c (read_minibuf): Likewise.
10126 * msdos.c (IT_set_frame_parameters): Likewise.
10127 * xmenu.c (Fx_popup_dialog): Likewise.
10128 * w32menu.c (Fx_popup_dialog): Likewise.
10129
c8add24e
GM
101302012-07-11 Glenn Morris <rgm@gnu.org>
10131
4b575b3c
GM
10132 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10133 since nothing has defined it on these platforms.
10134
09f4e3b0
GM
10135 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10136 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10137
172bedef
GM
10138 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10139 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10140 Move CLASH_DETECTION to configure.
10141
249685df
GM
10142 * s/gnu.h: Remove file, which is now empty.
10143
c8add24e
GM
10144 * s/gnu.h, s/gnu-linux.h:
10145 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10146
b41253a3
JW
101472012-07-11 John Wiegley <johnw@newartisans.com>
10148
10149 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10150 function attribute, so we only use it if it exists in the
10151 compiler.
10152
d923b542
DA
101532012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10154
10155 Avoid call to strlen in fast_c_string_match_ignore_case.
10156 * search.c (fast_c_string_match_ignore_case): Change to use
10157 length argument. Adjust users accordingly.
10158 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10159
5ebbef1d
PE
101602012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10161
bb352260
PE
10162 Assume mkdir, rmdir.
10163 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10164 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10165
57054ddd
PE
10166 Assume rename.
10167 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10168
b747d3f7
PE
10169 Assume perror.
10170 * s/hpux10-20.h (HAVE_PERROR): Remove.
10171 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10172 Remove dummy definition, as this problem was obsolete long ago.
10173
5ebbef1d
PE
10174 Assume strerror.
10175 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10176
984e7f30
DA
101772012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10178
10179 Avoid calls to strlen in font processing functions.
10180 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10181 (font_open_by_name): Change to use length argument.
10182 Adjust users accordingly.
d923b542
DA
10183 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10184 Adjust prototypes.
10185 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10186 Change to return ptrdiff_t.
984e7f30
DA
10187 (xfont_list_pattern, xfont_match): Use length returned by
10188 xfont_decode_coding_xlfd.
10189 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10190
20e94fdd
GM
101912012-07-11 Glenn Morris <rgm@gnu.org>
10192
9d596af3
GM
10193 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10194 Move DONT_REOPEN_PTY to configure.
10195
20e94fdd
GM
10196 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10197 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10198
e99a530f
PE
101992012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10200
22ffb973
PE
10201 Remove "#define unix" that is no longer needed (Bug#11905).
10202 * s/aix4-2.h (unix): Remove; no longer needed.
10203
e9a9ae03
PE
10204 EMACS_TIME simplification (Bug#11875).
10205 This replaces macros (which typically do not work in GDB)
10206 with functions, typedefs and enums, making the code easier to debug.
10207 The functional style also makes code easier to read and maintain.
10208 * systime.h: Include <sys/time.h> on all hosts, not just if
10209 WINDOWSNT, since 'struct timeval' is needed in general.
10210 (EMACS_TIME): Now a typedef, not a macro.
10211 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10212 not macros.
10213 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10214 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10215 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10216 (EMACS_TIME_LE): Now functions, not macros.
10217 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10218 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10219 which are not functions. All uses rewritten to use:
10220 (make_emacs_time): New function.
10221 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10222 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10223 not functions. All uses rewritten to use the following, respectively:
10224 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10225 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10226 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10227 * fileio.c (Fcopy_file):
10228 * xterm.c (XTflash): Get the current time closer to when it's used.
10229 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10230
ffacb126
PE
10231 * bytecode.c (targets): Suppress -Woverride-init warnings.
10232
e99a530f
PE
10233 Simplify by avoiding confusing use of strncpy etc.
10234 * doc.c (Fsnarf_documentation):
10235 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10236 * frame.c (Fmake_terminal_frame):
10237 * gtkutil.c (get_utf8_string):
10238 * lread.c (openp):
10239 * nsmenu.m (ns_update_menubar):
10240 * regex.c (regerror):
10241 Prefer memcpy to strncpy and strncat when either will do.
10242 * fileio.c (Fsubstitute_in_file_name):
10243 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10244 (menu_separator_name_p):
10245 * nsmenu.m (ns_update_menubar):
10246 Prefer memcmp to strncmp when either will do.
10247 * nsterm.m: Include <ftoastr.h>.
10248 (ns_get_color):
10249 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10250 Prefer snprintf to strncpy.
10251 * nsterm.m (ns_term_init):
10252 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10253 * nsterm.m (ns_term_init):
10254 Avoid the need for strncpy, by using build_string or
10255 make_unibyte_string directly. Use dtoastr, not snprintf.
10256 * process.c (Fmake_network_process): Diagnose service names that
10257 are too long, rather than silently truncating them or creating
10258 non-null-terminated names.
10259 (Fnetwork_interface_info): Likewise, for interface names.
10260 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10261 Prefer sprintf to strncat.
10262 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10263 Prefer vsnprintf to vsprintf + strncpy.
10264
c59592b3
GM
102652012-07-10 Glenn Morris <rgm@gnu.org>
10266
10267 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10268 Clarify fallback case.
10269
7d7bbefd
DA
102702012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10271
10272 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10273 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10274 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10275 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10276 where argument type is known to be a Lisp_Cons.
10277
3a4c8000
TT
102782012-07-10 Tom Tromey <tromey@redhat.com>
10279
10280 * bytecode.c (BYTE_CODE_THREADED): New macro.
10281 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10282 (enum byte_code_op): New type.
10283 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10284 (exec_byte_code): Use them. Use token threading when applicable.
10285
2a0213a6
DA
102862012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10287
10288 Optimize pure C strings initialization.
10289 * lisp.h (make_pure_string): Fix prototype.
10290 (build_pure_c_string): New function, defined as static inline. This
10291 provides a better opportunity to optimize away calls to strlen when
10292 the function is called with compile-time constant argument.
10293 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10294 argument, adjust users accordingly. Use build_pure_c_string where
10295 appropriate.
10296 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10297 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10298 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10299
cb1caeaf
DA
103002012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10301
10302 Avoid calls to strlen in miscellaneous functions.
10303 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10304 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10305 * lread.c (openp): Likewise.
10306
c293e30c
DA
103072012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10308
10309 Avoid calls to strlen in path processing functions.
10310 * fileio.c (file_name_as_directory): Add comment. Change to add
10311 srclen argument and return the length of result. Adjust users
10312 accordingly.
10313 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10314 swap 1st and 2nd arguments to obey the common convention.
10315 Adjust users accordingly.
c293e30c
DA
10316 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10317
9e059e3f
GM
103182012-07-10 Glenn Morris <rgm@gnu.org>
10319
d02eb359
GM
10320 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10321 Move PENDING_OUTPUT_COUNT definition to configure.
10322
882cf227
GM
10323 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10324 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10325 * s/gnu.h (DATA_START): Move definitions to configure.
10326
af6e839f
GM
10327 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10328 We include usg5-4-common.h, which defines them both.
10329
40289a12
GM
10330 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10331 O_RDONLY already includes it).
10332
9e059e3f
GM
10333 Stop ns builds setting the EMACSLOADPATH environment variable.
10334 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10335 Now it does not set EMACSLOADPATH, just returns the load-path string.
10336 * nsterm.h: Update accordingly.
10337 * lread.c [HAVE_NS]: Include nsterm.h.
10338 (init_lread) [HAVE_NS]: Use ns_load_path.
10339 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10340
7c4e8ec0
GM
103412012-07-09 Glenn Morris <rgm@gnu.org>
10342
d4f600ff
GM
10343 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10344 since the included bsd-common.h does so.
10345
cbb31951
GM
10346 Stop ns builds setting the EMACSPATH environment variable.
10347 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10348 (ns_init_paths): Do not set EMACSPATH.
10349 * nsterm.h (ns_exec_path): Add it.
10350 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10351 Use ns_exec_path.
10352
7c4e8ec0
GM
10353 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10354
26bccfae
PE
103552012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10356
a0bee46f
PE
10357 * process.c (wait_reading_process_output): 'waitchannels' was unset
10358 when read_kbd || !NILP (wait_for_cell); fix this.
10359
5994c183
PE
10360 Add GCC-style 'const' attribute to functions that can use it.
10361 * character.h (char_resolve_modifier_mask):
10362 * keyboard.h (make_ctrl_char):
10363 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10364 (init_character_once, next_almost_prime, init_fns, init_image)
10365 (flush_pending_output, init_sound):
10366 * mem-limits.h (start_of_data):
10367 * menu.h (finish_menu_items):
10368 Add ATTRIBUTE_CONST.
10369 * emacs.c (DEFINE_DUMMY_FUNCTION):
10370 Declare the dummy function with ATTRIBUTE_CONST.
10371 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10372 Add decls with ATTRIBUTE_CONST.
10373
26bccfae
PE
10374 Minor improvements to make_formatted_string.
10375 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10376 where int is good enough, as vsprintf returns an int.
10377 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10378
a8290ec3
DA
103792012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10380
10381 Use make_formatted_string to avoid double length calculation.
10382 * lisp.h (make_formatted_string): New prototype.
10383 * alloc.c (make_formatted_string): New function.
10384 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10385 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10386 * editfns.c (Fcurrent_time_zone): Likewise.
10387 * filelock.c (get_boot_time): Likewise.
10388 * frame.c (make_terminal_frame, set_term_frame_name)
10389 (x_report_frame_params): Likewise.
10390 * image.c (gs_load): Likewise.
10391 * minibuf.c (get_minibuffer): Likewise.
10392 * msdos.c (dos_set_window_size): Likewise.
10393 * process.c (make_process): Likewise.
10394 * xdisp.c (ensure_echo_area_buffers): Likewise.
10395 * xsettings.c (apply_xft_settings): Likewise.
10396
d01ba2f1
GM
103972012-07-09 Glenn Morris <rgm@gnu.org>
10398
10399 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10400 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10401 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10402 * nsterm.h (ns_etc_directory): Add it.
10403 * callproc.c [HAVE_NS]: Include nsterm.h.
10404 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10405
f1f924b6
DA
104062012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10407
10408 Move marker debugging code under MARKER_DEBUG.
10409 * marker.c (MARKER_DEBUG): Move marker debugging code under
10410 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10411 for bootstrap with --enable-checking (~3x slowdown reported
10412 by Juanma Barranquero <lekktu@gmail.com>).
10413 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10414
ab531b66
PE
104152012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10416
10417 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10418 See <http://bugs.gnu.org/11825#29>.
10419
c4b3bc8a
EZ
104202012-07-08 Eli Zaretskii <eliz@gnu.org>
10421
10422 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10423 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10424 (display_line): Add commentary about displaying truncation glyphs
10425 on GUI frames.
10426 (produce_special_glyphs): Move here from term.c.
10427
10428 * term.c (produce_special_glyphs): Move to xdisp.c.
10429
10430 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10431 section.
c4b3bc8a 10432
b676b881
AS
104332012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10434
f17c5273
AS
10435 * xdisp.c (display_line): Avoid warning about implicit declaration
10436 of FRAME_FONT.
10437
298819b9
AS
10438 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10439
b676b881
AS
10440 * lisp.h: Remove empty conditional.
10441
6045c4fd
PE
104422012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10443
b3350bf9
PE
10444 * lread.c (load_path_check): Now static.
10445
6045c4fd
PE
10446 Fix some minor --with-ns problems found by static checking.
10447 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10448 (x_set_font) [!HAVE_X_WINDOWS]:
10449 * image.c (xpm_load_image) [HAVE_NS]:
10450 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10451 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10452 Remove unused local.
10453 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10454 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10455 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10456 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10457 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10458 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10459 Fix pointer signedness problem.
10460 * xfaces.c (FRAME_X_FONT_TABLE):
10461 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10462
929e7845
GM
104632012-07-07 Glenn Morris <rgm@gnu.org>
10464
10465 * lread.c (load_path_check): New function, split from init_lread.
10466 (init_lread): Reorganize. Motivation:
10467 If EMACSLOADPATH is set, check/warn about that rather than the
10468 defaults, which we are not going to use. Hence we can remove
10469 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10470 Don't warn if site-lisp directories are missing.
10471 If not installed, start from a blank load-path, since
10472 PATH_LOADSEARCH refers to the eventual installation directories.
10473
58dd0aa4
EZ
104742012-07-07 Eli Zaretskii <eliz@gnu.org>
10475
10476 Support truncation and continuation glyphs on GUI frames, when
10477 fringes are disabled. (Bug#11832)
10478 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10479 continuation glyphs even if on GUI frames.
10480 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10481 or both, are absent.
10482 (start_display, move_it_in_display_line_to): Handle the case of a
10483 GUI frame without a fringe to display continuation or truncation
10484 glyphs.
10485 (insert_left_trunc_glyphs): Support GUI frames: make sure
10486 truncation glyphs overwrite enough glyphs from the current line to
10487 have sufficient space in pixels.
10488 (display_line): Support truncation and continuation glyphs on GUI
10489 frames. If some spare pixels are left on the line after inserting
10490 the truncation glyphs, fill that space with a stretch glyph of a
10491 suitably computed width.
10492
10493 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10494 produce_glyphs, to support GUI sessions.
10495
31571fd7
PE
104962012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10497
5a16b9bc
PE
10498 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10499
f3047c75
PE
10500 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10501
31571fd7
PE
10502 Do not require float-time's arg to fit in time_t (Bug#11825).
10503 This works better on hosts where time_t is unsigned, and where
10504 float-time is applied to the (negative) difference between two times.
10505 * editfns.c (decode_time_components): Last arg is now double *,
10506 not int *, and means to store all the result as a double, without
10507 worrying about whether the seconds part fits in time_t.
10508 All callers changed.
10509 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10510 All callers changed.
10511 (Ffloat_time): Do not fail merely because the specified time falls
10512 outside of time_t range.
10513
4516fbef
GM
105142012-07-07 Glenn Morris <rgm@gnu.org>
10515
10516 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10517 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10518 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10519
07adc2c6
JB
105202012-07-07 Juanma Barranquero <lekktu@gmail.com>
10521
10522 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10523 Update dependencies.
10524
10525 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10526
fd573f31
PE
105272012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10528
fee5959d
PE
10529 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10530 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10531 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10532 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10533 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10534 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10535
fd573f31
PE
10536 * xfont.c (compare_font_names): Redo to omit the need for casts.
10537
ddadbc0e
AS
105382012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10539
fca8d6b6
AS
10540 * xfns.c (Fx_change_window_property): Doc fix.
10541 * w32fns.c (Fx_change_window_property): Doc fix.
10542
ddadbc0e
AS
10543 * w32fns.c (Fx_window_property): Accept the same arguments as the
10544 X Windows version. Doc fix.
10545 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10546
ed9265fc 105472012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10548 Eli Zaretskii <eliz@gnu.org>
10549
10550 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10551 Windows-specific code from nt/config.nt moved here.
10552 Obsolete settings removed.
10553
216ee680
PE
105542012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10555
10556 * process.c: Avoid unnecessary calls to gettime.
10557 (wait_reading_process_output): Don't get the time of day
10558 when gobbling data immediately and not waiting, as there's no need
10559 for it in that case. This removes a FIXME.
10560
bdd091e4
JD
105612012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10562
10563 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10564 is defined (Bug#11768).
10565
9d44f8ce
DA
105662012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10567
10568 Fix marker debugging code.
10569 * marker.c (byte_char_debug_check): Do not perform the check
10570 if buffer is not multibyte.
090bd7cb
JB
10571 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10572 Call byte_char_debug_check with correct arguments.
9d44f8ce 10573
90fc4786
DA
105742012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10575
10576 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
10577 * marker.c (byte_char_debug_check, count_markers):
10578 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
10579 (byte_debug_flag): Remove.
10580 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10581 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10582
7b7ae965
DA
105832012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10584
4e57b342
DA
10585 Avoid code repetition in marker-related functions.
10586 * marker.c (attach_marker): New function.
10587 (Fset_marker, set_marker_restricted, set_marker_both)
10588 (set_marker_restricted_both): Use it.
10589 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10590 Consistently rename charno to charpos.
10591 (marker_position): Add eassert.
10592 (marker_byte_position): Convert to eassert.
10593
105942012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10595
10596 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 10597 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 10598 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 10599
657924ff
DA
106002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10601
10602 Introduce fast path for the widely used marker operation.
10603 * alloc.c (build_marker): New function.
10604 * lisp.h (build_marker): New prototype.
10605 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10606 * composite.c (autocmp_chars): Likewise.
10607 * editfns.c (buildmark): Remove.
10608 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10609 (save_restriction_save): Use build_marker.
10610 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10611 * window.c (save_window_save): Likewise.
10612
041a49a6
DA
106132012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10614
10615 Do not use Fdelete_overlay in delete_all_overlays
10616 to avoid redundant calls to unchain_overlay.
10617 * buffer.c (drop_overlay): New function.
10618 (delete_all_overlays, Fdelete_overlay): Use it.
10619 * minibuf.c (get_minibuffer): Fix comment.
10620
7dca65a4
PE
106212012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10622
10623 Port to OpenBSD 5.1 amd64.
10624 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10625 This is needed for OpenBSD, and should be harmless on all BSD systems.
10626 Also, include <sys/sysctl.h>, as it should be available on all
10627 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10628 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10629 use p_pid member, not kp_proc.pid.
10630
8eb876e2
GM
106312012-07-06 Glenn Morris <rgm@gnu.org>
10632
10633 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10634
38182d90
PE
106352012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10636
10637 More xmalloc and related cleanup.
10638 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10639 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10640 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10641 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10642 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10643 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10644 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10645 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10646 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10647 * xterm.c:
10648 Omit needless casts involving void * pointers and allocation.
10649 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10650 as the former is more robust if P's type is changed.
10651 Prefer xzalloc to xmalloc + memset 0.
10652 Simplify malloc-or-realloc to realloc.
10653 Don't worry about xmalloc returning a null pointer.
10654 Prefer xstrdup to xmalloc + strcpy.
10655 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10656 growing it.
10657 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10658 alloca of a constant.
10659
6dd5a677
EZ
106602012-07-05 Eli Zaretskii <eliz@gnu.org>
10661
10662 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10663 hscroll is larger than the line width. Fixes long and futile
10664 looping inside extend_face_to_end_of_line (on a TTY) producing
10665 glyphs that are not needed and thrown away.
10666
6b312f0f
DA
106672012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10668
10669 * marker.c (set_marker_restricted_both): Simplify by using
10670 clip_to_bounds.
10671
f520ef9b
PE
106722012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10673
10674 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10675
383b7c95
JD
106762012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10677
10678 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10679 not defined (Bug#11768).
10680 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10681 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10682 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10683 followed by gtk_box_set_homogeneous (Bug#11768).
10684 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
10685 (update_theme_scrollbar_width, xg_create_scroll_bar):
10686 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
10687 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10688 (is_box_type): New function (Bug#11768).
10689 (xg_tool_item_stale_p): Call is_box_type.
5293d758 10690 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
10691 with default display (Bug#11768).
10692
d6e7bf45
EZ
106932012-07-05 Eli Zaretskii <eliz@gnu.org>
10694
10695 * xdisp.c (window_hscroll_limited): New function.
10696 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10697 coordinates when window's hscroll is set to insanely large
10698 values. (Bug#11857)
10699
431391ec
JB
107002012-07-05 Juanma Barranquero <lekktu@gmail.com>
10701
10702 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10703 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10704
23f86fce
DA
107052012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10706
10707 Cleanup xmalloc.
10708 * lisp.h (xzalloc): New prototype. Omit needless casts.
10709 * alloc.c (xzalloc): New function. Omit needless casts.
10710 * charset.c: Omit needless casts. Convert all calls to
10711 xmalloc with following memset to xzalloc.
10712 * dispnew.c: Likewise.
10713 * fringe.c: Likewise.
10714 * image.c: Likewise.
10715 * sound.c: Likewise.
10716 * term.c: Likewise.
10717 * w32fns.c: Likewise.
10718 * w32font.c: Likewise.
10719 * w32term.c: Likewise.
10720 * xfaces.c: Likewise.
10721 * xfns.c: Likewise.
10722 * xterm.c: Likewise.
10723 * atimer.c: Omit needless casts.
10724 * buffer.c: Likewise.
10725 * callproc.c: Likewise.
10726 * ccl.c: Likewise.
10727 * coding.c: Likewise.
10728 * composite.c: Likewise.
10729 * doc.c: Likewise.
10730 * doprnt.c: Likewise.
10731 * editfns.c: Likewise.
10732 * emacs.c: Likewise.
10733 * eval.c: Likewise.
10734 * filelock.c: Likewise.
10735 * fns.c: Likewise.
10736 * gtkutil.c: Likewise.
10737 * keyboard.c: Likewise.
10738 * lisp.h: Likewise.
10739 * lread.c: Likewise.
10740 * minibuf.c: Likewise.
10741 * msdos.c: Likewise.
10742 * print.c: Likewise.
10743 * process.c: Likewise.
10744 * region-cache.c: Likewise.
10745 * search.c: Likewise.
10746 * sysdep.c: Likewise.
10747 * termcap.c: Likewise.
10748 * terminal.c: Likewise.
10749 * tparam.c: Likewise.
10750 * w16select.c: Likewise.
10751 * w32.c: Likewise.
10752 * w32reg.c: Likewise.
10753 * w32select.c: Likewise.
10754 * w32uniscribe.c: Likewise.
10755 * widget.c: Likewise.
10756 * xdisp.c: Likewise.
10757 * xmenu.c: Likewise.
10758 * xrdb.c: Likewise.
10759 * xselect.c: Likewise.
10760
0497dc44
PE
107612012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10762
10763 * fileio.c (time_error_value): Check the right error number.
10764 Problem reported by Troels Nielsen in
10765 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10766
356e7178
PE
107672012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10768
4e71fd89
PE
10769 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10770 This should be fixed in a better way; see Eli Zaretskii in
10771 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10772 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10773
f0941253
PE
10774 * fileio.c (time_error_value): Rename from special_mtime.
10775 The old name's problems were noted by Eli Zaretskii in
10776 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10777
065c9eb4
PE
10778 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10779 This variable's comment says Emacs needs at least one GDB-visible
10780 symbol of type enum pvec_type, to work around GDB problems.
10781 The symbol's value doesn't matter.
10782
356e7178
PE
10783 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10784 that causes compilation to fail on pre-C99 compilers.
10785
ed9265fc 107862012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
10787
10788 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10789 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10790
3884d954
DA
107912012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10792
d209e2fb 10793 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
10794 headers for buffer_defaults and buffer_local_symbols.
10795 Reported by Juanma Barranquero <lekktu@gmail.com>.
10796
ee28be33
SM
107972012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10798
10799 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10800 * lisp.h (enum pvec_type): Use fewer bits.
10801 (PSEUDOVECTOR_SIZE_BITS): New constant.
10802 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10803 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10804 change in pvec_type.
10805 (PSEUDOVECTOR_TYPEP): New macro.
10806 (TYPED_PSEUDOVECTORP): Use it.
10807 * fns.c (internal_equal): Adapt code to extract pvectype.
10808 * emacs.c (gdb_pvec_type): Update type.
10809 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10810 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10811 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10812 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10813 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10814 abusing vector->header.next.nbytes.
10815 (live_vector_p): Use PVEC_TYPE.
10816 (mark_object): Adapt code to extract pvectype. Use switch.
10817
c7f2cd7f
PE
108182012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10819
10820 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10821 Tighten new eassert a bit.
10822
8ce70ed2
DA
108232012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10824
10825 Fix compilation with --enable-gcc-warnings and -O1
10826 optimization level.
10827 * doprnt.c (doprnt): Change type of tem to int, initialize
10828 to avoid compiler warning. Add eassert.
10829 * search.c (simple_search): Initialize match_byte to avoid
10830 compiler warning. Add eassert.
10831
dea7f1e5
PE
108322012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10833
24a212eb
PE
10834 Avoid weird behavior with large horizontal scrolls.
10835 Without this change, for example, large hscroll values would
10836 mess up Emacs's display on Fedora 15 x86, presumably due to
10837 overflows in int calculations in the display code.
10838 Also, if buffers had long lines, Emacs would freeze.
10839 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10840 (set_window_hscroll): New function, containing the old guts of
10841 Fset_window_hscroll. Return the clipped value.
10842 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10843 This avoids the need to check against PTRDIFF_MAX.
10844
dea7f1e5
PE
10845 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10846
76046526
DA
108472012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10848
10849 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10850
39adff0d
PE
108512012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10852
63807d47
PE
10853 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10854 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10855 since GCC 4.4.6 issues a bogus warning for them.
10856
39adff0d
PE
10857 Fix bugs in file timestamp newness comparisons.
10858 * fileio.c (Ffile_newer_than_file_p):
10859 * lread.c (Fload): Use full timestamp resolution of files,
10860 not just the 1-second resolution, so that files that are only
10861 slightly newer still count as newer.
10862 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10863 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10864
dbeed9a6
PE
108652012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10866
10867 * fileio.c: Improve handling of file time marker. (Bug#11852)
10868 (special_mtime): New function.
10869 (Finsert_file_contents, Fverify_visited_file_modtime):
10870 Use it to set special mtime values consistently.
10871
636334d6
AS
108722012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10873
10874 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10875 marker for non-existing file. (Bug#11852)
10876
e2017fe2
GM
108772012-07-03 Glenn Morris <rgm@gnu.org>
10878
10879 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10880 and did not make it into globals.h).
10881
404dbd37
TT
108822012-07-03 Tom Tromey <tromey@redhat.com>
10883
10884 * window.c (Fset_window_margins, Fset_window_fringes)
10885 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10886 * textprop.c (Fprevious_property_change): No longer static.
10887 * syntax.c (Fsyntax_table_p): No longer static.
10888 * process.c (Fget_process, Fprocess_datagram_address): No longer
10889 static.
10890 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10891 * keyboard.c (Fcommand_execute): No longer static.
10892 Remove EXFUN.
10893 * insdel.c (Fcombine_after_change_execute): No longer static.
10894 * image.c (Finit_image_library): No longer static.
10895 * fileio.c (Fmake_symbolic_link): No longer static.
10896 * eval.c (Ffetch_bytecode): No longer static.
10897 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
10898 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10899 No longer static.
404dbd37
TT
10900 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10901 static.
10902 * dired.c (Ffile_attributes): No longer static.
10903 * composite.c (Fcomposition_get_gstring): No longer static.
10904 * callproc.c (Fgetenv_internal): No longer static.
10905
10906 * ccl.h: Remove EXFUNs.
10907 * buffer.h: Remove EXFUNs.
10908 * dispextern.h: Remove EXFUNs.
10909 * intervals.h: Remove EXFUNs.
10910 * fontset.h: Remove EXFUN.
10911 * font.h: Remove EXFUNs.
10912 * dosfns.c (system_process_attributes): Remove EXFUN.
10913 * keymap.h: Remove EXFUNs.
10914 * lisp.h: Remove EXFUNs.
10915 * w32term.h: Remove EXFUNs.
10916 * window.h: Remove EXFUNs.
10917 * xsettings.h: Remove EXFUN.
10918 * xterm.h: Remove EXFUN.
10919
8e4fd1e1
GM
109202012-07-03 Glenn Morris <rgm@gnu.org>
10921
10922 * lisp.h (Frandom): Make it visible to C.
10923 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10924 buffer for invisible buffers. (Bug#1229)
10925
ca95b3eb
DA
109262012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10927
10928 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10929 values which aren't power of 2.
14ae4239 10930 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 10931 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
10932 accordingly.
10933
7555c33f
SM
109342012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10935
10936 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10937
10938 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10939
d12e8f5a
DA
109402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10941
10942 * alloc.c (allocate_vector_block): Remove redundant
10943 calls to mallopt if DOUG_LEA_MALLOC is defined.
10944 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10945 avoid calls to mallopt if zero_vector is returned.
10946
296094c3
DA
109472012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10948
10949 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10950 is enabled, avoid dereferencing NULL current_sblock if
10951 running undumped.
10952
36429c89
DA
109532012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10954
10955 Cleanup basic buffer management.
10956 * buffer.h (struct buffer): Change layout to use generic vector
10957 marking code. Fix some comments. Change type of 'clip_changed'
10958 to bitfield. Remove unused #ifndef old.
10959 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10960 (GET_OVERLAYS_AT): Fix indentation.
10961 (for_each_per_buffer_object_at): New macro.
10962 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10963 (Fbuffer_local_variables): Use it.
10964 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10965 * alloc.c (allocate_buffer): Adjust to match new layout of
10966 struct buffer. Fix comment.
10967 (mark_overlay): New function.
10968 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10969 Lisp area of struct buffer.
10970 (mark_object): Use it. Adjust marking of misc objects
10971 and related comments.
10972
3b3e4cac
PE
109732012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10974
10975 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10976 wrapper that is not needed because the wrapped code is a no-op (zero
10977 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10978 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10979
cf5c0175
DA
109802012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10981
10982 * alloc.c (mark_buffer): Simplify. Remove prototype.
10983 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10984 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10985 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10986 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10987
ca26824c
GM
109882012-06-30 Glenn Morris <rgm@gnu.org>
10989
2e4c5312
GM
10990 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10991
ca26824c
GM
10992 * epaths.in (PATH_SITELOADSEARCH): New.
10993 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10994 This is rather than relying on --enable-locallisppath elements
10995 having "site-lisp" in their names. (Bug#10208#25, 11658)
10996
0d23c240
EZ
109972012-06-30 Eli Zaretskii <eliz@gnu.org>
10998
c9240d7a
EZ
10999 * w32proc.c (sys_select): Accept and ignore one more argument.
11000
11001 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11002
0d23c240 11003 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11004 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11005
11006 * sysdep.c: Don't include dos.h and dosfns.h.
11007
11008 * process.c (sys_select):
11009 * msdos.c (sys_select): Accept one more argument and ignore it.
11010
11011 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11012 adapt data types and code to that.
11013
11014 * dosfns.c:
11015 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11016 which clashes with the gnulib function of the same name.
11017
af5a5a98
AS
110182012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11019
c5e4379c
AS
11020 * font.c (font_style_to_value, font_style_symbolic)
11021 (font_prop_validate_style): Add type checks for values in
11022 font_style_table.
11023
af5a5a98
AS
11024 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11025 argument.
11026 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11027 uses.
11028
8d38f461
EZ
110292012-06-29 Eli Zaretskii <eliz@gnu.org>
11030
2e5a6631
EZ
11031 * xdisp.c (try_window_id): Undo last change.
11032
8d38f461
EZ
11033 * w32.c (getwd): Adjust commentary about startup_dir.
11034 (init_environment): Always call sys_access, even in non-MSVC
11035 builds. Don't chdir to the directory of the Emacs executable.
11036 This undoes code from 1997 which was justified by the need to
11037 "avoid conflicts when removing and renaming directories". But its
11038 downside was that every relative file name was being interpreted
11039 relative to the directory of the Emacs executable, which can never
11040 be TRT. In particular, it broke sys_access when called with
11041 relative file names.
11042 (sys_access): Map GetLastError to errno.
11043
2af3565e
DA
110442012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11045
11046 * window.h (struct window): Change type of 'fringes_outside_margins'
11047 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11048 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11049 Adjust comment.
11050 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11051 to ptrdiff_t.
11052
c8d3a25c 110532012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11054
c8d3a25c
GM
11055 * gnutls.c (emacs_gnutls_handshake):
11056 Add QUIT to make the loop interruptible.
57570cd3 11057
c8d3a25c 110582012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11059
c8d3a25c
GM
11060 * charset.c (init_charset): Make lack of etc/charsets fatal.
11061
3e984ee8
DA
110622012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11063
11064 * editfns.c (region_limit): Fix type mismatch.
11065
ef884f23
DA
110662012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11067
11068 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11069 undefined. Convert from xassert to eassert.
11070 * nsmenu.m: Convert from xassert to eassert.
11071 * nsterm.m: Likewise.
11072
7d7e0027
SM
110732012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11074
11075 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11076
aa754e6a
PE
110772012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11078
11079 Avoid integer overflow on scroll-left and scroll-right.
11080 * window.c (HSCROLL_MAX): New macro.
11081 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11082 overflow when requested scroll falls outside ptrdiff_t range.
11083
80b00b08
DA
110842012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11085
11086 * window.h (struct window): Change type of 'hscroll',
11087 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11088 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11089 Adjust users accordingly.
11090 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11091 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11092 from EMACS_INT to ptrdiff_t.
11093 (make_window): Omit redundant initialization.
11094
62b2bcf6
JB
110952012-06-28 Juanma Barranquero <lekktu@gmail.com>
11096
11097 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11098
45942c7d
DA
110992012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11100
11101 * window.h (struct window): Change type of 'use_time' and
11102 'sequence_number' from Lisp_Object to int.
11103 * frame.c (make_frame): Adjust users accordingly.
11104 * print.c (print_object): Likewise.
11105 * window.c (select_window, Fwindow_use_time, make_parent_window)
11106 (make_window): Likewise.
11107
e509cfa6
DA
111082012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11109
11110 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11111 enabled with --enable-checking=[all,glyphs] configure option.
11112 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11113 adjust comments accordingly.
11114 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11115 undefined, adjust comments accordingly.
11116 * image.c: Likewise.
11117 * scroll.c: Likewise.
11118 * w32fns.c: Likewise.
11119 * w32term.c: Likewise.
11120 * xdisp.c: Likewise.
11121 * xfaces.c: Likewise.
11122 * xfns.c: Likewise.
11123 * xterm.c: Likewise.
11124
a54e2c05
DA
111252012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11126
11127 Generalize run-time debugging checks.
11128 * dispextern.h (XASSERTS): Remove.
11129 * fontset.c (xassert): Remove.
11130 Convert from xassert to eassert.
11131 * alloc.c: Convert from xassert to eassert.
11132 * bidi.c: Likewise.
11133 * dispnew.c: Likewise.
11134 * fns.c: Likewise.
11135 * fringe.c: Likewise.
11136 * ftfont.c: Likewise.
11137 * gtkutil.c: Likewise.
11138 * image.c: Likewise.
11139 * keyboard.c: Likewise.
11140 * menu.c: Likewise.
11141 * process.c: Likewise.
11142 * scroll.c: Likewise.
11143 * sound.c: Likewise.
11144 * term.c: Likewise.
11145 * w32console.c: Likewise.
11146 * w32fns.c: Likewise.
11147 * w32term.c: Likewise.
11148 * window.c: Likewise.
11149 * xdisp.c: Likewise.
11150 * xfaces.c: Likewise.
11151 * xfns.c: Likewise.
11152 * xselect.c: Likewise.
11153 * xterm.c: Likewise.
11154
1ec4b7b2
SM
111552012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11156
11157 * fns.c (maybe_resize_hash_table): Output message when growing the
11158 purify-hashtable.
11159
2014308a
DA
111602012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11161
11162 * alloc.c (allocate_string_data): Remove dead code.
11163 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11164 avoid GCC warning about unused macro.
11165
246155eb
DA
111662012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11167
11168 * alloc.c (allocate_string): Omit intervals initialization.
11169 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11170 as in make_pure_string and make_pure_c_string.
11171
43184b7b
DA
111722012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11173
d209e2fb 11174 * alloc.c (allocate_string): Fix last change.
43184b7b 11175
3fe6dd74
DA
111762012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11177
d209e2fb 11178 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11179 to memset, add explicit initialization where appropriate.
11180
1ba6038a
GM
111812012-06-27 Glenn Morris <rgm@gnu.org>
11182
11183 * lisp.mk (lisp): Remove paths.elc.
11184
c89926a5
CY
111852012-06-27 Chong Yidong <cyd@gnu.org>
11186
11187 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11188
ed6b3510
JW
111892012-06-26 John Wiegley <johnw@newartisans.com>
11190
1ec4b7b2 11191 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11192 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11193
ed6b3510
JW
11194 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11195 when building with Clang.
11196
8edd4a2b
SM
111972012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11198
11199 * eval.c (Fapply): Allow calling it with a single argument.
11200
f6f62d1b
EZ
112012012-06-26 Eli Zaretskii <eliz@gnu.org>
11202
11203 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11204 _stricmp and _strnicmp.
11205 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11206
62efea5e
DA
112072012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11208
11209 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11210 allocated window.
11211 (allocate_process): Likewise for new process.
8edd4a2b 11212 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11213 (allocate_frame): Likewise.
11214 * frame.c (make_frame): Omit redundant initialization.
11215 * window.c (make_parent_window): Use memset.
11216 (make_window): Omit redundant initialization.
11217 * process.c (make_process): Omit redundant initialization.
11218 * terminal.c (create_terminal): Likewise.
11219
42997f4d
DA
112202012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11221
11222 * term.c (delete_tty): Remove redundant call to memset.
11223
1130ecfc
DA
112242012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11225
11226 * alloc.c: Remove build_string.
11227 * lisp.h: Define build_string as static inline. This provides
11228 a better opportunity to optimize away calls to strlen when the
11229 function is called with compile-time constant argument.
11230 * image.c (imagemagick_error): Convert to build_string.
11231 * w32proc.c (sys_spawnve): Likewise.
11232 * xterm.c (x_term_init): Likewise.
11233
cf38a720
PE
112342012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11235
99027bdd
PE
11236 Use sprintf return value instead of invoking strlen on result.
11237 In the old days this wasn't portable, since some sprintf
11238 implementations returned char *. But they died out years ago and
11239 Emacs already assumes sprintf returns int.
11240 Similarly for float_to_string.
11241 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11242 * ccl.c (ccl_driver):
11243 * character.c (string_escape_byte8):
11244 * data.c (Fnumber_to_string):
11245 * doprnt.c (doprnt):
11246 * print.c (print_object):
11247 * xdisp.c (message_dolog):
11248 * xfns.c (syms_of_xfns):
11249 Use sprintf or float_to_string result to avoid need to call strlen.
11250 * data.c (Fnumber_to_string):
11251 Use make_unibyte_string, since the string must be ASCII.
11252 * lisp.h, print.c (float_to_string): Now returns int length.
11253 * term.c (produce_glyphless_glyph):
11254 Use sprintf result rather than recomputing it.
11255
cf38a720
PE
11256 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11257 * Makefile.in (ALL_CFLAGS):
11258 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11259 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11260
3511c784
DA
112612012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11262
0a08eb21 11263 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11264 strcasecmp if available.
11265 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11266
fb7da12e
AS
112672012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11268
11269 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11270 Avoid comma operator.
11271 * menu.c (push_submenu_start, push_submenu_end)
11272 (push_left_right_boundary, push_menu_pane): Likewise.
11273 * msdos.c (dos_rawgetc): Likewise.
11274
afa2ffd8
DA
112752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11276
11277 * xfns.c (xic_create_fontsetname): Remove redundant calls
11278 to memset.
11279
b3b4476b
PE
112802012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11281
4495ff38
PE
11282 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11283 sprintf already null-terminates its output.
11284
b3b4476b
PE
11285 * xfns.c (x_window): Remove redundant cast.
11286
b00876c9
DA
112872012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11288
11289 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11290 `const char *' to `char *' to avoid compiler warning.
11291
d188e26b
PE
112922012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11293
885d1d74
PE
11294 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11295 instead of truncating it to 63 (admittedly a generous limit).
11296
d188e26b
PE
11297 * process.c: Fix spelling and caps in comments.
11298
e2f560b1
DN
112992012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11300
e86db54b 11301 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11302 * sysdep.c (setpgrp): Remove definition, not used in this file.
11303
7583a3a1
JB
113042012-06-24 Juanma Barranquero <lekktu@gmail.com>
11305
11306 * makefile.w32-in: Update dependencies.
11307
696056c2
EZ
113082012-06-24 Eli Zaretskii <eliz@gnu.org>
11309
11310 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11311 (SYSTIME_H): Add nt/inc/sys/time.h.
11312
11313 * systime.h [WINDOWSNT]: Include sys/time.h.
11314
11315 * s/ms-w32.h (struct timespec): Definition moved from
11316 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11317
845ca893
PE
113182012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11319
11320 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11321 * buffer.h (buffer_slot_type_mismatch):
11322 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11323 * eval.c (unwind_to_catch):
11324 * image.c (my_png_error, my_error_exit):
11325 * keyboard.c (quit_throw_to_read_char, user_error)
11326 (Fexit_recursive_edit, Fabort_recursive_edit):
11327 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11328 (wrong_type_argument, buffer_overflow, __executable_start)
11329 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11330 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11331 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11332 (fatal):
11333 (child_setup) [!DOS_NT]:
11334 * lread.c (end_of_file_error, invalid_syntax):
11335 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11336 * puresize.h (pure_write_error):
11337 * search.c (matcher_overflow):
11338 * sound.c (sound_perror, alsa_sound_perror):
11339 * sysdep.c, syssignal.h (croak):
11340 * term.c (maybe_fatal, vfatal):
11341 * textprop.c (text_read_only):
11342 * undo.c (user_error):
11343 * unexmacosx.c (unexec_error):
11344 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11345 Use _Noreturn rather than NO_RETURN.
11346 No need for separate decl merely because of _Noreturn.
11347 * sound.c (sound_warning, parse_sound):
11348 Remove unnecessary forward decls.
11349
f1dd8073
PE
113502012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11351
11352 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11353 * lisp.h (WAIT_READING_MAX): New macro.
11354 * dispnew.c (Fsleep_for, sit_for):
11355 * keyboard.c (kbd_buffer_get_event):
11356 * process.c (Faccept_process_output):
11357 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11358 This improves on the previous patch, which introduced a bug
11359 when time_t is unsigned and as wide as intmax_t.
11360 See <http://bugs.gnu.org/9000#51>.
11361
b82c1755
EZ
113622012-06-23 Eli Zaretskii <eliz@gnu.org>
11363
11364 * dispnew.c (sit_for, Fsleep_for):
11365 * keyboard.c (kbd_buffer_get_event):
11366 * process.c (Faccept_process_output): Avoid compiler warnings when
11367 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11368
ca300656
JB
113692012-06-23 Juanma Barranquero <lekktu@gmail.com>
11370
049ec95b
JB
11371 * makefile.w32-in: Update dependencies.
11372
ca300656
JB
11373 * w32.c (ltime): Add return type and declare static.
11374 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11375
db7b8d06
PE
113762012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11377
11378 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11379 Privately reported by Herbert J. Skuhra.
11380 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11381 All uses changed.
11382 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11383 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11384
0bd8297f
EZ
113852012-06-23 Eli Zaretskii <eliz@gnu.org>
11386
96512555
EZ
11387 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11388 last argument of make_unibyte_string.
11389
0bd8297f
EZ
11390 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11391 language ID in the event parameters.
11392
11393 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11394 event.code, not the obscure "character set ID".
11395
63def6b6
CY
113962012-06-23 Chong Yidong <cyd@gnu.org>
11397
11398 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11399
e8a02204
EZ
114002012-06-23 Eli Zaretskii <eliz@gnu.org>
11401
388cdec0
EZ
11402 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11403 * w32.c (fdutimens): New function.
11404
11405 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11406
11407 * s/ms-w32.h (pselect): Redirect to sys_select.
11408
11409 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11410
e8a02204
EZ
11411 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11412 in the logic of incrementing and decrementing the value of
11413 use_relocatable_buffers.
11414
d054f3fb
PE
114152012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11416
11417 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11418 Privately reported by Herbert J. Skuhra.
11419 [__FreeBSD__]: Remove "*/" typo after "#include".
11420 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11421 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11422 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11423 Don't assume EMACS_TIME and struct timeval are the same type.
11424
d35af63c
PE
114252012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11426
11427 Support higher-resolution time stamps (Bug#9000).
11428 The time stamps are only nanosecond-resolution at the C level,
11429 since that's the best that any real-world system supports now.
11430 But they are picosecond-resolution at the Lisp level, as that's
11431 easy, and leaves room for future OS improvements.
11432
11433 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11434 (LIBES): Use it.
11435
11436 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11437 Don't get current time unless it's needed.
11438
11439 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11440 now provides it if it's absent.
11441 (start_atimer): Port to higher-res time stamps.
11442 Check for time stamp overflow. Don't get current time more
11443 often than is needed.
11444
11445 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11446 Include systime.h, not time.h.
11447 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11448
11449 * dired.c: Include stat-time.h.
11450 (Ffile-attributes): File times now have higher resolution.
11451
11452 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11453 (struct image): Timestamp now has higher resolution.
11454
11455 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11456 has at least microseconds now. All uses removed.
11457 (update_frame, update_single_window, update_window, update_frame_1)
11458 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11459 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11460
11461 * editfns.c (time_overflow): Now extern.
11462 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11463 (float-time, Fformat_time_string, Fcurrent_time_string)
11464 (Fcurrent_time_zone): Accept and generate higher-resolution
11465 time stamps.
11466 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11467 (decode_time_components, lisp_seconds_argument): New functions.
11468 (make_time): Now static.
11469 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11470 Report an error if the time is invalid, rather than having the caller
11471 do that.
11472
11473 * fileio.c: Include <stat-time.h>
11474 (Fcopy_file): Copy higher-resolution time stamps.
11475 Prefer to set the time stamp via a file descriptor if that works.
11476 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11477 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11478 (Fvisited_file_modtime, Fset_visited_file_modtime):
11479 Support higher-resolution time stamps.
11480
11481 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11482
11483 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11484
11485 * image.c (prepare_image_for_display, clear_image_cache)
11486 (lookup_image): Port to higer-resolution time stamps.
11487
11488 * keyboard.c (start_polling, bind_polling_period):
11489 Check for time stamp overflow.
11490 (read_char, kbd_buffer_get_event, timer_start_idle)
11491 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11492 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11493 Port to higher-resolution time stamps. Do not assume time_t is signed.
11494 (decode_timer): New function. Timers are now vectors of length 9,
11495 not 8, to accommodate the picosecond component.
11496 (timer_check_2): Use it.
11497
11498 * nsterm.m (select_timeout, timeval_subtract): Remove.
11499 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11500 as they're a bit more accurate and handle overflow better.
11501 (ns_select): Change prototype to be compatible with pselect.
11502 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11503 * nsterm.h (ns_select): Adjust prototype.
11504
11505 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11506 us-resolution time stamps.
11507 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11508
11509 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11510
11511 * lisp.h (time_overflow): New decl.
11512 (wait_reading_process_output): First arg is now intmax_t, not int,
11513 to accommodate larger waits.
11514
11515 * process.h (struct Lisp_Process.read_output_delay):
11516 Now counts nanoseconds, not microseconds.
11517 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11518 EMACS_HAS_USECS.
11519 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11520 (wait_reading_process_output):
11521 Port to ns-resolution time stamps.
11522 (Faccept_process_output, wait_reading_process_output):
11523 Check for time stamp overflow. Do not assume time_t is signed.
11524 (select_wrapper): Remove; we now use pselect.
11525 (Fprocess_attributes): Now generates ns-resolution time stamps.
11526
11527 * sysdep.c: Include utimens.h. Don't include utime.h
11528 or worry about struct utimbuf; gnulib does that for us now.
11529 (gettimeofday): Remove; gnulib provides a substitute.
11530 (make_timeval): New function.
11531 (set_file_times): Now sets ns-resolution time stamps.
11532 New arg FD; all uses changed.
11533 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11534 (system_process_attributes):
11535 Now returns ns-resolution time stamp. All uses changed.
11536 Check for time stamp overflow.
11537
11538 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11539 provides a substitute now.
11540
11541 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11542 since it guarantees struct timespec.
11543 (EMACS_TIME): Now struct timespec, so that we can support
11544 ns-resolution time stamps.
11545 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11546 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11547 (EMACS_USECS): Remove.
11548 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11549 so multiply the arg by 1000 before storing it.
11550 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11551 New macros.
11552 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11553 Port to ns-resolution time stamps.
11554 (EMACS_TIME_NEG_P): Remove; replaced by....
11555 (EMACS_TIME_SIGN): New macro.
11556 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11557 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11558 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11559 (make_timeval, make_lisp_time, decode_time_components): New decls.
11560 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11561 that it mishandled time_t overflow. You can't compare by subtracting!
11562 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11563 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11564
11565 * term.c: Include <sys/time.h>.
11566 (timeval_to_Time): New function, for proper overflow wraparound.
11567 (term_mouse_position, term_mouse_click): Use it.
11568
11569 * undo.c (record_first_change): Support higher-resolution time stamps
11570 in the undo buffer.
11571 (Fprimitive_undo): Use them when restoring time stamps.
11572
11573 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11574 (w32_get_internal_run_time):
11575 Port to higher-resolution Emacs time stamps.
11576 (ltime): Now accepts single 64-bit integer, as that's more convenient
11577 for callers.
11578
11579 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11580
11581 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11582 for compatibility with pselect. Support ns-resolution time stamps.
11583
11584 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11585
11586 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11587 Check for time stamp overflow, and support ns-resolution time stamps.
11588
11589 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11590 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11591 (timeval_subtract): Remove; no longer needed.
11592 (XTflash, XTring_bell, x_wait_for_event):
11593 Port to ns-resolution time stamps. Don't assume time_t is signed.
11594
b6a92dfe
CY
115952012-06-22 Chong Yidong <cyd@gnu.org>
11596
11597 * xdisp.c (x_consider_frame_title): Revert last change.
11598
d251c37c
EZ
115992012-06-22 Eli Zaretskii <eliz@gnu.org>
11600
11601 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11602 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11603 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11604 staticidx goes up to 1597 out of 1600 = 0x640.)
11605
f10deafb
PE
116062012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11607
11608 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11609 Otherwise, the umask might be mistakenly 0 while handling input signals.
11610
ec6de1e2
SM
116112012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11612
11613 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11614
28be1ada
DA
116152012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11616
11617 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11618 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11619 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11620 access to `contents' member of Lisp_Vector objects with AREF and ASET
11621 where appropriate.
11622
c6bf3022
CY
116232012-06-19 Chong Yidong <cyd@gnu.org>
11624
11625 * frame.c (delete_frame): When selecting a frame on a different
11626 text terminal, do not alter the terminal's top-frame.
11627
11628 * xdisp.c (format_mode_line_unwind_data): Record the target
11629 frame's selected window and its terminal's top-frame.
11630 (unwind_format_mode_line): Restore them.
11631 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11632 Callers changed.
11633 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11634 since tty frames can be explicitly named.
11635 (prepare_menu_bars): Likewise.
11636
11637 * term.c (Ftty_top_frame): New function.
11638
defd4196
PE
116392012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11640
11641 Port byte-code-meter to modern targets.
11642 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11643 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11644 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11645 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11646 (METER_1, METER_2): Simplify.
11647
1053a871
SM
116482012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11649
11650 * data.c (Fdefalias): Return `symbol' (bug#11686).
11651
b7e8d081
MR
116522012-06-18 Martin Rudalics <rudalics@gmx.at>
11653
11654 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11655 gets killed during executing of this function (Bug#11665).
11656 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11657 (Vkill_buffer_query_functions): In doc-string say that functions
11658 run by this hook should not change the current buffer.
11659
7ea2b339
PE
116602012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11661
11662 Fix recently-introduced process.c problems found by static checking.
11663 * process.c (write_queue_push, write_queue_pop, send_process):
11664 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11665 (write_queue_pop): Fix pointer signedness problem.
11666 (send_process): Remove unused local.
11667
96a313a1
CY
116682012-06-17 Chong Yidong <cyd@gnu.org>
11669
11670 * xdisp.c (redisplay_internal): No need to redisplay terminal
11671 frames that are not on top.
11672
20ca2e94
TN
116732012-06-17 Troels Nielsen <bn.troels@gmail.com>
11674
11675 * process.c (make_process): Initialize write_queue.
11676 (write_queue_push, write_queue_pop): New functions.
11677 (send_process): Use them to maintain correct ordering of process
11678 writes (Bug#10815).
11679
9a900ca9
PE
116802012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11681
310fbfa8
PE
11682 * lisp.h (eassert): Assume C89 or later.
11683 This removes the need for CHECK.
11684 (CHECK): Remove. Its comments about always evaluating its
11685 argument were confusing, as 'eassert' typically does not evaluate
11686 its argument.
11687
27bb1ca4
PE
11688 * coding.c (produce_chars): Use ptrdiff_t, not int.
11689
9a900ca9
PE
11690 * xterm.c (x_draw_underwave): Check for integer overflow.
11691 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11692
41b7f8bc 116932012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
11694
11695 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11696 referenced (Bug#11583).
11697
9b0e3eba
AA
116982012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11699
11700 Implement wave-style variant of underlining.
11701 * dispextern.h (face_underline_type): New enum.
11702 (face): Add field for underline type.
11703 * nsterm.m (ns_draw_underwave): New function.
11704 (ns_draw_text_decoration): Use it.
11705 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11706 New functions.
11707 (x_draw_glyph_string): Use them.
11708 * xfaces.c (Qline, Qwave): New Lisp objects.
11709 (check_lface_attrs, merge_face_ref)
1053a871
SM
11710 (Finternal_set_lisp_face_attribute, realize_x_face):
11711 Handle wave-style underline face attributes.
9b0e3eba
AA
11712 * xterm.c (x_draw_underwave): New function.
11713 (x_draw_glyph_string): Use it.
11714
0fb52f11
JB
117152012-06-16 Juanma Barranquero <lekktu@gmail.com>
11716
11717 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11718 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11719 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11720 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11721 ($(BLD)/w32select.$(O)): Update dependencies.
11722
e5560ff7
AS
117232012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11724
11725 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11726 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11727 * character.c (_fetch_multibyte_char_p): Remove.
11728 * alloc.c: Include "character.h" before "buffer.h".
11729 * bidi.c: Likewise.
11730 * buffer.c: Likewise.
11731 * bytecode.c: Likewise.
11732 * callint.c: Likewise.
11733 * callproc.c: Likewise.
11734 * casefiddle.c: Likewise.
11735 * casetab.c: Likewise.
11736 * category.c: Likewise.
11737 * cmds.c: Likewise.
11738 * coding.c: Likewise.
11739 * composite.c: Likewise.
11740 * dired.c: Likewise.
11741 * dispnew.c: Likewise.
11742 * doc.c: Likewise.
11743 * dosfns.c: Likewise.
11744 * editfns.c: Likewise.
11745 * emacs.c: Likewise.
11746 * fileio.c: Likewise.
11747 * filelock.c: Likewise.
11748 * font.c: Likewise.
11749 * fontset.c: Likewise.
11750 * fringe.c: Likewise.
11751 * indent.c: Likewise.
11752 * insdel.c: Likewise.
11753 * intervals.c: Likewise.
11754 * keyboard.c: Likewise.
11755 * keymap.c: Likewise.
11756 * lread.c: Likewise.
11757 * macros.c: Likewise.
11758 * marker.c: Likewise.
11759 * minibuf.c: Likewise.
11760 * nsfns.m: Likewise.
11761 * nsmenu.m: Likewise.
11762 * print.c: Likewise.
11763 * process.c: Likewise.
11764 * regex.c: Likewise.
11765 * region-cache.c: Likewise.
11766 * search.c: Likewise.
11767 * syntax.c: Likewise.
11768 * term.c: Likewise.
11769 * textprop.c: Likewise.
11770 * undo.c: Likewise.
11771 * unexsol.c: Likewise.
11772 * w16select.c: Likewise.
11773 * w32fns.c: Likewise.
11774 * w32menu.c: Likewise.
11775 * window.c: Likewise.
11776 * xdisp.c: Likewise.
11777 * xfns.c: Likewise.
11778 * xmenu.c: Likewise.
11779 * xml.c: Likewise.
11780 * xselect.c: Likewise.
11781
2f07e6af
EZ
117822012-06-16 Eli Zaretskii <eliz@gnu.org>
11783
1053a871
SM
11784 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11785 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 11786 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
11787 row.
11788 (handle_face_prop): Use chunk-relative overlay string index when
11789 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
11790 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11791 the rightmost. (Bug#11720)
2f07e6af 11792
29b83cec
AS
117932012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11794
11795 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11796 (CATEGORY_MEMBER): Enforce 1/0 value.
11797 * category.c (_temp_category_set): Remove.
11798
4c5501e9
EZ
117992012-06-16 Eli Zaretskii <eliz@gnu.org>
11800
11801 * window.c (Fdelete_other_windows_internal)
11802 (Fdelete_window_internal): Don't access frame's mouse highlight
11803 info of the initial frame. (Bug#11677)
11804
2b570124
PE
118052012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11806
e93864f9
PE
11807 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11808 Assume USE_2_TAGS_FOR_INTS.
11809 (xreload): Adjust $tagmask width to match recent lisp.h change.
11810
2b570124
PE
11811 Simplify lisp.h in minor ways that should not affect code.
11812 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11813 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11814 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11815 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11816 (INTTYPEBITS): New macro, for clarity.
11817 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
11818 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11819 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
11820 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11821 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11822
81755f69
JB
118232012-06-13 Juanma Barranquero <lekktu@gmail.com>
11824
11825 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11826
16192a57
GM
118272012-06-13 Glenn Morris <rgm@gnu.org>
11828
11829 * s/bsd-common.h (BSD4_3):
11830 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11831
646b5f55
AS
118322012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11833
11834 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11835 instead of union.
11836 (XLI, XIL): Define.
1053a871
SM
11837 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11838 Use them.
11839 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 11840 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 11841 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
11842 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11843 * frame.c (delete_frame): Remove outdated comment.
11844 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11845 USE_LISP_UNION_TYPE.
11846 (Fw32_unregister_hot_key): Likewise.
11847 (Fw32_toggle_lock_key): Likewise.
11848 * w32menu.c (add_menu_item): Likewise.
11849 (w32_menu_display_help): Use XIL instead of checking
11850 USE_LISP_UNION_TYPE.
11851 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11852 (init_heap): Likewise.
11853 * w32term.c (w32_read_socket): Update comment.
11854
1d3823c9
GM
118552012-06-13 Glenn Morris <rgm@gnu.org>
11856
c62ff706
GM
11857 * s/usg5-4-common.h, src/s/unixware.h:
11858 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11859
1d3823c9
GM
11860 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11861
bfe3e0a2
PE
118622012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11863
11864 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11865 * alloc.c (make_number) [!defined make_number]:
11866 Remove, as lisp.h always defines this now.
11867 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11868 (roundup_size): Verify that it is a power of 2.
11869 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11870 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11871 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11872 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11873 USE_LSB_TAG now is always defined to be either 0 or 1.
11874 All uses changed.
11875 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11876 code works fine either way, and efficiency is not a concern here,
11877 as the union type is for debugging, not for production.
11878 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11879 Use an inline function on all platforms when using the union type,
11880 since this is simpler and 'static inline' can be used portably
11881 within Emacs now.
11882 (LISP_INITIALLY_ZERO): New macro.
11883 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11884 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11885
45fa9c0f
GM
118862012-06-12 Glenn Morris <rgm@gnu.org>
11887
b4492cba
GM
11888 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11889
11890 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 11891
45fa9c0f
GM
11892 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11893 Move BROKEN_SIGIO to configure.
11894
11895 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11896 Move NO_TERMIO to configure.
11897
0e25d334
CY
118982012-06-12 Chong Yidong <cyd@gnu.org>
11899
11900 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11901 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11902 MagickExportImagePixels is undefined.
11903
43682bb6
PE
119042012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11905
11906 * image.c (imagemagick_load_image): Remove unused label.
11907
a9be7d2b
GM
119082012-06-11 Glenn Morris <rgm@gnu.org>
11909
11910 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11911 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11912 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11913 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11914
3017f87f
SM
119152012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11916
11917 * alloc.c (make_byte_code): New function.
11918 (Fmake_byte_code): Use it. Don't purify here.
11919 * lread.c (read1): Use it as well to avoid extra allocation.
11920
1b9b4cf4
CY
119212012-06-11 Chong Yidong <cyd@gnu.org>
11922
11923 * image.c (imagemagick_load_image): Implement transparency.
11924
95988fcf
AS
119252012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11926
11927 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11928 account for preceding backslashes. (Bug#11663)
11929
cd4eb164
CY
119302012-06-09 Chong Yidong <cyd@gnu.org>
11931
11932 * term.c: Support italics in capable terminals (Bug#9652).
11933 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11934 (turn_on_face): Output using TS_enter_italic_mode if available.
11935 Don't handle unused blinking and alt-charset cases.
11936 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11937 and tty_alt_charset_p cases.
11938 (tty_capable_p, init_tty): Support italics.
11939
11940 * termchar.h (struct tty_display_info): Add field for italics.
11941 Remove unused blink field.
11942
11943 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11944 Handle slant.
11945
11946 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11947 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11948 tty_alt_charset_p. Add tty_italic_p.
11949
ff88beb8
MA
119502012-06-09 Michael Albinus <michael.albinus@gmx.de>
11951
11952 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11953 dbus_type_is_basic if available.
11954 (xd_extract_signed, xd_extract_unsigned): Rename from
11955 extract_signed and extract_unsigned, respectively. Adapt callers.
11956
44286096
CY
119572012-06-09 Chong Yidong <cyd@gnu.org>
11958
1682701f
CY
11959 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11960
44286096
CY
11961 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11962 case (Bug#9752).
11963
d86feb17
PE
119642012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11965
11966 * xdisp.c (vmessage): Treat frame message as multibyte.
11967 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11968 would generate the diagnostic "Making \302\247 buffer-local while
11969 let-bound!".
11970
d5c20fe8
EZ
119712012-06-08 Eli Zaretskii <eliz@gnu.org>
11972
11973 * dispnew.c (showing_window_margins_p): Undo last change, which
11974 was done due to an inadvertent commit.
11975 (adjust_frame_glyphs_for_frame_redisplay): Do call
11976 showing_window_margins_p.
11977
513749ee
SM
119782012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11979
11980 * eval.c (Fmake_var_non_special): New primitive.
11981 (syms_of_eval): Defsubr it.
11982 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11983
d4a8f5c1
JB
119842012-06-08 Juanma Barranquero <lekktu@gmail.com>
11985
11986 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11987 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11988
8bbbc977
EZ
119892012-06-08 Eli Zaretskii <eliz@gnu.org>
11990
11991 * alloc.c (allocate_vectorlike): Fix last change.
11992
f3372c87
DA
119932012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11994
11995 Block-based vector allocation of small vectors.
11996 * lisp.h (struct vectorlike_header): New field `nbytes',
11997 adjust comment accordingly.
11998 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 11999 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12000 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12001 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12002 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
12003 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
12004 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
12005 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12006 (roundup_size): New constant.
12007 (struct vector_block): New data type.
12008 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12009 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12010 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12011 (sweep_vectors): New functions.
12012 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12013 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12014 or equal to VBLOCK_BYTES_MAX.
12015 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12016 (init_alloc_once): Add call to init_vectors.
12017
4f18a4ed
SM
120182012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12019
12020 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12021
86f158bc
PE
120222012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12023
12024 * doprnt.c (doprnt): Truncate multibyte char correctly.
12025 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12026 would mishandle a string argument "Xc" if X was a multibyte
12027 character of length 2: it would truncate after X's first byte
12028 rather than including all of X.
12029
c5cfcbe0
CY
120302012-06-06 Chong Yidong <cyd@gnu.org>
12031
12032 * buffer.c (word_wrap): Doc fix.
12033
c05cf390
PE
120342012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12035
12036 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12037
0c3461de
GM
120382012-06-03 Glenn Morris <rgm@gnu.org>
12039
12040 * xdisp.c (tool-bar-style): Doc fix.
12041
c71232db
UM
120422012-06-03 Ulrich Müller <ulm@gentoo.org>
12043
12044 * Makefile.in (PAXCTL): Define.
12045 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12046 binary via PaX flags if the paxctl utility is available.
12047 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12048 Restore PaX flags to their default. (Bug#11398)
12049
383f7350
CY
120502012-06-03 Chong Yidong <cyd@gnu.org>
12051
12052 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12053 buffer (Bug#11226).
12054
5f2c76c6
CY
120552012-06-03 Chong Yidong <cyd@gnu.org>
12056
12057 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12058 (note_mode_line_or_margin_highlight): If there is no help echo,
12059 use mode-line-default-help-echo. Handle the case where the mouse
12060 position is past the end of the mode line string.
12061
12062 * buffer.c (buffer_local_value_1): New function, split from
12063 Fbuffer_local_value; can return Qunbound.
12064 (Fbuffer_local_value): Use it.
12065 (Vmode_line_format): Docstring tweaks.
12066
773d47f6
PE
120672012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12068
12069 * sysdep.c (system_process_attributes): Improve comment.
12070
f2d6a3df
SM
120712012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12072
12073 * keyboard.c: Export real-this-command to Elisp.
12074 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12075 and DEFVAR it. Update all users.
12076
63810350
PE
120772012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12078
7bd5c1f4
PE
12079 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12080
63810350
PE
12081 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12082 Convert pctcpu and pctmem to Lisp float properly.
12083 Let the compiler fold better, as 100.0/0x8000 is exact.
12084
a2821611
AS
120852012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12086
12087 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12088 cons_block.
12089
5fceba1d
PE
120902012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12091
12092 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12093
c98ff5dd
DA
120942012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12095
12096 For a 'struct window', replace some Lisp_Object fields to
12097 bitfields where appropriate, remove unused fields.
12098 * window.h (struct window): Remove unused 'last_mark_x' and
12099 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12100 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12101 Change type of 'force_start', 'optional_new_start',
12102 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12103 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12104
ca34e0be
PE
121052012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12106
12107 Pacify gcc -Wdouble-precision when using Xaw.
12108 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12109 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12110 Use 'float' consistently, rather than 'float' in most places
12111 and 'double' in a couple of places.
12112
efc00ab1 121132012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12114
12115 * xdisp.c (handle_stop): Detect whether we have overlay strings
12116 loaded by testing it->current.overlay_string_index to be
12117 non-negative, instead of checking whether n_overlay_strings is
12118 positive. (Bug#11587)
12119
efc00ab1 121202012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12121
12122 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12123
12124 * doc.c (Fsubstitute_command_keys): Doc fix.
12125
efc00ab1 121262012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12127
12128 * search.c (search_buffer): Remove calls to
12129 r_alloc_inhibit_buffer_relocation, as it is now called by
12130 maybe_unify_char, which was the cause of relocation of buffer text
12131 in bug#11519.
12132
efc00ab1 121332012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12134
12135 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12136 for the duration of call to load_charset, to avoid problems with
12137 callers of maybe_unify_char that access buffer text through C
12138 pointers.
12139
12140 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12141 decrement the inhibition flag, instead of just setting or
12142 resetting it.
12143
ba93a187
PE
121442012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12145
12146 Remove obsolete '#define static' cruft.
12147 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12148 This #undef was "temporary" in 2000; it is no longer needed
12149 now that '#define static' has gone away.
12150 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12151 (gray_bitmap_bits): Remove; no longer needed.
12152 All uses replaced with definiens.
12153 * xterm.c: Include "bitmaps/gray.xbm".
12154
9e4bf381
PE
121552012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12156
12157 Clean up __executable_start, monstartup when --enable-profiling.
12158 The following changes affect the code only when profiling.
12159 * dispnew.c (__executable_start): Rename from safe_bcopy.
12160 Define only on platforms that need it.
12161 * emacs.c: Include <sys/gmon.h> when profiling.
12162 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12163 (__executable_start): Remove decl, since lisp.h does it now.
12164 (safe_bcopy): Remove decl; no longer has that name.
12165 (main): Coalesce #if into single bit of code, for simplicity.
12166 Cast pointers to uintptr_t, since standard libraries want integers
12167 and not pointers.
12168 * lisp.h (__executable_start): New decl.
12169
32d72c2f
GM
121702012-05-31 Glenn Morris <rgm@gnu.org>
12171
12172 * image.c (Fimagemagick_types): Doc fix.
12173
baac5bc7
JM
121742012-05-30 Jim Meyering <meyering@redhat.com>
12175
12176 * callproc.c (Fcall_process_region): Include directory component
12177 in mkstemp error message (Bug#11586).
12178
72cb32cf
PE
121792012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12180
12181 * alloc.c, lisp.h (make_pure_vector): Now static.
12182
61b108cc
SM
121832012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12184
12185 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12186 Move to byte-run.el.
12187 (Fautoload): Do the hash-doc more carefully.
12188 * data.c (Fdefalias): Purify definition, except for keymaps.
12189 (Qdefun): Move from eval.c.
12190 * lisp.h (Qdefun): Remove.
12191 * lread.c (read1): Tiny simplification.
12192
471fe23d
TN
121932012-05-29 Troels Nielsen <bn.troels@gmail.com>
12194
934f3f58 12195 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12196 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12197 Bug#9642, but explicitly check that the buffer the overlay would
12198 be moved to is live and rearrange lines to make sure that errors
12199 will not put the overlay in an inconsistent state.
12200 (Fdelete_overlay): Cosmetics.
12201
85d0efd1
EZ
122022012-05-28 Eli Zaretskii <eliz@gnu.org>
12203
12204 * w32term.c (my_bring_window_to_top): New function.
12205 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12206 could be different from the original one.
12207 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12208 (Bug#11513)
12209
12210 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12211 by calling BringWindowToTop.
12212
12213 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12214 (WM_EMACS_END): Increase by one.
12215
da92a98c
PE
122162012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12217
12218 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12219 This avoids undefined behavior that might cause the eassert
12220 to not catch an out-of-range value.
12221
74d1f848
JB
122222012-05-28 Juanma Barranquero <lekktu@gmail.com>
12223
12224 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12225 Update dependencies.
12226
9e1a06fc
EZ
122272012-05-27 Eli Zaretskii <eliz@gnu.org>
12228
12229 * bidi.c (bidi_mirror_char): Fix last change.
12230
f3dd7312
AS
122312012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12232
12233 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12234 when referring to sectname field in printf format.
12235
81899c91
PE
122362012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12237
57b81a9f
PE
12238 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12239 Only r_alloc_inhibit_buffer_relocation needed to be added;
12240 the others were already declared.
12241
81899c91
PE
12242 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12243 before checking whether it's out of range. Put the check inside
12244 eassert. See
12245 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12246
33017faf 122472012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12248
12249 * callproc.c (Fcall_process): Restore a line that was accidentally
12250 commented out in the 2011-02-13 change (bug#11547).
12251
33017faf 122522012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12253
12254 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12255 defined on ralloc.c.
12256
12257 * buffer.c [REL_ALLOC]: Remove prototypes of
12258 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12259 they are now on lisp.h.
12260
12261 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12262
12263 * search.c (search_buffer): Use it to inhibit relocation of buffer
12264 text while re_search_2 is doing its job, because re_search_2 is
12265 passed C pointers to buffer text. (Bug#11519)
12266
23415acf
EZ
12267 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12268 Update value to 24.
12269
44e27368
EZ
12270 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12271 state after an additional call to move_it_in_display_line_to, keep
12272 the values of it->max_ascent and it->max_descent found for the
12273 entire line.
12274 (pos_visible_p): Revert the comparison against bottom_y to what it
12275 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12276 (Bug#11464)
12277
c1892f11
PE
122782012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12279
12280 Fix coding-related core dumps with gcc -ftrapv.
12281 The code was computing A - B, where A and B are pointers, and B is
12282 random garbage. This can lead to core dumps on platforms that
12283 have special pointer registers, and it also leads to core dumps on
12284 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12285 A - B only when B is initialized properly.
12286 * coding.c (coding_set_source, coding_set_destination): Return void.
12287 (coding_change_source, coding_change_destinations): New functions,
12288 with the old behaviors of coding_set_source and coding_set_destination.
12289 All callers that need an offset changed to use these new functions.
12290
eb7afdad
GM
122912012-05-26 Glenn Morris <rgm@gnu.org>
12292
12293 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12294
f12fdf02
EZ
122952012-05-26 Eli Zaretskii <eliz@gnu.org>
12296
53a63be6 12297 Extend mouse support on W32 text-mode console.
61b108cc
SM
12298 * xdisp.c (draw_row_with_mouse_face):
12299 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12300
eb3f6f01 12301 * w32console.c: Include window.h.
61b108cc
SM
12302 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12303 New functions.
eb3f6f01
EZ
12304 (initialize_w32_display): Initialize mouse-highlight data.
12305
53a63be6
EZ
12306 * w32inevt.c: Include termchar.h and window.h.
12307 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12308 moves, call note_mouse_highlight. If help_echo changed, call
12309 gen_help_event to produce help-echo message in the echo area.
12310 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12311 highlight info.
12312
4cfd81f6
PE
123132012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12314
12315 * lread.c (read1): Simplify slightly to avoid an overflow warning
12316 with GCC 4.7.0 on x86-64.
12317
4446092a
EZ
123182012-05-26 Eli Zaretskii <eliz@gnu.org>
12319
12320 * bidi.c (bidi_mirror_char): Revert last change: an int is
12321 definitely wide enough here.
12322
42b2a986 123232012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12324
42b2a986 12325 Fix integer width and related bugs (Bug#9874).
eb106a49 12326 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12327 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12328 (string_bytes, check_sblock, allocate_string_data):
12329 (compact_small_strings, Fmake_bool_vector, make_string)
12330 (make_unibyte_string, make_multibyte_string)
12331 (make_string_from_bytes, make_specified_string)
12332 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12333 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12334 (mark_vectorlike):
12335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12336 (allocate_pseudovector):
12337 Use int, not EMACS_INT, where int is wide enough.
12338 (inhibit_garbage_collection, Fgarbage_collect):
12339 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12340 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12341 int might not be wide enough.
12342 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12343 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12344 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12345 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12346 (bidi_level_of_next_char, bidi_move_to_visually_next):
12347 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12348 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12349 (Fkill_buffer, Fset_buffer_major_mode)
12350 (advance_to_char_boundary, Fbuffer_swap_text)
12351 (Fset_buffer_multibyte, overlays_at, overlays_in)
12352 (overlay_touches_p, struct sortvec, record_overlay_string)
12353 (overlay_strings, recenter_overlay_lists)
12354 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12355 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12356 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12357 (Foverlay_recenter, last_overlay_modification_hooks_used)
12358 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12360 (validate_region): Omit unnecessary test for b <= e,
12361 since that's guaranteed by the previous test.
d311d28c
PE
12362 (adjust_overlays_for_delete): Avoid pos + length overflow.
12363 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12364 (report_overlay_modification):
12365 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12366 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12367 Omit pointer cast, which isn't needed anyway, and doesn't work
12368 after the EMACS_INT -> ptrdiff_t change.
02481186 12369 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12370 * buffer.h: Adjust decls to match defn changes elsewhere.
12371 (struct buffer_text, struct buffer):
12372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12373 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12374 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12375 not int, to avoid needless 32-bit limit on 64-bit hosts.
12376 (exec_byte_code): Use tighter memory-full test, one that checks
12377 for alloca overflow. Don't compute the address of the object just
12378 before an array, as that's not portable. Use EMACS_INT, not
12379 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12380 * callint.c (Fcall_interactively):
12381 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12382 * callproc.c (call_process_kill, Fcall_process):
12383 Don't assume pid_t fits into an Emacs fixnum.
12384 (call_process_cleanup, Fcall_process, child_setup):
12385 Don't assume pid_t fits into int.
12386 (call_process_cleanup, Fcall_process, delete_temp_file)
12387 (Fcall_process_region):
12388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12389 (Fcall_process): Simplify handling of volatile integers.
12390 Use int, not EMACS_INT, where int will do.
12391 * casefiddle.c (casify_object, casify_region, operate_on_word)
12392 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12394 (casify_object): Avoid integer overflow when overallocating buffer.
12395 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12396 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12397 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12398 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12399 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12400 integers are now checked earlier. All uses replaced with XINT.
12401 (ccl_driver):
12402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12403 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12404 (ccl_driver, Fregister_code_conversion_map):
12405 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12406 (resolve_symbol_ccl_program): Check that vector header is in range.
12407 Always copy the vector, so that we can check its contents reliably
12408 now rather than having to recheck each instruction as it's being
12409 executed. Check that vector words fit in 'int'.
12410 (ccl_get_compiled_code, Fregister_ccl_program)
12411 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12412 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12413 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12414 contents are in range.
12415 (Fccl_execute_on_string): Check that status is in range.
12416 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12417 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12418 Accept and return EMACS_INT, not int, because callers can pass values
12419 out of 'int' range.
12420 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12421 (multibyte_chars_in_text, parse_str_as_multibyte)
12422 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12423 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12424 (string_escape_byte8, Fget_byte):
12425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12426 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12427 avoid mishandling large integers.
12428 * character.h: Adjust decls to match defn changes elsewhere.
12429 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12430 (Ffind_charset_region):
12431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12432 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12433 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12434 Don't assume fixnum fits in int.
d311d28c
PE
12435 (load_charset_map_from_vector, Fmap_charset_chars):
12436 Remove now-unnecessary CHECK_NATNUMs.
12437 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12438 Don't rely on undefined behavior with signed left shift overflow.
12439 Don't assume unsigned int fits into fixnum, or that fixnum fits
12440 into unsigned int. Don't require max_code to be a valid fixnum;
12441 that's not true for gb10830 4-byte on a 32-bit host. Allow
12442 invalid_code to be a cons, for the same reason. Require code_offset
12443 to be a character. Avoid int overflow if max_char is close
12444 to INT_MAX.
12445 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12446 this is intended anyway and avoids some undefined behavior.
12447 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12448 INDEX_TO_CODE_POINT, as that's what it expects.
12449 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12450 * charset.h (DECODE_CHAR): Return int, not unsigned;
12451 this is what was intended anyway, and it avoids undefined behavior.
12452 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12453 integer-overflow issues.
12454 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12455 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12456 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12457 * chartab.c (Fmake_char_table, Fset_char_table_range)
12458 (uniprop_get_decoder, uniprop_get_encoder):
12459 Don't assume fixnum fits in int.
12460 * cmds.c (move_point): New function, that does the gist of
12461 Fforward_char and Fbackward_char, but does so while checking
12462 for integer overflow more accurately.
c96e5d6a 12463 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12464 (Fforward_line, Fend_of_line, internal_self_insert)
12465 (internal_self_insert):
12466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12467 Fix a FIXME, by checking for integer overflow when calculating
12468 target_clm and actual_clm.
12469 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12470 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12471 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12472 (coding_alloc_by_making_gap, alloc_destination)
12473 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12474 (encode_coding_utf_16, detect_coding_emacs_mule)
12475 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12476 (detect_coding_iso_2022, decode_coding_iso_2022)
12477 (encode_invocation_designation, encode_designation_at_bol)
12478 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12479 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12480 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12481 (encode_coding_ccl, encode_coding_raw_text)
12482 (detect_coding_charset, decode_coding_charset)
12483 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12484 (produce_composition, produce_charset, produce_annotation)
12485 (decode_coding, handle_composition_annotation)
12486 (handle_charset_annotation, consume_chars, decode_coding_gap)
12487 (decode_coding_object, encode_coding_object, detect_coding_system)
12488 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12489 (code_convert_region, code_convert_string)
8f50130c
PE
12490 (Fdefine_coding_system_internal)
12491 (coding_set_source, coding_set_destination):
d311d28c
PE
12492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12493 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12494 (Fdefine_coding_system_internal):
12495 Don't assume fixnums fit in int.
12496 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12497 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12498 (Funencodable_char_position, Fcheck_coding_systems_region)
12499 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12500 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12501 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12502 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12503 Don't access memory outside of the args array.
d311d28c 12504 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12505 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12506 result of ENCODE_CHAR.
d311d28c
PE
12507 * coding.h: Adjust decls to match defn changes elsewhere.
12508 (struct coding_system):
12509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12510 * composite.c (get_composition_id, find_composition)
12511 (run_composition_function, update_compositions)
12512 (compose_text, composition_gstring_put_cache)
12513 (composition_gstring_p, composition_gstring_width)
12514 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12515 (composition_compute_stop_pos, composition_reseat_it)
12516 (composition_update_it, struct position_record)
12517 (find_automatic_composition, composition_adjust_point)
12518 (Fcomposition_get_gstring, Ffind_composition_internal):
12519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12520 (update_compositions):
12521 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12522 * composite.h: Adjust decls to match defn changes elsewhere.
12523 (struct composition):
12524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12525 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12526 Do not attempt to compute the address of the object just before a
12527 buffer; this is not portable.
12528 (Faref, Faset):
12529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12530 (Faset): Use int, not EMACS_INT, where int is wide enough.
12531 (Fstring_to_number): Don't assume fixnums fit in int.
12532 (Frem): Don't assume arg is nonnegative.
12533 * dbusbind.c (xd_append_arg): Check for integers out of range.
12534 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12535 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12536 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12537 (xd_get_connection_references): Return ptrdiff_t, not int.
12538 All uses changed.
12539 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12540 (xd_read_message_1):
12541 Use int, not unsigned, where the dbus API uses int.
12542 (Fdbus_message_internal): Don't overflow mtype.
12543 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12544 * dired.c (directory_files_internal, file_name_completion, scmp)
12545 (file_name_completion_stat):
12546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12547 (file_name_completion): Don't overflow matchcount.
12548 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12549 * dispextern.h: Adjust decls to match defn changes elsewhere.
12550 (struct text_pos, struct glyph, struct bidi_saved_info)
12551 (struct bidi_string_data, struct bidi_it, struct composition_it)
12552 (struct it):
12553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12554 (struct display_pos, struct composition_it, struct it):
12555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12556 * dispnew.c (increment_matrix_positions)
12557 (increment_row_positions, mode_line_string)
12558 (marginal_area_string):
12559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12560 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
12561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12562 (duration_to_sec_usec): New function, to check for overflow better.
12563 (Fsleep_for, sit_for): Use it.
12564 * doc.c (get_doc_string, store_function_docstring):
12565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12566 (get_doc_string, Fsnarf_documentation):
12567 Use int, not EMACS_INT, where int is wide enough.
12568 (get_doc_string):
12569 Use SAFE_ALLOCA, not alloca.
12570 Check for overflow when converting EMACS_INT to off_t.
12571 * doprnt.c (doprnt):
12572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12573 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12574 Don't assume uid_t fits into fixnum.
12575 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12576 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12577 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12578 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12579 (general_insert_function)
12580 (Finsert_char, make_buffer_string, make_buffer_string_both)
12581 (update_buffer_properties, Fbuffer_substring)
12582 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12583 (Fsubst_char_in_region, check_translation)
12584 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12585 (transpose_markers, Ftranspose_regions):
12586 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12587 (clip_to_bounds): Move to lisp.h as an inline function).
12588 (Fconstrain_to_field): Don't assume integers are nonnegative.
12589 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12590 (Fsubst_char_in_region, Fsave_restriction):
12591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12592 (Femacs_pid): Don't assume pid_t fits into fixnum.
12593 (lo_time): Use int, not EMACS_INT, when int suffices.
12594 (lisp_time_argument): Check for usec out of range.
12595 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
12596 (Fuser_login_name, Fuser_full_name): Signal an error
12597 if a uid argument is out of range, rather than relying on
12598 undefined behavior.
c8d5c857
PE
12599 (Fformat_time_string): Remove now-unnecessary check.
12600 lisp_time_argument checks for out-of-range usec now.
243e0530 12601 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
12602 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12603 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12604 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12605 (init_cmdargs, Fdump_emacs):
12606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12607 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12608 the bottom (typically) 32 bits of the fixnum.
12609 * eval.c (specpdl_size, call_debugger):
12610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12611 (when_entered_debugger, Fbacktrace_debug):
12612 Don't assume fixnum can fit in int.
12613 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12614 the object just before a buffer; this is not portable.
12615 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12616 (grow_specpdl, unbind_to):
12617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12618 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12619 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 12620 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
12621 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12622 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12623 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12624 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12625 (a_write, e_write):
12626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12627 (Fcopy_file, non_regular_nbytes, read_non_regular)
12628 (Finsert_file_contents):
12629 Use int, not EMACS_INT, where int is wide enough.
12630 (READ_BUF_SIZE): Verify that it fits in int.
12631 (Finsert_file_contents): Check that counts are in proper range,
12632 rather than assuming fixnums fit into ptrdiff_t etc.
12633 Don't assume fixnums fit into int.
125b3835 12634 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12635 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12636 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12637 (string_char_to_byte, string_byte_to_char)
12638 (string_make_multibyte, string_to_multibyte)
12639 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12640 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12641 (substring_both, Fdelete, internal_equal, Ffillarray)
12642 (Fclear_string, mapcar1)
12643 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12644 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12645 (larger_vector, make_hash_table, maybe_resize_hash_table)
12646 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12647 (Fmaphash, secure_hash):
12648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12649 (concat): Check for string index and length overflow.
12650 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12651 (Frequire):
12652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12653 (larger_vector): New API (vec, incr_min, size_max) replaces old
12654 one (vec, new_size, init). This catches size overflow.
12655 INIT was removed because it was always Qnil.
12656 All callers changed.
12657 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12658 the upper bound on a hash table index size.
12659 (make_hash_table, maybe_resize_hash_table): Use it.
12660 (secure_hash): Computer start_byte and end_byte only after
12661 they're known to be in ptrdiff_t range.
12662 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12663 (Ffont_get_glyphs, Ffont_at):
12664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12665 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12666 (Flist_fonts, Fopen_font):
12667 Don't assume fixnum can fit in int.
12668 (check_gstring): Don't assume index can fit in int.
12669 (font_match_p): Check that fixnum is a character, not a nonnegative
12670 fixnum, since the later code needs to stuff it into an int.
12671 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12672 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12673 conversion overflow issues.
12674 (Fopen_font): Check for integer out of range.
12675 (Ffont_get_glyphs): Don't assume index can fit in int.
12676 * font.h: Adjust decls to match defn changes elsewhere.
12677 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12678 integer overflow.
12679 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12680 printmax_t, where ptrdiff_t is wide enough.
12681 (Finternal_char_font):
12682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12683 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12684 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12685 (Fset_frame_position, x_set_frame_parameters)
12686 (x_set_line_spacing, x_set_border_width)
12687 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12688 Check that fixnums are in proper range for system types.
12689 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12691 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12692 Use SAFE_ALLOCA_LISP, not alloca.
12693 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12694 intptr_t is wide enough.
12695 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12696 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12697 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12698 Check for fixnum out of range.
12699 * ftfont.c (ftfont_list): Don't assume index fits in int.
12700 Check that fixnums are in proper range for system types.
12701 (ftfont_shape_by_flt):
12702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
12703 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12705 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12706 Check that fixnums are in proper range for system types.
12707 * gnutls.h: Adjust decls to match defn changes elsewhere.
12708 * gtkutil.c (xg_dialog_run):
12709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12710 (update_frame_tool_bar):
12711 Check that fixnums are in proper range for system types.
12712 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 12713 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
12714 * indent.c (last_known_column, last_known_column_point):
12715 (current_column_bol_cache):
12716 (skip_invisible, current_column, check_display_width):
12717 (check_display_width, scan_for_column, current_column_1)
12718 (Findent_to, Fcurrent_indentation, position_indentation)
12719 (indented_beyond_p, Fmove_to_column, compute_motion):
12720 (Fcompute_motion, Fvertical_motion):
12721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12722 (last_known_column_modified): Use EMACS_INT, not int.
12723 (check_display_width):
12724 (Fcompute_motion):
12725 Check that fixnums and floats are in proper range for system types.
12726 (compute_motion): Don't assume index or fixnum fits in int.
12727 (compute_motion, Fcompute_motion):
12728 Use int, not EMACS_INT, when it is wide enough.
12729 (vmotion): Omit local var start_hpos that is always 0; that way
12730 we don't need to worry about overflow in expressions involving it.
12731 * indent.h: Adjust decls to match defn changes elsewhere.
12732 (struct position):
12733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12734 Use int, not EMACS_INT, where int is wide enough.
12735 Remove unused members ovstring_chars_done and tab_offset;
12736 all uses removed.
12737 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12738 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12739 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12740 (make_gap, copy_text, insert, insert_and_inherit)
12741 (insert_before_markers, insert_before_markers_and_inherit)
12742 (insert_1, count_combining_before, count_combining_after)
12743 (insert_1_both, insert_from_string)
12744 (insert_from_string_before_markers, insert_from_string_1)
12745 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12746 (adjust_after_replace, adjust_after_insert, replace_range)
12747 (replace_range_2, del_range, del_range_1, del_range_byte)
12748 (del_range_both, del_range_2, modify_region)
12749 (prepare_to_modify_buffer, signal_before_change)
12750 (signal_after_change, Fcombine_after_change_execute):
12751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12752 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12753 (balance_an_interval, split_interval_right, split_interval_left)
12754 (find_interval, next_interval, update_interval)
12755 (adjust_intervals_for_insertion, delete_node, delete_interval)
12756 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12757 (static_offset_intervals, offset_intervals)
12758 (merge_interval_right, merge_interval_left, make_new_interval)
12759 (graft_intervals_into_buffer, temp_set_point_both)
12760 (temp_set_point, set_point, adjust_for_invis_intang)
12761 (set_point_both, move_if_not_intangible, get_property_and_range)
12762 (get_local_map, copy_intervals, copy_intervals_to_string)
12763 (compare_string_intervals, set_intervals_multibyte_1):
12764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12765 * intervals.h: Adjust decls to match defn changes elsewhere.
12766 (struct interval):
12767 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12768 * keyboard.c (this_command_key_count, this_single_command_key_start)
12769 (before_command_key_count, before_command_echo_length, echo_now)
12770 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12771 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12772 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12773 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12775 (last_non_minibuf_size, last_point_position, echo_truncate)
12776 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12777 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12778 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12779 (stuff_buffered_input):
12780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12781 (last_auto_save, command_loop_1, read_char):
12782 Use EMACS_INT, not int, to avoid integer overflow.
12783 (record_char): Avoid overflow in total_keys computation.
12784 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12785 * keyboard.h: Adjust decls to match defn changes elsewhere.
12786 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12787 (Fkey_description, Fdescribe_vector, Flookup_key):
12788 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12789 (click_position): New function, to check that positions are in range.
12790 (Fcurrent_active_maps):
12791 (describe_command):
12792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12793 (Faccessible_keymaps, Fkey_description):
12794 (preferred_sequence_p):
12795 Don't assume fixnum can fit into int.
12796 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12797 Check for integer overflow in size calculations.
12798 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12799 avoid mishandling large integers.
12800 * lisp.h: Adjust decls to match defn changes elsewhere.
12801 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12802 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12803 (struct Lisp_Marker):
12804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12805 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
12806 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12807 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12808 All callers changed.
12809 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12810 Assume the arg has valid form, since it always does.
12811 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12812 unsigned integer system type.
12813 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12814 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12816 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12817 (duration_to_sec_usec): New decl.
12818 * lread.c (read_from_string_index, read_from_string_index_byte)
12819 (read_from_string_limit, readchar, unreadchar, openp)
12820 (read_internal_start, read1, oblookup):
12821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12822 (Fload, readevalloop, Feval_buffer, Feval_region):
12823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12824 (openp): Check for out-of-range argument to 'access'.
12825 (read1): Use int, not EMACS_INT, where int is wide enough.
12826 Don't assume fixnum fits into int.
6efdadfd 12827 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
12828 (read_filtered_event): Use duration_to_sec_usec
12829 to do proper overflow checking on durations.
d311d28c
PE
12830 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12831 in size calculation.
12832 (Fexecute_kbd_macro):
12833 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12834 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12835 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12836 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12837 (set_marker_both, set_marker_restricted_both, marker_position)
12838 (marker_byte_position, Fbuffer_has_markers_at):
12839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12840 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 12841 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
12842 It now merely ensures that the menu is large enough, without
12843 necessarily growing it, as this avoids some integer overflow issues.
12844 All callers changed.
12845 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12847 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12848 Use SAFE_ALLOCA_LISP, not alloca.
12849 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12850 to EMACS_INT. Check that fixnums are in proper range for system types.
12851 * minibuf.c (minibuf_prompt_width, string_to_object)
12852 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12853 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12855 (get_minibuffer, read_minibuf_unwind):
12856 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12857 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12858 this simplifies overflow checking. All callers changed.
12859 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12860 (Ftest_completion):
12861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12862 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12863 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12864 Check that fixnums are in proper range for system types.
12865 (Fx_create_frame, Fx_show_tip):
12866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12867 * nsfont.m (ns_findfonts, nsfont_list_family):
12868 Don't assume fixnum fits in long.
12869 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12871 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12872 wide enough.
17fdb222 12873 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
12874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12875 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12876 (PRINTDECLARE, PRINTPREPARE):
12877 (strout, print_string):
12878 (print, print_preprocess, print_check_string_charset_prop)
12879 (print_object):
12880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12881 (PRINTDECLARE):
12882 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12884 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 12885 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 12886 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
12887 (print_error_message): Use SAFE_ALLOCA, not alloca.
12888 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
12889 (print_depth, new_backquote_output, print_number_index):
12890 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
12891 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12892 (Fset_process_window_size, Fformat_network_address)
12893 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 12894 (sigchld_handler):
d311d28c 12895 Check that fixnums are in proper range for system types.
d44287d4 12896 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
12897 Check for process-ids out of pid_t range rather than relying on
12898 undefined behavior.
e4d81efc 12899 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
12900 (Fformat_network_address, read_process_output, send_process)
12901 (Fprocess_send_region, status_notify):
12902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12903 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12904 (wait_reading_process_output, read_process_output, exec_sentinel):
12905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12906 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12907 (Faccept_process_output): Use duration_to_sec_usec to do proper
12908 overflow checking on durations.
dde14581
PE
12909 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12910 Don't assume pid_t fits in int.
02481186
PE
12911 * process.h (struct Lisp_Process): Members tick and update_tick
12912 are now of type EMACS_INT, not int.
b62b53e8
PE
12913 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12914 configured --with-wide-int.
d311d28c
PE
12915 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12916 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12917 * search.c (looking_at_1, string_match_1):
12918 (fast_string_match, fast_c_string_match_ignore_case)
12919 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12920 (scan_newline, find_before_next_newline, search_command)
12921 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12922 (set_search_regs, wordify):
12923 (Freplace_match):
12924 (Fmatch_data):
12925 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12926 (string_match_1, search_buffer, set_search_regs):
12927 (Fmatch_data):
12928 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12929 (wordify): Check for overflow in size calculation.
12930 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12931 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12932 Check that fixnums are in proper range for system types.
12933 * sound.c (struct sound_device)
12934 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12936 (Fplay_sound_internal):
12937 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 12938 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
12939 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12940 (Fparse_partial_sexp):
12941 Don't assume fixnums can fit in int.
12942 (struct lisp_parse_state, find_start_pos, find_start_value)
12943 (find_start_value_byte, find_start_begv)
12944 (update_syntax_table, char_quoted, dec_bytepos)
12945 (find_defun_start, prev_char_comend_first, back_comment):
12946 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12947 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12949 (Finternal_describe_syntax_value): Check that match_lisp is a
12950 character, not an integer, since the code stuffs it into int.
12951 (scan_words, scan_sexps_forward):
12952 Check that fixnums are in proper range for system types.
12953 (Fforward_word):
12954 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12955 (scan_sexps_forward):
12956 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12957 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12958 * syntax.h: Adjust decls to match defn changes elsewhere.
12959 (struct gl_state_s):
12960 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12961 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12962 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12963 * sysdep.c (wait_for_termination_1, wait_for_termination)
12964 (interruptible_wait_for_termination, mkdir):
12965 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12966 (emacs_read, emacs_write):
12967 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12968 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12969 and double all fit in int.
d311d28c
PE
12970 * term.c (set_tty_color_mode):
12971 Check that fixnums are in proper range for system types.
12972 * termhooks.h (struct input_event):
12973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12974 * textprop.c (validate_interval_range, interval_of)
12975 (Fadd_text_properties, set_text_properties_1)
12976 (Fremove_text_properties, Fremove_list_of_text_properties)
12977 (Ftext_property_any, Ftext_property_not_all)
12978 (copy_text_properties, text_property_list, extend_property_ranges)
12979 (verify_interval_modification):
12980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12981 (Fnext_single_char_property_change)
12982 (Fprevious_single_char_property_change):
12983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12984 (copy_text_properties):
12985 Check for integer overflow in index calculation.
d311d28c
PE
12986 * undo.c (last_boundary_position, record_point, record_insert)
12987 (record_delete, record_marker_adjustment, record_change)
12988 (record_property_change):
12989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12990 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12992 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12993 (Fx_hide_tip, Fx_file_dialog):
12994 * w32menu.c (set_frame_menubar):
12995 Use ptrdiff_t, not int, for consistency with rest of code.
12996 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12997 (select_window, Fdelete_other_windows_internal)
12998 (window_scroll_pixel_based, window_scroll_line_based)
12999 (Frecenter, Fset_window_configuration):
13000 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13001 (Fset_window_hscroll, run_window_configuration_change_hook)
13002 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13003 (Fscroll_other_window, Frecenter):
d311d28c
PE
13004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13005 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13006 Don't assume fixnum fits in int.
13007 (Fset_window_scroll_bars):
13008 Check that fixnums are in proper range for system types.
13009 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13010 (string_pos, c_string_pos, number_of_chars, init_iterator)
13011 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13012 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13013 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13014 (face_before_or_after_it_pos, handle_invisible_prop)
13015 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13016 (display_prop_intangible_p, string_buffer_position_lim)
13017 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13018 (get_overlay_strings_1, get_overlay_strings)
13019 (iterate_out_of_display_property, forward_to_next_line_start)
13020 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13021 (get_next_display_element, set_iterator_to_next)
13022 (get_visually_first_element, compute_stop_pos_backwards)
13023 (handle_stop_backwards, next_element_from_buffer)
13024 (move_it_in_display_line_to, move_it_in_display_line)
13025 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13026 (add_to_log, message_dolog, message_log_check_duplicate)
13027 (message2, message2_nolog, message3, message3_nolog
13028 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13029 (current_message_1, truncate_echo_area, truncate_message_1)
13030 (set_message, set_message_1, store_mode_line_noprop)
13031 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13032 (text_outside_line_unchanged_p, check_point_in_composition)
13033 (reconsider_clip_changes)
13034 (redisplay_internal, set_cursor_from_row, try_scrolling)
13035 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13036 (redisplay_window, find_last_unchanged_at_beg_row)
13037 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13038 (trailing_whitespace_p, find_row_edges, display_line)
13039 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13040 (display_mode_element, store_mode_line_string)
13041 (pint2str, pint2hrstr, decode_mode_spec)
13042 (display_count_lines, display_string, draw_glyphs)
13043 (x_produce_glyphs, x_insert_glyphs)
13044 (rows_from_pos_range, mouse_face_from_buffer_pos)
13045 (fast_find_string_pos, mouse_face_from_string_pos)
13046 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13048 (safe_call, init_from_display_pos, handle_fontified_prop)
13049 (handle_single_display_spec, load_overlay_strings)
13050 (with_echo_area_buffer, setup_echo_area_for_printing)
13051 (display_echo_area, echo_area_display)
13052 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13053 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13054 (redisplay_window, dump_glyph_row, display_mode_line)
13055 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13056 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13058 (handle_single_display_spec, build_desired_tool_bar_string)
13059 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13060 (get_specified_cursor_type):
13061 Check that fixnums are in proper range for system types.
13062 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13063 (Flookup_image_map):
13064 Don't assume fixnums fit in int.
13065 (compare_overlay_entries):
13066 Avoid mishandling comparisons due to subtraction overflow.
13067 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13068 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13069 (handle_tool_bar_click):
13070 Use int, not unsigned, since we prefer signed and the signedness
13071 doesn't matter here.
13072 (get_next_display_element, next_element_from_display_vector):
13073 Use int, not EMACS_INT, when int is wide enough.
13074 (start_hourglass): Use duration_to_sec_usec to do proper
13075 overflow checking on durations.
13076 * xfaces.c (Fbitmap_spec_p):
13077 Check that fixnums are in proper range for system types.
13078 (compare_fonts_by_sort_order):
13079 Avoid mishandling comparisons due to subtraction overflow.
13080 (Fx_family_fonts, realize_basic_faces):
13081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13082 (Fx_family_fonts):
13083 Don't assume fixnum fits in int.
13084 Use SAFE_ALLOCA_LISP, not alloca.
13085 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13086 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13087 (face_at_buffer_position, face_for_overlay_string)
13088 (face_at_string_position):
13089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13090 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13091 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13092 (Fx_show_tip):
13093 Check that fixnums are in proper range for system types.
13094 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13095 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13096 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13097 (Fx_change_window_property): Don't assume fixnums fit in int.
13098 * xfont.c (xfont_chars_supported):
13099 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13100 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13101 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13103 * xml.c (parse_region):
13104 * xrdb.c (magic_file_p):
13105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13106 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13107 (x_get_local_selection, x_reply_selection_request)
13108 (x_handle_selection_request, wait_for_property_change):
13109 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13110 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13111 short is wide enough.
13112 (x_send_client_event): Don't assume fixnum fits in int.
13113 * xterm.c (x_x_to_emacs_modifiers):
13114 Don't assume EMACS_INT overflows nicely into int.
13115 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13116 may come from Lisp.
13117 (handle_one_xevent): NATNUMP can eval its arg twice.
13118 (x_connection_closed):
13119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13120 * xterm.h: Adjust decls to match defn changes elsewhere.
13121 (struct scroll_bar): Use struct vectorlike_header
13122 rather than rolling our own approximation.
13123 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13124
c6574eb5
GM
131252012-05-25 Glenn Morris <rgm@gnu.org>
13126
13127 * lisp.mk (lisp): Update for more files being compiled now.
13128
e8d32c7e
SM
131292012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13130
48def666
SM
13131 * lread.c: Remove `read_pure' which makes no difference.
13132 (read_pure): Remove var.
13133 (unreadpure): Remove function.
13134 (readevalloop): Don't call read_list with -1 flag.
13135 (read1, read_vector): Don't test read_pure any more.
13136 (read_list): Simplify.
13137
e8d32c7e
SM
13138 * fileio.c, character.h: Minor style tweaks.
13139
4b2addb7
DA
131402012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13141
13142 * window.h (clip_changed): Remove useless declaration.
13143
584461b2
JB
131442012-05-22 Juanma Barranquero <lekktu@gmail.com>
13145
13146 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13147 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13148
34374650
PE
131492012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13150
13151 Remove src/m/*.
13152 This directory predates autoconf and is no longer needed nowadays.
13153 Move its few remaining bits of functionality to where they're needed.
13154 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13155 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13156 * m/template.h: Remove.
13157 * Makefile.in (M_FILE): Remove. All uses removed.
13158 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13159 * lisp.h (USE_LSB_TAG):
13160 * mem-limits.h (EXCEEDS_LISP_PTR):
13161 Use VAL_MAX, not VALBITS, in #if.
13162 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13163 (EMACS_UINT): Define unconditionally now.
13164 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13165 (BITS_PER_EMACS_INT): New constants, replacing
13166 what used to be in config.h, but not useful in #if.
13167 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13168 define them any more.
13169 (VAL_MAX): New macro.
13170 (VALMASK): Use it.
13171 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13172 BITS_PER_EMACS_INT, in #if.
13173 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13174 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13175 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13176 * s/ms-w32.h (DATA_START):
13177 Move here from removed file m/intel386.h.
13178 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13179 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13180
261cb4bb
PE
131812012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13182
13183 Assume C89 or later.
13184 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13185 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13186 (xrealloc):
13187 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13188 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13189 * textprop.c, tparam.c (NULL): Remove.
13190 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13191 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13192 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13193 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13194 * xterm.c (input_signal_count): Assume volatile works.
13195
ff23cd9f
KB
131962012-05-21 Ken Brown <kbrown@cornell.edu>
13197
13198 * xgselect.c (xg_select): Fix first argument in call to 'select'
13199 (bug#11508).
13200
1b170bc6
KB
132012012-05-20 Ken Brown <kbrown@cornell.edu>
13202
13203 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13204 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13205
b2f4d39f
KB
132062012-05-19 Ken Brown <kbrown@cornell.edu>
13207
13208 * xfns.c (x_in_use): Remove `static' qualifier.
13209 * xterm.h (x_in_use): Declare.
13210 * xgselect.c: Include xterm.h.
13211 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13212 and `display_arg' (bug#9754).
13213
003fdae2
PE
132142012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13215
9232a6d9
PE
13216 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13217
003fdae2
PE
13218 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13219 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13220
784b56e2
EZ
132212012-05-18 Eli Zaretskii <eliz@gnu.org>
13222
13223 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13224
13225 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13226 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13227
13228 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13229 reference to image_cache->refcount.
13230 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13231
a0a79cde
JL
132322012-05-17 Juri Linkov <juri@jurta.org>
13233
13234 * search.c (Fword_search_regexp, Fword_search_backward)
13235 (Fword_search_forward, Fword_search_backward_lax)
13236 (Fword_search_forward_lax): Move functions to isearch.el
13237 (bug#10145, bug#11381).
13238
b0572523
PE
132392012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13240
13241 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13242
9660f5fc
SM
132432012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13244
13245 * lread.c (init_obarray): Declare Qt and Qnil as special.
13246
4374de83
GM
132472012-05-14 Glenn Morris <rgm@gnu.org>
13248
13249 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13250 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13251
dc44c39a
PE
132522012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13253
078c97cb
PE
13254 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13255
dc44c39a
PE
13256 * unexaix.c: Port to more-recent AIX compilers.
13257 (report_error, report_error_1, make_hdr, copy_sym)
13258 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13259 Make arguments const char *, not char *, to avoid violations of C
13260 standard and to fix some AIX warnings reported by Gilles Pion.
13261
e18afed7 132622012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13263
13264 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13265 already have overlays loaded.
13266 (handle_single_display_spec): Before returning without displaying
13267 fringe bitmap, synchronize the bidi iterator with the main display
13268 iterator, by calling iterate_out_of_display_property.
13269 (iterate_out_of_display_property): Detect buffer iteration by
13270 testing that it->string is a Lisp string.
13271 (get_next_display_element): When the current object is exhausted,
13272 and there's something on it->stack, call set_iterator_to_next to
13273 proceed with what's on the stack, instead of returning zero.
13274 (set_iterator_to_next): If called at the end of a Lisp string,
13275 proceed to consider_string_end without incrementing string
13276 position. Don't increment display vector index past the end of
13277 the display vector. (Bug#11417)
c8fb9dc6
EZ
13278 (pos_visible_p): Don't report a position visible when move_it_to
13279 stopped at the last line of window, which happens to be scanned
13280 backwards by the bidi iteration. (Bug#11464)
ac268e67 13281
e18afed7 132822012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13283
13284 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13285 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13286 are on a TTY, and thus unable to display on the fringes.
13287 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13288 so we need to signal to the caller that this is a "replacing"
13289 display spec. This fixes display when the spec is invalid or we
13290 are on a TTY.
13291
e18afed7 132922012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13293
13294 * unexaix.c (make_hdr): Fix typo in prototype.
13295 This bug broke the build on AIX. Problem reported by Gilles Pion.
13296
9d0a235a
MA
132972012-05-14 Michael Albinus <michael.albinus@gmx.de>
13298
13299 * keyboard.c (kbd_buffer_get_event): Read special events also in
13300 batch mode. (Bug#11415)
13301
9e6b06ed
GM
133022012-05-12 Glenn Morris <rgm@gnu.org>
13303
13304 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13305
c1a1d7a3
EZ
133062012-05-12 Eli Zaretskii <eliz@gnu.org>
13307
13308 * lisp.mk (lisp): Add newcomment.elc.
13309
3fe7cdc8
GM
133102012-05-12 Glenn Morris <rgm@gnu.org>
13311
13312 * Makefile.in (MKDIR_P): New, set by configure.
13313 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13314
53f7d2c0
PE
133152012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13316
13317 Remove unused function hourglass_started.
13318 * dispextern.h (hourglass_started):
13319 * w32fns.c (hourglass_started):
13320 * xdisp.c (hourglass_started): Remove.
13321
75aafb17
JB
133222012-05-10 Juanma Barranquero <lekktu@gmail.com>
13323
13324 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13325 Update dependencies.
13326
12959e8e
PE
133272012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13328
97107e2e
PE
13329 * xgselect.c (xg_select): Put maxfds+1 into a var.
13330 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13331
12959e8e
PE
13332 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13333
836d29b3
DA
133342012-05-10 Dave Abrahams <dave@boostpro.com>
13335
13336 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13337 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13338
5cb67954
MA
133392012-05-09 Michael Albinus <michael.albinus@gmx.de>
13340
13341 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13342 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13343 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13344 Initialize xd_registered_buses.
13345
3478ec45
PE
133462012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13347
b263a6b0
PE
13348 Untag more efficiently if USE_LSB_TAG.
13349 This is based on a proposal by YAMAMOTO Mitsuharu in
13350 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13351 For an admittedly artificial (nth 8000 longlist) benchmark on
13352 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13353 Emacs's overall text size by 1%.
13354 * lisp.h (XUNTAG): New macro.
13355 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13356 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13357 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13358 * eval.c (Fautoload):
13359 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13360 * frame.h (XFRAME): Use XUNTAG.
13361
3478ec45
PE
13362 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13363 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13364 Remove unportable assumptions about print widths of types like
13365 dbus_uint32_t.
13366 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13367 intptr_t when converting between pointer and integer, to avoid GCC
13368 warnings about wrong width.
13369
666b903b 133702012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13371
13372 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13373 stack for each reader_thread, instead of defaulting to 8MB
13374 determined by the linker. This avoids failures in creating
13375 subprocesses on Windows 7, see the discussion in this thread:
13376 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13377
b120cc17
JC
133782012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13379
13380 Fix up display of the *Minibuf-0* buffer in the mini window.
13381 * keyboard.c (read_char): Don't clear the echo area if there's no
13382 message to clear.
13383 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13384 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13385
9a4b36f8
MA
133862012-05-07 Michael Albinus <michael.albinus@gmx.de>
13387
13388 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13389 batch mode.
13390
e5f9458f
CY
133912012-05-06 Chong Yidong <cyd@gnu.org>
13392
13393 * lisp.mk (lisp): Update.
13394
eceeb5fc 133952012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13396
13397 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13398
71873e2b
SM
133992012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13400
13401 * data.c (PUT_ERROR): New macro.
13402 (syms_of_data): Use it. Add new error type `user-error'.
13403 * undo.c (user_error): New function.
13404 (Fprimitive_undo): Use it.
13405 * print.c (print_error_message): Adjust print style for `user-error'.
13406 * keyboard.c (user_error): New function.
13407 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13408
ab0fa4e4
PE
134092012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13410
13411 Do not limit current-time-string to years 1000..9999.
13412 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13413 (Fcurrent_time_string): Support any year that is supported by the
13414 underlying localtime representation. Don't use asctime, as it
13415 has undefined behavior for years outside the range -999..9999.
13416
7ed806a7
PE
134172012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13418
13419 Fix race conditions involving setenv, gmtime, localtime, asctime.
13420 Without this fix, interrupts could mess up code that uses these
13421 nonreentrant functions, since setting TZ invalidates existing
13422 tm_zone or tzname values, and since most of these functions return
13423 pointers to static storage.
13424 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13425 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13426 Grow the critical sections to include not just invoking
13427 localtime/gmtime, but also accessing these functions' results
13428 including their tm_zone values if any, and any related TZ setting.
13429 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13430 so that the struct tm is saved in the critical section.
13431 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13432 motivated by the fact that memory allocation needs to be outside
13433 the critical section.
13434
0c16dfed
DA
134352012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13436
13437 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13438 with RESET_INTERVAL.
13439
13440 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13441 Remove duplicated buffer name initialization.
13442
3f83ace8
JM
134432012-05-02 Jim Meyering <jim@meyering.net>
13444
13445 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13446
c7b8541e
JM
13447 * xfns.c (x_window): Use xstrdup (Bug#11375).
13448
90207a15 134492012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13450
13451 * xdisp.c (pos_visible_p): If already at a newline from the
13452 display string before the 'while' loop, don't walk back the glyphs
13453 from it3.glyph_row. Solves assertion violation when the display
13454 string begins with a newline (egg.el). (Bug#11367)
13455
b593d6a9
AH
134562012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13457
13458 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13459 Move to simple.el.
13460
4737362e
GM
134612012-05-01 Glenn Morris <rgm@gnu.org>
13462
99cf43f9
GM
13463 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13464 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13465 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13466 All were removed before 23.1.
13467
9311dcff
GM
13468 * dispnew.c: Remove HAVE_LIBNCURSES test;
13469 it is always true on relevant platforms.
13470
4d5c6349
GM
13471 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13472 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13473
4737362e
GM
13474 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13475
74dd3a6b
AS
134762012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13477
13478 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13479 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13480 Remove.
13481
13c379ee
PE
134822012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13483
13484 Do not avoid creating empty evaporating overlays (Bug#9642).
13485 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13486 That is, do not delete an evaporating overlay if it becomes
13487 empty after its bounds are adjusted to fit within its buffer.
13488 This fix caused other problems, and I'm reverting it until we get
13489 to the bottom of them.
13490
a8e7d6d7 134912012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13492
13493 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13494
a8e7d6d7 134952012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13496
13497 * xdisp.c (pos_visible_p): If the window start position is beyond
13498 ZV, start the display from buffer beginning. Prevents assertion
13499 violation in init_iterator when the minibuffer window is scrolled
13500 via the scroll bar.
13501
13502 * window.c (window_scroll_pixel_based): Likewise.
13503
a8e7d6d7 135042012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13505
13506 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13507
a8e7d6d7 135082012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13509
13510 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13511 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13512
a8e7d6d7 135132012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13514
b593d6a9
AH
13515 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13516 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13517
1c6900d9
EZ
135182012-04-26 Eli Zaretskii <eliz@gnu.org>
13519
4c3fa1d9
EZ
13520 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13521 display element, check also the underlying string or buffer
13522 character. (Bug#11341)
13523
1c6900d9
EZ
13524 * w32menu.c: Include w32heap.h.
13525 (add_menu_item): If the call to AppendMenuW (via
13526 unicode_append_menu) fails, disable Unicode menus only if we are
13527 running on Windows 9X/Me.
13528
42bf8205
AS
135292012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13530
13531 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13532 (xgetint): Add missing shift for LSB tags.
13533
b1bac16e
MR
135342012-04-24 Martin Rudalics <rudalics@gmx.at>
13535
13536 * keyboard.c (read_char): Don't wipe echo area for select window
13537 events: These might get delayed via `mouse-autoselect-window'
13538 (Bug#11304).
13539
d69621cc
JB
135402012-04-24 Juanma Barranquero <lekktu@gmail.com>
13541
13542 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13543 manipulation of :loaded-from data.
13544
02fd101b
JB
135452012-04-23 Juanma Barranquero <lekktu@gmail.com>
13546
13547 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13548 now a cons (bug#11311).
13549
888bec30
PE
135502012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13551
89a438bd
PE
13552 Do not create empty overlays with the evaporate property (Bug#9642).
13553 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13554 if it becomes empty after its bounds are adjusted to fit within
13555 its buffer. Without this fix, in a nonempty buffer (let ((o
13556 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13557 yields an empty overlay that has the evaporate property, which is
13558 not supposed to happen.
13559
1068fe4d
PE
13560 Fix minor GTK3 problems found by static checking.
13561 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13562 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13563 (struct _EmacsFixedClass, emacs_fixed_get_type):
13564 Move decls here from emacsgtkfixed.h, since they needn't be public.
13565 (emacs_fixed_get_type): Now static.
13566 (emacs_fixed_class_init): Omit unused local.
13567 (emacs_fixed_child_type): Remove; unused.
13568 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13569 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13570 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13571 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13572 (EMACS_FIXED_GET_CLASS): Remove; unused.
13573 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13574
888bec30
PE
13575 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13576 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13577
de85e130
PE
135782012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13579
d0baac98 13580 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 13581 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
13582 (__malloc_size_t, __malloc_ptrdiff_t):
13583 Remove. All uses removed, replaced by the definiens if needed,
13584 since we can assume C89 or better now.
13585 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13586 (protect_malloc_state, align, get_contiguous_space)
13587 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13588 (malloc_atfork_handler_child, malloc_enable_thread)
13589 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13590 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13591 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13592 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13593 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13594 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13595 Define using prototypes, not old style.
13596 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13597 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13598 (align): Don't assume that signed integer overflow wraps around.
13599 Omit unused local var.
13600 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13601 (_free_internal_nolock, memalign, mallochook, reallochook):
13602 Omit no-longer-needed casts.
13603 (valloc): Use getpagesize, not __getpagesize.
13604 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13605 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13606
de85e130
PE
13607 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13608
dcbf5805
MA
136092012-04-22 Michael Albinus <michael.albinus@gmx.de>
13610
13611 Move functions from C to Lisp. Make non-blocking method calls
13612 the default. Implement further D-Bus standard interfaces.
13613
13614 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13615 (QCdbus_request_name_allow_replacement)
13616 (QCdbus_request_name_replace_existing)
13617 (QCdbus_request_name_do_not_queue)
13618 (QCdbus_request_name_reply_primary_owner)
13619 (QCdbus_request_name_reply_in_queue)
13620 (QCdbus_request_name_reply_exists)
13621 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13622 (QCdbus_registered_serial, QCdbus_registered_method)
13623 (QCdbus_registered_signal): New Lisp objects.
13624 (XD_DEBUG_MESSAGE): Use sizeof.
13625 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13626 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13627 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13628 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13629 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13630 (xd_signature, xd_append_arg): Allow float for integer types.
13631 (xd_get_connection_references): New function.
b593d6a9
AH
13632 (xd_get_connection_address): Rename from xd_initialize.
13633 Return cached address.
dcbf5805
MA
13634 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13635 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13636 level.
13637 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13638 Return number of refcounts.
dcbf5805
MA
13639 (Fdbus_get_unique_name): Make stronger parameter check.
13640 (Fdbus_message_internal): New defun.
13641 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13642 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13643 (Fdbus_send_signal, Fdbus_register_service)
13644 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13645 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13646 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13647 (Vdbus_compiled_version, Vdbus_runtime_version)
13648 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13649 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13650 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13651 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13652 Adapt docstring.
dcbf5805 13653
52828e02
PE
136542012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13655
da05bc4c
PE
13656 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13657 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13658 Do not assume ptrdiff_t is the same width as 'int'.
13659
52828e02
PE
13660 * alloc.c: Handle unusual debugging option combinations.
13661 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13662 since the two debugging options are incompatible.
13663 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13664 is defined.
13665 (mem_init, mem_insert, mem_insert_fixup):
13666 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13667 (NEED_MEM_INSERT): Remove; no longer needed.
13668
f01769f9
LL
136692012-04-22 Leo Liu <sdl.web@gmail.com>
13670
13671 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13672
5790543d
PE
136732012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13674
13675 * sysdep.c [__FreeBSD__]: Minor cleanups.
13676 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13677 Use Emacs indenting style more consistently. Avoid some casts.
13678 Use 'double' consistently rather than mixing 'float' and 'double'.
13679
b91b7e4d
EW
136802012-04-21 Eduard Wiebe <usenet@pusto.de>
13681
b593d6a9
AH
13682 * sysdep.c (list_system_processes, system_process_attributes):
13683 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 13684
6114eb15
AS
136852012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13686
13687 * lisp.mk (lisp): Update.
13688
2f38dff7
PE
136892012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13690
13691 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13692 It is never used otherwise.
13693
4ae29f89
SM
136942012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13695
13696 * print.c (print_preprocess): Only check print_depth if print-circle
13697 is nil.
13698 (print_object): Check for cycles even when print-circle is nil and
13699 print-gensym is t, but only check print_depth if print-circle is nil.
13700
f30d612a
CY
137012012-04-20 Chong Yidong <cyd@gnu.org>
13702
13703 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13704 set the status to "failed" and ensure that sentinel is run.
13705
c07a4c0b 137062012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
13707
13708 * process.c (Fset_process_inherit_coding_system_flag)
13709 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 13710 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 13711
c07a4c0b 137122012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
13713
13714 * xdisp.c (string_buffer_position_lim): Limit starting position to
13715 BEGV.
13716 (set_cursor_from_row): If called for a mode-line or header-line
13717 row, return zero immediately.
13718 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
13719 farther than the first row after the header line, if any.
13720 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
13721 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13722
c07a4c0b 137232012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13724
4ae29f89
SM
13725 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13726 (bug#11238).
ad3a2b41 13727
c07a4c0b 137282012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 137292012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
13730
13731 configure: new option --enable-gcc-warnings (Bug#11207)
13732 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13733 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13734 (ALL_CFLAGS): Use new macros rather than old.
13735 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13736 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13737 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13738 -Wunused-result, -Wunused-variable. This should go away once
13739 the Emacs and Gnulib regex code is merged.
13740 (xmalloc, xrealloc): Now static.
13741
aba027e8
PE
137422012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13743
13744 * dired.c (Fsystem_groups): Remove unused local.
13745
e5a36063
GM
137462012-04-17 Glenn Morris <rgm@gnu.org>
13747
13748 * dired.c (Fsystem_users): Doc fix.
13749
316411f0
DA
137502012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13751
13752 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13753 (syms_of_dired): Add them.
13754
9426aba4
PE
137552012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13756
b62a57be
PE
13757 Fix minor alloc.c problems found by static checking.
13758 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13759 New extern decls, to avoid calling undeclared functions.
13760 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13761 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13762 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13763 (NEED_MEM_INSERT): New macro.
13764 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 13765 Remove one incorrect comment and fix another.
b62a57be 13766
3539f31f
PE
13767 Fix minor ralloc.c problems found by static checking.
13768 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13769 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13770 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13771 (r_alloc_sbrk): Now static.
13772
a041960a
PE
13773 Improve ralloc.c interface checking.
13774 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13775 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13776 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13777 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13778 [REL_ALLOC]: ... to here, to check interface.
13779 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13780 Remove decls. This fixes an "It stinks!".
13781
9426aba4
PE
13782 * alloc.c (which_symbols): Fix alignment issue / type clash.
13783
d55c12ed
AS
137842012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13785
13786 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13787 (struct Lisp_Misc_Any): Likewise.
13788 (struct Lisp_Free): Likewise.
13789 * alloc.c (union aligned_Lisp_Symbol): Define.
13790 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13791 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13792 (union aligned_Lisp_Misc): Define.
13793 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13794 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 13795 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 13796
b948ce8b
PE
137972012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13798
13799 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13800 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13801 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13802 * s/netbsd.h, s/sol2-6.h:
13803 Remove definition of GC_MARK_STACK, since the default now works.
13804 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13805 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13806 no longer the default.
13807 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13808
35dc09a1 138092012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13810
35dc09a1
GM
13811 * lread.c (lisp_file_lexically_bound_p):
13812 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 13813
35dc09a1
GM
138142012-04-14 Eli Zaretskii <eliz@gnu.org>
13815
13816 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13817 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13818
138192012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13820
13821 * nsterm.m (constrainFrameRect): Always constrain when there is only
13822 one screen (Bug#10962).
13823
bcd86815
KB
138242012-04-13 Ken Brown <kbrown@cornell.edu>
13825
13826 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13827
c25df26e
RT
138282012-04-13 Reuben Thomas <rrt@sc3d.org>
13829
13830 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13831
0fc59f1e
DC
138322012-04-11 Daniel Colascione <dancol@dancol.org>
13833
13834 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13835 against is gone. It's better to use vfork now so that when Cygwin
13836 gains a new, working vfork, we use it automatically (bug#10398).
13837
de8c03dc
SM
138382012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13839
13840 * window.c (save_window_save): Obey window-point-insertion-type.
13841
2f097256
GM
138422012-04-11 Glenn Morris <rgm@gnu.org>
13843
13844 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13845
453b951e
SM
138462012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13847
13848 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13849
75f1671a 138502012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
13851
13852 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13853 (force_quit_count): New var.
13854 (handle_interrupt): Use it.
13855
2a8ce227
JB
138562012-04-10 Juanma Barranquero <lekktu@gmail.com>
13857
13858 * w32.c (w32_delayed_load): Record the full path of the library
13859 being loaded (bug#10424).
13860
935396c0
GM
138612012-04-09 Glenn Morris <rgm@gnu.org>
13862
05920a43
GM
13863 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13864 not just in the obarray, before snarfing them. (Bug#11036)
13865
935396c0
GM
13866 * Makefile.in ($(leimdir)/leim-list.el):
13867 Pass EMACS rather than BUILT_EMACS.
13868
a18ecafa
TZ
138692012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13870
13871 * process.c (make_process):
13872 * process.h: Add integer `gnutls_handshakes_tried' member to
13873 process struct.
13874
6bbef4e5
JC
13875 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13876 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
13877
13878 * gnutls.c (gnutls_log_function2i): Convenience log function.
13879 (emacs_gnutls_read): Use new log functions,
13880 `gnutls_handshakes_tried' process member, and
13881 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13882 attempts per process (connection).
13883
b4d3bc10
CY
138842012-04-09 Chong Yidong <cyd@gnu.org>
13885
13886 * eval.c (Fuser_variable_p, user_variable_p_eh)
13887 (lisp_indirect_variable): Functions deleted.
13888 (Fdefvar): Caller changed.
13889
13890 * callint.c (Finteractive, Fcall_interactively):
13891 * minibuf.c (Fread_variable): Callers changed.
13892
70f4d973
EZ
138932012-04-09 Eli Zaretskii <eliz@gnu.org>
13894
13895 * xdisp.c (set_cursor_from_row): If the display string appears in
13896 the buffer at position that is closer to point than the position
13897 after the display string, display the cursor on the first glyph of
13898 the display string. Fixes cursor display when a 'display' text
13899 property immediately follows invisible text. (Bug#11094)
13900
cb3c2e3e
PE
139012012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13902
13903 composite.c: use 'double' consistently
13904 * composite.c (get_composition_id): Use 'double' consistently
13905 instead of converting 'float' to 'double' and vice versa; this is
13906 easier to understand and avoids a GCC warning.
13907
fd06db5d
GM
139082012-04-09 Glenn Morris <rgm@gnu.org>
13909
50fe702a
GM
13910 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13911 preparation for dumping it with emacs. (Bug#4789)
13912 (leimdir): New variable.
13913 ($(leimdir)/leim-list.el): New rule.
13914 (emacs$(EXEEXT)): Depend on leim-list.el.
13915
fd06db5d
GM
13916 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13917 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13918 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13919
55c131ee
AS
139202012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13921
13922 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13923 proper alignment.
13924
9209588f
JB
139252012-04-07 Juanma Barranquero <lekktu@gmail.com>
13926
13927 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13928 Remove unused local variable.
13929
e3fb2efb
PE
139302012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13931
13932 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13933 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13934 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13935 objects, as mark_maybe_pointer will catch them otherwise.
13936 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13937 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13938
b5385551
PE
139392012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13940
13941 Fix typo that broke non-Windows builds.
13942 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13943
9078ead6
EZ
139442012-04-07 Eli Zaretskii <eliz@gnu.org>
13945
13946 Support building on MS-Windows with libxml2.
13947
13948 * makefile.w32-in (OBJ2): Add xml.$(O).
13949 (GLOBAL_SOURCES): Add xml.c.
13950 ($(BLD)/xml.$(O)): New dependency list.
13951
13952 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13953 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13954 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13955 [!WINDOWSNT]: New macros.
13956 (init_libxml2_functions, libxml2_loaded_p): New functions.
13957 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13958 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13959 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13960 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13961 linked in).
6bbef4e5
JC
13962 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13963 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13964 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13965
13966 * emacs.c: Don't include libxml/parser.h.
13967 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13968 xmlCleanupParser directly.
13969
13970 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13971
3811fdf3
EZ
139722012-04-07 Eli Zaretskii <eliz@gnu.org>
13973
13974 * indent.c (Fvertical_motion): If there is a display string at
13975 point, use it.vpos to compute how many lines to backtrack after
13976 move_it_to point. (Bug#11133)
13977
2f8e16b2
EZ
139782012-04-06 Eli Zaretskii <eliz@gnu.org>
13979
13980 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13981 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13982 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13983 macros related to unification of CJK characters. For the details,
13984 see the discussion following the message here:
13985 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13986
3d439cd1
CY
139872012-04-04 Chong Yidong <cyd@gnu.org>
13988
13989 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13990
8bc53d00
EZ
139912012-04-01 Eli Zaretskii <eliz@gnu.org>
13992
13993 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13994 instead of alloca. (Bug#11138)
13995
3b0512a3
AS
139962012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13997
13998 * w32menu.c (is_simple_dialog): Properly check lisp types.
13999 (Bug#11141)
14000
8427ddd2
EZ
140012012-03-31 Eli Zaretskii <eliz@gnu.org>
14002
979022ef
EZ
14003 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14004 position we get to after a call to move_it_to fails the
14005 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14006 only if we wind up in a string from display property. (Bug#11063)
14007
a6b1c7cc
EZ
14008 * window.c (Fdelete_other_windows_internal): Invalidate the row
14009 and column information about mouse highlight, so that redisplay
14010 restores it after reallocating the glyph matrices. (Bug#7464)
14011
8427ddd2
EZ
14012 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14013 string comes from a `display' text property, use the buffer
14014 position of that property as if we actually saw that position in
14015 the row's glyphs.
697ba24b
EZ
14016 (move_it_by_lines): Remove the assertion that
14017 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14018 violated when there's a before-string at the beginning of a line.
14019 (Bug#11063)
8427ddd2 14020
65a0a738
EZ
140212012-03-30 Eli Zaretskii <eliz@gnu.org>
14022
14023 * xdisp.c (append_space_for_newline): If the default face was
14024 remapped, use the remapped face for the appended newline.
14025 (extend_face_to_end_of_line): Use the remapped default face for
14026 extending the face to the end of the line.
14027 (display_line): Call extend_face_to_end_of_line when the default
14028 face was remapped. (Bug#11068)
14029
581355cc
EZ
140302012-03-29 Eli Zaretskii <eliz@gnu.org>
14031
14032 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14033
e8fc049f
SM
140342012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14035
14036 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14037
4fb9a543
GM
140382012-03-27 Glenn Morris <rgm@gnu.org>
14039
14040 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14041 Doc fixes.
14042
679910f1
KH
140432012-03-26 Kenichi Handa <handa@m17n.org>
14044
14045 * dispextern.h (struct glyph): Fix previous change. Change the
14046 bit length of glyphless.ch to 25 (Bug#11082).
14047
90d49b7f
CY
140482012-03-26 Chong Yidong <cyd@gnu.org>
14049
14050 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14051 (command_loop_1): Use it; inhibit selection update for
14052 handle-select-window too (Bug#8996).
14053
f514f6f0
FP
140542012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14055
e8fc049f 14056 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14057
bf43fa51
KH
140582012-03-25 Kenichi Handa <handa@m17n.org>
14059
14060 * dispextern.h (struct glyph): Change the bit length of
14061 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14062
8a0c01dd
EZ
140632012-03-24 Eli Zaretskii <eliz@gnu.org>
14064
14065 * s/ms-w32.h (tzname): Include time.h before redirecting to
14066 _tzname. Fixes the MSVC build. (Bug#9960)
14067
7d1c3a76
AS
140682012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14069
8ed79523
AS
14070 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14071 characters.
14072
7d1c3a76
AS
14073 * xterm.c (XTread_socket): Only modify handling_signal if
14074 !SYNC_INPUT. (Bug#11080)
14075
e99a9b8b
EZ
140762012-03-23 Eli Zaretskii <eliz@gnu.org>
14077
14078 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14079 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14080 when fetching a multibyte character consumes more bytes than
14081 CHAR_BYTES returns, due to unification of CJK characters in
14082 string_char. (Bug#11073)
14083
5063c0e1
TN
140842012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14085
14086 * process.c (wait_reading_process_output): Handle pty disconnect
14087 by refraining from sending oneself a SIGCHLD (bug#10933).
14088
9f851fbd
CY
140892012-03-22 Chong Yidong <cyd@gnu.org>
14090
14091 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14092
5063c0e1 14093 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14094 Mark string as coming from a prefix property.
14095 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14096 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14097
fb5b8aca
CY
140982012-03-21 Chong Yidong <cyd@gnu.org>
14099
14100 * xfaces.c (Vface_remapping_alist): Doc fix.
14101
62356a1b
EZ
141022012-03-20 Eli Zaretskii <eliz@gnu.org>
14103
14104 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14105 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14106 Doc fixes.
62356a1b 14107
025de85b
CY
141082012-03-20 Chong Yidong <cyd@gnu.org>
14109
14110 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14111 to reflect default non-nil value of redisplay-dont-pause.
14112
4827f94e
KH
141132012-03-19 Kenichi Handa <handa@m17n.org>
14114
14115 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14116 it fit in a valid range (Bug#11003).
14117
e50a24a2
EZ
141182012-03-18 Eli Zaretskii <eliz@gnu.org>
14119
14120 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14121 that is not from display property, accept the row as a "cursor
14122 row" if one of the string's character has a non-nil `cursor'
14123 property. Fixes cursor positioning when there are newlines in
14124 overlay strings, e.g. in icomplete.el. (Bug#11035)
14125
9af5ed87
PE
141262012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14127
14128 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14129
d1f55f16
CY
141302012-03-12 Chong Yidong <cyd@gnu.org>
14131
14132 * eval.c (inhibit_lisp_code): Rename from
14133 inhibit_window_configuration_change_hook; move from window.c.
14134
14135 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14136 * window.c (run_window_configuration_change_hook)
14137 (syms_of_window): Callers changed.
14138
66c5eebd
CY
141392012-03-11 Chong Yidong <cyd@gnu.org>
14140
413df973
CY
14141 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14142
66c5eebd
CY
14143 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14144
1de11f56
CY
141452012-03-10 Chong Yidong <cyd@gnu.org>
14146
14147 * frame.c (other_visible_frames): Don't assume the selected frame
14148 is visible (Bug#10955).
14149
cae07000
SM
141502012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14151
14152 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14153
89c94350
JD
141542012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14155
14156 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14157 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14158 zero (Bug#10954).
14159
999dd333
GM
141602012-03-03 Glenn Morris <rgm@gnu.org>
14161
01a6dcc8 14162 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14163
de0100f2
EZ
141642012-03-02 Eli Zaretskii <eliz@gnu.org>
14165
14166 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14167 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14168 (redisplay_window, next_element_from_string): Fix typos in
14169 comments.
3e441275
EZ
14170 (redisplay_window): Pass to move_it_vertically the margin in
14171 pixels, not in screen lines.
de0100f2 14172
96a72ee9
GM
141732012-03-02 Glenn Morris <rgm@gnu.org>
14174
14175 * buffer.c (buffer-list-update-hook): Doc fix.
14176
312508d7
EZ
141772012-02-29 Eli Zaretskii <eliz@gnu.org>
14178
14179 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14180 push_it before setting up the iterator for the first overlay
14181 string, even if we have an empty string loaded.
14182 (next_overlay_string): If there's an empty string on the iterator
14183 stack, pop the stack. (Bug#10903)
14184
27f3c637
PE
141852012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14186
14187 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14188 Suggested by Stefan Monnier in
14189 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14190 * alloc.c (widen_to_Lisp_Object): New static function.
14191 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14192 and widening them to Lisp_Objects. This would work even if
14193 USE_LSB_TAG is defined and wide integers are used, which might
14194 happen in a future version of Emacs.
14195
3c9dfce6
CY
141962012-02-25 Chong Yidong <cyd@gnu.org>
14197
fa74b241
CY
14198 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14199 Doc fix.
14200
3c9dfce6
CY
14201 * xselect.c (Fx_selection_exists_p): Doc fix.
14202 (x_clipboard_manager_save_all): Print an informative message
14203 before saving to clipboard manager.
14204
9486df08
CY
142052012-02-24 Chong Yidong <cyd@gnu.org>
14206
14207 * keyboard.c (process_special_events): Handle all X selection
14208 requests in kbd_buffer, not just the next one (Bug#8869).
14209
f01d3321
CY
142102012-02-23 Chong Yidong <cyd@gnu.org>
14211
14212 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14213 call when setting menu-bar-lines and tool-bar-lines parameters.
14214 (unwind_create_frame_1): New helper function.
14215
14216 * window.c (inhibit_window_configuration_change_hook): New var.
14217 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14218 (syms_of_window): Initialize it.
f01d3321 14219
86b847b6
CY
142202012-02-22 Chong Yidong <cyd@gnu.org>
14221
14222 * xterm.c (x_draw_image_relief): Add missing type check for
14223 Vtool_bar_button_margin (Bug#10743).
14224
a59225b1
CY
142252012-02-21 Chong Yidong <cyd@gnu.org>
14226
14227 * fileio.c (Vfile_name_handler_alist): Doc fix.
14228
14229 * buffer.c (Fget_file_buffer): Protect against invalid file
14230 handler return value.
14231
310f5bd4
PE
142322012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14233
cb3a28cc
PE
14234 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14235 when computing $valmask.
14236
310f5bd4
PE
14237 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14238 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14239 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14240 It's useless in that case, and it can cause problems on hosts
14241 that allocate halves of EMACS_INT values separately.
14242 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14243 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14244 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14245 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14246 it avoids undefined behavior on hosts where shifting right by more
14247 than the word width has undefined behavior.
14248
2375c96a
CY
142492012-02-19 Chong Yidong <cyd@gnu.org>
14250
14251 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14252 (Funhandled_file_name_directory, Ffile_name_as_directory)
14253 (Fdirectory_file_name, Fexpand_file_name)
14254 (Fsubstitute_in_file_name): Protect against invalid file handler
14255 return values (Bug#10845).
14256
3eb49e71
EZ
142572012-02-18 Eli Zaretskii <eliz@gnu.org>
14258
14259 * .gdbinit (pitx): Fix incorrect references to fields of the
14260 iterator stack.
14261
7b926f3f
CY
142622012-02-17 Chong Yidong <cyd@gnu.org>
14263
14264 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14265
11273115
PE
142662012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14267
14268 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14269 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14270
c3a70e2b
CY
142712012-02-15 Chong Yidong <cyd@gnu.org>
14272
14273 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14274 marked as special. Also, starting docstrings with * is obsolete.
14275
0ca43699
AS
142762012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14277
14278 * gnutls.c (emacs_gnutls_write): Fix last change.
14279
2e8f3c56
LI
142802012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14281
14282 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14283 send_process.
14284
af70074f
SM
142852012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14286
14287 * keymap.c (Fsingle_key_description): Handle char ranges.
14288
95986d52
CY
142892012-02-12 Chong Yidong <cyd@gnu.org>
14290
afd83bd1
CY
14291 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14292 as that creates a dangerous corner case.
14293
95986d52
CY
14294 * window.c (Fdelete_window_internal): Invalidate the mouse
14295 highlight (Bug#9904).
14296
bd7da63e
GM
142972012-02-12 Glenn Morris <rgm@gnu.org>
14298
14299 * xselect.c (Fx_own_selection_internal)
14300 (Fx_get_selection_internal, Fx_disown_selection_internal)
14301 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14302 * nsselect.m (Fx_own_selection_internal)
14303 (Fx_disown_selection_internal, Fx_selection_exists_p)
14304 (Fx_selection_owner_p, Fx_get_selection_internal):
14305 Sync docs and argument specs with the xselect.c versions.
14306
77abcbc2
LI
143072012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14308
14309 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14310
90b671e2
EZ
143112012-02-11 Eli Zaretskii <eliz@gnu.org>
14312
1c0ca0b7
EZ
14313 * w32select.c (Fx_selection_exists_p): Sync doc string and
14314 argument list with xselect.c. (Bug#10783)
14315
14316 * w16select.c (Fx_selection_exists_p): Sync doc string and
14317 argument list with xselect.c. (Bug#10783)
90b671e2 14318
49241268
GM
143192012-02-10 Glenn Morris <rgm@gnu.org>
14320
14321 * fns.c (Fsecure_hash): Doc fix.
14322
f998bbe7 143232012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14324
14325 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14326
0992bd9c
CY
143272012-02-07 Chong Yidong <cyd@gnu.org>
14328
14329 * buffer.c (Fbuffer_local_variables)
14330 (buffer_lisp_local_variables): Handle unbound vars correctly;
14331 don't let Qunbound leak into Lisp.
14332
af008560
GM
143332012-02-07 Glenn Morris <rgm@gnu.org>
14334
dd605cc4
GM
14335 * image.c (Fimagemagick_types): Doc fix.
14336
af008560
GM
14337 * image.c (imagemagick-render-type): Change it from a lisp object
14338 to an integer. Move the doc here from the lisp manual.
14339 Treat all values not equal to 0 the same.
14340
1449fa1d
CY
143412012-02-06 Chong Yidong <cyd@gnu.org>
14342
14343 * doc.c (store_function_docstring): Avoid applying docstring of
14344 alias to base function (Bug#2603).
14345
3723ec07
AS
143462012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14347
14348 * .gdbinit (pp1, pv1): Remove redundant defines.
14349 (pr): Use pp.
14350
79c1cc1e
CY
143512012-02-04 Chong Yidong <cyd@gnu.org>
14352
14353 * nsterm.m: Declare a global (Bug#10694).
14354
d7f29f8e
EZ
143552012-02-04 Eli Zaretskii <eliz@gnu.org>
14356
cae07000
SM
14357 * w32.c (get_emacs_configuration_options):
14358 Include --enable-checking, if specified, in the return value.
d7f29f8e 14359
3b95a6f9
MR
143602012-02-04 Martin Rudalics <rudalics@gmx.at>
14361
14362 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14363 after rounding frame sizes. (Bug#9723)
14364
d6fa96a6
EZ
143652012-02-04 Eli Zaretskii <eliz@gnu.org>
14366
14367 * keyboard.c (adjust_point_for_property): Don't position point
14368 before BEGV. (Bug#10696)
14369
df0b2940
PE
143702012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14371
14372 Handle overflow when computing char display width (Bug#9496).
14373 * character.c (char_width): Return EMACS_INT, not int.
14374 (char_width, c_string_width): Check for overflow when
14375 computing the width; this is possible now that individual
14376 characters can have unbounded width. Problem introduced
14377 by merge from Emacs 23 on 2012-01-19.
14378
6bee44d6
MA
143792012-02-02 Michael Albinus <michael.albinus@gmx.de>
14380
14381 * dbusbind.c (Fdbus_register_method): Mention the return value
14382 :ignore in the docstring.
14383
44f92739
GM
143842012-02-02 Glenn Morris <rgm@gnu.org>
14385
1b9f60cc
GM
14386 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14387
44f92739
GM
14388 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14389 Unconditionally set to t. (Bug#10673)
14390 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14391 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14392 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14393
c5d3843c
KH
143942012-02-02 Kenichi Handa <handa@m17n.org>
14395
14396 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14397 0, do not call append_composite_glyph.
14398
159462d4 143992012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14400
14401 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14402 NULL (Bug#6988).
14403 (x_produce_glyphs): If the component of a composition is a null
14404 string, set it->pixel_width to 1 to avoid zero-width glyph.
14405
78cef877
EZ
144062012-02-01 Eli Zaretskii <eliz@gnu.org>
14407
14408 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14409 first 2 arguments are identical. This makes inserting large
14410 output from a subprocess an order of magnitude faster on
14411 MS-Windows, where all sbrk'ed memory is always contiguous.
14412
97897668
GM
144132012-01-31 Glenn Morris <rgm@gnu.org>
14414
14415 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14416 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14417 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14418
31fd3586
GM
144192012-01-29 Glenn Morris <rgm@gnu.org>
14420
14421 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14422
0e24a8b2
CY
144232012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14424
14425 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14426
cc0adcb0
CY
144272012-01-28 Chong Yidong <cyd@gnu.org>
14428
14429 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14430
acc28cb9
CY
144312012-01-26 Chong Yidong <cyd@gnu.org>
14432
9c69cfb7
CY
14433 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14434
acc28cb9
CY
14435 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14436 repeat counts (Bug#10507).
14437
48da7392
GM
144382012-01-26 Glenn Morris <rgm@gnu.org>
14439
14440 * lread.c (syms_of_lread): Doc fix.
14441
14af5f7f
CY
144422012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14443
14444 * coding.c (encode_designation_at_bol): Change return value to
14445 EMACS_INT.
14446
0b21c100
CY
144472012-01-25 Chong Yidong <cyd@gnu.org>
14448
14449 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14450
3c2907f7
CY
144512012-01-21 Chong Yidong <cyd@gnu.org>
14452
14453 * floatfns.c (Fcopysign): Make the second argument non-optional,
14454 since nil is not allowed anyway.
14455
959ad23f
AS
144562012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14457
14458 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14459 (send_process): Likewise.
14460
34a02f46
MR
144612012-01-19 Martin Rudalics <rudalics@gmx.at>
14462
14463 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14464 (Vwindow_persistent_parameters): Do not use Qstate.
14465 Rewrite doc-strings.
34a02f46 14466
1259009a 144672012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14468
14469 * character.c (char_width): New function.
70d4fdf6
GM
14470 (Fchar_width, c_string_width, lisp_string_width):
14471 Use char_width (Bug#9496).
25ed9e61 14472
6a6ee00d
MR
144732012-01-16 Martin Rudalics <rudalics@gmx.at>
14474
14475 * window.c (Vwindow_persistent_parameters): New variable.
14476 (Fset_window_configuration, save_window_save): Handle persistent
14477 window parameters.
14478
c85efaf7
EZ
144792012-01-14 Eli Zaretskii <eliz@gnu.org>
14480
14481 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14482 thrashing the stack of the thread. (Bug#9087)
14483
5944709e
PE
144842012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14485
14486 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14487
e71f5d99
EZ
144882012-01-11 Eli Zaretskii <eliz@gnu.org>
14489
14490 * xdisp.c (rows_from_pos_range): Handle the case where the
14491 highlight ends on a newline. (Bug#10464)
14492 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14493 he end column for display of highlight that ends on a newline
14494 before a R2L line.
14495
ce316182
GM
144962012-01-11 Glenn Morris <rgm@gnu.org>
14497
14498 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14499 from load-path also when installation-directory is nil. (Bug#10208)
14500
5b43da69
GM
145012012-01-10 Glenn Morris <rgm@gnu.org>
14502
74cc8ff9
GM
14503 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14504
7d8d6e4e
GM
14505 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14506 Update template values to be closer to their typical values these days.
5b43da69 14507
a0db8d43
EZ
145082012-01-09 Eli Zaretskii <eliz@gnu.org>
14509
14510 * xdisp.c (rows_from_pos_range): Accept additional argument
14511 DISP_STRING, and accept any glyph in a row whose object is that
14512 string as eligible for mouse highlight. Fixes mouse highlight of
14513 display strings from overlays. (Bug#10464)
14514
9a0115ab 145152012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14516
b9110d6a 14517 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14518 * fileio.c (auto_saving_dir_umask): New static var.
14519 (Fmake_directory_internal): Use it.
14520 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14521 creating the directory. The old code temporarily assigns
14522 too-generous permissions to the directory.
14523 (do_auto_save_eh): Clear it.
b9110d6a 14524 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14525 that the var is always cleared.
14526
6c1bd3f3
EZ
145272012-01-07 Eli Zaretskii <eliz@gnu.org>
14528
14529 * search.c (scan_buffer): Pass character positions to
14530 know_region_cache, not byte positions. (Bug#6540)
14531
069d2b50
L
145322012-01-07 LynX <_LynX@bk.ru> (tiny change)
14533
14534 * w32.c (sys_rename): Report EXDEV when rename of a directory
14535 fails because the target is on another logical disk. (Bug#10284)
14536
75bf0d33
DB
145372012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14538
14539 * xterm.c (x_embed_request_focus): New function.
14540
14541 * xterm.h: Add prototype.
14542
14543 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14544
1c6e5a32
GM
145452012-01-05 Glenn Morris <rgm@gnu.org>
14546
14547 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14548
651e947e
EZ
145492012-01-01 Eli Zaretskii <eliz@gnu.org>
14550
14551 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14552 Load gnutls_transport_set_lowat only if GnuTLS version is below
14553 2.11.1.
14554 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14555 GnuTLS versions below 2.11.1.
14556
3778cdd8
AL
145572011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14558
14559 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14560 to the doc string advising against its use for altering the way
14561 windows are scrolled.
14562
0e5317f7
KH
145632011-12-28 Kenichi Handa <handa@m17n.org>
14564
14565 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14566 coding-system ASCII compatible only when it does not produce BOM
14567 on encoding (Bug#10383).
14568
93d5ca1f
JD
145692011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14570
14571 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14572 can scroll.
14573 (create_and_show_popup_menu): Always use menu_position_func for
14574 Gtk3 (Bug#10361).
14575
ca22b785
AS
145762011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14577
14578 * callint.c (Fcall_interactively): Don't truncate prompt string.
14579
d048e1e6
EZ
145802011-12-23 Eli Zaretskii <eliz@gnu.org>
14581
14582 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14583 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 14584 resumed from there (after widening). (Bug#10360)
d048e1e6 14585
5ccaba1f
JD
145862011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14587
14588 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14589
204ee57f
JD
145902011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14591
b81d40f0
JB
14592 * nsterm.m (x_free_frame_resources):
14593 Release f->output_data.ns->miniimage.
204ee57f
JD
14594 (ns_index_color): Fix indentation. Do not retain
14595 color_table->colors[i].
14596
14597 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14598 before returning.
14599
14600 * nsfns.m (x_set_background_color): Assign return value from
14601 ns_index_color to face-background instead of NSColor*.
14602 (ns_implicitly_set_icon_type): Fix indentation.
14603 Change assignment in for loop to comparison.
14604
14605 * emacs.c (ns_pool): New variable.
14606 (main): Assign ns_pool.
14607 (Fkill_emacs): Call ns_release_autorelease_pool.
14608
14609 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14610 autorelease fdesc, release fdAttrs and tdict.
14611 (ns_get_covering_families): Release charset.
14612 (ns_findfonts): Release NSFontDescriptor created with new.
14613 (ns_uni_to_glyphs): Fix indentation.
14614 (setString): Release attrStr before assigning new value.
14615
c803b2b7
JD
146162011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14617
678f4426
JD
14618 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14619 and NS_IMPL_COCOA.
14620 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14621 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14622
cd394be1 146232011-12-18 David Reitter <reitter@cmu.edu>
678f4426 14624
5fecd5fc
JD
14625 * nsterm.m (ns_term_init): Subscribe for notifications
14626 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14627 to method trackingNotification in EmacsMenu.
14628
14629 * nsmenu.m (trackingMenu): New variable.
3771cb17 14630 (trackingNotification): New method (from Aquamacs).
5fecd5fc 14631 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14632 from Aquamacs (Bug#7030).
678f4426
JD
14633
146342011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14635
c803b2b7
JD
14636 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14637 (symbol_to_nsstring): Fix indentation.
14638 (ns_symbol_to_pb): New function.
cae07000
SM
14639 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14640 (Fns_rotate_cut_buffers_internal): Remove.
14641 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14642 Fns_store_cut_buffer_internal.
14643 (ns_get_foreign_selection, Fx_own_selection_internal)
14644 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14645 (Fns_get_selection_internal, Fns_store_selection_internal):
14646 Use ns_symbol_to_pb and check if return value is nil.
14647 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14648 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14649 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14650 renamed to Sns_store_selection_internal.
14651 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14652 and remove this function.
14653 (ns_handle_selection_clear): Remove, never used.
14654 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14655 here.
14656
e1b01a3a
KB
146572011-12-17 Ken Brown <kbrown@cornell.edu>
14658
14659 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14660 GID is unknown (Bug#10257).
14661
2adb6e85
PE
146622011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14663
14664 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14665 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14666 which caused a build failure on GNU/Linux IA-64. This problem was
14667 introduced by my 2011-10-07 patch.
14668
d1d7b339
JL
146692011-12-15 Juri Linkov <juri@jurta.org>
14670
14671 * image.c (imagemagick_error): New function. (Bug#10112)
14672 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14673 Use `imagemagick_error' where ImageMagick functions return
14674 `MagickFalse'.
14675 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14676 proper order.
14677
100d5755
KH
146782011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14679
14680 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14681 fill background (Bug#8992).
14682
454592a6
MR
146832011-12-13 Martin Rudalics <rudalics@gmx.at>
14684
14685 * window.c (Vwindow_combination_resize)
14686 (Vwindow_combination_limit): Use t instead of non-nil in
14687 doc-strings.
61d4b438
MR
14688 (Vrecenter_redisplay): Add first sentence of doc-string on
14689 separate line.
53524d93 14690 (Frecenter): Fix doc-string typo.
454592a6 14691
3633e3aa
KH
146922011-12-11 Kenichi Handa <handa@m17n.org>
14693
14694 * coding.c (Funencodable_char_position): Pay attention to the
14695 buffer text relocation (Bug#9389).
14696
7b9d523a 146972011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 14698
7b9d523a
JD
14699 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14700 gtk_init (Bug#10100).
14701
b73189c6
EZ
147022011-12-10 Eli Zaretskii <eliz@gnu.org>
14703
14704 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14705 IT->string is nil. (Bug#10263)
14706
f7dfe5d6
JD
147072011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14708
83faebb4
JD
14709 * nsterm.h (x_free_frame_resources): Declare.
14710
f7dfe5d6
JD
14711 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14712 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14713
14714 * nsterm.h (ns_get_defaults_value): Declare.
14715
14716 * nsterm.m (ns_default): Call ns_get_defaults_value.
14717
7cd4e72c
EZ
147182011-12-09 Eli Zaretskii <eliz@gnu.org>
14719
14720 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14721 (Bug#10170)
14722
b34d7317
YM
147232011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14724
14725 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14726 that where the value of an _OBJC_* symbol points to is in the .bss
14727 section (Bug#10240).
14728
76470ad1
KH
147292011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14730
14731 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 14732 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 14733
745fff94
KH
147342011-12-08 Kenichi Handa <handa@m17n.org>
14735
14736 * ftfont.c (get_adstyle_property): Fix previous change
14737 (Bug#10233).
14738
6e44397c
JB
147392011-12-07 Juanma Barranquero <lekktu@gmail.com>
14740
14741 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14742 dirs from the default value of EMACSLOADPATH (bug#10208).
14743
7efa6272
GM
147442011-12-07 Glenn Morris <rgm@gnu.org>
14745
14746 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14747 installation and source directories as well. (Bug#10208)
14748
f6fc4d87
CY
147492011-12-06 Chong Yidong <cyd@gnu.org>
14750
14751 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14752
2bf26180
GM
147532011-12-06 Glenn Morris <rgm@gnu.org>
14754
14755 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14756 as an error, not just -1. (Bug#10217)
14757
3a6ad4f0
CY
147582011-12-05 Chong Yidong <cyd@gnu.org>
14759
14760 * keyboard.c (process_special_events): New function.
14761 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14762
75a3b399
PE
147632011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14764
14765 * coding.c (encode_designation_at_bol): Don't use uninitialized
14766 local variable (Bug#9318).
14767
c3c9e25e
KH
147682011-12-05 Kenichi Handa <handa@m17n.org>
14769
14770 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14771 return Qnil (Bug#8046, Bug#10193).
14772
5eb05ea3
KH
147732011-12-05 Kenichi Handa <handa@m17n.org>
14774
14775 * coding.c (encode_designation_at_bol): New args charbuf_end and
14776 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
14777 (coding_set_source): Return how many bytes coding->source was
14778 relocated.
14779 (coding_set_destination): Return how many bytes
14780 coding->destination was relocated.
14781 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 14782 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
14783
147842011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14785
14786 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14787 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14788 macro (Bug#9318).
14789
147902011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14791
14792 The following changes are to fix Bug#9318.
14793
a79703f5 14794 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
14795 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14796 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 14797 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 14798
7dbda6df
JB
147992011-12-05 Juanma Barranquero <lekktu@gmail.com>
14800
14801 * lisp.h (process_quit_flag): Fix external declaration.
14802
6d5eb5b0
SM
148032011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14804
14805 Don't macro-inline non-performance-critical code.
14806 * eval.c (process_quit_flag): New function.
14807 * lisp.h (QUIT): Use it.
14808
a0c3fad0
JD
148092011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14810
14811 * nsfns.m (get_geometry_from_preferences): New function.
14812 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14813
6c07aac2
AS
148142011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14815
14816 * emacs.c (Qkill_emacs): Define.
14817 (syms_of_emacs): Initialize it.
14818 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14819 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
14820 (quit_throw_to_read_char): Add parameter `from_signal'.
14821 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
14822 * lisp.h (QUIT): Call Fkill_emacs if requested.
14823
c052ead4
JD
148242011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14825
14826 * widget.c (update_wm_hints): Return if wmshell is null.
14827 (widget_update_wm_size_hints): New function.
14828
14829 * widget.h (widget_update_wm_size_hints): Declare.
14830
14831 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14832 widget_update_wm_size_hints (Bug#10104).
14833
9e49252b
EZ
148342011-12-03 Eli Zaretskii <eliz@gnu.org>
14835
14836 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14837 before a newline, prepare the bidi iterator for consuming the
14838 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 14839 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 14840
02b16839
JL
148412011-12-02 Juri Linkov <juri@jurta.org>
14842
14843 * search.c (Fword_search_regexp): New Lisp function created from
14844 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14845 (Fword_search_backward, Fword_search_forward)
14846 (Fword_search_backward_lax, Fword_search_forward_lax):
14847 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14848 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14849
0068070e
SM
148502011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14851
14852 * fileio.c (Finsert_file_contents): Move after-change-function call
14853 to before the "handled:" label, since all "goto handled" appear in
14854 cases where the *-change-functions have already been properly called
14855 (bug#10117).
14856
3360a3fc
AS
148572011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14858
14859 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14860 waiting for input. (Bug#10169)
14861
73d6c093
EZ
148622011-11-30 Eli Zaretskii <eliz@gnu.org>
14863
14864 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14865 verifies glyph row's hash code--we have just reallocated the
14866 glyphs, so their contents can be complete garbage. (Bug#10164)
14867
febe6bea
JB
148682011-11-30 Juanma Barranquero <lekktu@gmail.com>
14869
14870 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14871
801a4313
EZ
148722011-11-30 Eli Zaretskii <eliz@gnu.org>
14873
14874 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14875 attributes are tested _before_ calling verify_row_hash, to protect
14876 against GCC re-ordering of the tests. (Bug#10164)
14877
2b56b87e
JD
148782011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14879
14880 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14881
14882 * xterm.c (handle_one_xevent): Only set async_visible and friends
14883 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 14884 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
14885 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14886
dbf31225
PE
148872011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14888
14889 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14890 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14891 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14892 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14893 All uses changed to use GCPRO1 etc.
14894 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14895 Revert to old implementation (i.e., before 2011-03-11).
14896
1305621b
YM
148972011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14898
14899 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14900 of scroll runs so as to avoid assigning disabled bogus rows and
14901 unnecessary graphics copy operations.
14902
8c9afb46
EZ
149032011-11-27 Eli Zaretskii <eliz@gnu.org>
14904
14905 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14906 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14907 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14908 (malloc, free, realloc, calloc): Redirect to e_* only when
14909 compiling Emacs.
14910
14911 * lisp.h (GCTYPEBITS): Move before first use.
14912 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14913 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14914 this macro definition.
14915
14916 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14917 _MSC_VER.
14918
54e9e3bf
JD
149192011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14920
6d5eb5b0
SM
14921 * gtkutil.c (xg_create_frame_widgets):
14922 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
14923 present with Gtk+ 2.0.
14924
83aca1cb
PE
149252011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14926
14927 * fileio.c (Finsert_file_contents): Undo previous change; see
14928 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14929
5b76caa4
PE
149302011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14931
14932 Rename locals to avoid shadowing.
14933 * fileio.c (Finsert_file_contents):
14934 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14935 * process.c (wait_reading_process_output):
14936 Rename inner 'proc' to 'p' to avoid shadowing.
14937 Indent for consistency with usual Emacs style.
14938
8c535114
EZ
149392011-11-25 Eli Zaretskii <eliz@gnu.org>
14940
14941 * xdisp.c (redisplay_window): If cursor row is not fully visible
14942 after recentering, and scroll-conservatively is set to a large
14943 number, scroll window by a few more lines to make the cursor fully
14944 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14945 (start_display): Don't move to the next line if the display should
14946 start at a newline that is part of a display vector or an overlay
14947 string. (Bug#10119)
8c535114 14948
fa4fdb5c
JL
149492011-11-24 Juri Linkov <juri@jurta.org>
14950
14951 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14952 after the `MagickPingImage' call. (Bug#10112)
14953
90ec88df
CY
149542011-11-23 Chong Yidong <cyd@gnu.org>
14955
14956 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14957
56e2e794
MR
149582011-11-23 Martin Rudalics <rudalics@gmx.at>
14959
14960 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14961 making another buffer current. (Bug#10114)
14962
b6e64c41
GM
149632011-11-23 Glenn Morris <rgm@gnu.org>
14964
14965 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14966
6b21de18
CY
149672011-11-23 Chong Yidong <cyd@gnu.org>
14968
14969 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14970 using it (Bug#5984).
14971
b12cd789
EZ
149722011-11-22 Eli Zaretskii <eliz@gnu.org>
14973
14974 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14975 and header-lines, as they don't have one computed for them.
14976 (Bug#10098)
14977
14978 * .gdbinit (prow): Make displayed values more self-explaining.
14979 Add row's hash code.
14980
261b6fd4
LMI
149812011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14982
14983 * process.c (wait_reading_process_output): Fix asynchrounous
14984 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14985 (wait_reading_process_output): Add comment and URL.
261b6fd4 14986
e7cfd277
JD
149872011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14988
14989 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14990
a9b9b7f5
CY
149912011-11-21 Chong Yidong <cyd@gnu.org>
14992
14993 * window.c (Fnext_window, Fprevious_window): Doc fix.
14994
b0d15b4f
SM
149952011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14996
14997 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14998
fe7a3057
JB
149992011-11-20 Juanma Barranquero <lekktu@gmail.com>
15000
15001 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15002
d2999b1a
MR
150032011-11-20 Martin Rudalics <rudalics@gmx.at>
15004
15005 * window.c (Fset_window_combination_limit): Rename argument
15006 STATUS to LIMIT.
15007 (Vwindow_combination_limit): Remove "status" from doc-string.
15008
d5ff9cd0
AS
150092011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15010
15011 * m/ibms390.h: Remove.
15012 * m/ibms390x.h: Don't include "ibms390.h".
15013
a5bb9bd3
SM
150142011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15015
15016 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15017 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15018
cd1181db
JB
150192011-11-20 Juanma Barranquero <lekktu@gmail.com>
15020
15021 * casetab.c (Fset_case_table):
15022 * charset.c (Fcharset_after): Fix typos.
15023
615a3b8d 150242011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15025
17e845af
PE
15026 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15027 Otherwise, valgrind does not work on some platforms.
15028 Problem reported by Andreas Schwab in
6a0bf43d
PE
15029 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15030 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15031 is set, removing the need for VIRT_ADDRESS_VARIES.
15032 (PURE_P): Use a more-efficient implementation that needs just one
15033 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15034 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15035 to 4 (xorl, subq, cmpq, setbe).
15036 * alloc.c (pure): Always extern now, since that's the
15037 VIRT_ADDR_VARIES behavior.
15038 (PURE_POINTER_P): Use a single comparison, not two, for
15039 consistency with the new puresize.h.
15040 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15041 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15042 Remove VIRT_ADDR_VARIES no longer needed.
15043
f8fe6f96
EZ
150442011-11-19 Eli Zaretskii <eliz@gnu.org>
15045
15046 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15047 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15048 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15049 behave as if the cursor position were at the window margin.
15050
15051 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15052 and the cursor position is out of bounds, behave as if the cursor
15053 position were at the window margin. (Bug#10075)
15054
df05a53c
CY
150552011-11-18 Chong Yidong <cyd@gnu.org>
15056
15057 * window.c (Fwindow_combination_limit): Make first argument
15058 non-optional, since it is meaningless for live windows like the
15059 selected window.
61ccba97 15060
2071918e
DA
150612011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15062
15063 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15064
b50a28de
SM
150652011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15066
15067 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15068 (graft_intervals_into_buffer): Simplify.
15069
015137db
EZ
150702011-11-18 Eli Zaretskii <eliz@gnu.org>
15071
15072 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15073 hash values of the two rows.
15074 (copy_row_except_pointers): Preserve the used[] arrays and the
15075 hash values of the two rows. (Bug#10035)
68c95424 15076 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15077
15078 * xdisp.c (row_hash): New function, body extracted from
15079 compute_line_metrics.
15080 (compute_line_metrics): Call row_hash, instead of computing the
15081 hash code inline.
15082
15083 * dispnew.c (verify_row_hash): Call row_hash for computing the
15084 hash code of a row, instead of duplicating code from xdisp.c.
15085
15086 * dispextern.h (row_hash): Add prototype.
15087
a2addb04
TH
150882011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15089
15090 * frame.c (delete_frame): Don't delete the terminal when the last
15091 X frame is closed if emacs is built with GTK toolkit.
15092
df85d315
JB
150932011-11-17 Juanma Barranquero <lekktu@gmail.com>
15094
15095 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15096
a0c2d0ae
MR
150972011-11-17 Martin Rudalics <rudalics@gmx.at>
15098
15099 * window.c (Vwindow_splits): Rename to
15100 Vwindow_combination_resize. Suggested by Juri Linkov.
15101 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15102 of Vwindow_splits.
15103
58179cce
JB
151042011-11-16 Juanma Barranquero <lekktu@gmail.com>
15105
7877f373
JB
15106 * nsfns.m (Fns_font_name):
15107 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15108
b6f67890
MR
151092011-11-16 Martin Rudalics <rudalics@gmx.at>
15110
15111 * window.h (window): Rename slot "nest" to "combination_limit".
15112 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15113 (Fset_window_nest): Rename to Fset_window_combination_limit.
15114 (Vwindow_nest): Rename to Vwindow_combination_limit.
15115 (recombine_windows, make_parent_window, make_window)
15116 (Fsplit_window_internal, saved_window)
15117 (Fset_window_configuration, save_window_save): Rename all
15118 occurrences of window_nest to window_combination_limit.
15119
c7015153
JB
151202011-11-15 Juanma Barranquero <lekktu@gmail.com>
15121
15122 * image.c (imagemagick_load_image): Fix typo.
15123
322ad6ec
EZ
151242011-11-14 Eli Zaretskii <eliz@gnu.org>
15125
15126 * xdisp.c (display_line): Move the call to
15127 highlight_trailing_whitespace before the call to
15128 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15129 faces of all the glyphs to compute ROW's hash value.
15130 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15131
f067b8ec
JB
151322011-11-14 Juanma Barranquero <lekktu@gmail.com>
15133
15134 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15135 just return (bug#10044).
15136
1e5b2111
EZ
151372011-11-12 Eli Zaretskii <eliz@gnu.org>
15138
7ef3cbd5
EZ
15139 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15140 with user-defined heap size. Bump the default size of the temacs
15141 heap to 27MB, to avoid memory warning when running temacs.
15142 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15143
1e5b2111
EZ
15144 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15145 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15146 (verify_row_hash) [XASSERTS]: New function.
15147 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15148 that the hash value of glyph rows is correct.
1e5b2111 15149
89d61221
MR
151502011-11-12 Martin Rudalics <rudalics@gmx.at>
15151
15152 * window.h (window): Remove splits slot.
15153 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15154 (Fdelete_other_windows_internal, make_parent_window)
15155 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15156 (Fset_window_configuration, save_window_save): Don't deal with
15157 split status of windows.
15158 (saved_window): Remove splits slot.
15159 (Vwindow_splits): Rewrite doc-string.
15160
97f18cc8
JD
151612011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15162
15163 * xfns.c (unwind_create_frame):
15164 * nsfns.m (unwind_create_frame):
15165 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15166 Vframe_list (Bug#9999).
15167
22a648b4
DA
151682011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15169
0b381c7e 15170 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15171
659afede
KH
151722011-11-11 Kenichi Handa <handa@m17n.org>
15173
15174 * callproc.c (Fcall_process): Set the member dst_multibyte of
15175 process_coding.
15176
9ac0394b
KH
151772011-11-11 Johan Bockgård <bojohan@gnu.org>
15178
15179 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15180 avoid a crash (bug#9496).
15181
2fbdc249
CY
151822011-11-09 Chong Yidong <cyd@gnu.org>
15183
15184 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15185 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15186
ac6b1f81
PE
151872011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15188
15189 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15190
09db192c
PE
151912011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15192
15193 Avoid some portability problems by eschewing 'extern inline' functions.
15194 The trivial performance wins aren't worth the portability hassles; see
15195 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15196 et seq.
15197 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15198 (window_box_width, window_box_left, window_box_left_offset)
15199 (window_box_right, window_box_right_offset): Undo previous change,
15200 by removing the "extern"s.
15201 * intervals.c (adjust_intervals_for_insertion)
15202 (adjust_intervals_for_deletion): Undo previous change,
15203 making these static again.
15204 (offset_intervals, temp_set_point_both, temp_set_point)
15205 (copy_intervals_to_string): No longer inline.
15206 * xdisp.c (window_text_bottom_y, window_box_width)
15207 (window_box_height, window_box_left_offset)
15208 (window_box_right_offset, window_box_left, window_box_right)
15209 (window_box): No longer inline.
15210
105216ed
CY
152112011-11-08 Chong Yidong <cyd@gnu.org>
15212
15213 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15214 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15215 Signal an error if not a live window.
105216ed
CY
15216 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15217 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15218
ae9e237f
JB
152192011-11-07 Juanma Barranquero <lekktu@gmail.com>
15220
15221 * lisp.h (syms_of_abbrev): Remove declaration.
15222 Reported by CHENG Gao <chenggao@royau.me>.
15223
c7aa8333
EZ
152242011-11-07 Eli Zaretskii <eliz@gnu.org>
15225
15226 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15227 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15228 of temacs in GUI mode.
15229
be7f5545
MR
152302011-11-07 Martin Rudalics <rudalics@gmx.at>
15231
15232 * window.h: Declare delete_all_child_windows instead of
15233 delete_all_subwindows.
15234 * window.c (Fwindow_nest, Fset_window_nest)
15235 (Fset_window_new_total, Fset_window_new_normal)
15236 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15237 (delete_all_subwindows): Rename to delete_all_child_windows.
15238 (Fdelete_other_windows_internal, Fset_window_configuration):
15239 Call delete_all_child_windows instead of delete_all_subwindows.
15240 * frame.c (delete_frame): Call delete_all_child_windows instead
15241 of delete_all_subwindows.
15242
ca78dc43
PE
152432011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15244
15245 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15246 This is also needed for porting to any host where GC_MARK_STACK is
15247 not GC_MAKE_GCPROS_NOOPS.
15248 (which_symbols): Use it.
15249
a0241d01
KH
152502011-11-07 Kenichi Handa <handa@m17n.org>
15251
15252 * coding.c (coding_set_destination): Check coding->src_pos only
15253 when coding->src_object is a buffer (bug#9910).
15254
15255 * process.c (send_process): Set the member src_multibyte of coding
15256 to 0 (bug#9911) when sending a unibyte text.
15257
15258 * callproc.c (Fcall_process): Set the member src_multibyte of
15259 process_coding to 0 (bug#9912).
15260
a64bfdfa 152612011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15262
15263 * xmenu.c (cleanup_widget_value_tree): New function.
15264 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15265 calling free_menubar_widget_value_tree directly (Bug#9830).
15266
cb41b32a
PE
152672011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15268
15269 Fix some portability problems with 'inline'.
15270 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15271 (window_box_width, window_box_left, window_box_left_offset)
15272 (window_box_right, window_box_right_offset): Declare extern.
15273 Otherwise, these inline functions do not conform to C99 and
15274 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15275 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15276 * intervals.c (adjust_intervals_for_insertion)
15277 (adjust_intervals_for_deletion): Now extern, because otherwise the
15278 extern inline functions 'offset_intervals' couldn't refer to it.
15279 (static_offset_intervals): Remove.
15280 (offset_intervals): Rewrite using the old contents of
15281 static_offset_intervals. The old version didn't conform to C99
15282 because an extern inline function contained a reference to an
15283 identifier with static linkage.
15284
b7041366
AS
152852011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15286
15287 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15288 GC.
15289
88a37c4d
EZ
152902011-11-06 Eli Zaretskii <eliz@gnu.org>
15291
15292 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15293 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15294 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15295 return Qleft_to_right.
15296
49745b39
CY
152972011-11-06 Chong Yidong <cyd@gnu.org>
15298
15299 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15300 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15301 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15302 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15303 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15304 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15305 (Fwindow_vscroll): Doc fix.
15306 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15307 argument, since it makes no sense to pass a live window and for
15308 consistency with window-child.
15309
1f05cd82
CS
153102011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15311
15312 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15313 support MSVC.
15314
22610910
JR
153152011-11-05 Jason Rumney <jasonr@gnu.org>
15316
15317 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15318 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15319 fonts (Bug#6029).
15320 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15321 bitwise arithmetic preventing use of unicode-sip and non-truetype
15322 opentype fonts.
15323
a06776b2
EZ
153242011-11-05 Eli Zaretskii <eliz@gnu.org>
15325
3ad924ba
EZ
15326 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15327 "emacs"-only part.
15328
a06776b2
EZ
15329 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15330 initialization code to keep similarity to xfns.c after changes
15331 from 2011-11-05.
15332
c9e7db78
JD
153332011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15334
a97f8f3f
JD
15335 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15336 (unwind_create_frame): New function (Bug#9943).
15337 (Fx_create_frame): Restructure code to be more similar to the one in
15338 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15339 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15340 Move terminal->reference_count++ just before making the frame official
15341 (Bug#9943).
15342
15343 * nsterm.m (x_free_frame_resources): New function.
15344 (x_destroy_window): Move code to x_free_frame_resources.
15345
c9e7db78 15346 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15347 (Fx_create_frame, x_create_tip_frame):
15348 Move terminal->reference_count++ just before making the frame
75f1671a 15349 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15350 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15351
a6fc3b5c
EZ
153522011-11-05 Eli Zaretskii <eliz@gnu.org>
15353
15354 Support MSVC build with newer versions of Visual Studio.
15355 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15356 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15357 nt/gmake.defs.
15358
15359 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15360 which are not supported by MSVC.
15361 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15362 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15363 bitfields.
15364 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15365 types in bitfields.
15366 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15367
15368 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15369
58179cce 153702011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15371
15372 Support MSVC build with newer versions of Visual Studio.
15373 * w32.c: Don't include w32api.h for MSVC.
15374 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15375
15376 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15377 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15378 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15379 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15380 e_* cousins.
15381 (alloca) [_MSC_VER]: Define to _alloca.
15382
15383 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15384
15385 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15386
a58c13ed
EZ
153872011-11-04 Eli Zaretskii <eliz@gnu.org>
15388
15389 * xdisp.c (note_mouse_highlight): If either of
15390 previous/next-single-property-change returns nil, treat that as
15391 the beginning or the end of the buffer. (Bug#9955)
15392
fe0b6370
JD
153932011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15394
a58c13ed 15395 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15396 label is not null (Bug#9951).
15397 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15398 may be NULL.
15399
89bd5ee1
EZ
154002011-11-04 Eli Zaretskii <eliz@gnu.org>
15401
15402 * window.c (Fwindow_body_size): Mention in the doc string that the
15403 return value is in frame's canonical units. (Bug#9949)
15404
84c3edb9
EZ
154052011-11-03 Eli Zaretskii <eliz@gnu.org>
15406
4e2fb5c7
EZ
15407 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15408
84c3edb9 15409 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15410 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15411 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15412
bc17a887
EZ
154132011-11-01 Eli Zaretskii <eliz@gnu.org>
15414
15415 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15416 Don't stop backward scan on the continuation glyph, even though
15417 its CHARPOS is positive.
6d5eb5b0
SM
15418 (mouse_face_from_buffer_pos, note_mouse_highlight):
15419 Rename cover_string to disp_string.
bc17a887 15420
4ee88440
MR
154212011-11-01 Martin Rudalics <rudalics@gmx.at>
15422
15423 * window.c (temp_output_buffer_show): Don't use
15424 Vtemp_buffer_show_specifiers.
15425 (Vtemp_buffer_show_specifiers): Remove unused variable.
15426
c2ff3c02
EZ
154272011-10-30 Eli Zaretskii <eliz@gnu.org>
15428
15429 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15430 past the beginning of the current glyph matrix.
15431
58179cce 154322011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15433
15434 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15435 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15436 HAVE_GTK3 (Bug#9869).
b77a6a7f 15437
3b574623
JD
15438 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15439 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15440
b77a6a7f
JD
15441 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15442
15443 * xterm.c: Declare x_handle_net_wm_state to return int.
15444 (handle_one_xevent): Check if we are iconified but don't have
15445 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15446 (get_current_wm_state): Return non-zero if not hidden,
15447 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15448 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15449 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15450 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15451
196e41e4
PE
154522011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15453
15454 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15455 so that this new function doesn't get optimized away by a
15456 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15457
021f2e1a
AS
154582011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15459
15460 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15461
8b058d44
EZ
154622011-10-29 Eli Zaretskii <eliz@gnu.org>
15463
15464 Fix the `xbytecode' command.
15465 * .gdbinit (xprintbytestr): New command.
b50a28de 15466 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15467 (xbytecode): Print the byte-code string as well.
15468
4452fb80
EZ
154692011-10-29 Kim Storm <storm@cua.dk>
15470
8b058d44
EZ
15471 * alloc.c (which_symbols): New function.
15472
21b72067
AS
154732011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15474
15475 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15476 line. (Bug#9903)
15477
83ed7b5c
GM
154782011-10-29 Glenn Morris <rgm@gnu.org>
15479
15480 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15481 Not clear what it was for, and it causes various bugs. (Bug#9839)
15482
5a7a728b
EZ
154832011-10-28 Eli Zaretskii <eliz@gnu.org>
15484
15485 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15486 possible random value that matches one of those tested as
15487 condition to clear the mouse face.
15488
d3d0842f
CY
154892011-10-28 Chong Yidong <cyd@gnu.org>
15490
15491 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15492
31b39d13
DN
154932011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15494
15495 * window.c (make_window): Initialize phys_cursor_on_p.
15496
9aba6043
SM
154972011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15498
15499 * lisp.h (struct Lisp_Symbol): Update comments.
15500
c20992f4
JB
155012011-10-28 Juanma Barranquero <lekktu@gmail.com>
15502
15503 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15504
db4f02f2
EZ
155052011-10-28 Eli Zaretskii <eliz@gnu.org>
15506
15507 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15508 <oslsachem@gmail.com> for helping to debug this.
15509
15510 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15511 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15512 (g_b_init_get_glyph_outline_w): New static variables.
15513 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15514 (GetGlyphOutlineW_Proc): New typedefs.
15515 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15516 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15517 New functions.
15518 (w32font_open_internal, compute_metrics):
15519 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15520 instead of calling the "wide" APIs directly.
15521
15522 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15523
15524 * w32.h (syms_of_w32font): Add prototype.
15525
87e68db4
JB
155262011-10-27 Juanma Barranquero <lekktu@gmail.com>
15527
15528 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15529 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15530 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15531 (Fmove_to_window_line): Doc fix.
15532
435c1d67
CY
155332011-10-27 Chong Yidong <cyd@gnu.org>
15534
15535 * process.c (make_process): Set gnutls_state to NULL.
15536
15537 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15538 non-NULL, regardless of GNUTLS_INITSTAGE.
15539 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15540 an error. Set process slots as soon as we allocate them.
15541
15542 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15543
9c6c6f49
CY
155442011-10-27 Chong Yidong <cyd@gnu.org>
15545
9aba6043
SM
15546 * gnutls.c (emacs_gnutls_deinit): New function.
15547 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15548 (Fgnutls_deinit, Fgnutls_boot): Use it.
15549
15550 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15551 (deactivate_process): Call emacs_gnutls_deinit.
15552
657d08d3
JB
155532011-10-27 Juanma Barranquero <lekktu@gmail.com>
15554
15555 * image.c (x_create_x_image_and_pixmap):
15556 * w32.c (sys_rename, w32_delayed_load):
15557 * w32font.c (fill_in_logfont):
15558 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15559
5430d399
JB
155602011-10-26 Juanma Barranquero <lekktu@gmail.com>
15561
15562 * w32fns.c (w32_default_color_map): New function,
15563 extracted from Fw32_default_color_map.
a7ef684b 15564 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 15565
fe0055fa
PE
155662011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15567
15568 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15569
e6346438
SM
155702011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15571
15572 * keyboard.c (test_undefined): New function (bug#9751).
15573 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15574
e112cc37
ET
155752011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15576
15577 * sysdep.c (init_sys_modes): Fix the check for the controlling
15578 terminal (Bug#6649).
15579
7b5d6677
EZ
155802011-10-20 Eli Zaretskii <eliz@gnu.org>
15581
15582 * dispextern.h (struct bidi_it): New member next_en_type.
15583
15584 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15585 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15586 current character, check also for next_en_type being WEAK_EN.
15587 (bidi_resolve_weak): Don't enter the expensive loop if the current
15588 position is before next_en_pos. Record the bidi type of the first
15589 non-ET, non-BN character we find, in addition to its position.
15590 (bidi_level_of_next_char): Invalidate next_en_type when
15591 next_en_pos is over-stepped.
15592
7da0b018
PE
155932011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15594
15595 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15596 * editfns.c: Rewrite current-time-zone so that it invokes
15597 the equivalent of (format-time-string "%Z") to get the time zone name.
15598 This fixes a bug when the time zone name contains characters that
15599 need converting from the system time locale to Emacs internal format.
15600 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15601 that patch fixed format-time-string to do the conversion, but
15602 I forgot to fix current-time-zone.
15603 (format_time_string): New function, containing most of
15604 what Fformat_time_string used to contain.
15605 (Fformat_time_string): Rewrite in terms of format_time_string.
15606 This doesn't change this function's behavior.
15607 (current-time-zone): Rewrite to use format_time_string.
15608 This fixes the bug reported by Michael Schierl in
15609 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15610 Jason Rumney's 2007-06-07 change worked around this bug, but
15611 didn't fix it.
15612 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15613
8547b010
EZ
156142011-10-19 Eli Zaretskii <eliz@gnu.org>
15615
15616 * xdisp.c (start_display): If the character at POS is displayed
15617 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
15618 (try_window_reusing_current_matrix): If a line ends in a display
15619 vector or the next line starts in a display vector, continue
15620 redrawing the window even though the character position of
15621 start_row was reached.
8547b010
EZ
15622 (Bug#9771, part 2)
15623
4e948d15
CY
156242011-10-18 Chong Yidong <cyd@gnu.org>
15625
15626 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15627 with nobreak-char-display too.
15628
4787455f
EZ
156292011-10-18 Eli Zaretskii <eliz@gnu.org>
15630
15631 Fix part 3 of bug#9771.
15632 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15633 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15634 non-neutral characters if the current character is a paragraph
15635 separator (a.k.a. Newline). This avoids running the same
15636 expensive loop twice, once when we consume the preceding newline
15637 and the other time when the line actually needs to be displayed.
15638 Avoid the loop when we see neutrals on the base embedding level
15639 following a character whose directionality is the same as the
15640 paragraph's. This avoids running the expensive loop when a line
15641 ends in a long sequence of neutrals, like control characters.
15642 Add assertion against STRONG_AL type. Slightly rearrange code
15643 that determines the type of a neutral given the first non-neutral
15644 that follows it.
15645 (bidi_level_of_next_char): Set next_en_pos to zero when
15646 invalidating its info.
15647
2c91f553
EZ
156482011-10-17 Eli Zaretskii <eliz@gnu.org>
15649
15650 * xdisp.c (push_display_prop): Determine whether to record string
15651 or buffer position by IT->string, not by IT->method. Allow
15652 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15653 (move_it_vertically_backward): Don't look for character position
15654 immediately after the newline when in a continuation line.
15655 (Bug#9771, part 1)
2c91f553 15656
c7b08b0d
MR
156572011-10-15 Martin Rudalics <rudalics@gmx.at>
15658
15659 * window.c (coordinates_in_window): Rewrite and delabelize
15660 vertical border check. (Bug#5357) (Bug#9618)
15661
6b02f655
SM
156622011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15663
15664 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15665 errors in XSetWindowBorder (bug#9310).
15666
81d40c92
DA
156672011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15668
15669 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15670 avoid crash when xmalloc overrun checking is enabled.
15671
d4172c3b
EZ
156722011-10-13 Eli Zaretskii <eliz@gnu.org>
15673
15674 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15675 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15676 cursor motion with <left> and <right> arrow keys.
15677
15678 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15679 some callers set that themselves.
15680
b00eea75
EZ
156812011-10-12 Eli Zaretskii <eliz@gnu.org>
15682
15683 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15684 display string and the previous row comes from the same string and
15685 is empty. (Bug#9739) (Bug#9738)
15686
8fe012c4
SM
156872011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15688
15689 * doc.c (get_doc_string): Encode file name (bug#9735).
15690
0074aef2
EZ
156912011-10-12 Eli Zaretskii <eliz@gnu.org>
15692
79beb178
EZ
15693 * bidi.c (bidi_level_of_next_char):
15694 * xdisp.c (get_visually_first_element): Remove old incorrect
15695 comments regarding the Unicode Line Separator character.
15696
0074aef2
EZ
15697 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15698
6e4b3fbe
DA
156992011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15700
15701 * alloc.c (Fgc_status): Do not access beyond zombies array
15702 boundary if nzombies > MAX_ZOMBIES.
15703 * alloc.c (dump_zombies): Add missing format specifier.
15704
0324f3af
PE
157052011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15706
b5525cac
PE
15707 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15708 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15709
0324f3af
PE
15710 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15711 Some packages use them to denote characters with modifiers.
15712
e9b5f888
AS
157132011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15714
15715 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15716 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15717 matching a pp-number. Rename parameter var to var1.
15718
127827c0
SM
157192011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15720
15721 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15722
c8fd3bd0
GM
157232011-10-08 Glenn Morris <rgm@gnu.org>
15724
15725 * callint.c (Fcall_interactively): Give a more explicit error for the
15726 'c' case with a non-character input. (Bug#8479)
15727
352ec8ff
EZ
157282011-10-08 Eli Zaretskii <eliz@gnu.org>
15729
03669ccb
EZ
15730 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15731 lines.
7061c986
EZ
15732 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15733 lines that are hscrolled on the left.
03669ccb 15734
352ec8ff
EZ
15735 * dispnew.c (buffer_posn_from_coords): Account for a possible
15736 presence of header-line. (Bug#4426)
15737
a66cfb1c
SM
157382011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15739
6b02f655
SM
15740 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15741 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 15742
7c5ee88e
PE
157432011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15744
15745 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15746 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15747 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15748 this makes Emacs dump core during garbage collection on rare
15749 occasions. sizeof is obviously inferior to offsetof here, so
15750 stick with offsetof.
15751 (GC_POINTER_ALIGNMENT): New macro.
15752 (mark_memory): Omit 3rd (offset) arg; caller changed.
15753 Don't assume EMACS_INT alignment is the same as pointer alignment.
15754
df1bbe5b
SM
157552011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15756
15757 * keyboard.c (read_key_sequence_remapped): New var.
15758 (read_key_sequence): Compute remapping in the right buffer.
15759 (command_loop_1): Use read_key_sequence's remapping directly.
15760
51553db6
SM
157612011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15762
32c1fffd
SM
15763 * dired.c (file_name_completion): Don't expand file name.
15764 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15765 before checking file name handler.
15766
51553db6
SM
15767 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15768 they've been requested explicitly (bug#9591).
15769
b6bd1599 157702011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
15771
15772 * keymap.c (Fsingle_key_description): Use make_specified_string
15773 instead of build_string to build string from push_key_description.
15774 (Bug#5193)
15775
f701dc2a
PE
157762011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15777
4222c55d
PE
15778 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15779 This fixes a Y2038 bug on 64-bit hosts.
15780 * buffer.c (reset_buffer):
15781 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15782 (Fclear_buffer_auto_save_failure):
15783 Use 0, not -1, to represent an unset failure time, since time_t
15784 might not be signed.
15785
f701dc2a
PE
15786 Remove dependency on glibc malloc internals.
15787 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15788 Move back here from lisp.h, but with their new implementations.
15789 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15790 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15791 * charset.c (charset_table_init): New static var.
15792 (syms_of_charset): Use it instead of xmalloc. This removes a
15793 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15794 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15795 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15796 Move back to alloc.c.
15797 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15798 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15799
9ceebf39
JD
158002011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15801
15802 * nsterm.m (windowDidResize): Call x_set_window_size only when
15803 ns_in_resize is true. Otherwise set pixelwidth/height and
15804 call change_frame_size (Bug#9628).
15805
cb993c58
PE
158062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15807
3930c88b
PE
15808 Port --enable-checking=all to Fedora 14 x86-64.
15809 * charset.c (syms_of_charset): Also account for glibc malloc's
15810 internal overhead when calculating the initial malloc maximum.
15811
cb993c58
PE
15812 Port --enable-checking=all to Fedora 14 x86.
15813 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15814 Move to lisp.h.
15815 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15816 (overrun_check_realloc, overrun_check_free):
15817 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15818 That way, xmalloc returns a properly-aligned pointer even if
15819 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15820 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15821 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15822 into account when calculating the initial malloc maximum.
15823 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15824 Move here from alloc.c, so that charset.c can use it too.
15825 Properly align; the old code wasn't right for common 32-bit hosts
15826 when configured with --enable-checking=all.
15827 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15828 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15829
31bed486
EZ
158302011-09-29 Eli Zaretskii <eliz@gnu.org>
15831
04c70788 15832 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
15833 use EDOM.
15834
fbcaa2f3
EZ
158352011-09-28 Eli Zaretskii <eliz@gnu.org>
15836
15837 * xdisp.c (compute_display_string_end): If there's no display
15838 string at CHARPOS, return -1.
15839
15840 * bidi.c (bidi_fetch_char): When compute_display_string_end
15841 returns a negative value, treat the character as a normal
15842 character not covered by a display string. (Bug#9624)
15843
a239d4e9
JB
158442011-09-28 Juanma Barranquero <lekktu@gmail.com>
15845
15846 * lread.c (Fread_from_string): Fix typo in docstring.
15847
88652fd5
EZ
158482011-09-27 Eli Zaretskii <eliz@gnu.org>
15849
15850 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15851 newline, reseat the iterator instead of bidi-iterating there one
15852 character at a time. (Bug#9610)
32c1fffd
SM
15853 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15854 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 15855
ed497dd4
AS
158562011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15857
15858 * lread.c (readevalloop): Use correct code for NBSP.
15859 (read1): Likewise. (Bug#9608)
15860
b2bf61aa
MA
158612011-09-25 Michael Albinus <michael.albinus@gmx.de>
15862
15863 * dbusbind.c (Fdbus_register_signal): When service is not
15864 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15865
32bbb17c
GM
158662011-09-25 Glenn Morris <rgm@gnu.org>
15867
15868 * buffer.c (truncate-lines): Doc fix.
15869
94e0933e
CY
158702011-09-24 Chong Yidong <cyd@stupidchicken.com>
15871
15872 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15873 (Fset_window_next_buffers): Doc fix.
15874
cddde921
GM
158752011-09-24 Glenn Morris <rgm@gnu.org>
15876
15877 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15878
1260aef1
PE
158792011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15880
25b4bfa0
PE
15881 Fix minor problems found by static checking.
15882 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
15883 * indent.c (Fvertical_motion): Fix == vs = typo.
15884
e3cbd34b
EZ
158852011-09-24 Eli Zaretskii <eliz@gnu.org>
15886
a66cfb1c
SM
15887 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15888 Default value is now t. Doc fix.
6bf7006f 15889
e3cbd34b 15890 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 15891 logic when moving up, not only when moving down. Fix the
e3cbd34b 15892 confusing name and values of the it_overshoot_expected variable;
32c1fffd 15893 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
15894
15895 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15896 CHARPOS is covered by a display string which includes newlines.
15897 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15898 is covered by a display string with embedded newlines.
15899
a3de0cbd
MA
159002011-09-24 Michael Albinus <michael.albinus@gmx.de>
15901
15902 * dbusbind.c (Fdbus_register_signal): Add match rule to
15903 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
15904 (Fdbus_register_method, Vdbus_registered_objects_table):
15905 Fix docstring.
a3de0cbd 15906
b260039d
JM
159072011-09-24 Jim Meyering <meyering@redhat.com>
15908
32c1fffd 15909 do not ignore write error for any output size
b260039d
JM
15910 The previous change was incomplete.
15911 While it makes emacs --batch detect the vast majority of stdout
15912 write failures, errors were still ignored whenever the output size is
15913 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15914 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15915 && echo FAIL: ignored write error
15916 FAIL: ignored write error
15917 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15918 && echo FAIL: ignored write error
15919 FAIL: ignored write error
15920 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15921
8eca8a7c
AS
159222011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15923
15924 * emacs.c (Fkill_emacs): In noninteractive mode exit
15925 non-successfully if a write error occurred on stdout. (Bug#9574)
15926
3341db62
EZ
159272011-09-21 Eli Zaretskii <eliz@gnu.org>
15928
15929 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15930 the xassert test.
15931
15932 * dispextern.h (struct it): Update the comment documenting what
15933 can it->OBJECT be.
15934
8c203dbf
EZ
159352011-09-20 Eli Zaretskii <eliz@gnu.org>
15936
15937 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15938 a display string, extend search for cursor position to end of row.
15939 (find_row_edges): If the row ends in a newline from a display
15940 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15941 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
15942 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15943 non-empty line. Fixes confusing cursor motion with arrow keys at
15944 the beginning of a line that starts with whitespace.
8c203dbf 15945
a4824228
LMI
159462011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15947
15948 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15949 (bug#9493).
15950
33ed493b
CY
159512011-09-18 Chong Yidong <cyd@stupidchicken.com>
15952
15953 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15954 boolean (Bug#9154).
15955
56cd55c8
EZ
159562011-09-18 Eli Zaretskii <eliz@gnu.org>
15957
15958 * xdisp.c (display_line): Record maximum and minimum buffer
15959 positions even if no glyphs were produced (e.g., by a zero-width
15960 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15961 buffer positions that will be removed from the glyph row because
15962 they don't fit.
c02dcedf
EZ
15963 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15964 column is beyond frame width: don't subtract 1 "pixel" when
15965 computing width of the stretch.
3e62b7e0
EZ
15966 (reseat_at_next_visible_line_start): Undo the change made on
15967 2011-09-17 that saved paragraph information and restored it after
15968 the call to `reseat'. (Bug#9545)
56cd55c8 15969
5ed99d36 159702011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15971
15972 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15973 and turn window cursor on if cleared (Bug#9415).
15974
5ed99d36 159752011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15976
15977 * search.c (boyer_moore): Take unibyte characters from pattern
15978 literally. (Bug#9458)
15979
9bade7b2
EZ
159802011-09-18 Eli Zaretskii <eliz@gnu.org>
15981
15982 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15983
e5e9d610
PE
159842011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15985
87e4427a
PE
15986 Fix minor problem found by static checking.
15987 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15988 initialized, to pacify gcc -Wuninitialized.
15989
e5e9d610
PE
15990 * fileio.c: Report proper errno when syscall falls.
15991 (Finsert_file_contents): Save and restore errno,
15992 so that report_file_error outputs the correct diagnostic.
15993 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15994
a1674f0b
EZ
159952011-09-18 Eli Zaretskii <eliz@gnu.org>
15996
15997 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15998
fbfb6dd4
EZ
159992011-09-17 Eli Zaretskii <eliz@gnu.org>
16000
16001 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16002 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16003
bb187662
EZ
160042011-09-17 Eli Zaretskii <eliz@gnu.org>
16005
1137e8b8 16006 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16007 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16008
16009 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16010 (bidi_find_paragraph_start): Search back for paragraph beginning
16011 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16012 (bidi_move_to_visually_next): Only trigger paragraph-related
16013 computations when the last character is a newline or at EOB, not
16014 just any NEUTRAL_B. (Bug#9470)
16015
bb187662
EZ
16016 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16017 truncated lines if point is covered by a display string. (Bug#9524)
16018
2e621251
PE
160192011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16020
16021 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16022 (cons_to_x_long): New function.
16023 (lisp_data_to_selection_data): Use it. Correct the test for
16024 short-versus-long data; it was negated. Break out of vector
16025 loop, for efficiency, when a long datum is discovered.
16026
91a15bc6
SM
160272011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16028
16029 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16030
b41c3a35
EZ
160312011-09-16 Eli Zaretskii <eliz@gnu.org>
16032
16033 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16034 GCC PR/17406) by declaring this function with external scope.
16035
7812ba2d
PE
160362011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16037
16038 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16039 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16040
cf7edc2a
AS
160412011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16042
16043 * editfns.c (Fformat): Correctly handle text properties on "%%".
16044
bd01620e
EZ
160452011-09-15 Eli Zaretskii <eliz@gnu.org>
16046
16047 * xterm.c (x_draw_composite_glyph_string_foreground):
16048 * w32term.c (x_draw_composite_glyph_string_foreground):
16049 * term.c (encode_terminal_code):
16050 * composite.c (composition_update_it, get_composition_id):
16051 * xdisp.c (get_next_display_element)
16052 (fill_composite_glyph_string): Add comments about special meaning
16053 of TAB characters in a composition.
16054
a02719a3
PE
160552011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16056
16057 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16058 This occurs when processing a multibyte format.
16059 Problem reported by Wolfgang Jenker.
a02719a3 16060
72589a3c
JB
160612011-09-15 Johan Bockgård <bojohan@gnu.org>
16062
16063 * xdisp.c (try_cursor_movement): Only check for exact match if
16064 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16065
1c14176c
PE
160662011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16067
16068 Remove unused external symbols.
16069 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16070 * xdisp.c (calc_pixel_width_or_height): Now static.
16071 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16072 * indent.c (check_display_width):
16073 * w32term.c: Fix comment to match code.
16074 * xterm.c, xterm.h (x_catching_errors): Remove.
16075
d2eea5b5
PE
160762011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16077
16078 * xselect.c: Use signed conversions more consistently (Bug#9498).
16079 (selection_data_to_lisp_data): Assume incoming selection data are
16080 signed integers, not unsigned. This is to be consistent with
16081 outgoing selection data, which was modified to use signed integers
16082 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16083 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16084 expects long, not unsigned long.
16085
46888499
EZ
160862011-09-14 Eli Zaretskii <eliz@gnu.org>
16087
16088 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16089 computation of loop end. Reported by Johan Bockgård
16090 <bojohan@gnu.org>.
16091
ef8ef9fb
CY
160922011-09-13 Chong Yidong <cyd@stupidchicken.com>
16093
16094 * frame.c (Fother_visible_frames_p): Function deleted.
16095
fa819fed
EZ
160962011-09-12 Eli Zaretskii <eliz@gnu.org>
16097
16098 * indent.c (compute_motion): Process display vector front to back
16099 rather than the other way around. (Bug#2496)
16100
2ba8e008
SM
161012011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16102
16103 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16104
20f53c69
CY
161052011-09-11 Chong Yidong <cyd@stupidchicken.com>
16106
16107 * minibuf.c (Fread_from_minibuffer): Doc fix.
16108
d562d7a4
EZ
161092011-09-11 Eli Zaretskii <eliz@gnu.org>
16110
16111 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16112 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16113
1c4d7f3d
LMI
161142011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16115
16116 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16117 value for non-existent files.
16118
b885bf36
EZ
161192011-09-11 Eli Zaretskii <eliz@gnu.org>
16120
16121 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16122 set its "size" to -1. This will set the modtime_size field of
16123 the corresponding buffer to -1, which is what
16124 verify-visited-file-modtime expects for files that do not exist.
16125 (Bug#9139)
16126
6612f0bf
PE
161272011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16128
16129 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16130 here ...
16131 * lisp.h: ... from here. push_key_description is no longer
16132 defined in keyboard.c, so its declaration should not be in
16133 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16134 logically belongs with push_key_description.
16135
dfb3f755
PE
161362011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16137
16138 * buffer.h: Include <sys/types.h> instead of <time.h>.
16139 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16140 Problem reported by Herbert J. Skuhra.
16141
3134906c
LMI
161422011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16143
16144 * xml.c (parse_region): Make the parsing work for
16145 non-comment-starting XML files again (bug#9144).
16146
8d903f4e
AS
161472011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16148
16149 * image.c (gif_load): Fix calculation of bottom and right corner.
16150 (Bug#9468)
16151
80ad64f4
EZ
161522011-09-10 Eli Zaretskii <eliz@gnu.org>
16153
16154 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16155 redisplay in small windows.
16156
208a048d
EZ
161572011-09-09 Eli Zaretskii <eliz@gnu.org>
16158
16159 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16160
9b1c252e
MR
161612011-09-08 Martin Rudalics <rudalics@gmx.at>
16162
16163 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16164 Operate on live windows only.
16165
2949f33b
JB
161662011-09-08 Juanma Barranquero <lekktu@gmail.com>
16167
16168 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16169
e08dcafd
EZ
161702011-09-07 Eli Zaretskii <eliz@gnu.org>
16171
16172 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16173 only under bidi iteration.
16174
115b96bd
JD
161752011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16176
16177 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16178
c8199d0f
PE
161792011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16180
16181 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16182 Without this fix, the command to link temacs failed due to an
16183 undefined symbol __builtin_isnan. This is because
16184 /usr/include/iso/math_c99.h #defines isnan(x) to
16185 __builtin_isnan(x), but the bundled gcc, which identifies itself
16186 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16187 a __builtin_isnan.
16188 * floatfns.c (isnan): #undef, and then #define to a clone of
16189 what's in data.c.
16190 (Fisnan): Always define, since it's always available now.
16191 (syms_of_floatfns): Always define isnan at the Lisp level.
16192
e39b275c 161932011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16194
16195 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16196
b2db44d9 161972011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16198
f4af5137 16199 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16200 The previous code assumed that file offsets (off_t values) fit in
16201 EMACS_INT variables, which is not true on typical 32-bit hosts.
16202 The code messed up by falsely reporting buffer overflow in cases
16203 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16204 when "big" contains more than 2**29 bytes, even though this
16205 inserts just one byte and does not overflow the buffer.
16206 (Finsert_file_contents): Store file offsets as off_t
16207 values, not as EMACS_INT values. Check for overflow when
16208 converting between EMACS_INT and off_t. When checking for
16209 buffer overflow or for overlap, take the offsets into account.
16210 Don't use EMACS_INT for small values where int suffices.
16211 When checking for overlap, fix a typo: ZV was used where
16212 ZV_BYTE was intended.
16213 (Fwrite_region): Don't assume off_t fits into 'long'.
16214 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16215
ecfc0a49
MA
162162011-09-05 Michael Albinus <michael.albinus@gmx.de>
16217
16218 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16219
6511acf2 162202011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16221
0999621a 16222 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16223
16224 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16225 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16226 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16227 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16228 (modify_event_symbol): Do not assume that the length of
16229 name_alist_or_stem is safe to alloca and fits in int.
16230 (Fexecute_extended_command): Likewise for function name and binding.
16231 (Frecursion_depth): Wrap around reliably on integer overflow.
16232 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16233 since some callers pass EMACS_INT values.
16234 (Fsingle_key_description): Don't crash if symbol name contains more
16235 than MAX_ALLOCA bytes.
16236 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16237 (get_minibuffer): Arg is now EMACS_INT, not int.
16238 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16239 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16240 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16241
2be7d702
PE
16242 * dbusbind.c (signature_cat): New function.
16243 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16244 Do not overrun buffer; instead, report string overflow.
16245
9d1df220
PE
16246 * dispnew.c (add_window_display_history): Don't overrun buffer.
16247 Truncate instead; this is OK since it's just a log.
16248
33ef5c64
PE
16249 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16250 even if the time zone offset is outlandishly large.
16251 Don't mishandle offset == INT_MIN.
16252
66c6fdd5
PE
16253 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16254 when creating daemon; the previous buffer-overflow check was incorrect.
16255
d749b01b
PE
16256 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16257 which has the guts of the old verror function.
16258
b5cd1905
PE
16259 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16260 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16261
6e1a67fb
PE
16262 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16263 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16264 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16265 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16266 length of string rather than counting it via multiple sprintfs;
16267 that's simpler and more reliable.
c21721cc
PE
16268 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16269 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16270 sprintf, in case result does not fit in int.
16271
c57b67fc
PE
16272 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16273 (fontset_from_font): Print it.
16274
8a401434
PE
16275 * frame.c (tty_frame_count): Now printmax_t, not int.
16276 (make_terminal_frame, set_term_frame_name): Print it.
16277 (x_report_frame_params): In X, window IDs are unsigned long,
16278 not signed long, so print them as unsigned.
16279 (validate_x_resource_name): Check for implausibly long names,
16280 and don't assume name length fits in 'int'.
16281 (x_get_resource_string): Don't blindly alloca invocation name;
16282 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16283 not fit in int.
16284
6e1a67fb
PE
16285 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16286 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16287 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16288
0df02bf3
PE
16289 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16290 Use esprintf, not sprintf, in case result does not fit in int.
16291
48e30793
PE
16292 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16293 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16294 it as a large positive number.
16295 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16296 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16297
a66ff6d8
PE
16298 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16299 in case result does not fit in int.
16300
aca216ff
PE
16301 * print.c (float_to_string): Detect width overflow more reliably.
16302 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16303 buffer overrun. Don't assume list length fits in 'int'. Treat
16304 print length of 0 as 0, not as infinity; to be consistent with other
16305 uses of print length in this function. Don't overflow print length
16306 index. Don't assume hash table size fits in 'long', or that
16307 vectorlike size fits in 'unsigned long'.
16308
31c286f7
PE
16309 * process.c (make_process): Use printmax_t, not int, to format
16310 process-name gensyms.
16311
55e5faa1
PE
16312 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16313
80f2e268
PE
16314 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16315 to avoid potential buffer overrun.
16316
670741ab
PE
16317 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16318 if X resource line is longer than 512 bytes.
16319
b7163a50
PE
16320 * xfns.c (x_window): Make sprintf buffer a bit bigger
16321 to avoid potential buffer overrun.
16322
ae58ff1f
PE
16323 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16324
c43c8a6a
PE
16325 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16326
3f8236f4
PE
163272011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16328
53e9fe90 16329 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16330 Without these, Emacs silently mishandles large integers sometimes.
16331 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16332 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16333
6511acf2
PE
16334 * xdisp.c (try_window_id): Check Emacs fixnum range before
16335 converting to 'int'.
806add1d 16336
6511acf2 16337 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16338 Check that an Emacs fixnum is in range before assigning it to 'int'.
16339 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16340 values converted from Emacs fixnums.
16341 (Frecenter): Don't wrap around a line count if it is out of 'int'
16342 range; instead, treat it as an extreme value.
16343 (Fset_window_configuration, compare_window_configurations):
16344 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16345
6511acf2
PE
16346 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16347 that can exceed INT_MAX. Check that EMACS_INT value is in range
16348 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16349 (match_limit): Don't assume that a fixnum can fit in 'int'.
16350
6511acf2 16351 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16352 exceed INT_MAX.
16353
6511acf2 16354 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16355 (Fvertical_motion): Don't wrap around LINES values that don't fit
16356 in 'int'. Instead, treat them as extreme values. This is good
16357 enough for windows, which can't have more than INT_MAX lines anyway.
16358
fcb901a7
LMI
163592011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16360
0f2f6b6d
LMI
16361 * Require libxml/parser.h to avoid compilation warning.
16362
fcb901a7
LMI
16363 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16364
16365 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16366 since this reportedly can destroy thread storage.
16367
6e20a0d4
CY
163682011-08-30 Chong Yidong <cyd@stupidchicken.com>
16369
16370 * syntax.c (find_defun_start): Update all cache variables if
16371 exiting early (Bug#9401).
16372
148ae00e
EZ
163732011-08-30 Eli Zaretskii <eliz@gnu.org>
16374
f6cfbd8f
EZ
16375 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16376
148ae00e
EZ
16377 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16378 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16379 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16380
16381 * term.c (tty_append_glyph): New function.
16382 (produce_stretch_glyph): Static function and its prototype deleted.
16383
a66cfb1c
SM
16384 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16385 Add prototypes.
148ae00e 16386
c4a07a4c
PE
163872011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16388
16389 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16390 when checking :margin (Bug#9390).
16391 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16392 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16393 so that the name doesn't mislead. All uses changed.
16394
6bc8cd65
JB
163952011-08-28 Johan Bockgård <bojohan@gnu.org>
16396
16397 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16398 set_tty_hooks.
16399
dca4927e
EZ
164002011-08-27 Eli Zaretskii <eliz@gnu.org>
16401
16402 * xdisp.c (move_it_to): Don't bail out early when reaching
16403 position beyond to_charpos, if we are scanning backwards.
16404 (move_it_vertically_backward): When DY == 0, make sure we get to
16405 the first character in the line after the newline.
16406
f2cad773
PE
164072011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16408
16409 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16410 (ccl_driver): Do not generate an out-of-range pointer.
16411 (Fccl_execute_on_string): Remove unnecessary check for
16412 integer overflow, noted by Stefan Monnier in
16413 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16414 Remove a FIXME that didn't need fixing.
16415 Simplify the newly-introduced buffer reallocation code.
16416
0cae2cdb
JB
164172011-08-27 Juanma Barranquero <lekktu@gmail.com>
16418
16419 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16420
5fc295a4 164212011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16422
70c60eb2 16423 Integer and memory overflow issues (Bug#9196).
726e0ab1 16424
d31850da
PE
16425 * doc.c (get_doc_string): Rework so that
16426 get_doc_string_buffer_size is the actual buffer size, rather than
16427 being 1 less than the actual buffer size; this makes xpalloc more
16428 convenient.
16429
a69fbedb
PE
16430 * image.c (x_allocate_bitmap_record, cache_image):
16431 * xselect.c (Fx_register_dnd_atom):
16432 Simplify previous changes by using xpalloc.
16433
fe5c5d37
PE
16434 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16435 since either will do and ptrdiff_t is convenient with xpalloc.
16436
0065d054
PE
16437 * charset.c (charset_table_size)
16438 (struct charset_sort_data.priority): Now ptrdiff_t.
16439 (charset_compare): Don't overflow if priorities differ greatly.
16440 (Fsort_charsets): Don't assume list length fits in int.
16441 Check for size-calculation overflow when allocating sort data.
16442 (syms_of_charset): Allocate an initial charset table that is
16443 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16444
16445 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16446
16447 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16448 The actual value is always <= INT_MAX, and leaving it unsigned made
16449 overflow checking harder.
16450
16451 * dispextern.h (struct glyph_matrix.rows_allocated)
16452 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16453 with xpalloc. The values are still always <= INT_MAX.
16454
16455 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16456
16457 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16458 (SAFE_NALLOCA): New macro.
16459
16460 * region-cache.c (struct boundary.pos, find_cache_boundary)
16461 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16462 (set_cache_region, invalidate_region_cache)
16463 (revalidate_region_cache, know_region_cache, region_cache_forward)
16464 (region_cache_backward, pp_cache):
16465 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16466 so that ptrdiff_t * can be passed to xpalloc.
16467 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16468 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16469 (pp_cache): Don't assume cache_len fits in int.
16470 * region-cache.h: Adjust extern decls to match.
16471
16472 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16473 EMACS_INT, since either will do, for xpalloc.
16474
16475 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16476 (xnmalloc, xnrealloc, xpalloc): New functions.
16477
726e0ab1
PE
16478 * bidi.c (bidi_shelve_header_size): New constant.
16479 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16480 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16481
51f30bc5 16482 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16483 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16484 (overlay_strings):
16485 Don't update size of array until after memory allocation succeeds,
16486 because xmalloc/xrealloc may not return.
0065d054
PE
16487 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16488 now that we have proper integer overflow checking.
16489 (record_overlay_string, overlay_strings): Catch overflows when
16490 calculating size of overlay_str_buf.
726e0ab1 16491
0065d054
PE
16492 * callproc.c (Fcall_process): Check for size overflow when
16493 calculating size of args2.
16494 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16495 Normally we prefer signed values, but sticking with ptrdiff_t would
16496 require adding more-complicated checks.
726e0ab1
PE
16497
16498 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16499 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16500 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16501 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16502
16503 * character.c (Fstring): Check for size-calculation overflow.
16504
16505 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16506 unnecessary integer overflow. Check for size overflow.
16507 (encode_coding_object): Don't update size until xmalloc succeeds.
16508
16509 * composite.c (get_composition_id): Check for overflow in glyph
16510 length calculations.
16511
16512 Integer and memory overflow fixes for display code.
16513 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16514 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16515 (scrolling_window): Check for overflow in size calculations.
16516 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16517 Don't assume glyph table len fits in int.
16518 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16519 (row_table_size): Now ptrdiff_t, not int.
16520 (scrolling_window): Avoid overflow in size calculations.
16521 Don't update size until allocation succeeds.
16522 * fns.c (concat): Check for overflow in size calculations.
16523 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16524 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16525 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16526
16527 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16528 (get_doc_string): Check for size calculation overflow.
16529 Don't update size until allocation succeeds.
16530 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16531 EMACS_INT, where ptrdiff_t will do.
16532 (Fsubstitute_command_keys): Check for string overflow.
16533
16534 * editfns.c (set_time_zone_rule): Don't assume environment length
16535 fits in int.
16536 (message_length): Now ptrdiff_t, not int.
16537 (Fmessage_box): Don't update size until allocation succeeds.
16538 Don't assume message length fits in int.
16539 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16540
0065d054
PE
16541 * emacs.c (main): Do not reallocate argv, since there is a null at
16542 the end that can be overwritten, and this way there's no need to
16543 worry about size-calculation overflow.
16544 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16545
16546 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16547 alloc succeeds.
16548 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16549
16550 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16551 (x_set_scroll_bar_width, x_figure_window_size):
16552 Check for integer overflow.
16553 (x_set_alpha): Do not assume XINT fits in int.
16554
16555 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16556 This is for the members text_lines, text_cols, total_lines, total_cols,
16557 where the system imposes an 'int' limit.
16558
16559 * fringe.c (Fdefine_fringe_bitmap):
16560 Don't update size until alloc works.
16561
16562 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16563 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16564
16565 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16566 Check for size-calculation overflow.
16567 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16568 do, as we prefer signed integers.
16569 (id_to_widget.max_size, id_to_widget.used)
16570 (xg_store_widget_in_map, xg_remove_widget_from_map)
16571 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16572 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16573 Use and return ptrdiff_t, not int.
16574 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16575 * gtkutil.h: Change prototypes to match the above.
16576
16577 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16578 are duplicate now that they've been promoted to lisp.h.
16579 (x_allocate_bitmap_record, x_alloc_image_color)
16580 (make_image_cache, cache_image, xpm_load):
16581 Don't update size until alloc is done.
16582 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16583 (x_detect_edges):
3256efce 16584 Check for size calculation overflow.
726e0ab1
PE
16585 (ct_colors_allocated_max): New constant.
16586 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16587 overflow.
3256efce 16588
726e0ab1
PE
16589 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16590 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16591 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16592 Use ptrdiff_t, not int, to count maps.
16593 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
16594 calculations. Don't update size until allocation succeeds.
16595 Redo calculations to avoid overflow.
726e0ab1
PE
16596 * keyboard.h: Change prototypes to match the above.
16597
16598 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16599 to count maps.
16600 (current_minor_maps): Check for size calculation overflow.
16601 * keymap.h: Change prototypes to match the above.
16602
16603 * lread.c (read1, init_obarray): Don't update size until alloc done.
16604
16605 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16606 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16607
726e0ab1
PE
16608 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16609 Now ptrdiff_t, not int.
16610 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16611 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16612
16613 * process.c (Fnetwork_interface_list): Check for overflow
16614 in size calculation.
16615
16616 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16617
16618 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16619 overflow. Don't bother calling xmalloc when xrealloc will do.
16620
16621 * search.c (Freplace_match): Check for size calculation overflow.
16622 (Fset_match_data): Don't assume list lengths fit in 'int'.
16623
16624 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16625 for command line length. Do not attempt to address one before the
16626 beginning of an array, as that's not portable.
16627
16628 * term.c (max_frame_lines): Remove; unused.
16629 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16630 not int.
16631 (encode_terminal_code, calculate_costs): Check for size
16632 calculation overflow.
16633 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16634 table lengths and related sizes. Don't update size until alloc
16635 done. Redo calculations to avoid overflow.
16636 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16637
16638 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16639 subtracting pointers.
16640 (gobble_line): Check for overflow more carefully. Don't update size
16641 until alloc done.
16642
16643 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16644 Don't update size until alloc done.
16645 Redo size calculations to avoid overflow.
16646 Check for size calculation overflow.
0065d054 16647 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16648
16649 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16650 Use ptrdiff_t, not int, for sizes.
16651 (store_mode_line_noprop_char): Don't update size until alloc done.
16652
0065d054
PE
16653 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16654 Use ptrdiff_t, not int, for sizes.
16655 (Finternal_make_lisp_face, cache_face):
16656 Check for size calculation overflow.
16657 (cache_face): Treat size calculation overflows as if they were
16658 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16659
16660 * xfns.c (x_encode_text, x_set_name_internal)
16661 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16662 sizes, since they can exceed INT_MAX in size. Check for size
16663 calculation overflow.
16664
0065d054
PE
16665 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16666 (xg_select): Check for size calculation overflow.
726e0ab1
PE
16667 Don't update size until alloc done.
16668
0065d054 16669 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 16670 as sprintf is limited to int lengths.
1d526e2f 16671
252c5ee1
PE
16672 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16673 (X_LONG_MIN): New macros.
864d7ce7
PE
16674 Use them to make the following changes clearer.
16675 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16676 This change doesn't affect the value now, but it may help remind
16677 future maintainers not to raise the value too much later.
16678 (SELECTION_QUANTUM): Remove, replacing with ...
16679 (selection_quantum): ... new function, which avoids overflow.
16680 All uses changed.
16681 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16682 assumption that selection length fits in 'int'.
16683 (x_reply_selection_request, x_handle_selection_request)
16684 (x_get_window_property, receive_incremental_selection)
16685 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16686 (lisp_data_to_selection_data, clean_local_selection_data):
16687 Use ptrdiff_t, not int, to record length of selection.
16688 (x_reply_selection_request, x_get_window_property)
16689 (receive_incremental_selection, x_property_data_to_lisp):
16690 Redo calculations to avoid overflow.
16691 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 16692 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
16693 something.
16694 (x_get_window_property, receive_incremental_selection)
16695 (lisp_data_to_selection_data, x_property_data_to_lisp):
16696 Check for size-calculation overflow.
16697 (x_get_window_property, receive_incremental_selection)
16698 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16699 Don't store size until memory allocation succeeds.
16700 (x_get_window_property): Plug memory leak on memory exhaustion.
16701 Don't double-block input; malloc is safe here. Don't assume 2**34
16702 - 4 fits in unsigned long. Add an xassert to check
16703 XGetWindowProperty overflow. Be more careful about overflow
16704 calculations, and distinguish size from memory overflow better.
16705 (receive_incremental_selection): When tracing, don't assume
16706 unsigned int is less than INT_MAX.
16707 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16708 harmful) conversions of unsigned short to int.
16709 (lisp_data_to_selection_data): Don't assume that integers
16710 in the range -65535 through -1 fit in an X unsigned short.
16711 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16712 result parameters unless successful. Rely on cons_to_unsigned
16713 to report problems with elements; the old code wasn't right anyway.
16714 (x_check_property_data): Check for int overflow; we cannot use
16715 a wider type due to X limits.
16716 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16717
726e0ab1 16718 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 16719
0065d054
PE
16720 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16721 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
16722 (x_color_cells): Don't store size until memory allocation succeeds.
16723 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 16724 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
16725 (x_term_init): Don't assume length fits in int (sprintf is limited
16726 to int size).
bc18e09d 16727
ebfa62c0
PE
16728 Use ptrdiff_t for composition IDs.
16729 * character.c (lisp_string_width):
16730 * composite.c (composition_table_size, n_compositions)
16731 (get_composition_id, composition_gstring_from_id):
16732 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16733 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16734 * window.c (Frecenter):
16735 Use ptrdiff_t, not int, for composition IDs.
16736 * composite.c (get_composition_id): Check for integer overflow.
16737 * composite.h: Adjust prototypes to match the above changes.
16738
d3411f89
PE
16739 Use ptrdiff_t for hash table indexes.
16740 * category.c (hash_get_category_set):
16741 * ccl.c (ccl_driver):
16742 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16743 * coding.c (coding_system_charset_list, detect_coding_system):
16744 * coding.h (struct coding_system.id):
16745 * composite.c (get_composition_id, gstring_lookup_cache):
16746 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16747 * image.c (xpm_get_color_table_h):
16748 * lisp.h (hash_lookup, hash_put):
16749 * minibuf.c (Ftest_completion):
16750 Use ptrdiff_t for hash table indexes, not int (which is too
16751 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16752 32-bit --with-wide-int hosts).
16753
e097a6fa
PE
16754 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16755 Add a FIXME comment about memory leaks.
16756 (syms_of_charset): Don't assume xmalloc returns.
16757
5637687f
PE
16758 Don't assume that stated character widths fit in int.
16759 * character.c (Fchar_width, c_string_width, lisp_string_width):
16760 * character.h (CHAR_WIDTH):
16761 * indent.c (MULTIBYTE_BYTES_WIDTH):
16762 Use sanitize_char_width to avoid undefined and/or bad behavior
16763 with outlandish widths.
a66cfb1c 16764 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
16765 now that we have two such functions. All uses changed.
16766 (sanitize_char_width): New inline function.
16767
a2271ba2
PE
16768 Don't assume that tab-width fits in int.
16769 * character.h (sanitize_width): New inline function.
16770 (SANE_TAB_WIDTH): New macro.
16771 (ASCII_CHAR_WIDTH): Use it.
16772 * indent.c (sane_tab_width): Remove. All uses replaced by
16773 SANE_TAB_WIDTH (current_buffer).
16774 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16775
18c52557
PE
16776 * fileio.c: Integer overflow issues with file modes.
16777 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16778
caeeedc1
PE
16779 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16780 Remove unreachable code.
16781 (read_hex, load_charset_map_from_file): Check for integer overflow.
16782
6df6ae42 16783 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
16784 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16785 (x_send_scroll_bar_event): Likewise. Check that the size does not
16786 exceed limits imposed by XClientMessageEvent, as well as the usual
16787 ptrdiff_t and size_t limits.
16788
b13995db
PE
16789 * keyboard.c: Overflow, signedness and related fixes.
16790 (make_lispy_movement): Use same integer type in forward decl
16791 that is used in the definition.
16792 (read_key_sequence, keyremap_step):
16793 Change bufsize argument back to int, undoing my 2011-03-30 change.
16794 We prefer signed types, and int is wide enough here.
16795 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16796 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16797 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16798 length, not size_t. Use ptrdiff_t for index, not int.
16799 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16800 possibility of integer overflow.
16801
13464394
PE
16802 Overflow, signedness and related fixes for images.
16803
16804 * dispextern.h (struct it.stack[0].u.image.image_id)
16805 (struct_it.image_id, struct image.id, struct image_cache.size)
16806 (struct image_cache.used, struct image_cache.ref_count):
16807 * gtkutil.c (update_frame_tool_bar):
16808 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16809 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16810 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16811 * nsmenu.m (update_frame_tool_bar):
16812 * xdisp.c (calc_pixel_width_or_height):
16813 * xfns.c (image_cache_refcount):
16814 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16815 on typical 64-bit hosts.
16816
16817 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16818 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16819 Omit unnecessary casts to int.
16820 (parse_image_spec): Check that integers fall into 'int' range
16821 when the callers expect that.
16822 (image_ascent): Redo ascent calculation to avoid int overflow.
16823 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16824 (lookup_image): Remove unnecessary tests.
16825 (xbm_image_p): Locals are now of int, not EMACS_INT,
16826 since parse_image_check makes sure they fit into int.
16827 (png_load, gif_load, svg_load_image):
16828 Prefer int to unsigned where either will do.
16829 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
16830 old tiff_error_handler and tiff_warning_handler.
16831 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
16832 stack buffer overflows. It uses only the features of vsnprintf
16833 that are common to both POSIX and native Microsoft.
16834 (tiff_error_handler, tiff_warning_handler): Use it.
16835 (tiff_load, gif_load, imagemagick_load_image):
16836 Don't assume :index value fits in 'int'.
16837 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16838 (imagemagick_load_image): Check that crop parameters fit into
16839 the integer types that MagickCropImage accepts. Don't assume
16840 Vimagemagick_render_type has a nonnegative value. Don't assume
16841 size_t fits in 'long'.
16842 (gs_load): Use printmax_t to print the widest integers possible.
16843 Check for integer overflow when computing image height and width.
16844
c11821d4
EZ
168452011-08-26 Eli Zaretskii <eliz@gnu.org>
16846
16847 * xdisp.c (redisplay_window): Don't force window start if point
16848 will be invisible in the resulting window. (Bug#9324)
16849
0c95fcf7
EZ
168502011-08-25 Eli Zaretskii <eliz@gnu.org>
16851
16852 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16853 the display spec is of the form `(space ...)'.
16854 (handle_display_spec): Return the value returned by
16855 handle_single_display_spec, not just 1 or zero.
16856 (handle_single_display_spec): If the display spec is of the form
16857 `(space ...)', and specifies display in the text area, return 2
16858 rather than 1.
fee65a97 16859 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
16860 accurately, and prefer exact match for point under bidi.
16861 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
16862
16863 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16864 into disp_prop; all users changed.
16865
16866 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16867 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16868 for the text covered by the display property.
16869
e4ed06f1
CY
168702011-08-25 Chong Yidong <cyd@stupidchicken.com>
16871
16872 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16873 Change return value to nil.
16874 (Frecord_buffer): Delete unused function.
16875
f67cdd7f
EZ
168762011-08-24 Eli Zaretskii <eliz@gnu.org>
16877
5980d4c6
EZ
16878 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16879 buffers, return left-to-right.
8610fe8b
EZ
16880 (set_cursor_from_row): Consider candidate row a win if its glyph
16881 represents a newline and point is on that newline. Fixes cursor
16882 positioning on the newline at EOL of R2L text within L2R
16883 paragraph, and vice versa.
16884 (try_cursor_movement): Check continued rows, in addition to
16885 continuation rows. Fixes unwarranted scroll when point enters a
16886 continued line of R2L text within an L2R paragraph, or vice versa.
16887 (cursor_row_p): Consider the case of point being equal to
16888 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16889 from the end of a short line to the beginning of a continued line
16890 of R2L text within L2R paragraph.
16891 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16892 composed characters.
5980d4c6 16893
f67cdd7f
EZ
16894 * bidi.c (bidi_check_type): Use xassert.
16895 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16896 members.
16897
bca633fb
EZ
168982011-08-23 Eli Zaretskii <eliz@gnu.org>
16899
16900 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16901 a character.
16902
4a5885a7
CY
169032011-08-23 Chong Yidong <cyd@stupidchicken.com>
16904
16905 * nsfont.m (ns_otf_to_script): Fix typo.
16906
0902a04e
KH
169072011-08-22 Kenichi Handa <handa@m17n.org>
16908
16909 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16910 extra slot even if the purpose is char-code-property-table.
16911
1a2e6670
EZ
169122011-08-23 Eli Zaretskii <eliz@gnu.org>
16913
8ddde651
EZ
16914 * xdisp.c (redisplay_window): When computing centering_position,
16915 account for the height of the header line. (Bug#8874)
16916
425cc014
EZ
16917 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16918 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16919 candidate is selected by the mouse, and that candidate has a
16920 composed character under the mouse.
16921
1a2e6670
EZ
16922 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16923 coordinates reported by pos-visible-in-window-p for a composed
16924 character in column zero.
16925
8b76d6f8
SM
169262011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16927
16928 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16929
dac347dd
EZ
169302011-08-22 Eli Zaretskii <eliz@gnu.org>
16931
16932 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16933 consider it a hit if to_charpos is anywhere in the range of the
16934 composed buffer positions.
16935
e013fb34
CY
169362011-08-22 Chong Yidong <cyd@stupidchicken.com>
16937
16938 * image.c (gif_load): Don't assume that each subimage has the same
16939 dimensions as the base image. Handle disposal method that is
16940 "undefined" by the gif spec (Bug#9335).
16941
bd1ba3e8
CY
169422011-08-20 Chong Yidong <cyd@stupidchicken.com>
16943
16944 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16945 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16946
54a1215b
EZ
169472011-08-19 Eli Zaretskii <eliz@gnu.org>
16948
823564e5
EZ
16949 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16950 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16951 from an Org mode buffer to a Speedbar frame.
16952
54a1215b
EZ
16953 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16954 a composition, take its buffer position from IT->cmp_it.charpos.
16955 Fixes cursor positioning at the beginning of a line that begins
16956 with a composed character.
16957
9778ebcc
EZ
169582011-08-18 Eli Zaretskii <eliz@gnu.org>
16959
0be6ee06
EZ
16960 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16961 character bidirectional type, use STRONG_L instead. Fixes crashes
16962 in a buffer produced by `describe-categories'.
16963
9778ebcc
EZ
16964 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16965 members before the level stack, so they would be saved and
16966 restored when copying iterator state. Fixes incorrect reordering
16967 around TABs covered by display properties.
16968
156bffbe
AS
169692011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16970
6b02f655 16971 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16972
72ad093b
CY
169732011-08-17 Chong Yidong <cyd@stupidchicken.com>
16974
16975 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16976 (internal_condition_case_2, internal_condition_case_n):
16977 Remove unnecessary aborts (Bug#9081).
72ad093b 16978
35774242
EZ
169792011-08-17 Eli Zaretskii <eliz@gnu.org>
16980
16981 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16982 has no `load' handler, try opening the file locally. (Bug#9311)
16983
db76dd85
KB
169842011-08-16 Ken Brown <kbrown@cornell.edu>
16985
16986 * gmalloc.c: Expand comment.
16987
b215eee5
EZ
169882011-08-16 Eli Zaretskii <eliz@gnu.org>
16989
16990 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16991 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16992
a4579d33
KB
169932011-08-16 Ken Brown <kbrown@cornell.edu>
16994
16995 Fix memory allocation problems in Cygwin build (Bug#9273).
16996
16997 * unexcw.c ( __malloc_initialized): Declare external variable.
16998 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16999
8b76d6f8
SM
17000 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17001 New variables.
a4579d33
KB
17002 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17003 dumped emacs.
17004 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17005 in the static heap.
17006 [CYGWIN] (special_realloc): New function.
17007 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17008 requests to realloc storage in the static heap.
17009
3ebec551
PE
170102011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17011
17012 * bidi.c (bidi_initialize): Remove unused local.
17013
9fd8be00
EZ
170142011-08-15 Eli Zaretskii <eliz@gnu.org>
17015
6b02f655
SM
17016 * bidimirror.h:
17017 * biditype.h: Remove file.
17018 * makefile.w32-in ($(BLD)/bidi.$(O)):
17019 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17020
17021 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17022
17023 * chartab.c: Improve commentary for the uniprop_table API.
17024
32413314
EZ
17025 * bidi.c (bidi_paragraph_init): Support zero value of
17026 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17027 (bidi_initialize): Use uniprop_table instead of including
17028 biditype.h and bidimirror.h.
32413314 17029
9fd8be00
EZ
17030 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17031 coordinates of the iterator when restoring from ppos_it.
17032 (Bug#9296)
17033
5cf2b69b
KH
170342011-08-14 Kenichi Handa <handa@m17n.org>
17035
17036 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17037 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17038
daf17d00
EZ
170392011-08-14 Eli Zaretskii <eliz@gnu.org>
17040
17041 * xdisp.c (move_it_in_display_line_to): Don't invoke
17042 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17043 ppos_it. Fixes vertical cursor motion when line beginning is
17044 covered by an image. (Bug#9296)
17045
08e3161a
JD
170462011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17047
17048 * nsterm.h (ns_run_ascript): Declare.
17049 (NSAPP_DATA2_RUNASSCRIPT): Define.
17050
17051 * nsfns.m (as_script, as_result, as_status): New static variables.
17052 (ns_run_ascript): New function.
5e617bc2 17053 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17054 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17055 the event loop. Get status from as_status (Bug#7276).
17056
17057 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17058 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17059 the event loop (Bug#7276).
17060
a3720aa2
AS
170612011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17062
17063 * gnutls.c (QCgnutls_bootprop_priority)
17064 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17065 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17066 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17067 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17068 (QCgnutls_bootprop_verify_hostname_error)
17069 (QCgnutls_bootprop_callbacks_verify): Rename from
17070 Qgnutls_bootprop_..., all uses changed.
17071
17072 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17073 uses changed.
17074
0a0d27fb
PE
170752011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17076
19d5c50c
PE
17077 * xfaces.c (Qframe_set_background_mode): Now static.
17078 * dispextern.h (Qframe_set_background_mode): Remove decl.
17079
0a0d27fb
PE
17080 * process.c (Fnetwork_interface_info): Declare local only if needed.
17081
377538cb
JD
170822011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17083
17084 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17085 (Fnetwork_interface_list): Allocate in increments of bytes instead
17086 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17087 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17088 sockaddr.
17089 (struct ifflag_def): notrailers is smart on OSX.
17090 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17091 Get hardware address with getifaddrs if available.
17092
08fff70c
EZ
170932011-08-12 Eli Zaretskii <eliz@gnu.org>
17094
17095 * xdisp.c (iterate_out_of_display_property): xassert that
17096 IT->position is set to within IT->object's boundaries. Break from
17097 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17098 when IT->position is set up wrongly due to some bug.
17099 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17100 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17101 entry. Force push_it to save on the stack the current
17102 buffer/string position, to be restored by pop_it. Fix flags in
17103 the iterator structure wrt the object coming from a display
17104 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17105 properties. (Bug#9284)
17106
7be1c708 171072011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17108
7be1c708
CY
17109 * fontset.c (fontset_get_font_group): Add proper type checks.
17110 (Bug#9172)
aac0c6e3 17111
7be1c708 171122011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17113
7be1c708
CY
17114 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17115 and LC_VERSION_MIN_MACOSX.
17116 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17117 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17118
97bb72a6
EZ
171192011-08-08 Eli Zaretskii <eliz@gnu.org>
17120
17121 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17122 no-display-properties-and-no-overlays under bidi display.
17123 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17124 properties and overlays.
97bb72a6 17125
d5617611
CY
171262011-08-08 Chong Yidong <cyd@stupidchicken.com>
17127
37e11a63
CY
17128 * editfns.c (Fset_time_zone_rule): Document relationship with the
17129 setenv function.
17130
d5617611
CY
17131 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17132 the font entity extracted from the cache (Bug#8109).
17133
58872834
CY
171342011-08-07 Chong Yidong <cyd@stupidchicken.com>
17135
17136 * composite.c (autocmp_chars): Don't reset point. That is done by
17137 restore_point_unwind (Bug#5984).
17138
75bfc667
JL
171392011-08-07 Juri Linkov <juri@jurta.org>
17140
17141 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17142 to show the arg `TIME' instead of `TIMEVAL'.
17143
d1410150
EZ
171442011-08-06 Eli Zaretskii <eliz@gnu.org>
17145
17146 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17147 display property strides EOL and includes a newline, as in
17148 longlines-mode. (Bug#9254)
75b771e4
EZ
17149 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17150 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17151
17152 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17153 is non-zero, even if the data buffer is NULL. Fixes a crash in
17154 vertical-motion with longlines-mode. (Bug#9254)
17155
35928349
EZ
171562011-08-05 Eli Zaretskii <eliz@gnu.org>
17157
ec7cc85b
EZ
17158 * bidi.c <bidi_cache_total_alloc>: Now static.
17159 (bidi_initialize): Initialize bidi_cache_total_alloc.
17160
8b76d6f8 17161 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17162 cache. (Bug#9221)
17163
17164 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17165 amount allocated this far in `bidi_cache_total_alloc'.
17166 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17167 non-zero, only free the data buffer without restoring the cache
17168 contents. All callers changed.
17169
17170 * dispextern.h (bidi_unshelve_cache): Update prototype.
17171
17172 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17173 (move_it_in_display_line, move_it_to)
17174 (move_it_vertically_backward, move_it_by_lines): Replace the call
17175 to xfree to an equivalent call to bidi_unshelve_cache.
17176 (move_it_in_display_line_to): Fix logic of returning
412b6358 17177 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17178
e2e2423b
EZ
171792011-08-05 Eli Zaretskii <eliz@gnu.org>
17180
17181 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17182 came from a string character with a `cursor' property. (Bug#9229)
17183
ae9e757a
JD
171842011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17185
17186 * Makefile.in (LIB_PTHREAD): New variable.
17187 (LIBES): Add LIB_PTHREAD (Bug#9216).
17188
17189 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17190 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17191
213bd7f2
AS
171922011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17193
6b02f655 17194 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17195
99aaf75f
JD
171962011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17197
17198 * xterm.c (x_find_topmost_parent): New function.
17199 (x_set_frame_alpha): Find topmost parent window with
17200 x_find_topmost_parent and set the property there also (bug#9181).
17201 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17202
c74e9d86
PE
172032011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17204
17205 * callproc.c (Fcall_process): Avoid vfork clobbering
17206 the local vars buffer, coding_systems, current_dir.
17207
640c8776
SM
172082011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17209
17210 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17211
f26d0e4c
PE
172122011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17213
8a10d76c
PE
17214 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17215 so that it is not optimized away.
17216
f26d0e4c
PE
17217 * xdisp.c (compute_display_string_pos): Remove unused local.
17218
55439c61
EZ
172192011-08-02 Eli Zaretskii <eliz@gnu.org>
17220
17221 Fix slow cursor motion and scrolling in large buffers with
17222 selective display, like Org Mode buffers. (Bug#9218)
17223
17224 * dispextern.h (struct bidi_it): New member disp_prop_p.
17225
17226 * xdisp.c: Remove one-slot cache of display string positions.
17227 (compute_display_string_pos): Accept an additional argument
5e617bc2 17228 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17229 for a display string or property. If found, set DISP_PROP_P
17230 non-zero.
17231
17232 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17233 DISP_PROP_P, and pass it to compute_display_string_pos.
17234 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17235 non-zero. All callers of bidi_fetch_char changed.
17236
fb33fa43
SM
172372011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17238
17239 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17240
b099e063
DM
172412010-12-03 Don March <don@ohspite.net>
17242
17243 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17244 last character M-[char] is translated to ESC [char] (bug#7541).
17245
5cc7f7af
KH
172462011-08-02 Kenichi Handa <handa@m17n.org>
17247
d0fffa3f 17248 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17249
17250 * chartab.c (uniprop_table): Make it non-static.
17251
525d5e6e
EZ
172522011-08-01 Eli Zaretskii <eliz@gnu.org>
17253
17254 * xdisp.c (forward_to_next_line_start): Accept additional argument
17255 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17256 on the newline.
17257 (reseat_at_next_visible_line_start): Use the bidi iterator state
17258 returned by forward_to_next_line_start to restore the state of
17259 it->bidi_it after backing up to previous newline. (Bug#9212)
17260
31011111
AS
172612011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17262
17263 * regex.c (re_comp): Protoize.
17264 (re_exec): Fix return type.
17265 (regexec): Fix type of `ret'. (Bug#9203)
17266
476371c4
PE
172672011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17268
e5d76069
PE
17269 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17270 This is needed if max-image-size is a floating-point number.
17271
9a79b20c
AS
172722011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17273
17274 * print.c (print_object): Print empty symbol as ##.
17275
17276 * lread.c (read1): Read ## as empty symbol.
17277
d8c2fa78
AA
172782011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17279
17280 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17281 setting frame foreground color (Bug#9175).
17282 (x_set_background_color): Likewise.
17283
ffe57a7a
AA
17284 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17285 contents (Bug#9176).
17286 (EmacsTooltip -init): Remove bezels and add shadows to
17287 tooltip windows.
17288
bf3492a5
AA
17289 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17290 or scroll bar (Bug#8470).
17291
d55e9c53
AA
17292 * nsfont.m (nsfont_open): Remove assignment to voffset and
17293 unnecessary vars hshink, expand, hd, full_height, min_height.
17294 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17295
17296 * nsterm.h (nsfont_info): Remove voffset field.
17297
d8c2fa78 172982011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17299
17300 Implement strike-through and overline on NextStep (Bug#8863).
17301
17302 * nsfont.m (nsfont_open): Use underline position provided by font,
17303 instead of hard-coded value of 2.
17304 (nsfont_draw): Call ns_draw_text_decoration instead.
17305
17306 * nsterm.h: Add declaration for ns_draw_text_decoration.
17307
17308 * nsterm.m (ns_draw_text_decoration): New function for drawing
17309 underline, overline, and strike-through.
17310 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17311 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17312 accommodate underlining, etc.
4843aac3 17313
4cc60b9b
EZ
173142011-07-28 Eli Zaretskii <eliz@gnu.org>
17315
bc7ece87
EZ
17316 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17317 default.
4cc60b9b 17318
476371c4
PE
173192011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17320
66606eea
PE
17321 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17322 Without this fix, if a signal arrives just after memory fills up,
17323 'malloc' might be invoked reentrantly.
17324
476371c4
PE
17325 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17326 In other words, assume that every image size is allowed, on non-X
17327 hosts. This assumption is probably wrong, but it lets Emacs compile.
17328
f3fcc40d
AS
173292011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17330
17331 * regex.c (re_iswctype): Convert return values to boolean.
17332
350c992f
EZ
173332011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17334
17335 * xdisp.c (compute_display_string_pos): Don't use cached display
17336 string position if the buffer had its restriction changed.
17337 (Bug#9184)
17338
5266b4bb
PE
173392011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17340
17341 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17342
2573a837 173432011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17344
41f55ccd 17345 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17346
39e378da
PE
17347 * bidi.c: Integer size and overflow fixes.
17348 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17349 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17350 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17351 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17352 (bidi_find_other_level_edge):
17353 Use ptrdiff_t instead of EMACS_INT where either will do.
17354 This works better on 32-bit hosts configured --with-wide-int.
17355 (bidi_cache_ensure_space): Check for size-calculation overflow.
17356 Use % rather than repeated addition, for better worst-case speed.
17357 Don't set bidi_cache_size until after xrealloc returns, because it
17358 might not return.
17359 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17360 (bidi_cache_ensure_space): Also check that the bidi cache size
17361 does not exceed that of the largest Lisp string or buffer. See Eli
17362 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17363
5e927815
PE
17364 * alloc.c (__malloc_size_t): Remove.
17365 All uses replaced by size_t. See Andreas Schwab's note
17366 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17367
ca4aa935
PE
17368 * image.c: Improve checking for integer overflow.
17369 (check_image_size): Assume that f is nonnull, since
17370 it is always nonnull in practice. This is one less thing to
17371 worry about when checking for integer overflow later.
17372 (x_check_image_size): New function, which checks for integer
17373 overflow issues inside X.
17374 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17375 This removes the need for a memory_full check.
17376 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17377 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17378 (xbm_read_bitmap_data): Change locals back to 'int', since
17379 their values must fit in 'int'.
17380 (xpm_load_image, png_load, tiff_load):
17381 Invoke x_create_x_image_and_pixmap earlier,
17382 to avoid much needless work if the image is too large.
17383 (tiff_load): Treat overly large images as if
17384 x_create_x_image_and_pixmap failed, not as malloc failures.
17385 (gs_load): Use x_check_image_size.
17386
5f8f9cc2
PE
17387 * gtkutil.c: Omit integer casts.
17388 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17389 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17390
5adf60bc
PE
17391 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17392
c8907a93
PE
17393 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17394 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17395 would wrongly return t on a 64-bit host.
17396
e3c25c68
PE
17397 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17398 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17399 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17400 and therefore cause GCC to emit a bogus diagnostic in some cases.
17401
3f791afe
PE
17402 * image.c: Integer signedness and overflow and related fixes.
17403 This is not an exhaustive set of fixes, but it's time to
17404 record what I've got.
17405 (lookup_pixel_color, check_image_size): Remove redundant decls.
17406 (check_image_size): Don't assume that arbitrary EMACS_INT values
17407 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17408 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17409 (tiff_load, imagemagick_load_image):
17410 Check for overflow in size calculations.
17411 (x_create_x_image_and_pixmap): Remove unnecessary test for
17412 xmalloc returning NULL; that can't happen.
17413 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17414 (xpm_color_bucket): Use better integer hashing function.
17415 (xpm_cache_color): Don't possibly over-allocate memory.
17416 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17417 (gif_memory_source):
17418 Use ptrdiff_t, not int or size_t, to record sizes.
17419 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17420 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17421 either works, as we prefer signed integers.
17422 (tiff_read_from_memory, tiff_write_from_memory):
17423 Return tsize_t, not size_t, since that's what the TIFF API wants.
17424 (tiff_read_from_memory): Don't fail simply because the read would
17425 go past EOF; instead, return a short read.
17426 (tiff_load): Omit no-longer-needed casts.
17427 (Fimagemagick_types): Don't assume size fits into 'int'.
17428
3cc5a532
PE
17429 Improve hashing quality when configured --with-wide-int.
17430 * fns.c (hash_string): New function, taken from sxhash_string.
17431 Do not discard information about ASCII character case; this
17432 discarding is no longer needed.
17433 (sxhash-string): Use it. Change sig to match it. Caller changed.
17434 * lisp.h: Declare it.
17435 * lread.c (hash_string): Remove, since we now use fns.c's version.
17436 The fns.c version returns a wider integer if --with-wide-int is
17437 specified, so this should help the quality of the hashing a bit.
17438
b312a492
PE
17439 * emacs.c: Integer overflow minor fix.
17440 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17441 Define only if GNU_LINUX.
17442 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17443
dfd153ae
PE
17444 * dispnew.c: Integer signedness and overflow fixes.
17445 Remove unnecessary forward decls, that were a maintenance hassle.
17446 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17447 All uses changed.
17448 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17449 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17450 (prepare_desired_row, line_draw_cost):
17451 Use int, not unsigned, where either works.
17452 (save_current_matrix, restore_current_matrix):
17453 Use ptrdiff_t, not size_t, where either works.
17454 (init_display): Check for overflow more accurately, and without
17455 relying on undefined behavior.
17456
a81d11a3
PE
17457 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17458 Remove, replacing with the new symbols in lisp.h. All uses changed.
17459 * fileio.c (make_temp_name):
17460 * filelock.c (lock_file_1, lock_file):
17461 * xdisp.c (message_dolog):
17462 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17463 Use pMd etc. instead.
17464 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17465 replacing the pWIDE etc. symbols removed from editfns.c.
17466
3300e6fd
PE
17467 * keyboard.h (num_input_events): Now uintmax_t.
17468 This is (very slightly) less likely to mess up due to wraparound.
17469 All uses changed.
17470
fd05c7e9
PE
17471 * buffer.c: Integer signedness fixes.
17472 (alloc_buffer_text, enlarge_buffer_text):
17473 Use ptrdiff_t rather than size_t when either will do, as we prefer
17474 signed integers.
17475
903fe15d
PE
17476 * alloc.c: Integer signedness and overflow fixes.
17477 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17478 (__malloc_size_t): Default to size_t, not to int.
17479 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17480 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17481 Prefer ptrdiff_t to size_t when either would do, as we prefer
17482 signed integers.
17483 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17484 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17485 Now const. Initialize with values that are in range even if char
17486 is signed.
17487 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17488 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17489 These functions do the right thing with sizes > 2**32.
17490 (check_depth): Now ptrdiff_t, not int.
17491 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17492 Adjust to new way of storing sizes. Check for size overflow bugs
17493 in rest of code.
17494 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17495 slightly wrong anyway, as it missed one instance of
17496 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17497 (refill_memory_reserve): Omit needless cast to size_t.
17498 (mark_object_loop_halt): Mark as externally visible.
17499
ac82cc6a
PE
17500 * xselect.c: Integer signedness and overflow fixes.
17501 (Fx_register_dnd_atom, x_handle_dnd_message):
17502 Use ptrdiff_t, not size_t, since we prefer signed.
17503 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17504 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17505 x_dnd_atoms_size and x_dnd_atoms_length.
17506
c2d1e36d
PE
17507 * doprnt.c: Prefer signed to unsigned when either works.
17508 * eval.c (verror):
17509 * doprnt.c (doprnt):
17510 * lisp.h (doprnt):
17511 * xdisp.c (vmessage):
17512 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17513 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17514 prefer signed arithmetic to avoid comparison confusion.
17515 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17516 but is a bit tricky.
17517
0e926e56
PE
17518 Assume freestanding C89 headers, string.h, stdlib.h.
17519 * data.c, doprnt.c, floatfns.c, print.c:
17520 Include float.h unconditionally.
17521 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17522 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17523 * regex.c: Likewise for stddef.h, string.h.
17524 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17525 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17526 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17527 (STDC_HEADERS): Remove obsolete defines.
17528 * sysdep.c: Include limits.h unconditionally.
17529
9cfdb3ec
PE
17530 Assume support for memcmp, memcpy, memmove, memset.
17531 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17532 * regex.c (memcmp, memcpy):
17533 Remove; we assume C89 now.
17534
17535 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17536 (__malloc_safe_bcopy): Remove; no longer needed.
17537
cf950e6b 17538 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17539 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17540 well either way, and we prefer signed to unsigned.
17541
dbf38e02
LMI
175422011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17543
17544 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17545 closes the connection while we're reading (bug#9182).
17546
d6f0886c 175472011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17548
d6f0886c
JD
17549 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17550 are specified (Bug#9168).
24e0f6b1 17551
2eb1f9e6
PE
175522011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17553
17554 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17555 Found by GCC static checking and --with-wide-int on a 32-bit host.
17556
22381272 175572011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17558
17559 * xdisp.c (compute_display_string_pos): Fix logic of caching
17560 previous display string position. Initialize cached_prev_pos to
17561 -1. Fixes slow-down at the beginning of a buffer.
17562
f25e39b4
EZ
175632011-07-24 Eli Zaretskii <eliz@gnu.org>
17564
17565 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17566 for attrs[LFACE_FONTSET_INDEX].
17567
04c4b52e
PE
175682011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17569
17570 * xml.c (parse_region): Remove unused local
17571 that was recently introduced.
17572
c1734fbd
EZ
175732011-07-23 Eli Zaretskii <eliz@gnu.org>
17574
be18c5a5
EZ
17575 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17576 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17577
c1734fbd
EZ
17578 * xdisp.c (move_it_in_display_line_to): Record the best matching
17579 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
17580 exit if none of the characters scanned was an exact match.
17581 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
17582 when exact match is impossible due to invisible text, and the
17583 lines are truncated.
17584
a258d627
JD
175852011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17586
17587 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17588 for OSX >= 10.7.
17589
b6d5a689
EZ
175902011-07-22 Eli Zaretskii <eliz@gnu.org>
17591
0f74f785
EZ
17592 Fix a significant slow-down of cursor motion with C-n, C-p,
17593 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17594 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 17595 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
17596 (next_element_from_buffer): Call compute_stop_pos_backwards to
17597 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
17598 base_level_stop.
17599 (reseat): Don't look for prev_stop, as that could mean a very long
17600 run.
17601 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17602 <cached_disp_overlay_modiff>: Cache for last found display string
17603 position.
551918c1 17604 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
17605 about the same buffer in the same area of character positions, and
17606 the buffer wasn't changed since the time the display string
17607 position was cached.
551918c1 17608
b2d0c91a
EZ
176092011-07-22 Eli Zaretskii <eliz@gnu.org>
17610
17611 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17612 is an integer, which is important for empty lines. (Bug#9149)
17613
043604ee
CY
176142011-07-22 Chong Yidong <cyd@stupidchicken.com>
17615
17616 * frame.c (Fmodify_frame_parameters): In tty case, update the
17617 default face if necessary (Bug#4238).
17618
da4adb04
CY
176192011-07-21 Chong Yidong <cyd@stupidchicken.com>
17620
17621 * editfns.c (Fstring_to_char): No need to explain what a character
17622 is in the docstring (Bug#6576).
17623
9abd0532
LMI
176242011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17625
17626 * xml.c (parse_region): Make sure we always return a tree.
17627
36881d16
HK
176282011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17629
17630 * xml.c (parse_region): If a document contains only comments,
17631 return that, too.
17632
1e98674d
LMI
176332011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17634
17635 * xml.c (make_dom): Return comments, too.
17636
590bd467
PE
176372011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17638
17639 Port to OpenBSD.
17640 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17641 and the surrounding thread.
17642 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17643 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17644 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17645 timer goes off.
17646 * s/openbsd.h (BROKEN_SIGIO): Define.
17647 * unexelf.c (unexec) [__OpenBSD__]:
17648 Don't update the .mdebug section of the Alpha COFF symbol table.
17649
f41628b2
LMI
176502011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17651
17652 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17653 (bug#8460).
17654
b59b67c5
PE
176552011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17656
15e3a074
PE
17657 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17658 This fixes some race conditions on the permissions of any newly
17659 created file.
17660
41bed37d
PE
17661 * alloc.c (valid_pointer_p): Use pipe, not open.
17662 This fixes some permissions issues when debugging.
17663
b59b67c5
PE
17664 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17665 If fchown fails to set both uid and gid, try to set just gid,
17666 as that is sometimes allowed. Adjust the file's mode to eliminate
17667 setuid or setgid bits that are inappropriate if fchown fails.
17668
925a6be7
SM
176692011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17670
17671 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17672 to compare Lisp_Objects.
17673 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17674 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17675 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17676
52968808
AS
176772011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17678
0a6a104b
AS
17679 * lread.c (read_integer): Unread even EOF character.
17680 (read1): Likewise. Properly record start position of symbol.
17681
52968808
AS
17682 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17683 symbol character follows.
17684
9e381cdd
PE
176852011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17686
17687 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17688 This works around a problem with the previous change to Fcopy_file.
17689 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17690 and without this change, GCC might complain about discarding
17691 fchown's return value.
17692
b5641435
JB
176932011-07-16 Juanma Barranquero <lekktu@gmail.com>
17694
17695 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17696
a8031457
PE
176972011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17698
17699 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17700
dd889327
LMI
177012011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17702
750c33f7
LMI
17703 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17704 it's used from the C level.
17705
dd889327
LMI
17706 * process.c: Use the same condition for POLL_FOR_INPUT in both
17707 keyboard.c and process.c (bug#1858).
17708
87e86684
LM
177092011-07-09 Lawrence Mitchell <wence@gmx.li>
17710
17711 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17712 (Fgnutls_boot): Use it.
17713
64348f40
AS
177142011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17715
17716 * doc.c (Fsubstitute_command_keys): Revert last change.
17717
1d698799
LMI
177182011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17719
f863868c
LMI
17720 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17721 quotes the next character, and doesn't affect other longer
17722 sequences (bug#8935).
17723
1d698799
LMI
17724 * lread.c (syms_of_lread): Clarify that is isn't only
17725 `eval-buffer' and `eval-defun' that's affected by
17726 `lexical-binding' (bug#8460).
17727
aa4b6df6
EZ
177282011-07-15 Eli Zaretskii <eliz@gnu.org>
17729
17730 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 17731 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 17732
5d856da6
PE
177332011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17734
ad6042bb
PE
17735 Fix minor problems found by static checking.
17736 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17737 (elsz): Now a signed constant, not a size_t var. We prefer signed
17738 types to unsigned, to avoid integer comparison confusion. Without
17739 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17740 "cannot optimize loop, the loop counter may overflow", a symptom
17741 of the confusion.
f00bbb22 17742 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
17743 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17744
6468f31c
LMI
177452011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17746
49080b10
LMI
17747 * search.c (Fre_search_backward): Mention `case-fold-search' in
17748 all the re_search_* functions (bug#8138).
17749
6468f31c
LMI
17750 * keyboard.c (Fopen_dribble_file): Document when the file is
17751 closed (bug#8056).
17752
c965adc5
EZ
177532011-07-14 Eli Zaretskii <eliz@gnu.org>
17754
df9733bf
EZ
17755 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17756 bidi_cache_idx.
17757
0bb23927
EZ
17758 Support bidi reordering of display and overlay strings.
17759 * xdisp.c (compute_display_string_pos)
17760 (compute_display_string_end): Accept additional argument STRING.
17761 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17762 (reseat_to_string): Initialize bidi_it->string.s and
17763 bidi_it->string.schars.
17764 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
17765 NULL (avoids a crash in bidi_paragraph_init).
17766 Initialize itb.string.lstring.
0bb23927
EZ
17767 (init_iterator): Call bidi_init_it only of a valid
17768 buffer position was specified. Initialize paragraph_embedding to
17769 L2R.
17770 (reseat_to_string): Initialize the bidi iterator.
17771 (display_string): If we need to ignore text properties of
17772 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17773 original value of -1 will not work with bidi.)
17774 (compute_display_string_pos): First arg is now struct
17775 `text_pos *'; all callers changed. Support display properties on
17776 Lisp strings.
17777 (compute_display_string_end): Support display properties on Lisp
17778 strings.
17779 (init_iterator, reseat_1, reseat_to_string): Initialize the
17780 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17781 when iterating on a string not from display properties).
640c8776
SM
17782 (compute_display_string_pos, compute_display_string_end):
17783 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
17784 arrow keys.
17785 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
17786 base_level_stop; instead, set base_level_stop to BEGV.
17787 Fixes crashes in vertical-motion.
0bb23927
EZ
17788 (next_element_from_buffer): Improve commentary for when
17789 the iterator is before prev_stop.
17790 (init_iterator): Initialize bidi_p from the default value of
17791 bidi-display-reordering, not from buffer-local value. Use the
17792 buffer-local value only if initializing for buffer iteration.
17793 (handle_invisible_prop): Support invisible properties on strings
17794 that are being bidi-reordered.
17795 (set_iterator_to_next): Support bidi reordering of C strings and
17796 Lisp strings.
17797 (next_element_from_string): Support bidi reordering of Lisp
17798 strings.
17799 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
17800 (display_string): Support display of R2L glyph rows.
17801 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
17802 (init_iterator): Don't initialize it->bidi_p for strings
17803 here.
17804 (reseat_to_string): Initialize it->bidi_p for strings here.
17805 (next_element_from_string, next_element_from_c_string)
17806 (next_element_from_buffer): Add xassert's for correspondence
17807 between IT's object being iterated and it->bidi_it.string
17808 structure.
17809 (face_before_or_after_it_pos): Support bidi iteration.
17810 (next_element_from_c_string): Handle the case of the first string
17811 character that is not the first one in the visual order.
17812 (get_visually_first_element): New function, refactored from common
17813 parts of next_element_from_buffer, next_element_from_string, and
17814 next_element_from_c_string.
17815 (tool_bar_lines_needed, redisplay_tool_bar)
17816 (display_menu_bar): Force left-to-right direction. Add a FIXME
17817 comment for making that be controlled by a user option.
17818 (push_it, pop_it): Save and restore the state of the
17819 bidi iterator. Save and restore the bidi_p flag.
17820 (pop_it): Iterate out of display property for string iteration as
17821 well.
17822 (iterate_out_of_display_property): Support iteration over strings.
17823 (handle_single_display_spec): Set up it->bidi_it for iteration
17824 over a display string, and call bidi_init_it.
17825 (handle_single_display_spec, next_overlay_string)
17826 (get_overlay_strings_1, push_display_prop): Set up the bidi
17827 iterator for displaying display or overlay strings.
17828 (forward_to_next_line_start): Don't use the shortcut if
17829 bidi-iterating.
17830 (back_to_previous_visible_line_start): If handle_display_prop
17831 pushed the iterator stack, restore the internal state of the bidi
17832 iterator by calling bidi_pop_it same number of times.
17833 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17834 and we are bidi-iterating, don't decrement the iterator position;
17835 instead, set the first_elt flag in the bidi iterator, to produce
17836 the same effect.
17837 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17838 (push_display_prop): xassert that we are iterating a buffer.
17839 (push_it, pop_it): Save and restore paragraph_embedding member.
17840 (handle_single_display_spec, next_overlay_string)
17841 (get_overlay_strings_1, reseat_1, reseat_to_string)
17842 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17843 correctly. Don't assume unibyte strings are not bidi-reordered.
17844 (compute_display_string_pos)
17845 (compute_display_string_end): Fix handling the case of C string.
17846 (push_it, pop_it): Save and restore from_disp_prop_p.
17847 (handle_single_display_spec, push_display_prop): Set the
17848 from_disp_prop_p flag.
17849 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17850 (pop_it): Call iterate_out_of_display_property only if we are
17851 popping after iteration over a string that came from a display
17852 property. Fix a typo in popping stretch info. Add an assertion
17853 for verifying that the iterator position is in sync with the bidi
17854 iterator.
17855 (handle_single_display_spec, get_overlay_strings_1)
17856 (push_display_prop): Fix initialization of paragraph direction for
17857 string when that of the parent object is not yet determined.
17858 (reseat_1): Call bidi_init_it to resync the bidi
17859 iterator with IT's position. (Bug#7616)
17860 (find_row_edges): If ROW->start.pos gives position
17861 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17862 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17863 Reset the from_disp_prop_p flag.
17864 (SAVE_IT, RESTORE_IT): New macros.
17865 (pos_visible_p, face_before_or_after_it_pos)
17866 (back_to_previous_visible_line_start)
17867 (move_it_in_display_line_to, move_it_in_display_line)
17868 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17869 (try_scrolling, redisplay_window, display_line): Use them when
17870 saving a temporary copy of the iterator and restoring it back.
17871 (back_to_previous_visible_line_start, reseat_1)
17872 (init_iterator): Empty the bidi cache "stack".
17873 (move_it_in_display_line_to): If iterator ended up at
17874 EOL, but we never saw any buffer positions smaller than
17875 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17876 motion in bidi-reordered lines.
17877 (move_it_in_display_line_to): Record prev_method and prev_pos
17878 immediately before the call to set_iterator_to_next. Fixes cursor
17879 motion in bidi-reordered lines with stretch glyphs and strings
17880 displayed in margins. (Bug#8133) (Bug#8867)
17881 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17882 TO_CHARPOS.
640c8776
SM
17883 (pos_visible_p): Support positions in bidi-reordered lines.
17884 Save and restore bidi cache.
0bb23927
EZ
17885
17886 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17887 (bidi_paragraph_info): Delete unused struct.
17888 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17889 (bidi_cache_start): New variable.
17890 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17891 to zero.
17892 (bidi_cache_fetch_state, bidi_cache_search)
17893 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17894 (bidi_cache_find, bidi_peek_at_next_level)
17895 (bidi_level_of_next_char, bidi_find_other_level_edge)
17896 (bidi_move_to_visually_next): Compare cache index with
17897 bidi_cache_start rather than with zero.
17898 (bidi_fetch_char): Accept new argument STRING; all callers
17899 changed. Support iteration over a string. Support strings with
17900 display properties. Support unibyte strings. Fix the type of
17901 `len' according to what STRING_CHAR_AND_LENGTH expects.
17902 (bidi_paragraph_init, bidi_resolve_explicit_1)
17903 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
17904 (bidi_level_of_next_char, bidi_move_to_visually_next):
17905 Support iteration over a string.
0bb23927
EZ
17906 (bidi_set_sor_type, bidi_resolve_explicit_1)
17907 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17908 can now be zero (for strings); special values 0 and -1 were
17909 changed to -1 and -2, respectively.
17910 (bidi_char_at_pos): New function.
17911 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17912 Call it instead of FETCH_MULTIBYTE_CHAR.
17913 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17914 initialized to valid values.
17915 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17916 values.
17917 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17918 the test for valid cached positions. Fix the logic for looking up
17919 the sentinel state in the cache. GCPRO the Lisp string we are
17920 iterating.
17921 (bidi_push_it, bidi_pop_it): New functions.
17922 (bidi_initialize): Initialize the bidi cache start stack pointer.
17923 (bidi_cache_ensure_space): New function, refactored from part of
17924 bidi_cache_iterator_state. Don't assume the required size is just
17925 one BIDI_CACHE_CHUNK away.
17926 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17927 (bidi_count_bytes, bidi_char_at_pos): New functions.
17928 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17929 always valid if bidi_cache_idx is valid.
17930 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17931 is valid if it's going to be used.
17932 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17933 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
17934 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17935 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
17936 (bidi_find_other_level_edge, bidi_cache_start_stack):
17937 All variables related to cache indices are now EMACS_INT.
c965adc5 17938
0bb23927
EZ
17939 * dispextern.h (struct bidi_string_data): New structure.
17940 (struct bidi_it): New member `string'. Make flag members be 1-bit
17941 fields, and put them last in the struct.
640c8776
SM
17942 (compute_display_string_pos, compute_display_string_end):
17943 Update prototypes.
0bb23927
EZ
17944 (bidi_push_it, bidi_pop_it): Add prototypes.
17945 (struct iterator_stack_entry): New members bidi_p,
17946 paragraph_embedding, and from_disp_prop_p.
17947 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17948 (bidi_shelve_cache, bidi_unshelve_cache):
17949 Declare prototypes.
0bb23927
EZ
17950
17951 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17952 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17953 and vector-like objects.
17954
17955 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17956 cache around display iteration.
17957
17958 * window.c (Fwindow_end, window_scroll_pixel_based)
17959 (displayed_window_lines, Frecenter): Save and restore the bidi
17960 cache around display iteration.
17961
3bbd2265
LMI
179622011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17963
17964 * editfns.c (Fdelete_region): Clarify the use of the named
17965 parameters (bug#6788).
17966
adc47434
MR
179672011-07-14 Martin Rudalics <rudalics@gmx.at>
17968
17969 * indent.c (Fvertical_motion): Set and restore w->pointm when
17970 saving and restoring the window's buffer (Bug#9006).
17971
837c31f8
LMI
179722011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17973
17974 * editfns.c (Fstring_to_char): Clarify just what is returned
17975 (bug#6576). Text by Eli Zaretskii.
17976
ac389d0c
JB
179772011-07-13 Juanma Barranquero <lekktu@gmail.com>
17978
17979 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17980
0be0ce47
EZ
179812011-07-13 Eli Zaretskii <eliz@gnu.org>
17982
17983 * buffer.c (mmap_find): Fix a typo.
17984
cd18e7e3
JB
179852011-07-13 Johan Bockgård <bojohan@gnu.org>
17986
17987 Fix execution of x selection hooks.
17988 * xselect.c (Qx_lost_selection_functions)
17989 (Qx_sent_selection_functions): New vars.
17990 (syms_of_xselect): DEFSYM them.
17991 (x_handle_selection_request): Pass Qx_sent_selection_functions
17992 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17993 (x_handle_selection_clear,x_clear_frame_selections):
17994 Pass Qx_lost_selection_functions rather than
17995 Vx_lost_selection_functions to Frun_hook_with_args.
17996
47ea7f44
PE
179972011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17998
ac389d0c 17999 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18000 The old code sometimes used this field without initializing it.
18001
47ea7f44
PE
18002 * alloc.c (gc_sweep): Don't read past end of array.
18003 In theory, the old code could also have corrupted Emacs internals,
18004 though it'd be very unlikely.
18005
bc985c87
AS
180062011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18007
18008 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18009 argument. (Bug#4026)
bc985c87 18010
0cf34688
LMI
180112011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18012
b3dadd76
LMI
18013 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18014 key" (bug#4257).
18015
0cf34688
LMI
18016 * window.c (Fset_window_start): Doc fix (bug#4199).
18017 (Fset_window_hscroll): Ditto.
18018
270768cd
PE
180192011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18020
077e3dda 18021 Fix minor new problems caught by GCC 4.6.1.
270768cd 18022 * term.c (init_tty): Remove unused local.
490011a6 18023 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18024 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18025 not used otherwise.
270768cd 18026
b1f58454
CY
180272011-07-12 Chong Yidong <cyd@stupidchicken.com>
18028
18029 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18030
22b9578d
LMI
180312011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18032
6e70ab07
LMI
18033 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18034 are the mini-buffer and the echo area (bug#3320).
18035
22b9578d
LMI
18036 * term.c (init_tty): Remove support for supdup, c10 and perq
18037 terminals, which are no longer supported (bug#1482).
18038
8974cc9f
JB
180392011-07-10 Johan Bockgård <bojohan@gnu.org>
18040
18041 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18042
a560d974
JD
180432011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18044
18045 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18046 for non-popups (Bug#3642).
18047
1dae0f0a
AS
180482011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18049
268c2c36 18050 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18051 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18052 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18053 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18054 * data.c (fmod): Likewise.
18055 * dispnew.c (swap_glyphs_in_rows): Likewise.
18056 * emacs.c (memory_warning_signal): Likewise.
18057 * floatfns.c (float_error): Likewise.
18058 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18059 (otf_open, font_otf_capability, generate_otf_features)
18060 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18061 Likewise.
18062 * image.c (pbm_read_file): Likewise.
18063 * indent.c (string_display_width): Likewise.
18064 * intervals.c (check_for_interval, search_for_interval)
18065 (inc_interval_count, count_intervals, root_interval)
18066 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18067 * lread.c (defalias): Likewise.
268c2c36 18068 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18069 * regex.c (set_image_of_range_1, set_image_of_range)
18070 (regex_grow_registers): Likewise.
18071 * sysdep.c (strerror): Likewise.
18072 * termcap.c (valid_filename_p, tprint, main): Likewise.
18073 * tparam.c (main): Likewise.
18074 * unexhp9k800.c (run_time_remap, save_data_space)
18075 (update_file_ptrs, read_header, write_header, calculate_checksum)
18076 (copy_file, copy_rest, display_header): Likewise.
18077 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18078 Likewise.
18079 * xdisp.c (check_it): Likewise.
18080 * xfaces.c (register_color, unregister_color, unregister_colors):
18081 Likewise.
18082 * xfns.c (print_fontset_result): Likewise.
18083 * xrdb.c (member, fatal, main): Likewise.
18084
99033785
PE
180852011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18086
18087 Fix minor problems found by static checking (Bug#9031).
18088 * chartab.c (char_table_set_range, map_sub_char_table):
18089 Remove unused locals.
18090 (uniprop_table): Now static.
18091 * composite.c (_work_char): Remove unused static var.
18092
9cb2ac56
JB
180932011-07-09 Juanma Barranquero <lekktu@gmail.com>
18094
18095 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18096
f25661f0
JD
180972011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18098
18099 * gtkutil.c (qttip_cb): Remove code without function.
18100
8278c4fe
EZ
181012011-07-09 Eli Zaretskii <eliz@gnu.org>
18102
18103 * w32.c (pthread_sigmask): New stub.
18104
1692ae2d 181052011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18106
8a6ebd58 18107 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18108 sigprocmask is portable only for single-threaded applications, and
18109 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18110 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18111 (LIBES): Use it.
18112 * callproc.c (Fcall_process):
18113 * process.c (create_process):
18114 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18115 Use pthread_sigmask, not sigprocmask.
123403e4 18116
1b854618
JD
181172011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18118
18119 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18120 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18121 wrong (Bug#8591).
18122
3fe4b549
JD
181232011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18124
0ce7e563
JD
18125 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18126 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18127 (xg_hide_tooltip): Fix comment.
18128
3fe4b549
JD
18129 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18130 in registerServicesMenuSendTypes.
18131 (validRequestorForSendType): Don't check ns_return_types.
18132
18133 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18134 ns_return_type.
18135
5df75e47
JR
181362011-07-08 Jason Rumney <jasonr@gnu.org>
18137
22610910
JR
18138 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18139 SH_SHOW for hidden windows (Bug#5482).
18140
5df75e47
JR
18141 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18142 frame struct members of non-existent frames (Bug#6284).
18143
699c10bd
JD
181442011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18145
4393663b
JD
18146 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18147 variable firstTime not needed on OSX >= 10.6.
18148 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18149 >= 10.5. Use setKnobProportion, setDoubleValue.
18150
18151 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18152 (MAC_OS_X_VERSION_10_5): Define if not defined.
18153 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18154 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18155 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18156
18157 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18158 cString and lossyCString on OSX >= 10.4.
4393663b 18159
58179cce 18160 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18161 sizeToFit on OSX >= 10.2.
18162
18163 * nsimage.m (allocInitFromFile): Don't use deprecated method
18164 bestRepresentationForDevice on OSX >= 10.6.
18165
18166 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18167 to avoid warning.
18168
18169 * emacs.c: Declare unexec_init_emacs_zone.
18170
a63e0781
JD
18171 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18172
699c10bd
JD
18173 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18174
18175 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18176 on svcsMenu (Bug#8842).
18177
18178 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18179 ns_return_types.
18180 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18181
18182 * nsterm.m (QUTF8_STRING): Declare.
18183 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18184 (validRequestorForSendType): Return type is (id).
18185 Change indexOfObjectIdenticalTo to indexOfObject.
18186 Check if we have local selection before returning self (Bug#8842).
18187 (writeSelectionToPasteboard): Put local selection into paste board
18188 if we have a local selection (Bug#8842).
18189 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18190
18191 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18192 (ns_get_local_selection): Declare.
18193
54e10184
LMI
181942011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18195
9888ff71
LMI
18196 * keymap.c (describe_map_tree): Don't insert a double newline at
18197 the end of the buffer (bug#1169) and return whether we inserted
18198 something.
18199
54e10184
LMI
18200 * callint.c (Fcall_interactively): Change "reading args" to
18201 "providing args" to try to clarify what it does (bug#1010).
18202
15fa4783
KH
182032011-07-07 Kenichi Handa <handa@m17n.org>
18204
18205 * composite.c (composition_compute_stop_pos): Ignore a static
18206 composition starting before CHARPOS (Bug#8915).
18207
18208 * xdisp.c (handle_composition_prop): Likewise.
18209
a8815b00
EZ
182102011-07-07 Eli Zaretskii <eliz@gnu.org>
18211
18212 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18213 (Bug#9015)
18214
ef7b981d 182152011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18216
18217 * character.h (unicode_category_t): New enum type.
18218
18219 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18220 (Qchar_code_property_table): New variable.
18221 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18222 (UNIPROP_COMPRESSED_FORM_P): New macros.
18223 (char_table_ascii): Uncompress the compressed values.
18224 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18225 Uncompress the compressed values.
ac389d0c 18226 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18227 (char_table_ref_and_range): Uncompress the compressed values.
18228 (sub_char_table_set): New arg is_uniprop. Callers changed.
18229 Uncompress the compressed values.
18230 (sub_char_table_set_range): Args changed. Callers changed.
18231 (char_table_set_range): Adjuted for the above change.
18232 (map_sub_char_table): Delete args default_val and parent. Add arg
18233 top. Give decoded values to a Lisp function.
640c8776 18234 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18235 values to a Lisp function. Gcpro more variables.
18236 (uniprop_table_uncompress)
18237 (uniprop_decode_value_run_length): New functions.
18238 (uniprop_decoder, uniprop_decoder_count): New variables.
18239 (uniprop_get_decoder, uniprop_encode_value_character)
18240 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18241 New functions.
18242 (uniprop_encoder, uniprop_encoder_count): New variables.
18243 (uniprop_get_encoder, uniprop_table)
18244 (Funicode_property_table_internal, Fget_unicode_property_internal)
18245 (Fput_unicode_property_internal): New functions.
18246 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18247 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18248 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18249 char-code-property-alist.
18250
640c8776 18251 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18252 Vunicode_category_table.
18253
640c8776 18254 * font.c (font_range): Adjust for the change of
c805dec0
KH
18255 Vunicode_category_table.
18256
76b397fb
DN
182572011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18258
18259 * m/iris4d.h: Remove file, move contents ...
18260 * s/irix6-5.h: ... here.
18261
22b4128e
PE
182622011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18263
18264 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18265 * alloc.c (mark_buffer):
18266 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18267 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18268 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18269 This isn't true in general, and it's particularly not true
18270 if Emacs is configured with --with-wide-int.
18271 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18272 New macros, used in the buffer.c change.
18273
869795d6
JD
182742011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18275
18276 * xsettings.c: Use both GConf and GSettings if both are available.
18277 (store_config_changed_event): Add comment.
18278 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18279 (store_tool_bar_style_changed): New functions.
5e617bc2 18280 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18281 (struct xsettings): Move font inside HAVE_XFT.
18282 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18283 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18284 Move inside HAVE_XFT.
640c8776 18285 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18286 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18287 also.
18288 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18289 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18290 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18291 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18292 (parse_settings): Move check for font inside HAVE_XFT.
18293 (read_settings, apply_xft_settings): Add comment.
18294 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18295 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18296 call store_font_name_changed.
18297 (xft_settings_event): Add comment.
18298 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18299 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18300 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18301 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18302 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18303 (xsettings_get_system_font, xsettings_get_system_normal_font):
18304 Add comment.
869795d6 18305
d8ed26bd
PE
183062011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18307
18308 Random fixes. E.g., (random) never returned negative values.
18309 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18310 subseconds part to the entropy, as that's a bit more random.
18311 Prefer signed to unsigned, since the signedness doesn't matter and
18312 in general we prefer signed. When given a limit, use a
18313 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18314 latter isn't right if USE_2_TAGS_FOR_INTS.
18315 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18316 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18317
cabf1cac
SM
183182011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18319
18320 * textprop.c (text_property_stickiness):
18321 Obey Vtext_property_default_nonsticky.
18322 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18323 * w32fns.c (syms_of_w32fns):
18324 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18325
6e9b2be9
PE
183262011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18327
18328 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18329 This is more efficient than Ffile_directory_p and avoids a minor race.
18330
90186c68
LMI
183312011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18332
7c301272
LMI
18333 * buffer.c (Foverlay_put): Say what the return value is
18334 (bug#7835).
18335
c4f2d8d4
LMI
18336 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18337 is a directory before asking whether to use the file name
18338 (bug#7564).
ad637907
LMI
18339 (barf_or_query_if_file_exists): Make the "File is a directory"
18340 error be more correct.
c4f2d8d4 18341
90186c68
LMI
18342 * fns.c (Frequire): Remove the mention of the .gz files, since
18343 that's installation-specific, but keep the mention of
18344 `get-load-suffixes'.
18345
da64016e
PE
183462011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18347
18348 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18349 Report string overflow if the output is too long.
18350
7d47b580
JB
183512011-07-04 Juanma Barranquero <lekktu@gmail.com>
18352
a555cb87
JB
18353 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18354 (syms_of_gnutls): Remove duplicate DEFSYM for
18355 Qgnutls_bootprop_verify_hostname_error, an error for
18356 Qgnutls_bootprop_verify_error (which is no longer used).
18357
7d47b580
JB
18358 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18359 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18360 Also (re)move comments that are misplaced or no longer relevant.
18361
1e49bfab
LMI
183622011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18363
18364 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18365
1485f4c0
CY
183662011-07-03 Chong Yidong <cyd@stupidchicken.com>
18367
18368 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18369 and background color parameters if they have been changed.
18370
a9ab721e
LMI
183712011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18372
18373 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18374
cf7cff57
PE
183752011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18376
2e13213d
PE
18377 * xsettings.c (SYSTEM_FONT): Define only when used.
18378 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18379
cf7cff57
PE
18380 * keymap.c (access_keymap_1): Now static.
18381
7a8e04f7
CY
183822011-07-02 Chong Yidong <cyd@stupidchicken.com>
18383
18384 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18385 leave any prefix arg for the up event (Bug#1586).
18386
61352f62
LMI
183872011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18388
69bb1ef7
LMI
18389 * lread.c (syms_of_lread): Mention single symbols defined by
18390 `defvar' or `defconst' (bug#7154).
18391
61352f62 18392 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18393 (Frequire): Mention get-load-suffixes.
61352f62 18394
28545e04
MR
183952011-07-02 Martin Rudalics <rudalics@gmx.at>
18396
18397 * window.h (window): Remove clone_number slot.
18398 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18399 Remove.
18400 (make_parent_window, make_window, saved_window)
18401 (Fset_window_configuration, save_window_save): Don't deal with
18402 clone numbers.
18403 * buffer.c (Qclone_number): Remove declaration.
18404 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18405
3349e122
SM
184062011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18407
18408 Add multiple inheritance to keymaps.
18409 * keymap.c (Fmake_composed_keymap): New function.
18410 (Fset_keymap_parent): Simplify.
18411 (fix_submap_inheritance): Remove.
18412 (access_keymap_1): New function extracted from access_keymap to handle
18413 embedded parents and handle lists of maps.
18414 (access_keymap): Use it.
18415 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18416 (Fcopy_keymap): Handle embedded parents.
18417 (Fcommand_remapping, define_as_prefix): Simplify.
18418 (Fkey_binding): Simplify.
18419 (syms_of_keymap): Move minibuffer-local-completion-map,
18420 minibuffer-local-filename-completion-map,
18421 minibuffer-local-must-match-map, and
18422 minibuffer-local-filename-must-match-map to Elisp.
18423 (syms_of_keymap): Defsubr make-composed-keymap.
18424 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18425 (parse_menu_item): Trivial simplification.
18426
3279eb87
GM
184272011-07-01 Glenn Morris <rgm@gnu.org>
18428
18429 * Makefile.in (SETTINGS_LIBS): Fix typo.
18430
39cb9e56 184312011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18432
18433 * coding.c (Fencode_coding_string): Record the last coding system
18434 used, as the function doc string says (bug#8738).
18435
0949d2b6
JD
184362011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18437
18438 * xsettings.c (store_monospaced_changed): Take new font as arg and
18439 check for change against current_mono_font.
18440 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18441 (emacs_settings_constructor, emacs_settings_get_property)
18442 (emacs_settings_set_property, emacs_settings_class_init)
18443 (emacs_settings_init, gsettings_obj): Remove.
18444 (something_changedCB): New function for HAVE_GSETTINGS.
18445 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18446 with value as argument.
18447 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18448 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18449 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18450 "changed".
18451
18452 * xgselect.c: Add defined (HAVE_GSETTINGS).
18453 (xgselect_initialize): Ditto.
18454
18455 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18456 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18457 xg_select.
18458
bbc6b304
PE
184592011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18460
18461 * eval.c (struct backtrace): Simplify and port the data structure.
18462 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18463 signed bit field, as this assumption is not portable and it makes
18464 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18465 "char debug_on_exit : 1" as this is not portable either; instead,
18466 use the portable "unsigned int debug_on_exit : 1". Remove unused
18467 member evalargs. Remove obsolete comments about cc bombing out.
18468
9851bfc5
JD
184692011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18470
51bb811f 18471 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18472 Let HAVE_GSETTINGS override HAVE_GCONF.
18473 (store_monospaced_changed): New function.
18474 (EMACS_SETTINGS): A new type derived from GObject to handle
18475 GSettings notifications.
18476 (emacs_settings_constructor, emacs_settings_get_property)
18477 (emacs_settings_set_property, emacs_settings_class_init):
18478 New functions.
18479 (gsettings_client, gsettings_obj): New variables.
18480 (GSETTINGS_SCHEMA): New define.
18481 (something_changedCB): Call store_monospaced_changed.
18482 (init_gsettings): New function.
18483 (xsettings_initialize): Call init_gsettings.
18484 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18485 to NULL.
18486
640c8776 18487 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18488 GCONF_CFLAGS/LIBS.
18489
5386012d
MR
184902011-06-29 Martin Rudalics <rudalics@gmx.at>
18491
18492 * window.c (resize_root_window, grow_mini_window)
18493 (shrink_mini_window): Rename Qresize_root_window to
18494 Qwindow_resize_root_window and Qresize_root_window_vertically to
18495 Qwindow_resize_root_window_vertically.
18496
f13e0b08
PE
184972011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18498
18499 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18500
94515237
JB
185012011-06-27 Juanma Barranquero <lekktu@gmail.com>
18502
18503 * makefile.w32-in: Redesign dependencies so they reflect more
18504 clearly which files are directly included by each source file,
18505 and not through other includes.
18506
e43b6e43
MR
185072011-06-27 Martin Rudalics <rudalics@gmx.at>
18508
18509 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18510 (sort_overlays, overlay_strings): When an overlay's clone number
18511 matches the window's clone number process the overlay even if
18512 the overlay's window property doesn't match the current window.
18513
d68443dc
MR
18514 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18515 (Fwindow_hchild): Rename to Fwindow_left_child.
18516 (Fwindow_next): Rename to Fwindow_next_sibling.
18517 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18518 (resize_window_check): Rename to window_resize_check.
18519 (resize_window_apply): Rename to window_resize_apply.
18520 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18521 (Fdelete_other_windows_internal, resize_frame_windows)
18522 (Fsplit_window_internal, Fdelete_window_internal)
18523 (grow_mini_window, shrink_mini_window)
18524 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18525
c7e73be5
JD
185262011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18527
18528 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18529 (emacs_fixed_set_min_size): Remove.
18530 (emacs_fixed_new): Take frame as argument.
18531
18532 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18533 (_EmacsFixedPrivate): Remove minwidth/height.
18534 Add struct frame *f.
18535 (emacs_fixed_init): Initialize priv->f.
18536 (get_parent_class, emacs_fixed_set_min_size): Remove.
18537 (emacs_fixed_new): Set priv->f to argument.
18538 (emacs_fixed_get_preferred_width)
18539 (emacs_fixed_get_preferred_height): Use min_width/height from
18540 frames size_hint to set minimum and natural (Bug#8919).
18541 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18542 and use min_width/height from frames size_hint to set
18543 min_width/height (Bug#8919).
18544
18545 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18546 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18547 Fix indentation.
c7e73be5 18548
cf99dcf8
EZ
185492011-06-26 Eli Zaretskii <eliz@gnu.org>
18550
18551 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18552 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18553 called at ZV.
18554
029529ac
CY
185552011-06-26 Chong Yidong <cyd@stupidchicken.com>
18556
18557 * process.c (wait_reading_process_output): Bypass select if
18558 waiting for a cell while ignoring keyboard input, and input is
18559 pending. Suggested by Jan Djärv (Bug#8869).
18560
7a7ef429
PE
185612011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18562
18563 Use gnulib's dup2 module instead of rolling our own.
18564 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18565
11fdef7d 185662011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
18567
18568 * dispnew.c (scrolling_window): Before scrolling, turn off a
18569 mouse-highlight in the window being scrolled.
18570
cd3520a4
JB
185712011-06-24 Juanma Barranquero <lekktu@gmail.com>
18572
18573 Move DEFSYM to lisp.h and use everywhere.
18574
18575 * character.h (DEFSYM): Move declaration...
18576 * lisp.h (DEFSYM): ...here.
18577
18578 * gnutls.c:
18579 * minibuf.c:
18580 * w32menu.c:
18581 * w32proc.c:
18582 * w32select.c: Don't include character.h.
18583
18584 * alloc.c (syms_of_alloc):
18585 * buffer.c (syms_of_buffer):
18586 * bytecode.c (syms_of_bytecode):
18587 * callint.c (syms_of_callint):
18588 * casefiddle.c (syms_of_casefiddle):
18589 * casetab.c (init_casetab_once):
18590 * category.c (init_category_once, syms_of_category):
18591 * ccl.c (syms_of_ccl):
18592 * cmds.c (syms_of_cmds):
18593 * composite.c (syms_of_composite):
18594 * dbusbind.c (syms_of_dbusbind):
18595 * dired.c (syms_of_dired):
18596 * dispnew.c (syms_of_display):
18597 * doc.c (syms_of_doc):
18598 * editfns.c (syms_of_editfns):
18599 * emacs.c (syms_of_emacs):
18600 * eval.c (syms_of_eval):
18601 * fileio.c (syms_of_fileio):
18602 * fns.c (syms_of_fns):
18603 * frame.c (syms_of_frame):
18604 * fringe.c (syms_of_fringe):
18605 * insdel.c (syms_of_insdel):
18606 * keymap.c (syms_of_keymap):
18607 * lread.c (init_obarray, syms_of_lread):
18608 * macros.c (syms_of_macros):
18609 * msdos.c (syms_of_msdos):
18610 * print.c (syms_of_print):
18611 * process.c (syms_of_process):
18612 * search.c (syms_of_search):
18613 * sound.c (syms_of_sound):
18614 * syntax.c (init_syntax_once, syms_of_syntax):
18615 * terminal.c (syms_of_terminal):
18616 * textprop.c (syms_of_textprop):
18617 * undo.c (syms_of_undo):
18618 * w32.c (globals_of_w32):
18619 * window.c (syms_of_window):
18620 * xdisp.c (syms_of_xdisp):
18621 * xfaces.c (syms_of_xfaces):
18622 * xfns.c (syms_of_xfns):
18623 * xmenu.c (syms_of_xmenu):
18624 * xsettings.c (syms_of_xsettings):
18625 * xterm.c (syms_of_xterm): Use DEFSYM.
18626
4228cf16
TZ
186272011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18628
cd3520a4 18629 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 18630
7fcccf1e
PE
186312011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18632
7efb4e0e
PE
18633 Integer and buffer overflow fixes (Bug#8873).
18634
ff5844ad
PE
18635 * print.c (printchar, strout): Check for string overflow.
18636 (PRINTPREPARE, printchar, strout):
18637 Don't set size unless allocation succeeds.
18638
90532f02
PE
18639 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18640 for sizes. Check for string overflow more accurately.
18641 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18642
6d84508d
PE
18643 * macros.c: Integer and buffer overflow fixes.
18644 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18645 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18646 Use ptrdiff_t, not int, for sizes.
18647 Don't increment bufsize until after realloc succeeds.
18648 Check for size-calculation overflow.
18649 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18650
437b2cb4
PE
18651 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18652
8b9ac8b4
PE
18653 * lread.c: Integer overflow fixes.
18654 (read_integer): Radix is now EMACS_INT, not int,
18655 to improve quality of diagnostics for out-of-range radices.
18656 Calculate buffer size correctly for out-of-range radices.
18657 (read1): Check for integer overflow in radices, and in
18658 read-circle numbers.
82cb60d3
PE
18659 (read_escape): Avoid int overflow.
18660 (Fload, openp, read_buffer_size, read1)
18661 (substitute_object_recurse, read_vector, read_list, map_obarray):
18662 Use ptrdiff_t, not int, for sizes.
18663 (read1): Use EMACS_INT, not int, for sizes.
20270765 18664 Check for size overflow.
8b9ac8b4 18665
7fcccf1e
PE
18666 * image.c (cache_image): Check for size arithmetic overflow.
18667
bfbbd7e7
PE
18668 * lread.c: Integer overflow issues.
18669 (saved_doc_string_size, saved_doc_string_length)
18670 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18671 Now ptrdiff_t, not int.
18672 (read1): Don't assume doc string length fits in int. Check for
18673 out-of-range doc string lengths.
18674 (read_list): Don't assume file position fits in int.
39019e54 18675 (read_escape): Check for hex character overflow.
bfbbd7e7 18676
4e323265
LL
186772011-06-22 Leo Liu <sdl.web@gmail.com>
18678
18679 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18680 Move to minibuffer.el.
18681
85fece3e
PE
186822011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18683
20b84ce9 18684 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
18685 The following patches are for when GLYPH_DEBUG && !XASSERT.
18686 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18687 * dispnew.c (flush_stdout):
18688 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18689 Mark as externally visible.
18690 * dispnew.c (check_window_matrix_pointers): Now static.
18691 * dispnew.c (window_to_frame_vpos):
18692 * xfns.c (unwind_create_frame):
18693 * xterm.c (x_check_font): Remove unused local.
18694 * scroll.c (CHECK_BOUNDS):
18695 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18696 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18697 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18698 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18699 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18700 Now static.
18701 (debug_method_add): Use va_list and vsprintf rather than relying
18702 on undefined behavior with wrong number of arguments.
18703 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18704 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18705 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18706 since we're not interested in debugging glyphs with old libraries.
18707 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18708 GCC 4.6.0's static checking.
18709
0766b489
PE
187102011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18711
31fd4b32
PE
18712 Integer overflow and signedness fixes (Bug#8873).
18713 A few related buffer overrun fixes, too.
18714
b79e8648
PE
18715 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18716
0766b489
PE
18717 * dispextern.h (struct face.stipple):
18718 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18719 (x_bitmap_mask, x_allocate_bitmap_record)
18720 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18721 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18722 (x_create_bitmap_from_xpm_data):
18723 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18724 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18725 (.bitmaps_last):
18726 * xfaces.c (load_pixmap):
18727 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18728 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18729 (.bitmaps_last, struct x_output.icon_bitmap):
18730 Use ptrdiff_t, not int, for bitmap indexes.
18731 (x_allocate_bitmap_record): Check for size overflow.
18732 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18733
b081724f
PE
18734 Use ptrdiff_t, not int, for overlay counts.
18735 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18736 * editfns.c (overlays_around, get_pos_property):
18737 * textprop.c (get_char_property_and_overlay):
18738 * xdisp.c (next_overlay_change, note_mouse_highlight):
18739 * xfaces.c (face_at_buffer_position):
21514da7
PE
18740 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18741 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18742 (Fnext_overlay_change, Fprevious_overlay_change)
18743 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 18744 Use ptrdiff_t, not int, for sizes.
21514da7 18745 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 18746
3de73e5e
PE
18747 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18748
2606c57b
PE
18749 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18750 (x_session_initialize): Do not assume string length fits in int.
18751
aaafe47a
PE
18752 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18753 This is unlikely, but can occur if DPI is outlandish.
18754
2674ddc8 18755 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
18756 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18757
28154962
PE
18758 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18759 * xrdb.c (magic_file_p, search_magic_path):
18760 Omit last arg SUFFIX; it was always 0. All callers changed.
18761 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18762
7de51af5
PE
18763 * xfont.c (xfont_match): Avoid need for strlen.
18764
25ed6cc3
PE
18765 * xfns.c: Don't assume strlen fits in int.
18766 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18767
4eab31dd
PE
18768 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18769 not unsigned long, as we prefer signed integers. All callers changed.
18770 Detect integer overflow in repeat count.
18771 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 18772 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 18773
171e2a58
PE
18774 * termcap.c: Don't assume sizes fit in int and never overflow.
18775 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18776 (gobble_line): Check for size-calculation overflow.
18777
ad39faca 18778 * minibuf.c (Fread_buffer):
6e5bb2dc 18779 * lread.c (intern, intern_c_string):
74ca2eb3
PE
18780 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18781 Don't assume string length fits in int.
18782
52c61c22 18783 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
18784 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18785
b5b8c9e5
PE
18786 * font.c: Don't assume string length fits in int.
18787 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18788 Use ptrdiff_t, not int.
ccd6111c
PE
18789 (font_intern_prop): Don't assume string length fits in int.
18790 Don't assume integer property fits in fixnum.
18791 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 18792
882f0d81 18793 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 18794 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
18795 Reformulate so as not to need the command string.
18796 Invoke gzip -cd rather than gunzip, as it's more portable.
18797 (lock_info_type, lock_file_1, lock_file):
18798 Don't assume pid_t and time_t fit in unsigned long.
18799 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18800 (current_lock_owner): Prefer signed type for sizes.
18801 Use memcpy, not strncpy, where memcpy is what is really wanted.
18802 Don't assume (via atoi) that time_t and pid_t fit in int.
18803 Check for time_t and/or pid_t out of range, e.g., via a network share.
18804 Don't alloca where an auto var works fine.
18805
93f4cf88
PE
18806 * fileio.c: Fix some integer overflow issues.
18807 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18808 Don't assume string length fits in int.
18809 (directory_file_name): Don't assume string length fits in long.
18810 (make_temp_name): Don't assume pid fits in int, or that its print
18811 length is less than 20.
18812
f3e92b69
PE
18813 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18814
1bfdaf10
PE
18815 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18816
35016e9a
PE
18817 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18818
3d1e65a1
PE
18819 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18820 We prefer signed integers, even for size calculations.
18821
0b963a93
PE
18822 * emacs.c: Don't assume string length fits in 'int'.
18823 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18824 (main): Don't invoke strlen when not needed.
18825
573f4b54
PE
18826 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18827 (XD_DEBUG_MESSAGE): Don't waste a byte.
18828
989f33ba
PE
18829 * callproc.c (getenv_internal_1, getenv_internal)
18830 (Fgetenv_internal):
965d34eb
PE
18831 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18832
e4d29b33
PE
18833 * lread.c (invalid_syntax): Omit length argument.
18834 All uses changed. This doesn't fix a bug, but it simplifies the
18835 code away from its former Hollerith-constant appearance, and it's
18836 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 18837 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 18838
eb49b136
PE
18839 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18840 This didn't break anything, but it didn't help either.
18841 It's confusing to put a bogus integer in a place where the actual
18842 value does not matter.
9f62aeb1 18843 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 18844 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 18845
15375a22
PE
18846 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18847 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18848 implementation.
b61cc01c
PE
18849 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18850 We prefer signed types, and the value cannot exceed the EMACS_INT
18851 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
18852 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18853 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18854 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 18855
53b2623d
PE
18856 * indent.c (sane_tab_width): New function.
18857 (current_column, scan_for_column, Findent_to, position_indentation)
18858 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 18859 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 18860
51cab52b 18861 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 18862
f2ed8a70
PE
18863 * lisp.h (lint_assume): New macro.
18864 * composite.c (composition_gstring_put_cache):
18865 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18866
abe80cc6
PE
18867 * editfns.c, insdel.c:
18868 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 18869
b02c740e
PE
18870 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18871
ebc96716
PE
18872 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18873
b4e50fa0 18874 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 18875 Use much-faster test for byte-length change.
311d5d7c 18876 Don't assume string byte-length fits in 'int'.
a4cf38e4 18877 Check that character arg fits in 'int'.
85461888 18878 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 18879
c0c1ee9f
PE
18880 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18881
a498d7f4
PE
18882 * fns.c (concat): Catch string overflow earlier.
18883 Do not rely on integer wraparound.
18884
51cab52b
PE
18885 * dispextern.h (struct it.overlay_strings_charpos)
18886 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
18887 * xdisp.c (forward_to_next_line_start)
18888 (back_to_previous_visible_line_start)
18889 (reseat_at_next_visible_line_start, next_element_from_buffer):
18890 Don't arbitrarily truncate the value of 'selective' to int.
18891
76031fad
PE
18892 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18893
5eb55db9
PE
18894 * composite.c: Don't truncate sizes to 'int'.
18895 (composition_gstring_p, composition_reseat_it)
18896 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
18897 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18898 not EMACS_UINT, for indexes.
5eb55db9 18899
0703a717
PE
18900 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18901
d6202519
PE
18902 * buffer.c: Include <verify.h>.
18903 (struct sortvec.priority, struct sortstr.priority):
8961a454 18904 Now EMACS_INT, not int.
c20998a7 18905 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
18906 (struct sortstr.size, record_overlay_string)
18907 (struct sortstrlist.size, struct sortlist.used):
18908 Don't truncate size to int.
18909 (record_overlay_string): Check for size-calculation overflow.
d6202519 18910 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 18911
d5a19415
JM
189122011-06-22 Jim Meyering <meyering@redhat.com>
18913
029529ac 18914 Don't leak an XBM-image-sized buffer
d5a19415
JM
18915 * image.c (xbm_load): Free the image buffer after using it.
18916
a9041e6c
PE
189172011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18918
18919 Port to Sun C.
18920 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18921 that Sun C diagnosed.
18922 * fns.c (secure_hash): Fix pointer signedness issue.
18923 * intervals.c (static_offset_intervals): New function.
18924 (offset_intervals): Use it.
18925
7f3f739f
LL
189262011-06-21 Leo Liu <sdl.web@gmail.com>
18927
18928 * deps.mk (fns.o):
18929 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18930 sha512.h.
18931
18932 * fns.c (secure_hash): Rename from crypto_hash_function and change
18933 the first arg to accept symbols.
5b66d427 18934 (Fsecure_hash): New primitive.
7f3f739f
LL
18935 (syms_of_fns): New symbols.
18936
76147d94
DD
189372011-06-20 Deniz Dogan <deniz@dogan.se>
18938
18939 * process.c (Fset_process_buffer): Clarify return value in
18940 docstring.
18941
7d7d0045
CY
189422011-06-18 Chong Yidong <cyd@stupidchicken.com>
18943
18944 * dispnew.c (add_window_display_history): Use BVAR.
18945
18946 * xdisp.c (debug_method_add): Use BVAR.
18947 (check_window_end, dump_glyph_matrix, dump_glyph)
18948 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18949
18950 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18951 Likewise.
18952
18953 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18954 check till after the cache is created in init_frame_faces.
18955
ff2bc410
SM
189562011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18957
18958 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18959
28177add
PE
189602011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18961
dd3482fe
PE
18962 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18963 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18964 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18965
393d71f3 18966 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18967 * fileio.c (Finsert_file_contents):
18968 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18969 Remove the old (too-loose) buffer overflow checks.
18970 They weren't needed, since make_gap checks for buffer overflow.
18971 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18972 The old code merely checked for Emacs fixnum overflow, and relied
18973 on undefined (wraparound) behavior. The new code avoids undefined
18974 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18975
2e6813b0 18976 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18977 Tune. Don't use wider integers than needed. Don't use alloca.
18978 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18979
599a9e4f
PE
18980 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18981
99561444
PE
18982 * insdel.c, lisp.h (buffer_overflow): New function.
18983 (insert_from_buffer_1, replace_range, replace_range_2):
18984 * insdel.c (make_gap_larger):
18985 * editfns.c (Finsert_char):
18986 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18987
28177add
PE
18988 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18989
e69dafad
PE
189902011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18991
4baa020d 18992 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18993
b1c46f02
PE
18994 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18995 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18996
e69dafad
PE
18997 * fileio.c: Don't assume EMACS_INT fits in off_t.
18998 (emacs_lseek): New static function.
18999 (Finsert_file_contents, Fwrite_region): Use it.
19000 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19001
566684ea
PE
19002 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19003
e6966cd6
PE
19004 * fns.c: Don't overflow int when computing a list length.
19005 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19006 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19007 truncation on 64-bit hosts. Check for QUIT every
19008 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19009 faster and is responsive enough.
19010 (Flength): Report an error instead of overflowing an integer.
19011 (Fsafe_length): Return a float if the value is not representable
19012 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19013 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19014 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19015
dd0b0efb
PE
19016 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19017 (header_size, word_size): New constants.
19018 (allocate_vectorlike): Don't check size overflow here.
19019 (allocate_vector): Check it here instead, since this is the only
19020 caller of allocate_vectorlike that could cause overflow.
19021 Check that the new vector's length is representable as a fixnum.
19022
86fe5cfe
PE
19023 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19024 The previous code was bogus. For example, next_almost_prime (32)
19025 returned 39, which is undesirable as it is a multiple of 3; and
19026 next_almost_prime (24) returned 25, which is a multiple of 5 so
19027 why was the code bothering to check for multiples of 7?
19028
80e88859
PE
19029 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19030
4a2f0ad6
PE
19031 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19032
f66c7cf8
PE
19033 Variadic C functions now count arguments with ptrdiff_t.
19034 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19035 Back then I didn't know that the Emacs coding style prefers signed int.
19036 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19037 were being counted with int, which may truncate counts on 64-bit
19038 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19039 * lisp.h (struct Lisp_Subr.function.aMANY)
19040 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19041 Arg counts are now ptrdiff_t, not size_t.
19042 All variadic functions and their callers changed accordingly.
19043 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19044 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19045 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19046 * callint.c (Fcall_interactively): Check arg count for overflow,
19047 to avoid potential buffer overrun. Use signed char, not 'int',
19048 for 'varies' array, so that we needn't bother to check its size
19049 calculation for overflow.
19050 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19051 * eval.c (apply_lambda):
19052 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19053 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19054 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19055
a1759b76
PE
19056 * callint.c (Fcall_interactively): Don't use index var as event count.
19057
d96be9fc
PE
19058 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19059 * mem-limits.h (SIZE): Remove; no longer used.
19060
a690a978 19061 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19062
578c21e6
PE
19063 Remove unnecessary casts.
19064 * xterm.c (x_term_init):
19065 * xfns.c (x_set_border_pixel):
19066 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19067 These aren't needed now that we assume ANSI C.
19068
96f53c6c
PE
19069 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19070 It's more likely to cause problems (due to unsigned overflow)
19071 than to cure them.
19072
83c77d31
PE
19073 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19074
ee2079f1
PE
19075 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19076
6da65536
PE
19077 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19078
7147c4a4
PE
19079 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19080
193e32d9
PE
19081 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19082
e5533da6
PE
19083 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19084
9910e595
PE
19085 GLYPH_CODE_FACE returns EMACS_INT, not int.
19086 * dispextern.h (merge_faces):
19087 * xfaces.c (merge_faces):
01103c44
PE
19088 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19089 Don't assume EMACS_INT fits in int.
9910e595 19090
2638320e
PE
19091 * character.h (CHAR_VALID_P): Remove unused parameter.
19092 * fontset.c, lisp.h, xdisp.c: All uses changed.
19093
045eb8d9
PE
19094 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19095
c1f134b5
PE
19096 * fns.c (concat): Minor tuning based on overflow analysis.
19097 This doesn't fix any bugs. Use int to hold character, instead
19098 of constantly refetching from Emacs object. Use XFASTINT, not
19099 XINT, for value known to be a character. Don't bother comparing
19100 a single byte to 0400, as it's always less.
19101
395fcb93 19102 * floatfns.c (Fexpt):
327eeec8
PE
19103 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19104
abbd3d23
PE
19105 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19106 for characters.
19107
684a03ef
PE
19108 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19109
0fed43f3
PE
19110 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19111 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19112 incorrectly succeed when S was a string, because 4294967386 was
19113 truncated before it was used.
19114
8fd02eb7
PE
19115 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19116 Otherwise, an out-of-range integer could cause undefined behavior
19117 on a 64-bit host.
19118
f8c86b69
PE
19119 * composite.c: Use int, not EMACS_INT, for characters.
19120 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19121 EMACS_INT, for values that are known to be in character range.
19122 This doesn't fix any bugs but is the usual style inside Emacs and
19123 may generate better code on 32-bit machines.
19124
34206dd2
PE
19125 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19126 This is for reasons similar to the recent CHAR_STRING fix.
19127 * charset.c (Fencode_char): Check that character arg is actually
19128 a character. Pass an int to ENCODE_CHAR.
19129 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19130 wider than 'int', as a compile-time check to prevent future regressions
19131 in this area.
19132
c5958d4c 19133 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19134
19135 Make sure a 64-bit char is never passed to CHAR_STRING.
19136 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19137 by silently ignoring the top 32 bits, allowing some values
19138 that were far too large to be valid characters.
19139 * character.h: Include <verify.h>.
19140 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19141 arguments are no wider than unsigned, as a compile-time check
19142 to prevent future regressions in this area.
19143 * data.c (Faset):
01103c44 19144 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19145 (Fsubst_char_in_region):
19146 * fns.c (concat):
19147 * xdisp.c (decode_mode_spec_coding):
19148 Adjust to CHAR_STRING's new requirement.
19149 * editfns.c (Finsert_char, Fsubst_char_in_region):
19150 * fns.c (concat): Check that character args are actually
19151 characters. Without this test, these functions did the wrong
19152 thing with wildly out-of-range values on 64-bit hosts.
19153
d37ca623
PE
19154 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19155 These casts should not be needed on 32-bit hosts, either.
19156 * keyboard.c (read_char):
19157 * lread.c (Fload): Remove casts to unsigned.
19158
ea204efb
PE
19159 * lisp.h (UNSIGNED_CMP): New macro.
19160 This fixes comparison bugs on 64-bit hosts.
19161 (ASCII_CHAR_P): Use it.
19162 * casefiddle.c (casify_object):
01103c44 19163 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19164 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19165 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19166 * dispextern.h (FACE_FROM_ID):
19167 * keyboard.c (read_char): Use UNSIGNED_CMP.
19168
41cb286c
PE
19169 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19170 not to EMACS_INT, to avoid GCC warning.
19171
4a1b9832
PE
19172 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19173
55daad71
PE
19174 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19175 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19176 isn't needed on 32-bit machines.
8f95c75c 19177
01103c44
PE
19178 * buffer.c (Fgenerate_new_buffer_name):
19179 Use EMACS_INT for count, not int.
0ceccced 19180 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19181
19182 * data.c (Qcompiled_function): Now static.
19183
c6f072e7
PE
19184 * window.c (window_body_lines): Now static.
19185
20ce5912
PE
19186 * image.c (gif_load): Rename local to avoid shadowing.
19187
9c4c5f81
PE
19188 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19189 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19190 * alloc.c (make_save_value): Integer argument is now of type
19191 ptrdiff_t, not int.
19192 (mark_object): Use ptrdiff_t, not int.
19193 * lisp.h (pD): New macro.
19194 * print.c (print_object): Use it.
19195
c0c5c8ae
PE
19196 * alloc.c: Use EMACS_INT, not int, to count objects.
19197 (total_conses, total_markers, total_symbols, total_vector_size)
19198 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19199 (total_free_floats, total_floats, total_free_intervals)
19200 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19201 Now EMACS_INT, not int. All uses changed.
19202 (Fgarbage_collect): Compute overall total using a double, so that
19203 integer overflow is less likely to be a problem. Check for overflow
19204 when converting back to an integer.
5a25e253
PE
19205 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19206 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19207 These were 'int' variables that could overflow on 64-bit hosts;
19208 they were never used, so remove them instead of repairing them.
211a0b2a 19209 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19210 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19211 Previously, this ceilinged at INT_MAX, but that doesn't work on
19212 64-bit machines.
e46bb31a 19213 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19214
c78baabf 19215 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19216 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19217 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19218 when a (possibly-narrower) signed value would do just as well.
19219 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19220
c9d624c6
PE
19221 * alloc.c: Catch some string size overflows that we were missing.
19222 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19223 for convenience in STRING_BYTES_MAX.
19224 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19225 The definition here is exact; the one in lisp.h was approximate.
19226 (allocate_string_data): Check for string overflow. This catches
19227 some instances we weren't catching before. Also, it catches
19228 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19229 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19230 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19231
c9d624c6
PE
19232 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19233 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19234 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19235
353032ce
PE
19236 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19237
2bccce07
PE
19238 * alloc.c (Fmake_string): Check for out-of-range init.
19239
0ac30604
SM
192402011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19241
19242 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19243
c195f2de
JD
192442011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19245
19246 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19247 xg_get_default_scrollbar_width.
19248
19249 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19250 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19251 (style_changed_cb): Call update_theme_scrollbar_width and call
19252 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19253 all frames (Bug#8505).
19254 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19255 Call gtk_window_set_resizable if HAVE_GTK3.
19256 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19257 and height if HAVE_GTK3 (Bug#8505).
19258 (scroll_bar_width_for_theme): New variable.
19259 (update_theme_scrollbar_width): New function.
19260 (xg_get_default_scrollbar_width): Move code to
19261 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19262 (xg_initialize): Call update_theme_scrollbar_width.
19263
19264 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19265
19266 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19267
e10ac9f1
MR
192682011-06-12 Martin Rudalics <rudalics@gmx.at>
19269
19270 * frame.c (make_frame): Call other_buffer_safely instead of
19271 other_buffer.
19272
19273 * window.c (temp_output_buffer_show): Call display_buffer with
19274 second argument Vtemp_buffer_show_specifiers and reset latter
19275 immediately after the call.
19276 (Vtemp_buffer_show_specifiers): New variable.
19277 (auto_window_vscroll_p, next_screen_context_lines)
19278 (Vscroll_preserve_screen_position): Remove leading asterisks from
19279 doc-strings.
19280
2d3c217e 192812011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19282
7b7f97e8 19283 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19284 * buffer.c (Qclone_number): Remove for now, as it's unused.
19285 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19286 (record_buffer): Remove unused local.
19287 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19288 (set_frame_buffer_list): Remove; unused.
19289 * frame.h (other_visible_frames): Remove decl.
19290 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19291 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19292 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19293 if HAVE_GPM.
19294 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19295 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19296 Define only if HAVE_GPM.
19297 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19298 (update_hints_inhibit): Remove; never set. All uses removed.
19299 * widgetprv.h (emacsFrameClassRec): Remove decl.
19300 * window.c (delete_deletable_window): Now returns void, since it
19301 wasn't returning anything.
19302 (compare_window_configurations): Remove unused locals.
19303 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19304 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19305 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19306 the same widths as pointers. This follows up on the 2011-05-06 patch.
19307 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19308 * xterm.h: Likewise.
19309 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19310
1384b89e
JB
193112011-06-12 Juanma Barranquero <lekktu@gmail.com>
19312
19313 * makefile.w32-in: Update dependencies.
19314 (LISP_H): Add lib/intprops.h.
19315
1100a63c
CY
193162011-06-11 Chong Yidong <cyd@stupidchicken.com>
19317
19318 * image.c (gif_load): Add animation frame delay to the metadata.
19319 (syms_of_image): Use DEFSYM. New symbol `delay'.
19320
6198ccd0
MR
193212011-06-11 Martin Rudalics <rudalics@gmx.at>
19322
19323 * window.c (delete_deletable_window): Re-add.
19324 (Fset_window_configuration): Rewrite to handle dead buffers and
19325 consequently deletable windows.
19326 (window_tree, Fwindow_tree): Remove. Supply functionality in
19327 window.el.
19328 (compare_window_configurations): Simplify code.
19329
b6e3633c
AS
193302011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19331
1ab0dee5
AS
19332 * image.c (imagemagick_load_image): Fix type mismatch.
19333 (Fimagemagick_types): Likewise.
19334
b6e3633c
AS
19335 * window.h (replace_buffer_in_windows): Declare.
19336
9397e56f
MR
193372011-06-11 Martin Rudalics <rudalics@gmx.at>
19338
19339 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19340 Qclone_number. Remove external declaration of Qdelete_window.
19341 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19342 code.
640c8776
SM
19343 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19344 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19345 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19346 buffer list implementation.
19347 (other_buffer_safely): New function.
19348 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19349 calls to replace_buffer_in_windows and
19350 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19351 if allowed.
19352 (record_buffer): Inhibit quitting and rewrite using quittable
19353 functions. Run Qbuffer_list_update_hook if allowed.
19354 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19355 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19356 Move switch-to-buffer to window.el.
9397e56f
MR
19357 (bury-buffer): Move to window.el.
19358 (Vbuffer_list_update_hook): New variable.
19359
19360 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19361 section.
19362
19363 * window.h (resize_frame_windows): Move up in code.
19364 (Fwindow_frame): Remove EXFUN.
19365 (replace_buffer_in_all_windows): Remove prototype.
19366 (replace_buffer_in_windows_safely): Add prototype.
19367
19368 * window.c: Declare Qdelete_window static again. Move down
19369 declaration of select_count.
19370 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19371 (Fother_window): Move to window.el.
19372 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19373 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19374 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19375 window.el.
19376 (replace_buffer_in_windows): Implement by calling
19377 Qreplace_buffer_in_windows.
19378 (replace_buffer_in_all_windows): Remove with some functionality
19379 moved into replace_buffer_in_windows_safely.
19380 (replace_buffer_in_windows_safely): New function.
19381 (select_window_norecord, select_frame_norecord): Move in front
19382 of run_window_configuration_change_hook. Remove now obsolete
19383 declarations.
640c8776
SM
19384 (Fset_window_buffer): Rewrite doc-string.
19385 Call Qrecord_window_buffer.
9397e56f
MR
19386 (keys_of_window): Move binding for other-window to window.el.
19387
b50691aa
CY
193882011-06-11 Chong Yidong <cyd@stupidchicken.com>
19389
19390 * dispextern.h (struct image): Replace data member, whose int_val
19391 and ptr_val fields were not used by anything, with a single
19392 lisp_val object.
19393
19394 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19395 (gif_clear_image, gif_load, imagemagick_load_image)
19396 (gs_clear_image, gs_load): Callers changed.
19397
3f754b86
PE
193982011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19399
cca69397
PE
19400 * buffer.h: Include <time.h>, for time_t.
19401 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19402
109e28d0
PE
19403 Fix minor problems found by static checking.
19404
60737f02
PE
19405 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19406
4b66faf3
PE
19407 Make identifiers static if they are not used in other modules.
19408 * data.c (Qcompiled_function, Qframe, Qvector):
19409 * image.c (QimageMagick, Qsvg):
19410 * minibuf.c (Qmetadata):
19411 * window.c (resize_window_check, resize_root_window): Now static.
19412 * window.h (resize_window_check, resize_root_window): Remove decls.
19413
109e28d0
PE
19414 * window.c (window_deletion_count, delete_deletable_window):
19415 Remove; unused.
46a4ce9e
PE
19416 (window_body_lines): Now static.
19417 (Fdelete_other_windows_internal): Mark vars as initialized.
19418 Make sure 'resize_failed' is initialized.
19419 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19420 (resize_window_apply): Remove unused local.
19421 * window.h (delete_deletable_window): Remove decl.
19422
109e28d0 19423 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19424 (imagemagick_load_image): Fix pointer signedness problem by changing
19425 last arg from unsigned char * to char *. All uses changed.
19426 Also, fix a local for similar reasons.
19427 Remove unused locals. Remove locals to avoid shadowing.
19428 (fn_rsvg_handle_free): Remove; unused.
19429 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19430 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19431
3f754b86
PE
19432 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19433
2547adb1
CY
194342011-06-10 Chong Yidong <cyd@stupidchicken.com>
19435
19436 * image.c (gif_load): Fix omitted cast error introduced by
19437 2011-06-06 change.
19438
2c8e37d4
MR
194392011-06-10 Martin Rudalics <rudalics@gmx.at>
19440
19441 * window.h (resize_proportionally, orig_total_lines)
19442 (orig_top_line): Remove from window structure.
19443 (set_window_height, set_window_width, change_window_heights)
19444 (Fdelete_window): Remove prototypes.
19445 (resize_frame_windows): Remove duplicate declaration.
19446
440a42e3
EZ
194472011-06-10 Eli Zaretskii <eliz@gnu.org>
19448
19449 * window.h (resize_frame_windows, resize_window_check)
19450 (delete_deletable_window, resize_root_window)
19451 (resize_frame_windows): Declare prototypes.
19452
19453 * window.c (resize_window_apply): Make definition be "static" to
19454 match the prototype.
19455
562dd5e9
MR
194562011-06-10 Martin Rudalics <rudalics@gmx.at>
19457
19458 * window.c: Remove declarations of Qwindow_size_fixed,
19459 window_min_size_1, window_min_size_2, window_min_size,
19460 size_window, window_fixed_size_p, enlarge_window, delete_window.
19461 Remove static from declaration of Qdelete_window, it's
19462 temporarily needed by Fbury_buffer.
19463 (replace_window): Don't assign orig_top_line and
19464 orig_total_lines.
19465 (Fdelete_window, delete_window): Remove. Window deletion is
19466 handled by window.el.
640c8776
SM
19467 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19468 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19469 (Fdelete_other_windows): Remove. Deleting other windows is
19470 handled by window.el.
19471 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19472 handled in window.el.
19473 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19474 Window minimum sizes are handled in window.el.
19475 (shrink_windows, size_window, set_window_height)
19476 (set_window_width, change_window_heights, window_height)
19477 (window_width, CURBEG, CURSIZE, enlarge_window)
19478 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19479 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19480 handled in window.el.
19481 (make_dummy_parent): Rename to make_parent_window and give it a
19482 second argument horflag.
19483 (make_window): Don't set resize_proportionally any more.
19484 (Fsplit_window): Remove. Windows are split in window.el.
19485 (save_restore_action, save_restore_orig_size)
19486 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19487 Resize mini windows in window.el.
19488 (grow_mini_window, shrink_mini_window): Implement by calling
19489 Qresize_root_window_vertically, resize_window_check and
19490 resize_window_apply.
640c8776
SM
19491 (saved_window, Fset_window_configuration, save_window_save):
19492 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19493 resize_proportionally.
19494 (window_min_height, window_min_width): Move to window.el.
19495 (keys_of_window): Move bindings for delete-other-windows,
19496 split-window, delete-window and enlarge-window to window.el.
19497
19498 * buffer.c: Temporarily extern Qdelete_window.
19499 (Fbury_buffer): Temporarily call Qdelete_window instead of
19500 Fdelete_window (Fbury_buffer will move to window.el soon).
19501
19502 * frame.c (set_menu_bar_lines_1): Remove code handling
19503 orig_top_line and orig_total_lines.
19504
19505 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19506 set_window_height but set heights directly.
19507 (change_frame_size_1): Use resize_frame_windows.
19508
19509 * xdisp.c (init_xdisp): Don't use set_window_height but set
19510 heights directly.
19511
640c8776
SM
19512 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19513 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19514 run_window_configuration_change_hook.
19515
19516 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19517 instead of change_window_heights and run
19518 run_window_configuration_change_hook.
19519
1a13852e
MR
195202011-06-09 Martin Rudalics <rudalics@gmx.at>
19521
19522 * window.c (replace_window): Rename second argument REPLACEMENT to
19523 NEW. New third argument SETFLAG. Rewrite.
19524 (delete_window, make_dummy_parent): Call replace_window with
19525 third argument 1.
19526 (window_list_1): Move down in code.
19527 (run_window_configuration_change_hook): Move set_buffer part
19528 before select_frame_norecord part in order to unwind correctly.
19529 Rename count1 to count.
19530 (recombine_windows, delete_deletable_window, resize_root_window)
19531 (Fdelete_other_windows_internal)
19532 (Frun_window_configuration_change_hook, make_parent_window)
19533 (resize_window_check, resize_window_apply, Fresize_window_apply)
19534 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19535 (Fdelete_window_internal, Fresize_mini_window_internal):
19536 New functions.
1a13852e
MR
19537 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19538
f3d1777e
MR
195392011-06-08 Martin Rudalics <rudalics@gmx.at>
19540
496e208e
MR
19541 * window.h (window): Add some new members to window structure -
19542 normal_lines, normal_cols, new_total, new_normal, clone_number,
19543 splits, nest, prev_buffers, next_buffers.
19544 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19545 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19546
f3d1777e
MR
19547 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19548 Remove.
496e208e
MR
19549 (make_dummy_parent): Set new members of windows structure.
19550 (make_window): Move down in code. Handle new members of window
19551 structure.
19552 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19553 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19554 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19555 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19556 (Fset_window_next_buffers, Fset_window_clone_number):
19557 New functions.
496e208e
MR
19558 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19559 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19560 Doc-string fixes.
19561 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19562 Argument WINDOW can be now internal window too.
19563 (Fwindow_use_time): Move up in code.
19564 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19565 Rewrite doc-string.
19566 (Fset_window_configuration, saved_window)
19567 (Fcurrent_window_configuration, save_window_save): Handle new
19568 members of window structure.
b9e809c2
MR
19569 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19570 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19571 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19572 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19573 Qget_mru_window, Qresize_root_window,
19574 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19575 Qauto_buffer_name; staticpro them.
f3d1777e 19576
abde8f8c
MR
195772011-06-07 Martin Rudalics <rudalics@gmx.at>
19578
19579 * window.c (Fwindow_total_size, Fwindow_left_column)
19580 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19581 (Fwindow_list_1): New functions.
19582 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
19583 (Fwindow_width, Fscroll_left, Fscroll_right):
19584 Use window_body_cols instead of window_box_text_cols.
19585 (delete_window, Fset_window_configuration):
19586 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
19587 (delete_all_subwindows): Take a window as argument and not a
19588 structure. Rewrite.
190b47e6
MR
19589 (window_loop): Remove handling of GET_LRU_WINDOW and
19590 GET_LARGEST_WINDOW.
19591 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
19592
19593 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
19594 window_box_text_cols. delete_all_subwindows now takes a
19595 Lisp_Object as argument.
abde8f8c 19596
640c8776
SM
19597 * indent.c (compute_motion, Fcompute_motion):
19598 Use window_body_cols instead of window_box_text_cols.
abde8f8c 19599
fa8a67e6
MR
19600 * frame.c (delete_frame): Call delete_all_subwindows with root
19601 window as argument.
19602
a54e3482
DC
196032011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19604
19605 * fns.c (Fputhash): Document return value.
19606
60002bf5
CY
196072011-06-06 Chong Yidong <cyd@stupidchicken.com>
19608
19609 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19610
0c671da6 196112011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 19612
b862a52a 19613 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 19614
be44ca6c
PE
19615 Check for overflow when converting integer to cons and back.
19616 * charset.c (Fdefine_charset_internal, Fdecode_char):
19617 Use cons_to_unsigned to catch overflow.
19618 (Fencode_char): Use INTEGER_TO_CONS.
19619 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19620 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19621 * data.c (long_to_cons, cons_to_long): Remove.
19622 (cons_to_unsigned, cons_to_signed): New functions.
19623 These signal an error for invalid or out-of-range values.
19624 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19625 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19626 * font.c (Ffont_variation_glyphs):
19627 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19628 * lisp.h: Include <intprops.h>.
19629 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19630 (cons_to_signed, cons_to_unsigned): New decls.
19631 (long_to_cons, cons_to_long): Remove decls.
19632 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19633 (Fprimitive_undo): Use CONS_TO_INTEGER.
19634 * xfns.c (Fx_window_property): Likewise.
19635 * xselect.c: Include <limits.h>.
19636 (x_own_selection, selection_data_to_lisp_data):
19637 Use INTEGER_TO_CONS.
19638 (x_handle_selection_request, x_handle_selection_clear)
19639 (x_get_foreign_selection, Fx_disown_selection_internal)
19640 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19641 (lisp_data_to_selection_data): Use cons_to_unsigned.
19642 (x_fill_property_data): Use cons_to_signed.
19643 Report values out of range.
19644
d1f3d2af
PE
19645 Check for buffer and string overflow more precisely.
19646 * buffer.h (BUF_BYTES_MAX): New macro.
19647 * lisp.h (STRING_BYTES_MAX): New macro.
19648 * alloc.c (Fmake_string):
19649 * character.c (string_escape_byte8):
19650 * coding.c (coding_alloc_by_realloc):
19651 * doprnt.c (doprnt):
19652 * editfns.c (Fformat):
19653 * eval.c (verror):
19654 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19655 since they may not be the same number.
19656 * editfns.c (Finsert_char):
19657 * fileio.c (Finsert_file_contents):
19658 Likewise for BUF_BYTES_MAX.
19659
dd52fcea
PE
19660 * image.c: Use ptrdiff_t, not int, for sizes.
19661 (slurp_file): Switch from int to ptrdiff_t.
19662 All uses changed.
19663 (slurp_file): Check that file size fits in both size_t (for
19664 malloc) and ptrdiff_t (for sanity and safety).
19665
7f9bbdbb
PE
19666 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19667 if b->modtime has its maximal value.
19668
dfe18f82
PE
19669 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19670
84acfcf0
PE
19671 Don't assume time_t can fit into int.
19672 * buffer.h (struct buffer.modtime): Now time_t, not int.
19673 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19674 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19675
ccd9a01a
PE
19676 Minor fixes for signed vs unsigned integers.
19677 * character.h (MAYBE_UNIFY_CHAR):
19678 * charset.c (maybe_unify_char):
19679 * keyboard.c (read_char, reorder_modifiers):
19680 XINT -> XFASTINT, since the integer must be nonnegative.
19681 * ftfont.c (ftfont_spec_pattern):
19682 * keymap.c (access_keymap, silly_event_symbol_error):
19683 XUINT -> XFASTINT, since the integer must be nonnegative.
19684 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19685 since it makes no difference and we prefer signed.
19686 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19687 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19688 nonnegative.
19689
d6d100dd
SM
196902011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19691
19692 * window.h (Fwindow_frame): Declare.
19693
2b6148e4
PE
196942011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19695
19696 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19697 (SPARE_MEMORY): Always define.
19698 (LARGE_REQUEST): Remove.
19699 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19700
f230ecc9
MR
197012011-06-06 Martin Rudalics <rudalics@gmx.at>
19702
727e958e
MR
19703 * lisp.h: Move EXFUNS for Fframe_root_window,
19704 Fframe_first_window and Fset_frame_selected_window to window.h.
19705
19706 * window.h: Move EXFUNS for Fframe_root_window,
19707 Fframe_first_window and Fset_frame_selected_window here from
19708 lisp.h.
19709
19710 * frame.c (Fwindow_frame, Fframe_first_window)
19711 (Fframe_root_window, Fframe_selected_window)
19712 (Fset_frame_selected_window): Move to window.c.
19713 (Factive_minibuffer_window): Move to minibuf.c.
19714 (Fother_visible_frames_p): New function.
19715
19716 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19717
f230ecc9
MR
19718 * window.c (decode_window, decode_any_window): Move up in code.
19719 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19720 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
19721 (Fwindow_buffer): Move up and rewrite doc-string.
19722 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19723 (Fwindow_prev): New functions.
727e958e
MR
19724 (Fwindow_frame): Move here from frame.c. Accept any window as
19725 argument.
19726 (Fframe_root_window, Fframe_first_window)
19727 (Fframe_selected_window): Move here from frame.c. Accept frame
19728 or arbitrary window as argument. Update doc-strings.
19729 (Fminibuffer_window): Move up in code.
19730 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
19731 (Fset_frame_selected_window): Move here from frame.c.
19732 Marginal rewrite.
727e958e
MR
19733 (Fselected_window, select_window, Fselect_window): Move up in
19734 code. Minor doc-string fixes.
f230ecc9 19735
4d09bcf6
PE
197362011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19737
19738 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19739 Do not assume that spare memory exists; that assumption is valid
19740 only if SYSTEM_MALLOC.
19741 (LARGE_REQUEST): New macro, so that the issue of large requests
19742 is separated from the issue of spare memory.
19743
810928a2
AS
197442011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19745
172418ad
AS
19746 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19747 format. (Bug#8806)
19748
43f862f7
AS
19749 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19750
810928a2
AS
19751 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19752 before statements.
19753
a059fe24
JD
197542011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19755
19756 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19757
19758 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19759
19760 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19761 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19762
989bf368
JB
197632011-06-05 Juanma Barranquero <lekktu@gmail.com>
19764
19765 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19766
4b80f674
CY
197672011-06-04 Chong Yidong <cyd@stupidchicken.com>
19768
19769 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19770 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
19771 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19772 New error handlers.
4b80f674
CY
19773 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19774 Obey Vx_select_enable_clipboard_manager. Catch errors in
19775 x_clipboard_manager_save (Bug#8779).
19776 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 19777 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 19778
99a33b77 197792011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
19780
19781 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19782
99a33b77 197832011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
19784
19785 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19786 in the current matrix if keep_current_p is non-zero.
19787
8264569d
EZ
197882011-06-04 Eli Zaretskii <eliz@gnu.org>
19789
19790 * bidi.c (bidi_level_of_next_char): Fix last change.
19791
57f97249
EZ
197922011-06-03 Eli Zaretskii <eliz@gnu.org>
19793
fec2107c 19794 Support bidi reordering of text covered by display properties.
57f97249 19795
fec2107c
EZ
19796 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19797 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19798 (bidi_cache_search, bidi_cache_iterator_state)
19799 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
19800 (bidi_level_of_next_char, bidi_move_to_visually_next):
19801 Support character positions inside a run of characters covered by a
fec2107c
EZ
19802 display string.
19803 (bidi_paragraph_init, bidi_resolve_explicit_1)
19804 (bidi_level_of_next_char): Call bidi_fetch_char and
19805 bidi_fetch_char_advance instead of FETCH_CHAR and
19806 FETCH_CHAR_ADVANCE.
19807 (bidi_init_it): Initialize new members.
19808 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19809 definitions.
19810 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19811 instead of using explicit *_CHAR codes.
d6d100dd
SM
19812 (bidi_resolve_explicit, bidi_resolve_weak):
19813 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
19814 bidirectional text is supported only in multibyte buffers.
19815 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19816 it to initialize the frame_window_p member of struct bidi_it.
19817 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19818 (bidi_resolve_explicit, bidi_resolve_weak)
19819 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19820 bidi_it->nchars is non-positive.
19821 (bidi_level_of_next_char): Don't try to lookup the cache for the
19822 next/previous character if nothing is cached there yet, or if we
19823 were just reseat()'ed to a new position.
c40e2fb2 19824
0e14fe90
EZ
19825 * xdisp.c (set_cursor_from_row): Set start and stop points
19826 according to the row's direction when priming the loop that looks
19827 for the glyph on which to display cursor.
19828 (single_display_spec_intangible_p): Function deleted.
19829 (display_prop_intangible_p): Reimplement to call
19830 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
19831 Accept 3 additional arguments needed by handle_display_spec.
19832 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
19833 values: lists, `(when COND...)' forms, etc.
19834 (single_display_spec_string_p): Support property values that are
19835 lists with the argument STRING its top-level element.
19836 (display_prop_string_p): Fix the condition for processing a
19837 property that is a list to be consistent with handle_display_spec.
fec2107c 19838 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
19839 last portion of handle_display_prop.
19840 (compute_display_string_pos): Accept additional argument
19841 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19842 value of a `display' property is a "replacing spec".
19843 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19844 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19845 the display property, but just return a value indicating whether
19846 the display property will replace the characters it covers.
19847 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19848 frame_window_p members of struct bidi_it.
d6d100dd
SM
19849 (compute_display_string_pos, compute_display_string_end):
19850 New functions.
fec2107c
EZ
19851 (push_it): Accept second argument POSITION, where pop_it should
19852 jump to continue iteration.
19853 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 19854
fec2107c
EZ
19855 * keyboard.c (adjust_point_for_property): Adjust the call to
19856 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
19857
19858 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
19859 (bidi_init_it): Update prototypes.
19860 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
19861 (compute_display_string_pos, compute_display_string_end):
19862 Declare prototypes.
fec2107c
EZ
19863 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19864 EMACS_INT.
fc6f18ce 19865
40087514 198662011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 19867
57f53182
PE
19868 Malloc failure behavior now depends on size of allocation.
19869 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19870 * lisp.h: Change signatures accordingly.
19871 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19872 All callers changed. (Bug#8762)
19873
19874 * gnutls.c: Use Emacs's memory allocators.
19875 Without this change, the gnutls library would invoke malloc etc.
19876 directly, which causes problems on non-SYNC_INPUT hosts, and which
19877 runs afoul of improving memory_full behavior. (Bug#8761)
19878 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19879 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19880 xfree instead of the default malloc, realloc, free.
19881 (Fgnutls_boot): No need to check for memory allocation failure,
19882 since xmalloc does that for us.
19883
ac32cd99 19884 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
19885 * category.c (hash_get_category_set):
19886 * ccl.c (ccl_driver):
19887 * charset.c (Fdefine_charset_internal):
19888 * charset.h (struct charset.hash_index):
19889 * composite.c (get_composition_id, gstring_lookup_cache)
19890 (composition_gstring_put_cache):
19891 * composite.h (struct composition.hash_index):
19892 * dispextern.h (struct image.hash):
19893 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19894 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19895 (hashfn_equal, hashfn_user_defined, make_hash_table)
19896 (maybe_resize_hash_table, hash_lookup, hash_put)
19897 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19898 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19899 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19900 * image.c (make_image, search_image_cache, lookup_image)
19901 (xpm_put_color_table_h):
19902 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 19903 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 19904 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 19905 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
19906 * alloc.c (allocate_vectorlike):
19907 Check for overflow in vector size calculations.
19908 * ccl.c (ccl_driver):
19909 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
19910 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19911 need to be updated by these changes.
40087514
PE
19912 * fns.c (make_hash_table, maybe_resize_hash_table):
19913 Check for integer overflow with large hash tables.
0de4bb68
PE
19914 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19915 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19916 (SXHASH_REDUCE): New macro.
19917 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19918 Use it instead of discarding useful hash info with large hash values.
19919 (sxhash_float): New function.
19920 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19921 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
19922 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19923 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
19924 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19925 Adjust signatures to match updated version of code.
19926 (consing_since_gc): Now EMACS_INT, since a single hash table can
19927 use more than INT_MAX bytes.
19928
698d32e2
DN
199292011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19930
19931 Make it possible to build with GCC-4.6+ -O2 -flto.
19932
19933 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19934
fd6fa53f
SM
199352011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19936
19937 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19938 Call minibuffer-inactive-mode.
19939
864db017
JB
199402011-05-31 Juanma Barranquero <lekktu@gmail.com>
19941
19942 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19943 Update dependencies.
19944
2ad0baf4
DN
199452011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19946
19947 * data.c (init_data): Remove code for UTS, this system is not
19948 supported anymore.
19949
4fcc2638
DN
199502011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19951
19952 Don't force ./temacs to start in terminal mode.
19953
19954 * frame.c (make_initial_frame): Initialize faces in all cases, not
19955 only when CANNOT_DUMP is defined.
19956 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19957
c56e0fd5
DN
199582011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19959
19960 * dispnew.c (add_window_display_history): Use const for the string
19961 pointer. Remove declaration, not needed.
19962
333d54da 199632011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19964
55d4c1b2 19965 Use 'inline', not 'INLINE'.
333d54da 19966 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19967 * alloc.c, fontset.c (INLINE): Remove.
19968 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19969 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19970 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19971 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19972 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19973
738db178
DN
199742011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19975
19976 Make it possible to run ./temacs.
19977
19978 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19979 syms_of_callproc does the same thing. Remove test for
19980 "initialized", do it in the caller.
19981 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19982
620c53a6
SM
199832011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19984
19985 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19986 (read_minibuf): Use get_minibuffer.
19987 (syms_of_minibuf): Use DEFSYM.
19988 (Qmetadata): New var.
19989 * data.c (Qbuffer): Don't make it static.
19990 (syms_of_data): Use DEFSYM.
19991
e003a292
PE
199922011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19993
19994 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19995 (CCL_CODE_MIN): New macro.
19996
ed008a6d
PE
199972011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19998
3687c2ef
PE
19999 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20000
ed008a6d
PE
20001 * eval.c (Qdebug): Now static.
20002 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20003 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20004 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20005
d66c4c7c
CY
200062011-05-29 Chong Yidong <cyd@stupidchicken.com>
20007
20008 * image.c: Various fixes to ImageMagick code comments.
20009 (Fimagemagick_types): Doc fix.
20010
5fbc2025
PE
200112011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20012
0196f88a
PE
20013 Minor fixes prompted by GCC 4.6.0 warnings.
20014
20015 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20016
5fbc2025
PE
20017 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20018 (x_clipboard_manager_save_all): Move extern decl to ...
20019 * xterm.h: ... here, so that it can be checked for consistency.
20020
1dd3c2d9
CY
200212011-05-29 Chong Yidong <cyd@stupidchicken.com>
20022
20023 * xselect.c (x_clipboard_manager_save_frame)
20024 (x_clipboard_manager_save_all): New functions.
20025 (Fx_clipboard_manager_save): Lisp function deleted.
20026
20027 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20028 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20029
20030 * xterm.h: Update prototype.
20031
5ba6571d
WX
200322011-05-28 William Xu <william.xwl@gmail.com>
20033
20034 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20035 exiting (Bug#8239).
20036
3eaff834
JM
200372011-05-28 Jim Meyering <meyering@redhat.com>
20038
e1900994 20039 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20040 * fns.c (to_uchar): Define.
20041 (crypto_hash_function): Use it to convert some newly-signed
20042 variables to unsigned, to avoid sign-extension bugs. For example,
20043 without this change, (md5 "truc") would evaluate to
20044 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20045 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20046 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20047
0f6990a7
PE
200482011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20049
20050 Integer overflow fixes.
c8a9ca5a 20051
08686060
PE
20052 * dbusbind.c: Serial number integer overflow fixes.
20053 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20054 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20055 to hold a serial number that is too large for a fixnum.
20056 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20057 Check for serial numbers out of range. Decode any serial number
59568bf0 20058 that was so large that it became a float. (Bug#8722)
08686060 20059
2d1fc3c7
PE
20060 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20061 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20062 Use XFASTINT rather than XUINT when numbers are nonnegative.
20063 (xd_append_arg, Fdbus_method_return_internal):
20064 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20065 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20066 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20067 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20068 (Bug#8722)
2d1fc3c7 20069
c8a9ca5a
PE
20070 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20071
519e1d69
PE
20072 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20073
6df6ae42 20074 ccl: Add integer overflow checks.
30569699
PE
20075 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20076 (IN_INT_RANGE): New macros.
20077 (ccl_driver): Use them to check for integer overflow when
20078 decoding a CCL program. Many of the new checks are whether XINT (x)
20079 fits in int; it doesn't always, on 64-bit hosts. The new version
20080 doesn't catch all possible integer overflows, but it's an
847044ea 20081 improvement. (Bug#8719)
30569699 20082
c11285dc
PE
20083 * alloc.c (make_event_array): Use XINT, not XUINT.
20084 There's no need for unsigned here.
20085
fdccd48e
PE
20086 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20087 This follows up to the 2011-05-06 change that substituted uintptr_t
20088 for EMACS_INT. This case wasn't caught back then.
20089
37910ab2
PE
20090 Rework Fformat to avoid integer overflow issues.
20091 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20092 now (part of C89). Include <verify.h>.
20093 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20094 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20095 (Fformat): Avoid the prepass trying to compute sizes; it was only
20096 approximate and thus did not catch overflow reliably. Instead, walk
20097 through the format just once, formatting and computing sizes as we go,
20098 checking for integer overflow at every step, and allocating a larger
20099 buffer as needed. Keep track separately whether the format is
20100 multibyte. Keep only the most-recently calculated precision, rather
20101 than them all. Record whether each argument has been converted to
20102 string. Use EMACS_INT, not int, for byte and char and arg counts.
20103 Support field widths and precisions larger than INT_MAX. Avoid
20104 sprintf's undefined behavior with conversion specifications such as %#d
20105 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20106 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20107 formatting out-of-range floating point numbers with int
9173deec 20108 formats. (Bug#8668)
37910ab2 20109
2e6578fb
PE
20110 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20111
0ae6bdee
PE
20112 * data.c: Avoid integer truncation in expressions involving floats.
20113 * data.c: Include <intprops.h>.
20114 (arith_driver): When there's an integer overflow in an expression
20115 involving floating point, convert the integers to floating point
20116 so that the resulting value does not suffer from catastrophic
20117 integer truncation. For example, on a 64-bit host (* 4
20118 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20119 Do not rely on undefined behavior after integer overflow.
20120
de883a70
PE
20121 merge count_size_as_multibyte, parse_str_to_multibyte
20122 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20123 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20124 Check for integer overflow.
20125 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20126 since it's now a duplicate of the other. This is more of
20127 a character than a buffer op, so better that it's in character.c.
20128 * fns.c, print.c: Adjust to above changes.
20129
2ff916cb
PE
201302011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20131
20132 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20133
f1b54466
PE
201342011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20135
fb1ac845
PE
20136 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20137 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20138 (x_clipboard_manager_save): Now static.
20139 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20140
f1b54466
PE
20141 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20142 (crypto_hash_function): Now static.
20143 Fix pointer signedness problems. Avoid unnecessary initializations.
20144
a9f737ee
CY
201452011-05-27 Chong Yidong <cyd@stupidchicken.com>
20146
20147 * termhooks.h (Vselection_alist): Make it terminal-local.
20148
20149 * terminal.c (create_terminal): Initialize it.
20150
20151 * xselect.c: Support for clipboard managers.
20152 (Vselection_alist): Move to termhooks.h as terminal-local var.
20153 (LOCAL_SELECTION): New macro.
20154 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20155 (symbol_to_x_atom): Remove gratuitous arg.
20156 (x_handle_selection_request, lisp_data_to_selection_data)
20157 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20158 (x_own_selection, x_get_local_selection, x_convert_selection):
20159 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20160 (some_frame_on_display): Delete unused function.
20161 (Fx_own_selection_internal, Fx_get_selection_internal)
20162 (Fx_disown_selection_internal, Fx_selection_owner_p)
20163 (Fx_selection_exists_p): New optional frame arg.
20164 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20165 (x_handle_selection_clear): Don't treat other terminals with the
20166 same keyboard specially. Use the terminal-local Vselection_alist.
20167 (x_clear_frame_selections): Use Frun_hook_with_args.
20168
20169 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20170
20171 * xterm.h: Add support for those atoms.
20172
e067f0c1
CY
201732011-05-26 Chong Yidong <cyd@stupidchicken.com>
20174
20175 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20176 (converted_selections, conversion_fail_tag): New global variables.
20177 (x_selection_request_lisp_error): Free the above.
20178 (x_get_local_selection): Remove unnecessary code.
20179 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20180 of converted selections stored in converted_selections.
20181 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20182 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20183 (x_convert_selection): New function.
20184 (x_handle_selection_event): Simplify.
20185 (x_get_foreign_selection): Don't ignore incoming requests while
20186 waiting for an answer; this will fail when we implement
20187 SAVE_TARGETS, and seems unnecessary anyway.
20188 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20189 (Vx_sent_selection_functions): Doc fix.
20190
0f4aebc0
LL
201912011-05-26 Leo Liu <sdl.web@gmail.com>
20192
20193 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20194
e61124cd
YM
201952011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20196
20197 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20198
20199 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20200 for fringe update if it has periodic bitmap.
ac389d0c 20201 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20202 and fringe_bitmap_periodic_p.
20203
20204 * fringe.c (get_fringe_bitmap_data): New function.
20205 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20206 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20207 row. Mark glyph row for fringe update if periodicity changed.
20208
20209 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20210 for fringe update unless it has periodic bitmap.
20211
f16d9837
KH
202122011-05-25 Kenichi Handa <handa@m17n.org>
20213
20214 * xdisp.c (get_next_display_element): Set correct it->face_id for
20215 a static composition.
20216
e1b90ef6
LL
202172011-05-24 Leo Liu <sdl.web@gmail.com>
20218
20219 * deps.mk (fns.o):
20220 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20221
20222 * fns.c (crypto_hash_function, Fsha1): New function.
20223 (Fmd5): Use crypto_hash_function.
20224 (syms_of_fns): Add Ssha1.
20225
7400048f
PE
202262011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20227
20228 * gnutls.c: Remove unused macros.
20229 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20230 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20231 Remove macros that are defined and never used.
20232 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20233
abb71cf4
CY
202342011-05-22 Chong Yidong <cyd@stupidchicken.com>
20235
20236 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20237 (Fx_get_selection_internal): Minor cleanup.
20238 (Fx_own_selection_internal): Rename arguments for consistency with
20239 select.el.
20240
6307db39
PE
202412011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20242
20243 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20244
f3d4e0a4
CY
202452011-05-22 Chong Yidong <cyd@stupidchicken.com>
20246
20247 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20248
4d8ade89
YM
202492011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20250
20251 * dispnew.c (scrolling_window): Don't exclude the case that the
20252 last enabled row in the desired matrix touches the bottom boundary.
20253
32078c8d
GM
202542011-05-21 Glenn Morris <rgm@gnu.org>
20255
20256 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20257 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20258 and add some more files.
32078c8d 20259
7285dc67
EZ
202602011-05-20 Eli Zaretskii <eliz@gnu.org>
20261
20262 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20263 report_file_error introduced by the change from 2011-05-07.
20264
89d1bd22
PE
202652011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20266
20267 * systime.h (Time): Define only if emacs is defined.
20268 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20269 where the include path doesn't have X11/X.h by default. See
20270 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20271
cd394be1 202722011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20273
20274 * composite.c (find_automatic_composition): Fix previous change.
20275
b9704ad9
GM
202762011-05-20 Glenn Morris <rgm@gnu.org>
20277
20278 * lisp.mk: New file, split from Makefile.in.
20279 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20280 (shortlisp): Remove.
20281 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20282
4a720484
GM
202832011-05-19 Glenn Morris <rgm@gnu.org>
20284
20285 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20286 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20287 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20288 (lisp): Set the order to that of loadup.el.
20289 (shortlisp): Make it a copy of $lisp.
20290 (SOME_MACHINE_LISP): Remove.
20291 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20292 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20293
a28d4396
KH
202942011-05-18 Kenichi Handa <handa@m17n.org>
20295
20296 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20297 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20298 (find_automatic_composition): Mostly rewrite for efficiency.
20299
a2b1fa8e
JB
203002011-05-18 Juanma Barranquero <lekktu@gmail.com>
20301
20302 * makefile.w32-in: Update dependencies.
20303
8e1f5610
CS
203042011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20305
20306 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20307 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20308
7025ee00 203092011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20310
cdfa6eab
PE
20311 Fix some integer overflow issues, such as string length overflow.
20312
06d6db33
PE
20313 * insdel.c (count_size_as_multibyte): Check for string overflow.
20314
2b4560a8
PE
20315 * character.c (lisp_string_width): Check for string overflow.
20316 Use EMACS_INT, not int, for string indexes and lengths; in
20317 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20318 the resulting string length overflows an EMACS_INT; instead,
20319 report a string overflow if no precision given. When checking for
20320 precision exhaustion, use a check that cannot possibly have
20321 integer overflow. (Bug#8675)
20322 * character.h (lisp_string_width): Adjust to new signature.
20323
cb93f9be
PE
20324 * alloc.c (string_overflow): New function.
20325 (Fmake_string): Use it. This doesn't change behavior, but saves
20326 a few bytes and will simplify future changes.
20327 * character.c (string_escape_byte8): Likewise.
20328 * lisp.h (string_overflow): New decl.
20329
1a1f3366
PE
20330 Fixups, following up to the user-interface timestamp change.
20331 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20332 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20333 * msdos.c (mouse_get_pos): Likewise.
20334 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20335 * w32gui.h (Time): Define by including "systime.h" rather than by
20336 declaring it ourselves. (Bug#8664)
20337
d4e3e4d3
PE
20338 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20339 * image.c (clear_image_cache): Likewise.
20340
f6a24d19
PE
20341 * term.c (term_mouse_position): Don't assume time_t wraparound.
20342
08dc5ae6
PE
20343 Be more systematic about user-interface timestamps.
20344 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20345 and sometimes 'EMACS_UINT', to represent these timestamps.
20346 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20347 This makes the code easier to follow, and makes it easier to catch
20348 integer overflow bugs such as Bug#8664.
20349 * frame.c (Fmouse_position, Fmouse_pixel_position):
20350 Use Time, not unsigned long, for user-interface timestamps.
20351 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20352 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20353 * keyboard.h (last_event_timestamp): Likewise.
20354 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20355 * menu.h (xmenu_show): Likewise.
20356 * term.c (term_mouse_position): Likewise.
20357 * termhooks.h (struct input_event.timestamp): Likewise.
20358 (struct terminal.mouse_position_hook): Likewise.
20359 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20360 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20361 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20362 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20363 what it was before.
20364 * menu.h, termhooks.h: Include "systime.h", for Time.
20365
8e55734a
PE
20366 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20367 Don't assume that the difference between two unsigned long values
20368 can fit into an integer. At this point, we know button_down_time
20369 <= event->timestamp, so the difference must be nonnegative, so
20370 there's no need to cast the result if double-click-time is
20371 nonnegative, as it should be; check that it's nonnegative, just in
20372 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20373 apart (about 25 days). (Bug#8664)
8e55734a 20374
841f1b75 20375 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20376 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20377
3e26f69c
PE
20378 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20379 that always fit in int. Use a sentinel instead of a counter, to
20380 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20381 * frame.h (struct frame): Use int for menu_bar_items_used
20382 instead of EMACS_INT, since it always fits in int.
3e26f69c 20383
5cc152c0
PE
20384 * menu.c (grow_menu_items): Check for int overflow.
20385
d89eb65e
PE
20386 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20387
5235bd3e
PE
20388 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20389 Before, the code was not consistent. These values cannot exceed
20390 2**31 - 1 so there's no need to make them unsigned.
20391 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20392 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20393 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20394 as modifiers.
20395 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20396
bc827e23
PE
20397 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20398 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20399 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20400 presumably because the widths might not match.
20401
78eb494e
PE
20402 * window.c (size_window): Avoid needless test at loop start.
20403
04f2d78b
CB
204042011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20405
20406 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20407
d2fc7e3d 204082011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20409
20410 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20411
d2fc7e3d 204122011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20413
20414 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20415 `width' to `bar_area_x' and `bar_area_width', respectively.
20416 (x_scroll_run): Take account of fringe background extension.
20417
04f2d78b
CB
20418 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20419 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20420 `bar_area_width', respectively.
20421 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20422 background extension.
20423
79b70037
GM
204242011-05-10 Jim Meyering <meyering@redhat.com>
20425
20426 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20427
2f142cc5
JB
204282011-05-10 Juanma Barranquero <lekktu@gmail.com>
20429
20430 * image.c (Finit_image_library): Return t for built-in image types,
20431 like pbm and xbm. (Bug#8640)
20432
57679c86
AS
204332011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20434
20435 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20436
888c9e86
EZ
204372011-05-07 Eli Zaretskii <eliz@gnu.org>
20438
b0512a1d
EZ
20439 * w32console.c (Fset_screen_color): Doc fix.
20440 (Fget_screen_color): New function.
20441 (syms_of_ntterm): Defsubr it.
20442
7285dc67
EZ
20443 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20444 unlink the temporary file if Fcall_process didn't create it in the
20445 first place.
20446 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20447 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20448 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20449 cue to call_process_cleanup not to close that handle.
20450
4d3fcc8e
BK
204512011-05-07 Ben Key <bkey76@gmail.com>
20452
20453 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20454 one of two shell specific rules, either bootstrap-temacs-CMD or
20455 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20456 to the previous implementation of the bootstrap-temacs rule.
20457 The bootstrap-temacs-CMD rule is similar to the previous
20458 implementation of the bootstrap-temacs rule except that it
20459 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20460 variable.
20461
20462 These changes, along with some changes to nt/configure.bat,
20463 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20464 earlier fix to add support for --cflags and --ldflags options
20465 that include quotes so that it works whether make uses cmd or
20466 sh as the shell.
20467
b4289b64
MA
204682011-05-06 Michael Albinus <michael.albinus@gmx.de>
20469
20470 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20471 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20472 is a constant.
20473 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20474 a string. Handle both cases.
20475 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20476 (Fdbus_register_method): Use Qinvalid_function.
20477
af4c0e28
JB
204782011-05-06 Juanma Barranquero <lekktu@gmail.com>
20479
20480 * makefile.w32-in: Update dependencies.
20481 (LISP_H): Add inttypes.h and stdin.h.
20482 (PROCESS_H): Add unistd.h.
20483
c51453d9
EZ
204842011-05-06 Eli Zaretskii <eliz@gnu.org>
20485
20486 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20487 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20488
8ff0ac3c 204892011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20490
4c4b566b
PE
20491 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20492
aab2b9b5
PE
20493 * term.c (vfatal): Remove stray call to va_end.
20494 It's not needed and the C Standard doesn't allow it here anyway.
20495
c378da0b
PE
20496 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20497 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20498
288b08c7
PE
20499 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20500 bytes.
20501
e3601888
PE
20502 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20503
db6c0e74
PE
20504 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20505
dd5963ea
PE
20506 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20507
88c9450f
PE
20508 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20509
2f9442b8
PE
20510 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20511
c032b5f8
PE
20512 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20513 * charset.c (Fdefine_charset_internal): Don't initialize
20514 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20515 32-bit int (Bug#8600).
a108c10b
PE
20516
20517 * lread.c (read_integer): Be more consistent with string-to-number.
20518 Use string_to_number to do the actual conversion; this avoids
20519 rounding errors and fixes some other screwups. Without this fix,
20520 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20521 (digit_to_number): Move earlier, for benefit of read_integer.
20522 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20523 not a digit in any supported base. (Bug#8602)
a108c10b 20524
ad5f9eea
PE
20525 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20526
aec1708a
PE
20527 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20528 to match comment at start of function. This also removes a
20529 GCC warning about overflow in a 32+64-bit port.
20530
47be4ab5
PE
20531 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20532
371cac43
PE
20533 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20534 Reported by Stefan Monnier in
20535 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20536 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20537 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20538
d01a7826
PE
20539 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20540 (EMACS_UINTPTR): Likewise, with uintptr_t.
20541
7fd47d5c
PE
20542 * lisp.h: Prefer 64-bit EMACS_INT if available.
20543 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20544 on 32-bit hosts that have 64-bit int, so that they can access
20545 large files.
122b0c86
PE
20546 However, temporarily disable this change unless the temporary
20547 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20548
8727937b
PE
20549 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20550
8ac068ac
PE
20551 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20552 This removes an assumption that EMACS_INT and long are the same
20553 width as pointers. The assumption is true for Emacs porting targets
20554 now, but we want to make other targets possible.
20555 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20556 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20557 In the rest of the code, change types of integers that hold casted
20558 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20559 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20560 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20561 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20562 No need to cast type when ORing.
20563 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20564 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20565 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20566 assume EMACS_INT is the same width as char *.
20567 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20568 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20569 Remove no-longer-needed casts.
20570 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20571 (xg_tool_bar_help_callback, xg_make_tool_item):
20572 Use EMACS_INTPTR to hold an integer
20573 that will be cast to void *; this can avoid a GCC warning
20574 if EMACS_INT is not the same width as void *.
20575 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20576 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20577 (current_message_1, set_message_1):
20578 Use a local to convert to proper width without a cast.
20579 * xmenu.c (dialog_selection_callback): Likewise.
20580
ede49d71
PE
20581 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20582 Also, don't assume VALBITS / RAND_BITS is less than 5,
20583 and don't rely on undefined behavior when shifting a 1 left into
20584 the sign bit.
20585 * lisp.h (get_random): Change signature to match.
20586
2f30ecd0
PE
20587 * lread.c (hash_string): Use size_t, not int, for hash computation.
20588 Normally we prefer signed values; but hashing is special, because
20589 it's better to use unsigned division on hash table sizes so that
20590 the remainder is nonnegative. Also, size_t is the natural width
20591 for hashing into memory. The previous code used 'int', which doesn't
20592 retain enough info to hash well into very large tables.
20593 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20594
2a866e7b
PE
20595 * dbusbind.c: Don't possibly lose pointer info when converting.
20596 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20597 Use XPNTR rather than XHASH, so that the high-order bits of
20598 the pointer aren't lost when converting through void *.
20599
51639eac
PE
20600 * eval.c (Fautoload): Don't double-shift a pointer.
20601
92394119
PE
20602 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20603
dbdb9a7c
JB
206042011-05-06 Juanma Barranquero <lekktu@gmail.com>
20605
20606 * gnutls.c (DEF_GNUTLS_FN):
20607 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20608
db7a0b4f
AS
206092011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20610
20611 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20612 marker. (Bug#8610)
20613
cd394be1 206142011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
20615
20616 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20617 New version that can reserve upto 2GB of heap space.
20618
f7ff1b0f 206192011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
20620
20621 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20622
639c109b
TZ
206232011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20624
20625 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20626 `gnutls_certificate_set_x509_key_file'.
20627
d2127135
JB
206282011-05-05 Juanma Barranquero <lekktu@gmail.com>
20629
20630 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20631 Update dependencies.
20632
e968f4f3
JB
206332011-05-04 Juanma Barranquero <lekktu@gmail.com>
20634
20635 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20636 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20637 Remove unused parameter `fildes'.
20638 * process.c (read_process_output, send_process): Don't pass it.
20639
84d358f0
JB
206402011-05-04 Juanma Barranquero <lekktu@gmail.com>
20641
20642 Fix previous change: the library cache is defined in w32.c.
20643 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20644 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20645
0898ca10
JB
206462011-05-04 Juanma Barranquero <lekktu@gmail.com>
20647
20648 Implement dynamic loading of GnuTLS on Windows.
20649
20650 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20651 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20652 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20653 Declare.
20654
20655 * gnutls.c (Qgnutls_dll): Define.
20656 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20657 (gnutls_*): Declare function pointers.
20658 (init_gnutls_functions): New function to initialize function pointers.
20659 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20660 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20661 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20662 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20663 (emacs_gnutls_write, emacs_gnutls_read)
20664 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20665 (Fgnutls_available_p): New function.
20666 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20667 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20668 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20669
20670 * image.c: Include w32.h.
20671 (Vimage_type_cache): Delete.
20672 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20673 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20674 (w32_delayed_load): Move to w32.c.
20675
20676 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20677
20678 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20679 (w32_delayed_load): Move from image.c. When loading a library, record
20680 its filename in the :loaded-from property of the library id.
20681 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20682 Initialize and staticpro them.
20683 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20684
20685 * process.c: Include lisp.h before w32.h, not after.
20686 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20687 instead of gnutls_record_check_pending.
20688
20689 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20690
ff4de4aa
TZ
206912011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20692
20693 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20694 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20695 as passed in.
20696
abe95abb
JD
206972011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20698
20699 * xterm.c (x_set_frame_alpha): Do not set property on anything
20700 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20701
e16e55d4
JB
207022011-05-02 Juanma Barranquero <lekktu@gmail.com>
20703
20704 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20705
bafcf6a5
JB
207062011-05-02 Juanma Barranquero <lekktu@gmail.com>
20707
20708 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20709 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20710 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20711 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20712 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20713 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20714 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20715 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20716 (Qgnutls_bootprop_callbacks_verify): Make static.
20717
e7a6747f
AS
207182011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20719
19ed11ba
AS
20720 * callproc.c: Indentation fixup.
20721
e7a6747f 20722 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
20723 (wait_for_termination, interruptible_wait_for_termination):
20724 Move after wait_for_termination_1.
e7a6747f 20725
1ef14cb4
LMI
207262011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20727
20728 * sysdep.c (interruptible_wait_for_termination): New function
20729 which is like wait_for_termination, but allows keyboard
20730 interruptions.
20731
20732 * callproc.c (Fcall_process): Add (:file "file") as an option for
20733 the STDOUT buffer.
20734 (Fcall_process_region): Ditto.
20735
330d880c
EZ
207362011-04-30 Eli Zaretskii <eliz@gnu.org>
20737
8db90b73
EZ
20738 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20739 rather than `XVECTOR (FOO)->size'.
20740
330d880c
EZ
20741 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20742 inttypes.h, as a gnulib replacement is used if it not available in
20743 system headers.
20744
15cbd324
EZ
207452011-04-21 Eli Zaretskii <eliz@gnu.org>
20746
20747 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20748 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20749 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20750
20751 * coding.c (coding_alloc_by_realloc): Error out if destination
20752 will grow beyond MOST_POSITIVE_FIXNUM.
20753 (decode_coding_emacs_mule): Abort if there isn't enough place in
20754 charbuf for the composition carryover bytes. Reserve an extra
20755 space for up to 2 characters produced in a loop.
20756 (decode_coding_iso_2022): Abort if there isn't enough place in
20757 charbuf for the composition carryover bytes.
20758
207592011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 20760
ae940cca
EZ
20761 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20762 aborting when %lld or %lll format is passed.
20763 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20764 %llo or %llx format is passed. (Bug#8545)
20765
03ab8921
EZ
20766 * window.c (window_scroll_line_based): Use a marker instead of
20767 simple variables to record original value of point. (Bug#7952)
20768
afda1437
EZ
20769 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20770 produced by %s or %c overflows available buffer space. (Bug#8545)
20771
f76dee0c
PE
207722011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20773
20774 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 20775 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 20776
fdc5744d
JB
207772011-04-28 Juanma Barranquero <lekktu@gmail.com>
20778
20779 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20780
638f053a
JB
207812011-04-28 Juanma Barranquero <lekktu@gmail.com>
20782
20783 * keyboard.c (Qdelayed_warnings_hook): Define.
20784 (command_loop_1): Run `delayed-warnings-hook'
20785 if Vdelayed_warnings_list is non-nil.
20786 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20787 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20788
d178f871
EZ
207892011-04-28 Eli Zaretskii <eliz@gnu.org>
20790
20791 * doprnt.c (doprnt): Don't return value smaller than the buffer
20792 size if the message was truncated. (Bug#8545).
20793
b124fd93
JB
207942011-04-28 Juanma Barranquero <lekktu@gmail.com>
20795
20796 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20797 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20798
e810457d
PE
207992011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20800
20801 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20802
ea51cceb
JB
208032011-04-27 Juanma Barranquero <lekktu@gmail.com>
20804
20805 * makefile.w32-in: Update dependencies.
20806
94dcfacf
EZ
208072011-04-27 Eli Zaretskii <eliz@gnu.org>
20808
20809 Improve `doprnt' and its usage. (Bug#8545)
20810 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20811 `format_end'. Remove support for %l as a conversion specifier.
20812 Don't use xrealloc. Improve diagnostics when the %l size modifier
20813 is used. Update the commentary.
20814
20815 * eval.c (verror): Simplify calculation of size_t.
20816
20817 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20818 messages.
20819
f61f41d7
PE
208202011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20821
20822 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20823 change.
20824
96fb4434
PE
208252011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20826
20827 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20828 This makes this file independent of the recent pseudovector change.
20829
671875da 208302011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 20831
69e9b5a3
PE
20832 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20833
b5f869a7 20834 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 20835 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 20836 Remove unused local.
c8926152 20837 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 20838
841a1577 20839 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
20840 GCC 4.6.0 optimizes based on type-based alias analysis.
20841 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
20842 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20843 != &v->size, and therefore "v->size = 1; b->size = 2; return
20844 v->size;" must therefore return 1. This assumption is incorrect
20845 for Emacs, since it type-puns struct Lisp_Vector * with many other
20846 types. To fix this problem, this patch adds a new type struct
f904488f 20847 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
20848 and pseudovectors, and helps optimizing compilers not get fooled
20849 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20850 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
20851 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20852 the size member.
eab3844f
PE
20853 (XSETPVECTYPE): Rewrite in terms of new macro.
20854 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20855 This is a bit clearer, and further avoids the possibility of
20856 undesirable aliasing.
20857 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 20858 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
20859 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20860 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
20861 (ASIZE): Now uses header.size rather than size.
20862 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
20863 to avoid the hassle of writing XVECTOR (foo)->header.size.
20864 (struct vectorlike_header): New type.
eab3844f
PE
20865 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20866 object, to help avoid aliasing.
20867 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20868 (SUBRP): Likewise, since Lisp_Subr is a special case.
20869 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20870 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20871 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 20872 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
20873 changed to be "header.size" and "header.next".
20874 * buffer.h (struct buffer): Likewise.
20875 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20876 * frame.h (struct frame): Likewise.
20877 * process.h (struct Lisp_Process): Likewise.
20878 * termhooks.h (struct terminal): Likewise.
20879 * window.c (struct save_window_data, struct saved_window): Likewise.
20880 * window.h (struct window): Likewise.
20881 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20882 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20883 * buffer.c (init_buffer_once): Likewise.
20884 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20885 special case.
20886 * process.c (Fformat_network_address): Use local var for size,
20887 for brevity.
20888
0df1eac5
PE
20889 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20890
847ab9d1 20891 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
20892 * data.c (atof): Remove decl; no longer used or needed.
20893 (digit_to_number): Move to lread.c.
20894 (Fstring_to_number): Use new string_to_number function, to be
20895 consistent with how the Lisp reader treats infinities and NaNs.
20896 Do not assume that floating-point numbers represent EMACS_INT
20897 without losing information; this is not true on most 64-bit hosts.
20898 Avoid double-rounding errors, by insisting on integers when
20899 parsing non-base-10 numbers, as the documentation specifies.
20900 * lisp.h (string_to_number): New decl, replacing ...
20901 (isfloat_string): Remove.
bc0a5c13 20902 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 20903 (read1): Do not accept +. and -. as integers; this
452f4150
PE
20904 appears to have been a coding error. Similarly, do not accept
20905 strings like +-1e0 as floating point numbers. Do not report
20906 overflow for integer overflows unless the base is not 10 which
20907 means we have no simple and reliable way to continue.
20908 Break out the floating-point parsing into a new
20909 function string_to_number, so that Fstring_to_number parses
20910 floating point numbers consistently with the Lisp reader.
04f2d78b 20911 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
20912 (E_CHAR, EXP_INT): Remove, replacing with ...
20913 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20914 (string_to_number): New function, replacing isfloat_string.
20915 This function checks for valid syntax and produces the resulting
20916 Lisp float number too. Rework it so that string-to-number
bc0a5c13 20917 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
20918 so that overflow for non-base-10 numbers is reported only when
20919 there's no portable and simple way to convert to floating point.
452f4150 20920
67769ffc
PE
20921 * textprop.c (set_text_properties_1): Rewrite for clarity,
20922 and to avoid GCC warning about integer overflow.
20923
c20db43f
PE
20924 * intervals.h (struct interval): Use EMACS_INT for members
20925 where EMACS_UINT might cause problems. See
20926 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20927 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20928 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20929 All uses changed.
37aa2f85
PE
20930 (offset_intervals): Tell GCC not to worry about length overflow
20931 when negating a negative length.
c20db43f 20932
2538aa2f
PE
20933 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20934 (overrun_check_free): Likewise.
20935
f2d3008d
PE
20936 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20937 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20938 word size.
20939
ec8df744
PE
20940 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20941 (gnutls_make_error): Rename local to avoid shadowing.
20942 (gnutls_emacs_global_deinit): ifdef out; not used.
20943 (Fgnutls_boot): Use const for pointer to readonly storage.
20944 Comment out unused local. Fix pointer signedness problems.
20945
640ee02d
PE
20946 * lread.c (openp): Don't stuff size_t into an 'int'.
20947 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20948 about possible signed overflow.
20949
6048fb2a
PE
20950 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20951 (GDK_KEY_g): Don't define if already defined.
20952 (xg_prepare_tooltip): Avoid pointer signedness problem.
20953 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20954
fa3c87e1
PE
20955 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20956 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20957
2172544b
PE
20958 * xfns.c (Fx_window_property): Simplify a bit,
20959 to make a bit faster and to avoid GCC 4.6.0 warning.
20960 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20961
9b821a21
PE
20962 * fns.c (internal_equal): Don't assume size_t fits in int.
20963
3c616cfa
PE
20964 * alloc.c (compact_small_strings): Tighten assertion a little.
20965
c2982e87
PE
20966 Replace pEd with more-general pI, and fix some printf arg casts.
20967 * lisp.h (pI): New macro, generalizing old pEd macro to other
20968 conversion specifiers. For example, use "...%"pI"d..." rather
20969 than "...%"pEd"...".
20970 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20971 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20972 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20973 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20974 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20975 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20976 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20977 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20978 64-bit hosts.
20979 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20980 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20981 * print.c (safe_debug_print, print_object): Likewise.
20982 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20983 to int.
6f04d126
PE
20984 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20985 avoiding the 0 flag, which is not portable.
c2982e87
PE
20986 * process.c (Fmake_network_process): Use pI to avoid cast.
20987 * region-cache.c (pp_cache): Likewise.
20988 * xdisp.c (decode_mode_spec): Likewise.
20989 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20990 behavior on 64-bit hosts with printf arg.
6f04d126 20991 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20992 (x_stop_queuing_selection_requests): Likewise.
20993 (x_get_window_property): Don't truncate byte count to an 'int'
20994 when tracing.
0b432f21 20995
5e073ec7
PE
20996 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20997 here, since it parses constructs like leading '-' and spaces,
20998 which are not wanted; and it overflows with large numbers.
20999 Instead, simply match F[0-9]+, which is what is wanted anyway.
21000
36372bf9
PE
21001 * alloc.c: Remove unportable assumptions about struct layout.
21002 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21003 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21004 (allocate_vectorlike, make_pure_vector): Use the new macros,
21005 plus offsetof, to remove unportable assumptions about struct layout.
21006 These assumptions hold on all porting targets that I know of, but
21007 they are not guaranteed, they're easy to remove, and removing them
21008 makes further changes easier.
21009
0b432f21
PE
21010 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21011 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21012 (string_overrun_cookie): Now const. Use initializers that
21013 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21014 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21015 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21016 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21017 multiple of sizeof (EMACS_INT); it need not be, if
21018 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21019 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21020
895009e1
JB
210212011-04-26 Juanma Barranquero <lekktu@gmail.com>
21022
21023 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21024
6a7a1b0b
TZ
210252011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21026
21027 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21028 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21029 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21030
841a1577 210312011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21032
21033 * lisp.h (Qdebug): List symbol.
895009e1 21034 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21035 * keyboard.c (debug-on-event): New variable.
21036 (handle_user_signal): Break into debugger when debug-on-event
21037 matches the current signal symbol.
21038
f2d3ba6f
DN
210392011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21040
21041 * alloc.c (check_sblock, check_string_bytes)
21042 (check_string_free_list): Convert to standard C.
21043
42ce4c63
TZ
210442011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21045
21046 * w32.c (emacs_gnutls_push): Fix typo.
21047
825cd63c
EZ
210482011-04-25 Eli Zaretskii <eliz@gnu.org>
21049
fb11d64d
EZ
21050 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21051 "cast to pointer from integer of different size".
21052
825cd63c
EZ
21053 Improve doprnt and its use in verror. (Bug#8545)
21054 * doprnt.c (doprnt): Document the set of format control sequences
21055 supported by the function. Use SAFE_ALLOCA instead of always
21056 using `alloca'.
21057
21058 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21059 is one byte too soon. Don't use xrealloc; instead xfree and
21060 xmalloc anew.
21061
e061a11b
TZ
210622011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21063
21064 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21065 callbacks stage.
21066
21067 * gnutls.c: Renamed global_initialized to
21068 gnutls_global_initialized. Added internals for the
21069 :verify-hostname-error, :verify-error, and :verify-flags
21070 parameters of `gnutls-boot' and documented those parameters in the
21071 docstring. Start callback support.
9173deec
JB
21072 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21073 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21074 on error. Return error code.
e061a11b
TZ
21075 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21076 (emacs_gnutls_read): Likewise.
21077 (Fgnutls_boot): Return handshake error code.
21078 (emacs_gnutls_handle_error): New function.
21079 (wsaerror_to_errno): Likewise.
21080
21081 * w32.h (emacs_gnutls_pull): Add prototype.
21082 (emacs_gnutls_push): Likewise.
21083
21084 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21085 (emacs_gnutls_push): Likewise.
21086
210872011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21088
21089 * process.c (wait_reading_process_output): Check if GnuTLS
21090 buffered some data internally if no FDs are set for TLS
21091 connections.
21092
21093 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21094 (LIBS): Link to USER_LIBS.
21095 ($(BLD)/gnutls.$(0)): New target.
21096
fa6996bc
EZ
210972011-04-24 Eli Zaretskii <eliz@gnu.org>
21098
eb35682e
EZ
21099 * xdisp.c (handle_single_display_spec): Rename the
21100 display_replaced_before_p argument into display_replaced_p, to
21101 make it consistent with the commentary. Fix typos in the
21102 commentary.
21103
e2ad650c
EZ
21104 * textprop.c (syms_of_textprop): Remove dead code.
21105 (copy_text_properties): Delete obsolete commentary about an
21106 interface that was deleted long ago. Fix typos in the description
21107 of arguments.
21108
1b2de274
EZ
21109 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21110 to changes in oldXMenu/XMenu.h from 2011-04-16.
21111 <menu_help_message, prev_menu_help_message>: Constify.
21112 (IT_menu_make_room): menu->help_text is now `const char **';
21113 adjust.
21114
21115 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21116 to changes in oldXMenu/XMenu.h from 2011-04-16.
21117 (struct XMenu): Declare `help_text' `const char **'.
21118
21119 * xfaces.c <Qunspecified>: Make extern again.
21120
21121 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21122 required by POSIX.
1b2de274 21123
762b15be
EZ
21124 * doc.c (get_doc_string): Improve the format passed to `error'.
21125
21126 * doprnt.c (doprnt): Improve commentary.
21127
21128 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21129
21130 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21131 them with etags.
21132
f1052e5d
EZ
21133 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21134 changes in globals.h immediately force recompilation.
762b15be
EZ
21135 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21136 $(CURDIR)/s/ms-w32.h.
21137 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21138
fa6996bc
EZ
21139 * character.c (Fchar_direction): Function deleted.
21140 (syms_of_character): Don't defsubr it.
21141 <char-direction-table>: Deleted.
21142
e6c3da20
EZ
211432011-04-23 Eli Zaretskii <eliz@gnu.org>
21144
21145 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21146 * doprnt.c: Include limits.h.
21147 (SIZE_MAX): New macro.
04f2d78b
CB
21148 (doprnt): Return a size_t value. 2nd arg is now size_t.
21149 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21150 Improve overflow protection. Support `l' modifier for integer
21151 conversions. Support %l conversion. Don't assume an EMACS_INT
21152 argument for integer conversions and for %c.
21153
21154 * lisp.h (doprnt): Restore prototype.
21155
21156 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21157 $(SRC)/character.h.
21158
21159 * Makefile.in (base_obj): Add back doprnt.o.
21160
21161 * deps.mk (doprnt.o): Add back prerequisites.
21162 (callint.o): Depend on character.h.
21163
21164 * eval.c (internal_lisp_condition_case): Include the handler
21165 representation in the error message.
21166 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21167 when breaking from the loop.
21168
21169 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21170
21171 * callint.c (Fcall_interactively): When displaying error message
21172 about invalid control letter, pass the character's codepoint, not
21173 a pointer to its multibyte form. Improve display of the character
21174 in octal and display also its hex code.
21175
21176 * character.c (char_string): Use %x to display the (unsigned)
21177 codepoint of an invalid character, to avoid displaying a bogus
21178 negative value.
21179
21180 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21181 `error', not SYMBOL_NAME itself.
21182
21183 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21184 character arguments to `error'.
21185
21186 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21187 to `error' in error message about FINAL_CHAR argument. Make sure
21188 FINAL_CHAR is a character, and use %c when it is passed as
21189 argument to `error'.
21190
4ffd0d6b 211912011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21192
21193 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21194
21195 * w32.c: Include <time.h>.
21196 (sys_localtime): New function.
21197
4ffd0d6b 211982011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21199
21200 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21201
4ffd0d6b 21202 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21203
4ffd0d6b 212042011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21205
4ffd0d6b
GM
21206 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21207 zombies (Bug#8467).
aac0c6e3 21208
04c56954
EZ
212092011-04-19 Eli Zaretskii <eliz@gnu.org>
21210
21211 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21212 gl_state.e_property when gl_state.object is Qt.
21213
21214 * insdel.c (make_gap_larger): Remove limitation of buffer size
21215 to <= INT_MAX.
21216
16a43933
CY
212172011-04-18 Chong Yidong <cyd@stupidchicken.com>
21218
21219 * xdisp.c (lookup_glyphless_char_display)
21220 (produce_glyphless_glyph): Handle cons cell entry in
21221 glyphless-char-display.
21222 (Vglyphless_char_display): Document it.
21223
21224 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21225 glyphless-char-display.
21226
4581706e
CY
212272011-04-17 Chong Yidong <cyd@stupidchicken.com>
21228
21229 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21230
21231 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21232
21233 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21234 definition for no-X builds.
21235
4887c6e2 212362011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21237
fd35b6f9
PE
21238 Static checks with GCC 4.6.0 and non-default toolkits.
21239
5c1ccb01
PE
21240 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21241
006c5daa
PE
21242 * process.c (keyboard_bit_set): Define only if SIGIO.
21243 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21244 (send_process): Repair possible setjmp clobbering.
21245
efc736d3
PE
21246 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21247
4e2fe2e6
PE
21248 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21249
f97334a2
PE
21250 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21251
4e75f29d
PE
21252 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21253 Define only if needed.
21254
90efadd1
PE
21255 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21256 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21257 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21258
3c647824
PE
21259 * dispextern.h (struct redisplay_interface): Rename param
21260 to avoid shadowing.
e264f262 21261 * termhooks.h (struct terminal): Likewise.
761383f4 21262 * xterm.c (xembed_send_message): Likewise.
3c647824 21263
b58c5c4a
PE
21264 * insdel.c (make_gap_smaller): Define only if
21265 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21266
cad59032
PE
21267 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21268 it.
21269
c339dc2e
PE
21270 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21271 so that we aren't warned about unused symbols.
21272
91a3e27b
PE
21273 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21274
399c71d3 21275 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21276
8ffc96f5
PE
21277 * xfns.c (x_real_positions): Mark locals as initialized.
21278
eef9bc79
PE
21279 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21280
098db9dd
PE
21281 * xterm.c: Fix problems found by static analysis with other toolkits.
21282 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21283 (x_dispatch_event): Declare static if USE_GTK, and
21284 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21285 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21286 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21287 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21288 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21289
eb18f6cc
PE
21290 * xmenu.c (menu_help_callback): Pointer type fixes.
21291 Use const pointers when pointing at readonly data. Avoid pointer
21292 signedness clashes.
21293 (FALSE): Remove unused macro.
21294 (update_frame_menubar): Remove unused decl.
21295
1fe72bf8
PE
21296 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21297
60d9e1db
PE
21298 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21299 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21300 (single_menu_item): Rename local to avoid shadowing.
21301
39261c26
PE
21302 * keyboard.c (make_lispy_event): Remove unused local var.
21303
018c5e19
PE
21304 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21305 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21306
63d2b86e
PE
21307 * bitmaps: Change bitmaps from unsigned char back to the X11
21308 compatible char. Avoid the old compiler warnings about
21309 out-of-range initializers by using, for example, '\xab' rather
21310 than 0xab.
21311
aefd87e1
PE
21312 * xgselect.c (xgselect_initialize): Check vs interface
21313 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21314
bf501fb9
PE
21315 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21316
e9829fdf
PE
21317 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21318 to read-only memory.
21319
1086c095
PE
21320 * fns.c (vector): Remove; this old hack is no longer needed.
21321
2baccd04 21322 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21323 Remove unused var.
dde42981 21324 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21325
72391843 21326 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21327
436c16df 21328 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21329 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21330 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21331
92bb796d 21332 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21333 (x_term_init): Remove local to avoid shadowing.
92bb796d 21334
764430a3 21335 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21336
21337 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21338 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21339
d1dfb56c
EZ
213402011-04-16 Eli Zaretskii <eliz@gnu.org>
21341
c4354cb4
EZ
21342 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21343
d1dfb56c
EZ
21344 Fix regex.c, syntax.c and friends for buffers > 2GB.
21345 * syntax.h (struct gl_state_s): Declare character position members
21346 EMACS_INT.
21347
21348 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21349
04f2d78b
CB
21350 * textprop.c (verify_interval_modification, interval_of):
21351 Declare arguments EMACS_INT.
d1dfb56c
EZ
21352
21353 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21354 EMACS_INT.
21355
21356 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21357
21358 * indent.c (Fvertical_motion): Local variable it_start is now
21359 EMACS_INT.
21360
21361 * regex.c (re_match, re_match_2, re_match_2_internal)
21362 (bcmp_translate, regcomp, regexec, print_double_string)
21363 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21364 (re_compile_pattern, re_exec): Declare arguments and local
21365 variables `size_t' and `ssize_t' and return values `regoff_t', as
21366 appropriate.
21367 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21368 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21369 <compile_stack_type>: `size' and `avail' are now `size_t'.
21370
21371 * regex.h <regoff_t>: Use ssize_t, not int.
21372 (re_search, re_search_2, re_match, re_match_2): Arguments that
21373 specify buffer/string position and length are now ssize_t and
21374 size_t. Return type is regoff_t.
21375
613052cd
BK
213762011-04-16 Ben Key <bkey76@gmail.com>
21377
21378 * nsfont.m: Fixed bugs in ns_get_family and
21379 ns_descriptor_to_entity that were caused by using free to
21380 deallocate memory blocks that were allocated by xmalloc (via
21381 xstrdup). This caused Emacs to crash when compiled with
21382 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21383 --enable-checking=xmallocoverrun). xfree is now used to
21384 deallocate these memory blocks.
21385
4170f62f 213862011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21387
71b41406
PE
21388 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21389
9587a89d
PE
21390 emacs_write: Accept and return EMACS_INT for sizes.
21391 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21392 et seq.
21393 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21394 Accept and return EMACS_INT.
21395 (emacs_gnutls_write): Return the number of bytes written on
21396 partial writes.
21397 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21398 (emacs_read, emacs_write): Remove check for negative size, as the
21399 Emacs source code has been audited now.
9587a89d
PE
21400 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21401 (emacs_read, emacs_write): Use it.
273a5f82
PE
21402 * process.c (send_process): Adjust to the new signatures of
21403 emacs_write and emacs_gnutls_write. Do not attempt to store
21404 a byte offset into an 'int'; it might overflow.
9587a89d 21405 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21406
3e047f51
PE
21407 * sound.c: Don't assume sizes fit in 'int'.
21408 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21409 Return EMACS_INT, not int.
3e047f51 21410 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21411 Accept EMACS_INT, not int.
21412 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21413 record read return values.
21414
cc39a9db
BK
214152011-04-15 Ben Key <bkey76@gmail.com>
21416
c9d0ec6d
JB
21417 * keyboard.c (Qundefined): Don't declare static since it is used
21418 in nsfns.m.
21419 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21420 static since they are used in nsfont.m.
cc39a9db 21421
6c60eb9f
SM
214222011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21423
21424 * process.c (Qprocessp): Don't declare static.
21425 * lisp.h (Qprocessp): Declare again.
21426
7990b61a
JB
214272011-04-15 Juanma Barranquero <lekktu@gmail.com>
21428
21429 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21430
5d4cb038
PE
214312011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21432
8bd7b830 21433 Improve C-level modularity by making more things 'static'.
cd64ea1d 21434
e3b27b31
PE
21435 Don't publish debugger-only interfaces to other modules.
21436 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21437 (verify_bytepos, count_markers): Move decls to the only modules
21438 that need them.
21439 * region-cache.h (pp_cache): Likewise.
21440 * window.h (check_all_windows): Likewise.
21441 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21442
5d4cb038
PE
21443 * sysdep.c (croak): Now static, if
21444 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21445 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21446
21447 * alloc.c (refill_memory_reserve): Now static if
21448 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21449 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21450
e87b6180
PE
21451 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21452 Define only if USE_LUCID.
21453
ac64929e
PE
21454 * xrdb.c (x_customization_string, x_rm_string): Now static.
21455
6f37259d
PE
21456 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21457 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21458
1683e3ab
PE
21459 * xdisp.c (draw_row_with_mouse_face): Now static.
21460 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21461
de9c2632
PE
21462 * window.h (check_all_windows): Mark externally visible.
21463
2b96acb7
PE
21464 * window.c (window_deletion_count): Now static.
21465
21466 * undo.c: Make symbols static if they're not exported.
21467 (last_undo_buffer, last_boundary_position, pending_boundary):
21468 Now static.
21469
50436f33
PE
21470 * textprop.c (interval_insert_behind_hooks): Now static.
21471 (interval_insert_in_front_hooks): Likewise.
21472
64520e5c
PE
21473 * term.c: Make symbols static if they're not exported.
21474 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21475 (max_frame_lines, tty_set_terminal_modes):
21476 (tty_reset_terminal_modes, tty_turn_off_highlight):
21477 (get_tty_terminal): Now static.
21478 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21479 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21480 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21481 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21482 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21483
1fa53021
PE
21484 * sysdep.c: Make symbols static if they're not exported.
21485 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21486 Now static.
21487 (sigprocmask_set, full_mask): Remove; unused.
21488 (wait_debugging): Mark as visible.
21489 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21490 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21491
d4b43b22
PE
21492 * syntax.c (syntax_temp): Define only if !__GNUC__.
21493
b7c513d0
PE
21494 * sound.c (current_sound_device, current_sound): Now static.
21495
989b29ad
PE
21496 * search.c (searchbufs, searchbuf_head): Now static.
21497
13a55a78
PE
21498 * scroll.c (scroll_cost): Remove; unused.
21499 * dispextern.h (scroll_cost): Remove decl.
21500
de68a1fc
PE
21501 * region-cache.h (pp_cache): Mark as externally visible.
21502
40ccffa6
PE
21503 * process.c: Make symbols static if they're not exported.
21504 (process_tick, update_tick, create_process, chan_process):
21505 (Vprocess_alist, proc_buffered_char, datagram_access):
21506 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21507 (deactivate_process): Mark defn as static, as well as decl.
21508 * lisp.h (create_process): Remove decl.
21509 * process.h (chan_process, Vprocess_alist): Remove decls.
21510
ad64fc97
PE
21511 * print.c: Make symbols static if they're not exported.
21512 (print_depth, new_backquote_output, being_printed, print_buffer):
21513 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21514 (print_interval, print_number_index, initial_stderr_stream):
21515 Now static.
21516 * lisp.h (Fprinc): Remove decl.
21517 (debug_output_compilation_hack): Mark as externally visible.
21518
adddb265
PE
21519 * sysdep.c (croak): Move decl from here to syssignal.h.
21520 * syssignal.h (croak): Put it here, so the API can be checked when
21521 'croak' is called from dissociate_if_controlling_tty.
21522
1717ede2
PE
21523 * minibuf.c: Make symbols static if they're not exported.
21524 (minibuf_save_list, choose_minibuf_frame): Now static.
21525 * lisp.h (choose_minibuf_frame): Remove decl.
21526
fa5fb2bc
PE
21527 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21528
1e3890d1
PE
21529 * lread.c: Make symbols static if they're not exported.
21530 (read_objects, initial_obarray, oblookup_last_bucket_number):
21531 Now static.
21532 (make_symbol): Remove; unused.
21533 * lisp.h (initial_obarray, make_symbol): Remove decls.
21534
8a1414fa
PE
21535 * keyboard.c: Make symbols static if they're not exported.
21536 (single_kboard, recent_keys_index, total_keys, recent_keys):
21537 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21538 (this_single_command_key_start, echoing, last_auto_save):
21539 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21540 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21541 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21542 (Vlispy_mouse_stem, double_click_count):
21543 Now static.
21544 (force_auto_save_soon): Define only if SIGDANGER.
21545 (ignore_mouse_drag_p): Now static if
21546 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21547 (print_help): Remove; unused.
21548 (stop_character, last_timer_event): Mark as externally visible.
21549 * keyboard.h (ignore_mouse_drag_p): Declare only if
21550 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21551 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21552 * lisp.h (echoing): Remove decl.
21553 (force_auto_save_soon): Declare only if SIGDANGER.
21554 * xdisp.c (redisplay_window): Simplify code, to make it more
21555 obvious that ignore_mouse_drag_p is not accessed if !defined
21556 USE_GTK && !defined HAVE_NS.
21557
93ea6e8f
PE
21558 * intervals.c: Make symbols static if they're not exported.
21559 (merge_properties_sticky, merge_interval_right, delete_interval):
21560 Now static.
21561 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21562
77382fcc
PE
21563 * insdel.c: Make symbols static if they're not exported.
21564 However, leave prepare_to_modify_buffer alone. It's never
21565 called from outside this function, but that appears to be a bug.
21566 (combine_after_change_list, combine_after_change_buffer):
4889fc82 21567 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
21568 (adjust_after_replace_noundo): Remove; unused.
21569 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 21570 (signal_before_change): Remove decls.
77382fcc 21571
9306c32e
PE
21572 * indent.c (val_compute_motion, val_vmotion): Now static.
21573
cd44d2eb
PE
21574 * image.c: Make symbols static if they're not exported.
21575 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21576 if USE_GTK.
21577 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21578 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21579
ad9a7a06
PE
21580 * fringe.c (standard_bitmaps): Now static.
21581 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21582
81626931
PE
21583 * frame.c: Make symbols static if they're not exported.
21584 (x_report_frame_params, make_terminal_frame): Now static.
21585 (get_frame_param): Now static, unless HAVE_NS.
21586 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21587 (x_get_resource_string): Remove; not used.
21588 * frame.h (make_terminal_frame, x_report_frame_params):
21589 (x_get_resource_string); Remove decls.
21590 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21591 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21592
239f9db9
PE
21593 * font.c, fontset.c: Make symbols static if they're not exported.
21594 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21595 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21596 * font.c (font_close_object): Now static.
21597 * font.h (font_close_object): Remove.
21598 * fontset.c (FONTSET_OBJLIST): Remove.
21599 (free_realized_fontset) #if-0 the body, which does nothing.
21600 (face_suitable_for_char_p): #if-0, as it's never called.
21601 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
21602 * xfaces.c (face_at_string_position):
21603 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
21604 since 0 is always ASCII.
21605
dfcf3579
PE
21606 * fns.c (weak_hash_tables): Now static.
21607
5045092b
PE
21608 * fileio.c: Make symbols static if they're not exported.
21609 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21610 (Vwrite_region_annotation_buffers): Now static.
21611
57a96f5c
PE
21612 * eval.c: Make symbols static if they're not exported.
21613 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21614 * lisp.h (backtrace_list): Remove decl.
21615
35f08c38
PE
21616 * emacs.c: Make symbols static if they're not exported.
21617 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21618 (fatal_error_code, fatal_error_signal_hook, standard_args):
21619 Now static.
21620 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21621 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21622 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21623 * lisp.h (fatal_error_signal_hook): Remove decl.
21624 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21625
f44bd759
PE
21626 * editfns.c: Move a (normally-unused) function to its only use.
21627 * editfns.c, lisp.h (get_operating_system_release): Remove.
21628 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21629 worth the hassle of breaking this out.
21630
b532497d
PE
21631 * xterm.c: Make symbols static if they're not exported.
21632 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21633 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21634 (x_destroy_window, x_delete_display):
21635 Now static.
21636 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21637 (x_mouse_leave): Remove; unused.
21638 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21639 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21640 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21641 Remove decls.
21642 (x_mouse_leave): Declare only if WINDOWSNT.
21643 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21644 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21645 USE_X_TOOLKIT.
21646
1675728f
PE
21647 * ftxfont.c: Make symbols static if they're not exported.
21648 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21649 HAVE_FREETYPE.
21650 * font.h (ftxfont_driver): Likewise.
21651
e4cebfca
PE
21652 * xfns.c: Make symbols static if they're not exported.
21653 (x_last_font_name, x_display_info_for_name):
21654 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21655 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21656 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21657 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21658 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21659 (last_show_tip_args): Now static.
21660 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21661 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21662 (x_screen_planes): Remove; unused.
21663 * dispextern.h (x_screen_planes): Remove decl.
21664
5bf46f05
PE
21665 * dispnew.c: Make symbols static if they're not exported.
21666 * dispextern.h (redraw_garbaged_frames, scrolling):
21667 (increment_row_positions): Remove.
21668 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21669 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21670 Now static.
21671 (redraw_garbaged_frames): Remove; unused.
21672
435f4c28
PE
21673 * xfaces.c: Make symbols static if they're not exported.
21674 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21675 Remove decls.
21676 * xterm.h (defined_color): Remove decls.
21677 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21678 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21679 (menu_face_changed_default, defined_color, free_realized_face):
21680 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21681 (ascii_face_of_lisp_face): Remove; unused.
21682
8524aef3
PE
21683 * xdisp.c: Make symbols static if they're not exported.
21684 * dispextern.h (scratch_glyph_row, window_box_edges):
21685 (glyph_to_pixel_coords, set_cursor_from_row):
21686 (get_next_display_element, set_iterator_to_next):
21687 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21688 (show_mouse_face): Remove decls
21689 * frame.h (message_buf_print): Likewise.
21690 * lisp.h (pop_message, set_message, check_point_in_composition):
21691 Likewise.
21692 * xterm.h (set_vertical_scroll_bar): Likewise.
21693 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21694 (message_buf_print, scratch_glyph_row, displayed_buffer):
21695 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21696 (get_next_display_element, show_mouse_face, window_box_edges):
21697 (frame_to_window_pixel_xy, check_point_in_composition):
21698 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21699 (glyph_to_pixel_coords): Remove; unused.
21700
16390cd2
PE
21701 * dired.c (file_name_completion): Now static.
21702
21703 * dbusbind.c (xd_in_read_queued_messages): Now static.
21704
a25f4dfa
PE
21705 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21706 * data.c (circular_list_error): Remove.
21707
14a9c8df
PE
21708 * commands.h (last_point_position, last_point_position_buffer):
21709 (last_point_position_window): Remove decls.
21710 * keyboard.c: Make these variables static.
21711
04f2d78b
CB
21712 * coding.h (coding, code_convert_region, encode_coding_gap):
21713 Remove decls.
74ab6df5
PE
21714 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21715 (iso_code_class, detect_coding, code_convert_region): Now static.
21716 (encode_coding_gap): Remove; unused.
21717
38dfbee1
PE
21718 * chartab.c (chartab_chars, chartab_bits): Now static.
21719
a2cb4e63
PE
21720 * charset.h (charset_iso_8859_1): Remove decl.
21721 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21722 Now static.
21723
127198fd
PE
21724 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21725 * ccl.c (Vccl_program_table): Now static.
21726 (check_ccl_update): Remove; unused.
21727
d85b608f
PE
21728 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21729 * category.h: ... from here.
21730 * category.c (check_category_table, set_category_set): Now static.
21731
31cd66f3
PE
21732 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21733 * lisp.h: Remove these decls.
21734
c358e587
PE
21735 * buffer.c (buffer_count): Remove unused var.
21736
e78aecca
PE
21737 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21738 so that it's not optimized away.
21739 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21740 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21741 exported only to the debugger.
21742
e192d7d3 21743 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 21744 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 21745
92470028
PE
21746 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21747 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21748 was inaccessible from Lisp.
21749 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21750 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21751
244ed907
PE
21752 alloc.c: Import and export fewer symbols, and remove unused items.
21753 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21754 is defined.
21755 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21756 it's not optimized away by whole-program optimization.
21757 (message_enable_multibyte, free_misc): Remove.
21758 (catchlist, handlerlist, mark_backtrace):
21759 Declare only if BYTE_MARK_STACK.
21760 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21761 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21762 (message_enable_multibyte): Remove decl.
21763 (free_misc, interval_free_list, float_block, float_block_index):
21764 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21765 (cons_free_list, last_marked_index):
21766 Now static.
21767 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21768 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21769 (mark_backtrace): Define only if BYTE_MARK_STACK.
21770 * xdisp.c (message_enable_multibyte): Now static.
21771
61c2b50e 21772 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
21773 This makes it easier for human readers (and static analyzers)
21774 to see whether these variables are used from other modules.
21775 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21776 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21777 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21778 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21779 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21780 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21781 * xmenu.c, xselect.c:
21782 Declare Q* vars static if they are not used in other modules.
21783 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21784 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21785 Remove decls of unexported vars.
21786 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21787
95c82688
PE
21788 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21789
16a97296
PE
21790 Make Emacs functions such as Fatom 'static' by default.
21791 This makes it easier for human readers (and static analyzers)
21792 to see whether these functions can be called from other modules.
21793 DEFUN now defines a static function. To make the function external
21794 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
21795 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21796 (Finit_image_library):
16a97296
PE
21797 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21798 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21799 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21800 Remove decls, since these functions are now static.
21801 (Funintern, Fget_internal_run_time): New decls, since these functions
21802 were already external.
95c82688 21803
16a97296
PE
21804 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21805 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21806 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21807 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21808 * keyboard.c, keymap.c, lread.c:
21809 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21810 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21811 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21812 Mark functions with DEFUE instead of DEFUN,
21813 if they are used in other modules.
21814 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21815 decls for now-static functions.
21816 * buffer.h (Fdelete_overlay): Remove decl.
21817 * callproc.c (Fgetenv_internal): Mark as internal.
21818 * composite.c (Fremove_list_of_text_properties): Remove decl.
21819 (Fcomposition_get_gstring): New forward static decl.
21820 * composite.h (Fcomposite_get_gstring): Remove decl.
21821 * dired.c (Ffile_attributes): New forward static decl.
21822 * doc.c (Fdocumntation_property): New forward static decl.
21823 * eval.c (Ffetch_bytecode): New forward static decl.
21824 (Funintern): Remove extern decl; now in .h file where it belongs.
21825 * fileio.c (Fmake_symbolic_link): New forward static decl.
21826 * image.c (Finit_image_library): New forward static decl.
21827 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21828 * intervals.h (Fprevious_property_change):
21829 (Fremove_list_of_text_properties): Remove decls.
21830 * keyboard.c (Fthis_command_keys): Remove decl.
21831 (Fcommand_execute): New forward static decl.
21832 * keymap.c (Flookup_key): New forward static decl.
21833 (Fcopy_keymap): Now static.
21834 * keymap.h (Flookup_key): Remove decl.
21835 * process.c (Fget_process): New forward static decl.
21836 (Fprocess_datagram_address): Mark as internal.
21837 * syntax.c (Fsyntax_table_p): New forward static decl.
21838 (skip_chars): Remove duplicate decl.
21839 * textprop.c (Fprevious_property_change): New forward static decl.
21840 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21841 Now internal.
21842 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21843 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21844
785bbd42
PE
21845 * editfns.c (Fformat): Remove unreachable code.
21846
8b913b57
AS
218472011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21848
21849 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21850 change. (Bug#8496)
21851
a6744a35
EZ
218522011-04-13 Eli Zaretskii <eliz@gnu.org>
21853
21854 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21855 when at ZV. (Bug#8487)
21856
e7974947
AS
218572011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21858
baad03f0
AS
21859 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21860 (Bug#8437)
21861 * keyboard.c (parse_tool_bar_item): Likewise.
21862 * sound.c (sound_cleanup, alsa_close): Likewise.
21863 * termcap.c (tgetent): Likewise.
21864 * xfns.c (x_default_font_parameter): Likewise.
21865 * xsettings.c (read_and_apply_settings): Likewise.
21866
e7974947
AS
21867 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21868 (overrun_check_free): Protoize.
21869
28272684
PE
218702011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21871
21872 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21873 since callers should never pass a negative size.
21874 Change the signature to match that of plain 'read' and 'write'; see
21875 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21876 * lisp.h: Update prototypes of emacs_write and emacs_read.
21877
11997c76
EZ
218782011-04-11 Eli Zaretskii <eliz@gnu.org>
21879
21880 * xdisp.c (redisplay_window): Don't try to determine the character
21881 position of the scroll margin if the window start point w->startp
e896f03c 21882 is outside the buffer's accessible region. (Bug#8468)
11997c76 21883
8a2cbd72
EZ
218842011-04-10 Eli Zaretskii <eliz@gnu.org>
21885
21886 Fix write-region and its subroutines for buffers > 2GB.
21887 * fileio.c (a_write, e_write): Modify declaration of arguments and
21888 local variables to support buffers larger than 2GB.
21889 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21890
21891 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21892 argument, local variables, and return value.
21893
21894 * lisp.h: Update prototypes of emacs_write and emacs_read.
21895
21896 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21897
4073e537 218982011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 21899
1ebfdcb6
PE
21900 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21901
b2ded58d
PE
21902 Fix more problems found by GCC 4.6.0's static checks.
21903
7d66342c
PE
21904 * xdisp.c (vmessage): Use a better test for character truncation.
21905
bbf47d44
PE
21906 * charset.c (load_charset_map): <, not <=, for optimization,
21907 and to avoid potential problems with integer overflow.
9248994d 21908 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 21909 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 21910 * editfns.c (Fformat): Likewise.
1e69125e 21911 * syntax.c (skip_chars): Likewise.
3befa583 21912
e3019616
PE
21913 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21914 This also lets GCC 4.6.0 generate slightly better loop code.
21915
becfa255
PE
21916 * callint.c (Fcall_interactively): <, not <=, for optimization.
21917 (Fcall_interactively): Count the number of arguments produced,
21918 not the number of arguments given. This is simpler and lets GCC
21919 4.6.0 generate slightly better code.
21920
dae0cd48
PE
21921 * ftfont.c: Distingish more carefully between FcChar8 and char.
21922 The previous code passed unsigned char * to a functions like
21923 strlen and xstrcasecmp that expect char *, which does not
21924 conform to the C standard.
21925 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21926 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21927 char * when the C standard requires it.
21928
76032d70
PE
21929 * keyboard.c (read_char): Remove unused var.
21930
eb3f1cc8
PE
21931 * eval.c: Port to Windows vsnprintf (Bug#8435).
21932 Include <limits.h>.
21933 (SIZE_MAX): Define if the headers do not.
21934 (verror): Do not give up if vsnprintf returns a negative count.
21935 Instead, grow the buffer. This ports to Windows vsnprintf, which
21936 does not conform to C99. Problem reported by Eli Zaretskii.
21937 Also, simplify the allocation scheme, by avoiding the need for
21938 calling realloc, and removing the ALLOCATED variable.
21939
70476b54
PE
21940 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21941
12020a9e
PE
21942 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21943 But keep the doprint source code for now, as we might revamp it
21944 and use it again (Bug#8435).
ea6c7ae6
PE
21945 * lisp.h (doprnt): Remove.
21946 * Makefile.in (base_obj): Remove doprnt.o.
21947 * deps.mk (doprnt.o): Remove.
21948
5fdb398c
PE
21949 error: Print 32- and 64-bit integers portably (Bug#8435).
21950 Without this change, on typical 64-bit hosts error ("...%d...", N)
21951 was used to print both 32- and 64-bit integers N, which relied on
21952 undefined behavior.
61bdb816 21953 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21954 * lisp.h (error, verror): Mark as printf-like functions.
21955 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21956 Report overflow in size calculations when allocating printf buffer.
21957 Do not truncate output string at its first null byte.
21958 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21959 Truncate the output at a character boundary, since vsnprintf does not
21960 do that.
21961 * charset.c (check_iso_charset_parameter): Convert internal
21962 character to string before calling 'error', since %c now has the
21963 printf meaning.
21964 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21965 overflow when computing char to be passed to 'error'. Do not
21966 pass Lisp_Object to 'error'; pass the integer instead.
21967 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21968 formatted with plain %d.
21969
b189fa66
PE
21970 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21971
bff87ef0
PE
21972 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21973
7e2cac20
PE
21974 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21975
ce4d90b5
PE
21976 * xterm.c (x_catch_errors): Remove duplicate declaration.
21977
266c9547
PE
21978 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21979
79c49ad2
PE
21980 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21981
368f4090
JM
219822011-04-10 Jim Meyering <meyering@redhat.com>
21983
21984 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21985 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21986 return ssize_t not "int", and use size_t as the buffer length.
21987 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21988 * gnutls.h: Update declarations.
21989 * process.c (read_process_output): Use ssize_t, to match.
21990 (send_process): Likewise.
21991
a32d4040
CY
219922011-04-09 Chong Yidong <cyd@stupidchicken.com>
21993
21994 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21995
8546720e 219962011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 21997
04f2d78b
CB
21998 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21999 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22000
8546720e
GM
22001 * xterm.c (handle_one_xevent):
22002 * xmenu.c (create_and_show_popup_menu):
22003 * xselect.c (x_decline_selection_request)
22004 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22005
0a2f5c1a 220062011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22007
22008 Fix some uses of `int' instead of EMACS_INT.
22009 * search.c (string_match_1, fast_string_match)
22010 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22011 (scan_buffer, find_next_newline_no_quit)
22012 (find_before_next_newline, search_command, Freplace_match)
22013 (Fmatch_data): Make some `int' variables be EMACS_INT.
22014
22015 * xdisp.c (display_count_lines): 3rd argument and return value now
22016 EMACS_INT. All callers changed.
22017 (pint2hrstr): Last argument is now EMACS_INT.
22018
22019 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22020 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22021 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22022 (decode_coding_utf_16, decode_coding_emacs_mule)
22023 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22024 (decode_coding_ccl, decode_coding_charset)
22025 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22026 (decode_coding_iso_2022, decode_coding_emacs_mule)
22027 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22028 <char_offset, last_offset>: Declare EMACS_INT.
22029 (encode_coding_utf_8, encode_coding_utf_16)
22030 (encode_coding_emacs_mule, encode_invocation_designation)
22031 (encode_designation_at_bol, encode_coding_iso_2022)
22032 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22033 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22034 Declare EMACS_INT.
22035 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22036 (encode_invocation_designation): Last argument P_NCHARS is now
22037 EMACS_INT.
22038 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22039 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22040
22041 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22042 All users changed.
22043
22044 * ccl.c (Fccl_execute_on_string): Declare some variables
22045 EMACS_INT.
22046
8546720e 220472011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22048
22049 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22050
4e19a977
CS
220512011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22052
22053 * process.c (Fformat_network_address): Doc fix.
22054
87302331
R
220552011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22056
ee7683eb 22057 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22058
cbb59342
CY
220592011-04-08 Chong Yidong <cyd@stupidchicken.com>
22060
22061 * keyboard.c (read_char): Call Lisp function help-form-show,
22062 instead of using internal_with_output_to_temp_buffer.
22063 (Qhelp_form_show): New var.
e0d38eeb 22064 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22065
22066 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22067
22068 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22069
e67a13ab
CY
220702011-04-06 Chong Yidong <cyd@stupidchicken.com>
22071
04f2d78b
CB
22072 * process.c (Flist_processes): Remove to Lisp.
22073 (list_processes_1): Delete.
e67a13ab 22074
973f782d
EZ
220752011-04-06 Eli Zaretskii <eliz@gnu.org>
22076
7c106b1e
EZ
22077 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22078
973f782d
EZ
22079 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22080
41cf7d1a 220812011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22082
ca23cc88
PE
22083 Fix more problems found by GCC 4.6.0's static checks.
22084
f390e2d5
PE
22085 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22086
42eea0d0
PE
22087 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22088
b69769da 22089 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22090
f9541e84
PE
22091 * xdisp.c (vmessage): Mark as a printf-like function.
22092
13841b55
PE
22093 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22094
c136c10f
PE
22095 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22096
5e2d4a30
PE
22097 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22098 printf-like functions.
22099 (tiff_load): Add casts to remove these marks before passing them
22100 to system-supplied API.
22101
583f48b9
PE
22102 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22103
b25d760e
PE
22104 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22105 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22106 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22107 directly, rather than having caller test rule sign. This avoids
22108 some unnecessary tests.
22109 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22110 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22111 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22112
bc7b6697 22113 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22114 (xfont_open): Avoid unnecessary tests.
bc7b6697 22115
27ccc379
PE
22116 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22117
dcd5c89a
PE
22118 * composite.h, composite.c (composition_gstring_put_cache):
22119 Use EMACS_INT, not int, for length.
22120
b13a45c6
PE
22121 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22122 breaking out part of COMPOSITION_DECODE_RULE.
22123 (COMPOSITION_DECODE_RULE): Use it.
22124 * composite.c (get_composition_id): Remove unused local vars,
22125 by using the new macro.
22126
1e792e4d
PE
22127 * textprop.c (set_text_properties_1): Change while to do-while,
22128 since the condition is always true at first.
22129
dc6c6455 22130 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22131 (interval_deletion_adjustment): Return unsigned value.
22132 All uses changed.
dc6c6455 22133
aba7731a
PE
22134 * process.c (list_processes_1, create_pty, read_process_output):
22135 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22136 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22137 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22138 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22139 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22140
fdfc4bf3
PE
22141 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22142
fca8fe46 22143 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22144 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22145
06a0259a 22146 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22147 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22148 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22149
e7b9e80f
PE
22150 * print.c (print_error_message): Avoid int overflow.
22151
56201685
PE
22152 * font.c (font_list_entities): Redo for clarity,
22153 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22154
78834453 22155 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22156 (font_score): Avoid potential overflow in diff calculation.
78834453 22157
0bc0b309 22158 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22159 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22160
e610eaca
PE
22161 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22162
b895abce
PE
22163 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22164 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22165 can always succeed if overflow has undefined behavior.
22166
1f1d9321 22167 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22168 (wordify): Omit three unnecessary tests.
1f1d9321 22169
c59478bc
PE
22170 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22171 All callers changed. This avoids the need for an unused var.
22172
79b73827
PE
22173 * casefiddle.c (casify_region): Remove var that is set but not used.
22174
a4db5dfe
PE
22175 * dired.c (file_name_completion): Remove var that is set but not used.
22176
43aae36e
PE
22177 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22178
2a47c44d 22179 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22180 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22181
a37c69bf
PE
22182 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22183 Check for integer overflow on size calculations.
22184
328ab8e7
PE
22185 * buffer.c (Fprevious_overlay_change): Remove var that is set
22186 but not used.
22187
e5a2a5cb
PE
22188 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22189 Remove vars that are set but not used.
8d84a6eb 22190 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22191 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22192
a60e5f68
PE
22193 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22194
f661cb61 22195 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22196 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22197
f0397f5a
PE
22198 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22199 that are set but not used.
22200
8664db06 22201 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22202 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22203
6abdaa4a
PE
22204 * xselect.c (x_get_local_selection, x_handle_property_notify):
22205 Remove vars that are set but not used.
22206
0ce7538d 22207 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22208 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22209
9ae848fc
PE
22210 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22211 Remove var that is set but not used.
0b918413
PE
22212 (scroll_bar_windows_size): Now size_t, not int.
22213 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22214 Check for overflow.
9ae848fc 22215
a5a62657
PE
22216 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22217 (map_tty_color) [!defined MSDOS]: Likewise.
22218
5c5cdd39
PE
22219 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22220
66ebf983
PE
22221 * coding.c: Remove vars that are set but not used.
22222 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22223 All callers changed.
22224 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22225 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22226 (decode_coding_charset): Remove vars that are set but not used.
22227
1be4d761
PE
22228 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22229 that is set but not used.
22230
47553fa8
PE
22231 * print.c (print_object): Remove var that is set but not used.
22232
1f7196bf 22233 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22234 The gnulib version avoids calling malloc in the usual case,
22235 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22236 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22237 * filelock.c (current_lock_owner): Likewise.
22238 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22239 * sysdep.c: Include allocator.h, careadlinkat.h.
22240 (emacs_no_realloc_allocator): New static constant.
22241 (emacs_readlink): New function.
fdb61804
PE
22242 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22243 ../lib/careadlinkat.h.
d1fdcab7 22244
f84c17c7
SM
222452011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22246
22247 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22248 first non-nil return value).
22249
ef3862ad
JD
222502011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22251
22252 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22253 if not defined (Bug#8403).
22254
376a7006
JB
222552011-04-02 Juanma Barranquero <lekktu@gmail.com>
22256
22257 * xdisp.c (display_count_lines): Remove parameter `start',
22258 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22259 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22260 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22261 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22262 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22263 and thereabouts. All callers changed.
22264 (get_per_char_metric): Remove parameter `f', unused since
22265 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22266
6ca3801d
JM
222672011-04-02 Jim Meyering <meyering@redhat.com>
22268
22269 do not dereference NULL upon failed strdup
22270 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22271 (ns_get_family): Likewise.
22272
d8e2b5ba
JB
222732011-04-02 Juanma Barranquero <lekktu@gmail.com>
22274
22275 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22276
8c74fcbd
JD
222772011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22278
22279 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22280 later (Bug#8403).
22281
7200d79c
SM
222822011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22283
03408648 22284 Add lexical binding.
7200d79c 22285
03408648
SM
22286 * window.c (Ftemp_output_buffer_show): New fun.
22287 (Fsave_window_excursion):
22288 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22289
22290 * lread.c (lisp_file_lexically_bound_p): New function.
22291 (Fload): Bind Qlexical_binding.
22292 (readevalloop): Remove `evalfun' arg.
22293 Bind Qinternal_interpreter_environment.
22294 (Feval_buffer): Bind Qlexical_binding.
22295 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22296 Mark as dynamic.
22297 (syms_of_lread): Declare `lexical-binding'.
22298
22299 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22300
22301 * keyboard.c (eval_dyn): New fun.
22302 (menu_item_eval_property): Use it.
ca105506
SM
22303
22304 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22305
03408648
SM
22306 * fns.c (concat, mapcar1): Accept byte-code-functions.
22307
22308 * eval.c (Fsetq): Handle lexical vars.
22309 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22310 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22311 (FletX, Flet): Obey lexical binding.
22312 (Fcommandp): Handle closures.
22313 (Feval): New `lexical' arg.
22314 (eval_sub): New function extracted from Feval. Use it almost
22315 everywhere where Feval was used. Look up vars in lexical env.
22316 Handle closures.
22317 (Ffunctionp): Move from subr.el.
22318 (Ffuncall): Handle closures.
22319 (apply_lambda): Remove `eval_flags'.
22320 (funcall_lambda): Handle closures and new byte-code-functions.
22321 (Fspecial_variable_p): New function.
22322 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22323 but without exporting it to Lisp.
23aba0ea 22324
23aba0ea 22325 * doc.c (Fdocumentation, store_function_docstring):
03408648 22326 * data.c (Finteractive_form): Handle closures.
23aba0ea 22327
03408648
SM
22328 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22329 interactive spec.
ba83908c 22330
04f2d78b
CB
22331 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22332 New byte-codes.
03408648
SM
22333 (exec_byte_code): New function extracted from Fbyte_code to handle new
22334 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22335
03408648 22336 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22337
03408648 22338 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22339
e2abce01
JB
223402011-03-31 Juanma Barranquero <lekktu@gmail.com>
22341
22342 * xdisp.c (redisplay_internal): Fix prototype.
22343
63696a73 223442011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22345
63696a73 22346 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22347 (try_scrolling): Use it when setting scroll_limit.
22348 Limit scrolling to 100 screen lines.
63696a73
EZ
22349 (redisplay_window): Even when falling back on "recentering",
22350 position point in the window according to scroll-conservatively,
22351 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22352
22353 (try_scrolling): When point is above the window, allow searching
22354 as far as scroll_max, or one screenful, to compute vertical
22355 distance from PT to the scroll margin position. This prevents
22356 try_scrolling from unnecessarily failing when
22357 scroll-conservatively is set to a value slightly larger than the
22358 window height. Clean up the case of PT below the margin at bottom
22359 of window: scroll_max can no longer be INT_MAX. When aggressive
22360 scrolling is in use, don't let point enter the opposite scroll
22361 margin as result of the scroll.
22362 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22363 threshold of 100 lines for never-recentering scrolling.
22364
e4cc2dfc
JB
223652011-03-31 Juanma Barranquero <lekktu@gmail.com>
22366
22367 * dispextern.h (move_it_by_lines):
22368 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22369 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22370 (message_log_check_duplicate): Remove parameters `prev_bol' and
22371 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22372 (redisplay_internal): Remove parameter `preserve_echo_area',
22373 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22374
22375 * indent.c (Fvertical_motion):
22376 * window.c (window_scroll_pixel_based, Frecenter):
22377 Don't pass `need_y_p' to `move_it_by_lines'.
22378
1c470562
SM
223792011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22380
44f230aa
SM
22381 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22382 steal a few bits to be more compact.
22383 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22384 Remove unneeded casts.
22385
1c470562
SM
22386 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22387
888adce9
ZK
223882011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22389
22390 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22391 binding" message (bug#7967).
22392
f838ed7b
PE
223932011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22394
77861b95
PE
22395 Fix more problems found by GCC 4.6.0's static checks.
22396
de6dbc14
PE
22397 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22398 Remove unused local var.
22399
f838ed7b
PE
22400 * editfns.c (Fmessage_box): Remove unused local var.
22401
792c7b2b
PE
22402 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22403 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22404 Omit unused local vars.
c499e557 22405 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22406 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22407 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22408 Omit unused local var.
22409
ba0165e1
PE
22410 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22411 Don't assume string length fits in int.
32ad8845 22412 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22413 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22414
3c59b4c9
PE
22415 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22416 instead of alloca (Bug#8344).
22417
a3eed478 22418 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22419 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22420
eb4d412d
PE
22421 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22422
1658b401
PE
22423 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22424 concerns.
22425
22426 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22427
22428 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22429
9a2c6e05
PE
22430 * keyboard.c (syms_of_keyboard): Use the same style as later
22431 in this function when indexing through an array. This also
22432 works around GCC bug 48267.
22433
03d0a109
PE
22434 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22435
44f730c8
PE
22436 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22437
fe75f926
PE
22438 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22439 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22440
ffa8c828
PE
22441 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22442 This avoids undefined behavior on integer overflow, and is a bit
22443 more convenient anyway since it is compared to a size_t variable.
22444
c5101a77
PE
22445 Variadic C functions now count arguments with size_t, not int.
22446 This avoids an unnecessary limitation on 64-bit machines, which
22447 caused (substring ...) to crash on large vectors (Bug#8344).
22448 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22449 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22450 All variadic functions and their callers changed accordingly.
c5101a77
PE
22451 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22452 * data.c (arith_driver, float_arith_driver): Likewise.
22453 * editfns.c (general_insert_function): Likewise.
22454 * eval.c (struct backtrace.nargs, interactive_p)
22455 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22456 (funcall_lambda, mark_backtrace): Likewise.
22457 * fns.c (concat): Likewise.
22458 * frame.c (x_set_frame_parameters): Likewise.
22459 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22460 0 if not found, not -1. All callers changed.
22461
dd3f25f7
PE
22462 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22463 (stack_copy_size): Now size_t, not int.
22464 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22465
461c2ab9
JB
224662011-03-28 Juanma Barranquero <lekktu@gmail.com>
22467
22468 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22469 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22470 All callers changed.
22471
22472 * lisp.h (multibyte_char_to_unibyte):
22473 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22474 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22475 * character.h (CHAR_TO_BYTE8):
22476 * cmds.c (internal_self_insert):
22477 * editfns.c (general_insert_function):
22478 * keymap.c (push_key_description):
22479 * search.c (Freplace_match):
22480 * xdisp.c (message_dolog, set_message_1): All callers changed.
22481
f6d62986
SM
224822011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22483
22484 * keyboard.c (safe_run_hook_funcall): New function.
22485 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22486 don't set the hook to nil, but remove the offending function instead.
22487 (Qcommand_hook_internal): Remove, unused.
22488 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22489 Vcommand_hook_internal.
22490
22491 * eval.c (enum run_hooks_condition): Remove.
22492 (funcall_nil, funcall_not): New functions.
22493 (run_hook_with_args): Call each function through a `funcall' argument.
22494 Remove `cond' argument, now redundant.
22495 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22496 (Frun_hook_with_args_until_failure): Adjust accordingly.
22497 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22498
1db5b1ad
JB
224992011-03-28 Juanma Barranquero <lekktu@gmail.com>
22500
22501 * dispextern.h (string_buffer_position): Remove declaration.
22502
22503 * print.c (strout): Remove parameter `multibyte', unused since
22504 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22505
22506 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22507 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22508 All callers changed.
22509
22510 * w32.c (_wsa_errlist): Use braces for struct initializers.
22511
22512 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22513 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22514 All callers changed.
22515 (string_buffer_position): Likewise. Also, make static (it's never
22516 used outside xdisp.c).
22517 (cursor_row_p): Remove parameter `w', unused since
22518 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22519 (decode_mode_spec): Remove parameter `precision', introduced during
22520 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22521 All callers changed.
22522
5ffb62aa
JD
225232011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22524
22525 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22526
461c2ab9 225272011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22528
22529 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22530 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22531 (ns_update_auto_hide_menu_bar): New functions.
22532 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22533 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22534 ns_constrain_all_frames.
22535 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22536 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22537
5c380ffb
JD
225382011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22539
22540 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22541
9af30bdf
GM
225422011-03-27 Glenn Morris <rgm@gnu.org>
22543
22544 * syssignal.h: Replace RETSIGTYPE with void.
22545 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22546 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22547 Replace SIGTYPE with void everywhere.
22548 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22549 * s/template.h (SIGTYPE): Remove commented out definition.
22550
e2abce01
JB
225512011-03-26 Eli Zaretskii <eliz@gnu.org>
22552
22553 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22554 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22555
f868cd8a
JB
225562011-03-26 Juanma Barranquero <lekktu@gmail.com>
22557
59eb0929
JB
22558 * w32.c (read_unc_volume): Use parameter `henum', instead of
22559 global variable `wget_enum_handle'.
22560
22561 * keymap.c (describe_vector): Remove parameters `indices' and
22562 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22563 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22564
f868cd8a
JB
22565 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22566
22567 * keyboard.c (timer_check): Remove parameter `do_it_now',
22568 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22569 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22570 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22571
22572 * keyboard.c (read_char):
22573 * w32menu.c (w32_menu_display_help):
22574 * xmenu.c (show_help_event, menu_help_callback):
22575 Adjust calls to `show_help_echo'.
22576
22577 * gtkutil.c (xg_maybe_add_timer):
22578 * keyboard.c (readable_events):
22579 * process.c (wait_reading_process_output):
22580 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22581
22582 * insdel.c (adjust_markers_gap_motion):
22583 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22584 (gap_left, gap_right): Don't call it.
22585
2ecf6fdb
CY
225862011-03-25 Chong Yidong <cyd@stupidchicken.com>
22587
22588 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22589 incurred during fontification.
22590
6b1f9ba4
JB
225912011-03-25 Juanma Barranquero <lekktu@gmail.com>
22592
22593 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22594 (DEFVAR_PER_BUFFER): Don't pass it.
22595
22596 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22597 (scrolling_window): Don't pass it.
22598
0f4a96b5
JB
225992011-03-25 Juanma Barranquero <lekktu@gmail.com>
22600
22601 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22602
22603 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22604 and `suffix'.
22605 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22606 of variables specific to SELinux and computation of `encoded_absname'.
22607
22608 * image.c (XPutPixel): Remove unused variable `height'.
22609
22610 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22611
22612 * unexw32.c (get_section_info): Remove unused variable `section'.
22613
22614 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22615 (system_process_attributes): Remove unused variable `sess'.
22616 (sys_read): Remove unused variable `err'.
22617
22618 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22619 (w32_wnd_proc): Remove unused variable `isdead'.
22620 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22621 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22622 (x_create_tip_frame): Remove unused variable `tem'.
22623
22624 * w32inevt.c (w32_console_read_socket):
22625 Remove unused variable `no_events'.
22626
22627 * w32term.c (x_draw_composite_glyph_string_foreground):
22628 Remove unused variable `width'.
22629
1149507c
JB
226302011-03-24 Juanma Barranquero <lekktu@gmail.com>
22631
22632 * w32term.c (x_set_glyph_string_clipping):
22633 Don't pass uninitialized region to CombineRgn.
22634
9c88f339
JB
226352011-03-23 Juanma Barranquero <lekktu@gmail.com>
22636
22637 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22638 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22639 (Fx_close_connection): Remove unused variable `i'.
22640
22641 * w32font.c (w32font_draw): Return number of glyphs.
22642 (w32font_open_internal): Remove unused variable `i'.
22643 (w32font_driver): Add missing initializer.
22644
22645 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22646 (fill_in_menu): Remove unused variable `items_added'.
22647
22648 * w32term.c (last_mouse_press_frame): Remove static global variable.
22649 (w32_clip_to_row): Remove unused variable `f'.
22650 (x_delete_terminal): Remove unused variable `i'.
22651
22652 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22653 (NOTHING): Remove unused static global variable.
22654 (uniscribe_check_otf): Remove unused variable `table'.
22655 (uniscribe_font_driver): Add missing initializers.
22656
dee091a3
JD
226572011-03-23 Julien Danjou <julien@danjou.info>
22658
22659 * term.c (Fsuspend_tty, Fresume_tty):
22660 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22661 * window.c (temp_output_buffer_show):
22662 * insdel.c (signal_before_change):
22663 * frame.c (Fhandle_switch_frame):
22664 * fileio.c (Fdo_auto_save):
22665 * emacs.c (Fkill_emacs):
22666 * editfns.c (save_excursion_restore):
22667 * cmds.c (internal_self_insert):
22668 * callint.c (Fcall_interactively):
22669 * buffer.c (Fkill_all_local_variables):
22670 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22671 Use Frun_hooks.
0f4a96b5 22672 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 22673 unconditionally since it does the check itself.
dee091a3 22674
2c520ab5 226752011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 22676
c9c49752
PE
22677 Fix more problems found by GCC 4.5.2's static checks.
22678
8abc3f12
PE
22679 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22680 the first time through the loop, since we know p0 < p1 then.
22681 This also avoids a gcc -Wstrict-overflow warning.
22682
a2d26660
PE
22683 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22684 leading to a memory leak, possible in functions like
22685 load_charset_map_from_file that can allocate an unbounded number
b12ef411 22686 of objects (Bug#8318).
a2d26660 22687
916c72e9
PE
22688 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22689 that could (at least in theory) be that large.
22690
19ab8a18
PE
22691 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22692 This is less likely to overflow, and avoids undefined behavior if
22693 overflow does occur. All callers changed. Use strtoul to scan
22694 for the unsigned long integer.
b7cbbd6f
PE
22695 (pint2hrstr): Simplify and tune code slightly.
22696 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 22697
f0641eff
PE
22698 * scroll.c (do_scrolling): Work around GCC bug 48228.
22699 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22700
7f650bb9
PE
22701 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22702 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
22703 (validate_x_resource_name): Simplify count usage.
22704 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 22705
37dd57d1
PE
22706 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22707 fail (Bug#8306).
81e56e61 22708
699979fc 22709 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 22710
401bf9b4
PE
22711 * process.c (Fmake_network_process): Use socklen_t, not int,
22712 where POSIX says socklen_t is required in portable programs.
22713 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 22714 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
22715 (Fmake_network_process, server_accept_connection):
22716 (wait_reading_process_output, read_process_output):
22717 Likewise.
22718
b93aacde
PE
22719 * process.c: Rename or move locals to avoid shadowing.
22720 (list_processes_1, Fmake_network_process):
22721 (read_process_output_error_handler, exec_sentinel_error_handler):
22722 Rename or move locals.
4dc343ee 22723 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 22724 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 22725 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 22726 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 22727 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 22728
af8a867c 22729 Make tparam.h and terminfo.c consistent.
44f230aa
SM
22730 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22731 Include tparam.h instead, since it declares them.
af8a867c
PE
22732 * cm.h (PC): Remove extern decl; tparam.h now does this.
22733 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22734 * terminfo.c: Include tparam.h, to check interfaces.
22735 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22736 (tparam): Adjust signature to match interface in tparam.h;
22737 this removes some undefined behavior. Check that outstring and len
22738 are zero, which they always are with Emacs.
22739 * tparam.h (PC, BC, UP): New extern decls.
22740
0248044d 22741 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 22742 (xftfont_open): Rename locals to avoid shadowing.
0248044d 22743
8ff096c1 22744 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
22745 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22746 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 22747 (ftfont_list): Remove unused local.
49eaafba
PE
22748 (get_adstyle_property, ftfont_pattern_entity):
22749 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22750 Rename locals to avoid shadowing.
8ff096c1 22751
e2be39f6
PE
22752 * xfont.c (xfont_list_family): Mark var as initialized.
22753
c9735e30
PE
22754 * xml.c (make_dom): Now static.
22755
8f5201ae
PE
22756 * composite.c (composition_compute_stop_pos): Rename local to
22757 avoid shadowing.
b246f932
PE
22758 (composition_reseat_it): Remove unused locals.
22759 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 22760 (composition_update_it): Mark var as initialized.
11b61122
PE
22761 (find_automatic_composition): Mark vars as initialized,
22762 with a FIXME (Bug#8290).
8f5201ae 22763
760fbc2c
PE
22764 character.h: Rename locals to avoid shadowing.
22765 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22766 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22767 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22768 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22769 to avoid shadowing.
22770
ff08eb85
PE
22771 * textprop.c (property_change_between_p): Remove; unused.
22772
fc7bf025
PE
22773 * intervals.c (interval_start_pos): Now static.
22774
235d7abc
PE
22775 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22776
44f230aa
SM
22777 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22778 Rename locals to avoid shadowing.
3e7d6594 22779
50060332
PE
22780 * sound.c (wav_play, au_play, Fplay_sound_internal):
22781 Fix pointer signedness.
d01f234b 22782 (alsa_choose_format): Remove unused local var.
c83b8872
PE
22783 (wav_play): Initialize a variable to 0, to prevent undefined
22784 behavior (Bug#8278).
50060332 22785
c4fc4e30
PE
22786 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22787
918436ed
PE
22788 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22789
c939f91b
PE
22790 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22791 clobbering (Bug#8298).
b9c7f648
PE
22792 * sysdep.c (sys_subshell): Likewise.
22793 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 22794
6bd8c144
PE
22795 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22796 This should get cleaned up, so that child_setup has the
22797 same signature on all platforms.
22798
7710357c 22799 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 22800 (relocate_fd): Rename locals to avoid shadowing.
7710357c 22801
c59da222
CY
228022011-03-22 Chong Yidong <cyd@stupidchicken.com>
22803
22804 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22805 not to be necessary, and produces flickering.
22806
66b87493
GM
228072011-03-20 Glenn Morris <rgm@gnu.org>
22808
22809 * config.in: Remove file.
22810
45b6f6d5
JB
228112011-03-20 Juanma Barranquero <lekktu@gmail.com>
22812
22813 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22814 are now in src/globals.h.
22815 (syms_of_minibuf): Remove spurious & from previous change.
22816
cd394be1 228172011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
22818
22819 * minibuf.c (completing-read-function): New variable.
22820 (completing-read-default): Rename from completing-read.
22821 (completing-read): Call completing-read-function.
22822
b14e3e21
CY
228232011-03-19 Juanma Barranquero <lekktu@gmail.com>
22824
22825 * xfaces.c (Fx_load_color_file):
22826 Read color file from absolute filename (bug#8250).
22827
f2b726e6
JB
228282011-03-19 Juanma Barranquero <lekktu@gmail.com>
22829
22830 * makefile.w32-in: Update dependencies.
22831
09f6ff02
EZ
228322011-03-17 Eli Zaretskii <eliz@gnu.org>
22833
22834 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22835
29a6015a
PE
228362011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22837
a3a6c54e
PE
22838 Fix more problems found by GCC 4.5.2's static checks.
22839
b766f867
PE
22840 * process.c (make_serial_process_unwind, send_process_trap):
22841 (sigchld_handler): Now static.
22842
be02381c
PE
22843 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22844 That way, the code declares only the vars that it needs.
22845 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22846 * s/cygwin.h (PTY_ITERATION): Likewise.
22847 * s/darwin.h (PTY_ITERATION): Likewise.
22848 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22849
57048744
PE
22850 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22851 * process.c (allocate_pty): Don't declare stb unless it's needed.
22852
7914961c 22853 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
22854 (CONSTANTLIM): Remove; unused.
22855 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22856 Define only if needed.
7914961c 22857
b3967b18
PE
22858 * unexelf.c (unexec): Name an expression,
22859 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
22860 Use a different way to cause a compilation error if anyone uses
22861 n rather than nn, a way that does not involve shadowing.
73366a00 22862 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 22863
29a6015a
PE
22864 * deps.mk (unexalpha.o): Remove; unused.
22865
43cfc33e 22866 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 22867 * unexec.h: New file.
ce701a33
PE
22868 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22869 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22870 Depend on unexec.h.
22871 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22872 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22873 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 22874 Change as necessary to match prototype in unexec.h.
ce701a33 22875
01f44d5a
PE
22876 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22877 shadowing.
4f63c6bb 22878 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 22879
a6670b0b
PE
22880 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22881 Rename locals to avoid shadowing.
22882
cef2010d 22883 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 22884 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 22885
d4d7173a
PE
22886 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22887
f08b802a
PE
22888 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22889 warning when compiling print.c.
22890
3ddb0639
PE
22891 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22892 instead of using an uninitialized var.
5ad03b97 22893 (font_sort_entities): Mark var as initialized.
3ddb0639 22894
170a2692
PE
22895 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22896
e663c700
PE
22897 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22898 pointers to constants.
89bc529a 22899 (font_parse_fcname): Remove unused vars.
7b81e2d0 22900 (font_delete_unmatched): Now static.
ea838e10 22901 (font_get_spec): Remove; unused.
13a547c6
PE
22902 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22903 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22904 Rename or move locals to avoid shadowing.
e663c700 22905
2a80c887 22906 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 22907 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 22908
1384fa33 22909 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 22910 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 22911
8b2c52e9
PE
22912 * alloc.c (mark_backtrace): Move decl from here ...
22913 * lisp.h: ... to here, so that it can be checked.
22914
475545b5 22915 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 22916 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
22917 (lisp_indirect_variable): Name an expression,
22918 to avoid gcc -Wbad-function-cast warning.
1faed8ae 22919 (Fdefvar): Rename locals to avoid shadowing.
475545b5 22920
b1349114 22921 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 22922 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 22923 Use const pointer when appropriate.
b1349114 22924
a2928364
PE
22925 * lisp.h (get_system_name, get_operating_system_release):
22926 Move decls here, to check interfaces.
22927 * process.c (get_operating_system_release): Move decl to lisp.h.
22928 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
22929 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22930 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22931 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
22932 (Fformat_time_string, Fencode_time, Finsert_char):
22933 (Ftranslate_region_internal, Fformat):
22934 Rename or remove local vars to avoid shadowing.
9710023e 22935 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 22936
a415e694
PE
22937 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22938 avoid shadowing.
22939
8ef4622d
PE
22940 * lisp.h (eassert): Check that the argument compiles, even if
22941 ENABLE_CHECKING is not defined.
22942
946f9a5b
PE
22943 * data.c (Findirect_variable): Name an expression, to avoid
22944 gcc -Wbad-function-cast warning.
112396d6 22945 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22946 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22947 (Fmake_variable_buffer_local, Fmake_local_variable):
22948 Mark variables as initialized.
52746918 22949 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22950
e5aab7e7 22951 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22952 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22953 Rename locals to avoid shadowing.
dff45157
PE
22954 (mark_stack): Move local variables into the #ifdef region where
22955 they're used.
7bc26fdb
PE
22956 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22957 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22958 needed otherwise.
22959 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22960 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22961 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22962
e5aab7e7
PE
22963 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22964 avoids undefined behavior in theory.
22965
4da60324
PE
22966 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22967
88043301
PE
22968 Use functions, not macros, for up- and down-casing (Bug#8254).
22969 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22970 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22971 to use the following functions instead of these macros.
22972 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22973 EMACS_INT, since callers assume the returned value fits in int.
22974 (upcase1): Likewise, for UPCASE_TABLE.
22975 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22976 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22977 the race-condition problem in the old DOWNCASE.
88043301 22978
19ed5445
PE
22979 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22980 Rename locals to avoid shadowing.
22981 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22982 (regex_compile, re_search_2, re_match_2_internal):
22983 Remove unused local vars.
952db0d7
PE
22984 (FREE_VAR): Rewrite so as not to use empty "else",
22985 which gcc can warn about.
da053e48 22986 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22987 (RETALLOC_IF): Define only if needed.
22988 (WORDCHAR_P): Likewise. This one is never needed, but is used
22989 only in a comment talking about a compiler bug, so put inside
22990 the #if 0 of that comment.
22991 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22992 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22993 Remove; unused.
19ed5445 22994
1f3561e4 22995 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
22996 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22997 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 22998
ded6f8f7
PE
22999 * search.c (simple_search): Remove unused var.
23000
dbd37a95
PE
23001 * dired.c (compile_pattern): Move decl from here ...
23002 * lisp.h: ... to here, so that it can be checked.
23003 (struct re_registers): New forward decl.
23004
7e47afad
PE
23005 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23006
85f24f61
PE
23007 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23008 All uses changed.
23009 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23010 Rename locals to avoid shadowing.
5671df8f 23011 (Fvertical_motion): Mark locals as initialized.
85f24f61 23012
181aa2be 23013 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23014 (casify_region): Mark local as initialized.
181aa2be 23015
930d429c
PE
23016 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23017
7082eac6
PE
23018 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23019 New macros, so that the caller can use some names other than
23020 gcpro1, gcpro2, etc.
23021 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23022 of the new macros.
23023 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23024 argument, for consistency with GCPRO2_VAR, etc: it is now the
23025 prefix of the variable, not the variable itself. All uses
23026 changed.
38b2c076
PE
23027 * dired.c (directory_files_internal, file_name_completion):
23028 Rename locals to avoid shadowing.
23029
15206ed9
PE
23030 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23031 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23032 dired.c's scmp function, had undefined behavior.
23033 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23034 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23035 * buffer.h: ... to here, because these macros use current_buffer,
23036 and the new implementation with inline functions needs to have
23037 current_buffer in scope now, rather than later when the macros
23038 are used.
23039 (downcase, upcase1): New static inline functions.
23040 (DOWNCASE, UPCASE1): Reimplement using these functions.
23041 This avoids undefined behavior in expressions like
23042 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23043 from race conditions in accessing the global variables
23044 case_temp1 and case_temp2.
23045 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23046 * lisp.h (case_temp1, case_temp2): Remove their decls.
23047 * character.h (ASCII_CHAR_P): Move from here ...
23048 * lisp.h: ... to here, so that the inline functions mentioned
23049 above can use them.
23050
4a6bea26
PE
23051 * dired.c (directory_files_internal_unwind): Now static.
23052
f14b7e14
PE
23053 * fileio.c (file_name_as_directory, directory_file_name):
23054 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23055 Now static.
2893f146
PE
23056 (file_name_as_directory): Use const pointers when appropriate.
23057 (Fexpand_file_name): Likewise. In particular, newdir might
23058 point at constant storage, so make it a const pointer.
fd4ead52 23059 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23060 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23061 signedness issues.
f839df0c
PE
23062 (Fset_file_times, Finsert_file_contents, auto_save_error):
23063 Rename locals to avoid shadowing.
f14b7e14 23064
5716756e 23065 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23066 (Ftry_completion, Fall_completions): Rename or remove locals
23067 to avoid shadowing.
5716756e 23068
b4c3046a
PE
23069 * marker.c (bytepos_to_charpos): Remove; unused.
23070
b45db522
PE
23071 * lisp.h (verify_bytepos, count_markers): New decls,
23072 so that gcc does not warn that these functions aren't declared.
23073
85876d07
PE
23074 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23075 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23076 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23077 (copy_text): Remove unused local var.
85876d07 23078
03d78a21 23079 * filelock.c (within_one_second): Now static.
b3dd38ab 23080 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23081
5df8f01b
PE
23082 * buffer.c (fix_overlays_before): Mark locals as initialized.
23083 (fix_start_end_in_overlays): Likewise. This function should be
23084 simplified by using pointers-to-pointers, but that's a different
23085 matter.
b1d876f1 23086 (switch_to_buffer_1): Now static.
8f54f30a
PE
23087 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23088 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23089
a70072c9 23090 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23091 Fix pointer signedness issue.
edced198
PE
23092 (sys_subshell): Mark local as volatile if checking for lint,
23093 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23094 (MAXPATHLEN): Define only if needed.
a70072c9 23095
a0977c44
PE
23096 * process.c (serial_open, serial_configure): Move decls from here ...
23097 * systty.h: ... to here, so that they can be checked.
23098
a884fdcc
PE
23099 * fns.c (get_random, seed_random): Move extern decls from here ...
23100 * lisp.h: ... to here, so that they can be checked.
23101
604efe86 23102 * sysdep.c (reset_io): Now static.
b8950c94 23103 (wait_for_termination_signal): Remove; unused.
604efe86 23104
38fc62d9
PE
23105 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23106 (copy_keymap_item, append_key, push_text_char_description):
23107 Now static.
1004a21a 23108 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23109 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23110 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23111 (describe_map_tree):
23112 Rename locals to avoid shadowing.
38fc62d9 23113
2f2650da
PE
23114 * keyboard.c: Declare functions static if they are not used elsewhere.
23115 (echo_char, echo_dash, cmd_error, top_level_2):
23116 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23117 (read_char, kbd_buffer_get_event, make_lispy_position):
23118 (make_lispy_event, make_lispy_movement, apply_modifiers):
23119 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23120 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23121 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23122 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23123 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23124
a053e86c 23125 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23126 (mark_kboards): Move decl here ...
23127 * alloc.c (mark_kboards): ... from here.
a053e86c 23128
4752793e
PE
23129 * lisp.h (force_auto_save_soon): New decl.
23130
74f10ca7 23131 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23132 (DEFINE_DUMMY_FUNCTION): New macro.
23133 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23134 Use it.
c03cd23f
PE
23135 (main): Add casts to avoid warnings
23136 if GCC considers string literals to be constants.
74f10ca7 23137
022e70d4
PE
23138 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23139
59d6fe83
PE
23140 * dbusbind.c: Pointer signedness fixes.
23141 (xd_signature, xd_append_arg, xd_initialize):
23142 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23143 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23144 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23145 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23146
78320123
PE
23147 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23148 if GCC considers string literals to be constants.
49cebcca 23149 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23150
35ac2a97
SM
231512011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23152
fb103ca9
SM
23153 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23154 (print_preprocess, print_object): New macro to fix last change.
23155
35ac2a97
SM
23156 * print.c (print_preprocess): Don't forget font objects.
23157
62973b41
JB
231582011-03-16 Juanma Barranquero <lekktu@gmail.com>
23159
23160 * emacs.c (USAGE3): Doc fixes.
23161
0e48bb22
AS
231622011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23163
23164 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23165 structure.
23166
7684e57b
JB
231672011-03-14 Juanma Barranquero <lekktu@gmail.com>
23168
23169 * lisp.h (VWindow_system, Qfile_name_history):
23170 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23171 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23172 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23173
23174 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23175 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23176
23177 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23178 * w32console.c (detect_input_pending, read_input_pending)
23179 (encode_terminal_code):
23180 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23181 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23182 (w32_system_caret_y, Qfile_name_history):
23183 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23184 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23185 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23186 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23187 * w32proc.c (Qlocal, report_file_error):
23188 * w32term.c (Vwindow_system, updating_frame):
23189 * w32uniscribe.c (initialized, uniscribe_font_driver):
23190 Remove unneeded extern declarations.
23191
2aa46d6c
CY
231922011-03-14 Chong Yidong <cyd@stupidchicken.com>
23193
c96bbc66 23194 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23195
cffc6f3b
CY
231962011-03-13 Chong Yidong <cyd@stupidchicken.com>
23197
23198 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23199 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23200 These macros can no longer be used for assignment.
23201
44f230aa
SM
23202 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23203 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23204 (record_buffer_markers, fetch_buffer_markers): New functions for
23205 recording and fetching special buffer markers.
23206 (set_buffer_internal_1, set_buffer_temp): Use them.
23207
23208 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23209
23210 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23211
23212 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23213 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23214
23215 * xdisp.c (hscroll_window_tree):
23216 (reconsider_clip_changes): Use PT instead of BUF_PT.
23217
d251f04b
EZ
232182011-03-13 Eli Zaretskii <eliz@gnu.org>
23219
23220 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23221 $(EMACS_ROOT)/lib/intprops.h.
23222
f0c77cd1
PE
232232011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23224
3eca4629
PE
23225 Fix more problems found by GCC 4.5.2's static checks.
23226
7c86ee98
PE
23227 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23228 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23229 (xg_free_frame_widgets): Make it clear that a local variable is
23230 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23231 (gdk_window_get_screen): Make it clear that this macro is needed
23232 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23233 (int_gtk_range_get_value): New function, which avoids a diagnostic
23234 from gcc -Wbad-function-cast.
23235 (xg_set_toolkit_scroll_bar_thumb): Use it.
23236 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23237 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23238 (get_utf8_string, xg_get_file_with_chooser):
23239 Rename locals to avoid shadowing.
23240 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23241
41729b81
PE
23242 * xgselect.c (xg_select): Remove unused var.
23243
f0c77cd1
PE
23244 * image.c (four_corners_best): Mark locals as initialized.
23245 (gif_load): Initialize transparent_p to zero (Bug#8238).
23246 Mark another local as initialized.
ec6cf4c6 23247 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23248
ce0ad53d 23249 * image.c (clear_image_cache): Now static.
d5d5a617 23250 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23251 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23252 (x_edge_detection): Remove unnecessary cast that
23253 gcc -Wbad-function-cast diagnoses.
2037898d 23254 (gif_load): Fix pointer signedness.
6ae141d6
PE
23255 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23256 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23257
33383987 232582011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23259
d32df629
PE
23260 Improve quality of tests for time stamp overflow.
23261 For example, without this patch (encode-time 0 0 0 1 1
23262 1152921504606846976) returns the obviously-bogus value (-948597
23263 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23264 reports time overflow. See
23265 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23266 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23267 * editfns.c: Include limits.h and intprops.h.
23268 (TIME_T_MIN, TIME_T_MAX): New macros.
23269 (time_overflow): Move earlier, to before first use.
23270 (hi_time, lo_time): New functions, for an accurate test for
23271 out-of-range times.
23272 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23273 (Fget_internal_run_time): Don't assume time_t fits in int.
23274 (make_time): Use list2 instead of Fcons twice.
23275 (Fdecode_time): More accurate test for out-of-range times.
23276 (check_tm_member): New function.
23277 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23278 (lisp_time_argument): Don't rely on undefined left-shift and
23279 right-shift behavior when checking for time stamp overflow.
8be6f318 23280
fe31d94c
PE
23281 * editfns.c (time_overflow): New function, refactoring common code.
23282 (Fformat_time_string, Fdecode_time, Fencode_time):
23283 (Fcurrent_time_string): Use it.
23284
8be6f318
PE
23285 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23286 * dired.c (make_time): Move to ...
23287 * editfns.c (make_time): ... here.
23288 * systime.h: Note the move.
23289
09d9db2c 232902011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23291
126bc0dc
YM
23292 * fringe.c (update_window_fringes): Remove unused variables.
23293
c47cbdfd
YM
23294 * unexmacosx.c (copy_data_segment): Also copy __got section.
23295 (Bug#8223)
23296
7ac80be9
EZ
232972011-03-12 Eli Zaretskii <eliz@gnu.org>
23298
c96bbc66 23299 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23300 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23301 Constify `char *' arguments and their references according to
23302 prototypes in tparam.h.
23303
ecb0f94d 23304 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23305
7ac80be9
EZ
23306 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23307 Adapt all references accordingly.
23308
23309 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23310
ef1fd07e
TT
233112011-03-11 Tom Tromey <tromey@redhat.com>
23312
23313 * buffer.c (syms_of_buffer): Remove obsolete comment.
23314
7ef4b50c
EZ
233152011-03-11 Eli Zaretskii <eliz@gnu.org>
23316
23317 * termhooks.h (encode_terminal_code): Declare prototype.
23318
23319 * msdos.c (encode_terminal_code): Don't declare prototype.
23320
23321 * term.c (encode_terminal_code): Now external again, used by
23322 w32console.c and msdos.c.
23323
44f230aa
SM
23324 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23325 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23326
4b1ec863 233272011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23328
1714f52b 23329 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23330
4b1ec863
PE
23331 * fringe.c (update_window_fringes): Mark locals as initialized
23332 (Bug#8227).
23333 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23334
524c7aa6
PE
23335 * alloc.c (mark_fringe_data): Move decl from here ...
23336 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23337 to check its interface.
23338 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23339
a5c0af81 23340 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23341 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23342 (fontset_font): Mark local as initialized.
a9a06e0b 23343 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23344
b4716021
PE
23345 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23346
811e9bac 23347 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23348 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23349 (x_own_selection, Fx_disown_selection_internal): Rename locals
23350 to avoid shadowing.
23351 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23352
7e3ab302
PE
23353 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23354 so that the caller can use some name other than gcpro1.
23355 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23356 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23357 (Fx_backspace_delete_keys_p):
23358 Use them to avoid shadowing, and rename vars to avoid shadowing.
23359 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23360 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23361 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23362 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23363 Remove unused locals.
7e3ab302
PE
23364 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23365 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23366 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23367 macros.
f78faa98 23368
e2b13473
PE
23369 * xterm.h (x_mouse_leave): New decl.
23370
77f23912
PE
23371 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23372 Remove unused functions.
cdf4ba58
PE
23373 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23374 (x_calc_absolute_position): Now static.
7411c686 23375 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23376 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23377 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23378 unless they are used.
38d0b34a
PE
23379 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23380 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23381 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23382 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23383 (x_error_catcher, x_connection_closed, x_error_handler):
23384 (x_error_quitter, xembed_send_message, x_iconify_frame):
23385 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23386 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23387 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23388
44f230aa
SM
23389 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23390 Rename or move locals to avoid shadowing.
6b463e58 23391 (tty_defined_color, merge_face_heights): Now static.
5967d051 23392 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23393 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23394 does not deduce is never used uninitialized.
73719eba
PE
23395 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23396 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23397
426994c3 23398 * terminal.c (store_terminal_param): Now static.
5489860b 23399
032f1620 23400 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23401 (set_frame_menubar): Remove unused local.
d4323972 23402 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23403 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23404 since they might point to immutable storage.
281585b0
PE
23405 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23406 since it's unused otherwise.
032f1620 23407
367c19e5 23408 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23409 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23410 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23411 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23412 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23413 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23414 does not deduce are never used uninitialized.
70739cbe 23415
07b48fa9
PE
23416 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23417
8868a238 23418 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23419 * window.c (window_loop, size_window):
23420 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23421
7e5cf297 23422 * window.c (display_buffer): Now static.
d6550a9f
PE
23423 (size_window): Mark variables that gcc -Wuninitialized
23424 does not deduce are never used uninitialized.
a586633d
PE
23425 * window.h (check_all_windows): New decl, to forestall
23426 gcc -Wmissing-prototypes diagnostic.
5b555da1 23427 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23428
f6095868
PE
23429 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23430 shadowing.
23431 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23432 Include <limits.h>.
23433 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23434 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23435 (load_charset_map): Mark variables that gcc -Wuninitialized
23436 does not deduce are never used uninitialized.
53df7c11 23437 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23438
f38b440c
PE
23439 * coding.c (coding_set_source, coding_set_destination):
23440 Use "else { /* comment */ }" rather than "else /* comment */;"
23441 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23442 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23443 a block, when the outer 'i' will do.
23444 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23445 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23446 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23447 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23448 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23449 Rename locals to avoid shadowing.
23450 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23451 * coding.c (emacs_mule_char, encode_invocation_designation):
23452 Now static, since they're not used elsewhere.
413bb2db 23453 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23454 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23455 (decode_coding_emacs_mule): Mark variables that gcc
23456 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23457 (detect_coding_iso_2022): Initialize a local variable that might
23458 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23459 this initialization is needed. (Bug#8211)
5f58e762
PE
23460 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23461 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23462 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23463 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23464 Remove unused macros.
f38b440c 23465
232b38b9 23466 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23467 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23468 * character.c (string_count_byte8): Likewise.
232b38b9 23469
fb90da1b
PE
23470 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23471 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23472
fb93dbc2
PE
23473 * chartab.c (copy_sub_char_table): Now static, since it's not used
23474 elsewhere.
5c156ace
PE
23475 (sub_char_table_ref_and_range, char_table_ref_and_range):
23476 Rename locals to avoid shadowing.
bbcd0949 23477 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23478
7d3b3862 23479 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23480 (BIDI_BOB): Remove unused macro.
7d3b3862 23481
6be7d3da
PE
23482 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23483 deduce are never used uninitialized.
c2ed9c8b 23484 * term.c (encode_terminal_code): Likewise.
6be7d3da 23485
75f8807f 23486 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23487
50938595
PE
23488 * tparam.h: New file.
23489 * term.c, tparam.h: Include it.
23490 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23491 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23492 Move these decls to tparam.h, and make them agree with what
23493 is actually in tparam.c. The previous trick of using incompatible
23494 decls in different modules does not conform to the C standard.
23495 All callers of tparam changed to use tparam's actual API.
23496 * tparam.c (tparam1, tparam, tgoto):
23497 Use const pointers where appropriate.
23498
fbceeba2
PE
23499 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23500 * cm.h (struct cm): Likewise.
23501 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23502 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23503 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23504 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23505 (turn_on_face, init_tty): Likewise.
23506 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23507
7f3f1250
PE
23508 * term.c (term_mouse_position): Rename local to avoid shadowing.
23509
e6ca6543
PE
23510 * alloc.c (mark_ttys): Move decl from here ...
23511 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23512
c40f8d15
AS
235132011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23514
23515 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23516
cfe0661d
JB
235172011-03-09 Juanma Barranquero <lekktu@gmail.com>
23518
23519 * search.c (compile_pattern_1): Remove argument regp, unused since
23520 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23521 (compile_pattern): Don't pass it.
23522
0afb4571
J
235232011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23524
23525 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23526 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23527 for ! HAVE_GTK3.
23528 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23529
23530 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23531
23532 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23533 gdk_window_get_screen, gdk_window_get_geometry,
23534 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23535 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23536 (xg_get_pixbuf_from_pixmap): New function.
23537 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23538 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23539 Call xg_get_pixbuf_from_pixmap instead of
23540 gdk_pixbuf_get_from_drawable.
23541 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23542 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23543 (xg_check_special_colors): Use GtkStyleContext and its functions
23544 for HAVE_GTK3.
23545 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23546 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23547 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23548 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23549 Call gtk_widget_get_preferred_size.
0afb4571
J
23550 (xg_frame_resized): gdk_window_get_geometry only takes 5
23551 parameters.
44f230aa
SM
23552 (xg_win_to_widget, xg_event_is_for_menubar):
23553 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23554 (xg_set_widget_bg): New function.
23555 (delete_cb): New function.
895009e1 23556 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23557 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23558 (xg_set_background_color): Call xg_set_widget_bg.
23559 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23560 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23561 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23562 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23563 if ! HAVE_GTK3.
23564 (update_frame_tool_bar): Call gtk_widget_hide.
23565 (xg_initialize): Use GDK_KEY_g.
23566
23567 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23568 if ! HAVE_GTK3
23569 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23570
23571 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23572 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23573 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23574
1c2cc4ef
JB
235752011-03-08 Juanma Barranquero <lekktu@gmail.com>
23576
23577 * w32xfns.c (select_palette): Check success of RealizePalette against
23578 GDI_ERROR, not zero.
23579
33383987 23580See ChangeLog.11 for earlier changes.
aac0c6e3
MR
23581
23582;; Local Variables:
23583;; coding: utf-8
aac0c6e3
MR
23584;; End:
23585
ab422c4d 23586 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
23587
23588 This file is part of GNU Emacs.
23589
23590 GNU Emacs is free software: you can redistribute it and/or modify
23591 it under the terms of the GNU General Public License as published by
23592 the Free Software Foundation, either version 3 of the License, or
23593 (at your option) any later version.
23594
23595 GNU Emacs is distributed in the hope that it will be useful,
23596 but WITHOUT ANY WARRANTY; without even the implied warranty of
23597 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23598 GNU General Public License for more details.
23599
23600 You should have received a copy of the GNU General Public License
23601 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.