Ignore additional platform-specific ACL errors (Bug#13702).
[bpt/emacs.git] / src / ChangeLog
CommitLineData
5406cfd9
RF
12013-04-07 Romain Francoise <romain@orebokech.com>
2
3 Ignore additional platform-specific ACL errors (Bug#13702).
4 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
5 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
6
95c0e83b
JD
72013-03-31 Jan Djärv <jan.h.d@swipnet.se>
8
9 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
10 f->output_data.ns.
11
876da980
PE
122013-04-07 Paul Eggert <eggert@cs.ucla.edu>
13
14 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
15 This bug was introduced by my 2013-02-25 change that simplified
16 data_start configuration. Without this change, on GNU/Linux
17 an Emacs configured with --enable-profiling fails immediately
18 due to a profiler signal.
19 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
20 with these flags. On platforms where special flags are needed
21 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
22 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
23 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
24
7452b7bd
DA
252013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
26
27 Get rid of some platform-specific functions examining window
28 system and its capabilities. This is a partial rework of the
29 2013-04-05 change.
30 * lisp.h (have_menus_p): Remove prototype. This function is
31 replaced with platform-independent window_system_available.
32 (check_window_system): Move to...
33 * frame.h (decode_window_system_frame, window_system_available):
34 ...here, add new prototypes.
35 * frame.c (window_system_available, decode_window_system_frame):
36 New functions.
37 (check_window_system): Platform-independent now.
38 * xterm.h (x_in_use): Remove declaration.
39 (check_x_frame):
40 * w32term.h (check_x_frame):
41 * nsterm.h (check_x_frame): Remove prototypes. This function
42 is replaced with platform-independent decode_window_system_frame.
43 * msdos.c (have_menus_p): Remove.
44 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
45 Remove platform-specific functions. Use check_window_system,
46 decode_window_system_frame and check_ns_display_info where
47 appropriate. Minor style and comment tweaks.
48 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
49 (check_x_frame): Likewise.
50 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
51 Likewise.
52 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
53 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
54 * xmenu.c, xselect.c: All related users changed.
55
251e9147
KH
562013-04-03 Kenichi Handa <handa@gnu.org>
57
58 The following changes is to optimize the code for reading UTF-8
59 files.
60
61 * coding.c (check_ascii): Renamed from detect_ascii. Return value
62 changed. Check EOL format. Do not call adjust_coding_eol_type
63 here.
64 (check_utf_8): New function.
65 (adjust_coding_eol_type): Do nothing if already adjusted.
66 (detect_coding): Compare the return value of check_ascii with
67 coding->src_bytes. Call adjust_coding_eol_type if necessary.
68 (decode_coding_gap): Optimize for valid UTF-8.
69
8bc369d4
KH
702013-03-21 Kenichi Handa <handa@gnu.org>
71
72 * coding.c (syms_of_coding): Cancel previous change.
73
74 * insdel.c (insert_from_gap): Fix previous change.
75
73931ad1
DA
762013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
77
78 Consistently use platform-specific function to detect window system.
79 * lisp.h (check_window_system): New prototype. This function is
80 going to replace check_x, check_w32 and check_ns.
81 (have_menus_p): Mention msdos.c in comment.
82 * fontset.c (check_window_system_func): Remove. Adjust all users.
83 * fontset.h (check_window_system_func): Remove prototype.
84 * nsterm.h (check_ns):
85 * xterm.h (check_x):
86 * w32term.h (check_w32): Likewise.
87 * menu.c (Fx_popup_menu): Use check_window_system.
88 * msdos.c (check_window_system): Define for MS-DOS.
89 * nsfns.m (check_window_system): Define for NS. Adjust all users.
90 * w32fns.c (check_window_system): Likewise for MS-Windows.
91 * xfns.c (check_window_system): Likewise for X.
92 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
93 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
94
7216e43b
PE
952013-04-02 Paul Eggert <eggert@cs.ucla.edu>
96
97 Prefer < to > in range checks such as 0 <= i && i < N.
98 This makes it easier to visualize quantities on a number line.
99 This patch doesn't apply to all such range checks,
100 only to the range checks affected by the 2013-03-24 change.
101 This patch reverts most of the 2013-03-24 change.
102 * alloc.c (xpalloc, Fgarbage_collect):
103 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
104 * character.c (string_escape_byte8):
105 * charset.c (read_hex):
106 * data.c (cons_to_unsigned):
107 * dispnew.c (update_frame_1):
108 * doc.c (Fsubstitute_command_keys):
109 * doprnt.c (doprnt):
110 * editfns.c (hi_time, decode_time_components):
111 * fileio.c (file_offset):
112 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
113 * font.c (font_intern_prop):
114 * frame.c (x_set_alpha):
115 * gtkutil.c (get_utf8_string):
116 * indent.c (check_display_width):
117 * keymap.c (Fkey_description):
118 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
119 * lread.c (read1):
120 * minibuf.c (read_minibuf_noninteractive):
121 * process.c (wait_reading_process_output):
122 * search.c (Freplace_match):
123 * window.c (get_phys_cursor_glyph):
124 * xdisp.c (redisplay_internal):
125 * xsmfns.c (smc_save_yourself_CB):
126 Prefer < to > for range checks.
127 * dispnew.c (sit_for): Don't mishandle NaNs.
128 This fixes a bug introduced in the 2013-03-24 change.
129 * editfns.c (decode_time_components): Don't hoist comparison.
130 This fixes another bug introduced in the 2013-03-24 change.
131
92759988
DA
1322013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
133
134 * frame.h (struct frame): Drop scroll_bottom_vpos
135 member becaue all real users are dead long ago.
136 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
137 * xdisp.c (redisplay_internal): Adjust user.
138
9a1971bb
GM
1392013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
140
f38ab167
JD
141 * nsmenu.m (showAtX:Y:for:): setLevel to
142 NSPopUpMenuWindowLevel (Bug#13998).
143
6d01f1fe
JD
1442013-03-30 Jan Djärv <jan.h.d@swipnet.se>
145
146 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
147 (ns_check_pending_open_menu): Declare.
148
149 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
150 (x_activate_menubar): Update the menu with title that matches
151 ns_get_pending_menu_title, and call
152 ns_check_pending_openmenu (Bug#12698).
153 (menuWillOpen:): New method.
154 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
155
156 * nsterm.m (menu_will_open_state, menu_mouse_point)
157 (menu_pending_title): New varaibles.
158 (ns_get_pending_menu_title, ns_check_menu_open)
159 (ns_check_pending_open_menu): New functions.
160
781f4782
DA
1612013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
162
163 * indent.c (current_column_bol_cache): Remove leftover which is not
164 used in Fmove_to_column any more.
165 (current_column, scan_for_column): Adjust users.
166 * keyboard.c (last_point_position_buffer, last_point_position_window):
167 Remove leftovers which are not used for recording undo any more.
168 (command_loop_1, syms_of_keyboard): Adjust users.
169 * xdisp.c (last_max_ascent): Remove leftover which is not used in
170 redisplay_window any more.
171 (move_it_to): Adjust user.
172
1921c31b
JB
1732013-03-29 Juanma Barranquero <lekktu@gmail.com>
174
175 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
176 Update dependencies.
177
717b8bcd
SM
1782013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
181 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
182 forward references.
183
e74aeda8
DA
1842013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
185
186 * window.h (struct window): Replace hchild, vchild and buffer slots
187 with the only contents slot. This is possible because each valid
188 window may have either the child window (in vertical or horizontal
189 combination) or buffer to display (for the leaf window). Using that,
190 a lof of operations to traverse and/or change window hierarchies may
191 be simplified. New member horizontal is used to distinguish between
192 horizontal and vertical combinations of internal windows.
193 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
194 (WINDOW_VERTICAL_COMBINATION_P): New macros.
195 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
196 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
197 Use contents slot, not buffer, where appropriate.
198 (wset_combination): New function.
199 (wset_buffer): Add eassert.
200 (Fframe_first_window): Simplify the loop reaching first window.
201 (Fwindow_buffer): Use WINDOW_LEAF_P.
202 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
203 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
204 (unshow_buffer): Convert initial debugging check to eassert.
205 (replace_window, recombine_windows, Fdelete_other_windows_internal)
206 (make_parent_window, window_resize_check, window_resize_apply)
207 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
208 (Fset_window_configuration, delete_all_child_windows, save_window_save):
209 Adjust to match struct window changes.
210 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
211 (mark_window_cursors_off, count_windows, get_leaf_windows)
212 (foreach_window_1): Simplify the loop.
213 * alloc.c (mark_object): Do not check for the leaf window because
214 internal windows has no glyph matrices anyway.
215 * dispnew.c (clear_window_matrices, showing_window_margins_p)
216 (allocate_matrices_for_window_redisplay, fake_current_matrices)
217 (allocate_matrices_for_frame_redisplay, free_window_matrices)
218 (build_frame_matrix_from_window_tree, mirror_make_current)
219 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
220 (update_window_tree, set_window_update_flags): Simplify the loop.
221 (sync_window_with_frame_matrix_rows): Enforce live window.
222 Use contents slot, not buffer, where appropriate.
223 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
224 and WINDOW_HORIZONTAL_COMBINATION_P.
225 (make_frame_visible_1): Simplify the loop.
226 Use contents slot, not buffer, where appropriate.
227 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
228 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
229 (expose_window_tree): Likewise.
230 Use contents slot, not buffer, where appropriate.
231 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
232 to avoid deleted windows. Use contents slot instead of buffer.
233 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
234 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
235 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
236 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
237
121ab1cd
EZ
2382013-03-28 Eli Zaretskii <eliz@gnu.org>
239
ef454cf7
EZ
240 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
241 identify the reasons for assertion violations in bug#14062 and
242 similar ones.
21e930f8
EZ
243 (Fx_show_tip): Fix compilation error under
244 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 245
121ab1cd
EZ
246 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
247 Reported by <rzl24ozi@gmail.com>.
248
5c89ca24
DA
2492013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
250
251 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
252 start marker...
253 (unwind_with_echo_area_buffer): ...to restore it here. This
254 is needed to ensure that...
255 (redisplay_window): ...both window markers are valid here,
256 which is verified by eassert.
257 * editfns.c (save_excursion_save): Do not assume that
258 selected_window always displays the buffer.
c7f53895
DA
259 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
260 Fix comment.
5c89ca24 261
f557c1b1
SM
2622013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
263
264 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
265 the upcase table.
266
40693bba 2672013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
268
269 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
270
c86f791f
EZ
2712013-03-27 Eli Zaretskii <eliz@gnu.org>
272
273 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
274 since MinGW's w32api headers do. This avoids compiler warnings.
275
276 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
277 if already defined.
278
c6e72e17
EZ
2792013-03-26 Eli Zaretskii <eliz@gnu.org>
280
281 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
282
54e95010
JD
2832013-03-26 Jan Djärv <jan.h.d@swipnet.se>
284
285 * gtkutil.c (style_changed_cb): Check if frame is live and an
286 X frame (Bug#14038).
287
b88b62de
EZ
2882013-03-26 Eli Zaretskii <eliz@gnu.org>
289
a18d7de6
EZ
290 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
291 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
292 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
293 MinGW64.
8f5e14c8
EZ
294 Move inclusion of time.h before sys/time.h, so that MinGW64 could
295 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 296
b88b62de
EZ
297 Fix incompatibilities between MinGW.org and MinGW64 headers.
298 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
299
300 * w32.c (REPARSE_DATA_BUFFER): Guard with
301 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
302
c074e458
JD
3032013-03-25 Jan Djärv <jan.h.d@swipnet.se>
304
305 * xterm.c: Include X11/XKBlib.h
306 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
307
908589fd
AS
3082013-03-24 Andreas Schwab <schwab@linux-m68k.org>
309
310 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
311 written backwards.
312 * blockinput.h (input_blocked_p): Likewise.
313 * bytecode.c (exec_byte_code): Likewise.
314 * callproc.c (call_process_kill, call_process_cleanup)
315 (Fcall_process): Likewise.
316 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
317 (Fccl_execute_on_string): Likewise.
318 * character.c (string_escape_byte8): Likewise.
319 * charset.c (read_hex): Likewise.
320 * cm.c (calccost): Likewise.
321 * data.c (cons_to_unsigned): Likewise.
322 * dired.c (directory_files_internal, file_name_completion):
323 Likewise.
324 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
325 (sit_for): Likewise.
326 * doc.c (Fsubstitute_command_keys): Likewise.
327 * doprnt.c (doprnt): Likewise.
328 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
329 * emacsgtkfixed.c: Likewise.
330 * fileio.c (file_offset, Fwrite_region): Likewise.
331 * floatfns.c (Fexpt, fmod_float): Likewise.
332 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
333 Likewise.
334 * font.c (font_intern_prop): Likewise.
335 * frame.c (x_set_alpha): Likewise.
336 * gtkutil.c (get_utf8_string): Likewise.
337 * indent.c (check_display_width): Likewise.
338 * intervals.c (create_root_interval, rotate_right, rotate_left)
339 (split_interval_right, split_interval_left)
340 (adjust_intervals_for_insertion, delete_node)
341 (interval_deletion_adjustment, adjust_intervals_for_deletion)
342 (merge_interval_right, merge_interval_left, copy_intervals)
343 (set_intervals_multibyte_1): Likewise.
344 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
345 * keymap.c (Fkey_description): Likewise.
346 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
347 * lread.c (openp, read_integer, read1, string_to_number):
348 Likewise.
349 * menu.c (ensure_menu_items): Likewise.
350 * minibuf.c (read_minibuf_noninteractive): Likewise.
351 * print.c (printchar, strout): Likewise.
352 * process.c (create_process, Faccept_process_output)
353 (wait_reading_process_output, read_process_output, send_process)
354 (wait_reading_process_output): Likewise.
355 * profiler.c (make_log, handle_profiler_signal): Likewise.
356 * regex.c (re_exec): Likewise.
357 * regex.h: Likewise.
358 * search.c (looking_at_1, Freplace_match): Likewise.
359 * sysdep.c (get_child_status, procfs_ttyname)
360 (procfs_get_total_memory): Likewise.
361 * systime.h (EMACS_TIME_VALID_P): Likewise.
362 * term.c (dissociate_if_controlling_tty): Likewise.
363 * window.c (get_phys_cursor_glyph): Likewise.
364 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
365 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
366 Likewise.
367 * xfns.c (Fx_window_property): Likewise.
368 * xmenu.c (set_frame_menubar): Likewise.
369 * xselect.c (x_get_window_property, x_handle_dnd_message):
370 Likewise.
371 * xsmfns.c (smc_save_yourself_CB): Likewise.
372 * xterm.c (x_scroll_bar_set_handle): Likewise.
373
2bf7d27a
DA
3742013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
375
376 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
377 to be optional or nil. Adjust comment and convert it to docstring.
378 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
379 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
380
a9ebfa0b
PE
3812013-03-24 Paul Eggert <eggert@cs.ucla.edu>
382
383 Static checking by GCC 4.8-20130319.
384 * image.c (gif_load): Assume pass < 3 to pacify GCC.
385 * process.c (Fset_process_datagram_address)
386 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
387 * xdisp.c (get_char_face_and_encoding):
388 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
389 (get_glyph_face_and_encoding): Prepare face before possibly using it.
390 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
391
4f3576ee
KB
3922013-03-24 Ken Brown <kbrown@cornell.edu>
393
789b5e9a
KB
394 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
395 fix compilation on 64-bit Cygwin, where underscores are not
396 automatically prepended.
397
4f3576ee
KB
398 * w32term.c (w32_initialize): Silence compiler warning.
399
b5b7745f
EZ
4002013-03-23 Eli Zaretskii <eliz@gnu.org>
401
cdc0d0bd
EZ
402 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
403 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
404 variables, to save and restore frame dimensions. Use
405 FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
406 after returning from a 'fullscreen' configuration. use
407 SendMessage instead of PostMessage to send the SC_RESTORE message,
408 to avoid races between the main thread and the input thread.
409
410 * w32term.h (struct w32_output): New members normal_width,
411 normal_height, normal_top, normal_left, and prev_fsmode.
412 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
413 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
414 members of a frame.
415
b5b7745f
EZ
416 * w32term.c (w32fullscreen_hook): Record last value of the frame's
417 'fullscreen' parameter. Always record previous width and height
418 of the frame, except when switching out of maximized modes, so
419 that they could be restored correctly, instead of resetting to the
420 default frame dimensions. Send SC_RESTORE command to the frame,
421 unless we are going to send SC_MAXIMIZE, to restore the frame
422 resize hints in the mouse pointer shown by the window manager.
423 (Bug#14032)
424
425 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
426
427 * lisp.h (get_frame_param): Adjust conditions for prototype
428 declaration.
429
a3454eed
KB
4302013-03-22 Ken Brown <kbrown@cornell.edu>
431
432 * unexcw.c: Drop unneeded inclusion of w32common.h.
433 (report_sheap_usage): Declare.
434 (read_exe_header): Add magic numbers for x86_64.
435 (fixup_executable): Fix printf format specifier for unsigned long
436 argument.
437
5a49b79c
DA
4382013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
439
440 * frame.h (struct frame): Put menu_bar_window under #ifdef
441 because this member is not needed when X toolkit is in use.
442 (fset_menu_bar_window):
443 * dispnew.c (clear_current_matrices, clear_desired_matrices)
444 (free_glyphs, update_frame):
445 * xdisp.c (expose_frame): Likewise.
446 (display_menu_bar): Likewise. Remove redundant eassert.
447 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
448 toolkit is in use.
449
d6723bf7
PE
4502013-03-21 Paul Eggert <eggert@cs.ucla.edu>
451
7b1123d8
PE
452 Use functions and constants to manipulate Lisp_Save_Value objects.
453 This replaces code that used macros and strings and token-pasting.
454 The change makes the C source a bit easier to follow,
455 and shrinks the Emacs executable a bit.
456 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
457 (make_save_value): Change 1st arg from string to enum. All callers
458 changed.
459 (INTX): Remove.
460 (mark_object): Use if, not #if, for GC_MARK_STACK.
461 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
462 (XSAVE_OBJECT): Now functions, not macros.
463 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
464 the constant was never used.
465 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
466 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
467 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
468 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
469 New constants.
470 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
471 type3 with a single member save_type. All uses changed.
472 (save_type, set_save_pointer, set_save_integer): New functions.
473 * print.c (PRINTX): Remove.
474
d6723bf7
PE
475 * alloc.c: Remove redundant static declarations.
476
5f24fa51
DA
4772013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
478
479 * window.h (struct window): Convert left_col, top_line, total_lines
480 and total_cols from Lisp_Objects to integers. Adjust comments.
481 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
482 Remove.
483 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
484 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
485 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
486 Adjust users where appropriate.
487
42143acd
DA
4882013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
489
490 * frame.h (struct frame): Drop resx and resy because the same data is
491 available from window system-specific output context. Adjust users.
96061a21 492 (default_pixels_per_inch_x, default_pixels_per_inch_y): New
42143acd
DA
493 functions to provide defaults when no window system available.
494 (FRAME_RES_X, FRAME_RES_Y): New macros.
495 (NUMVAL): Moved from xdisp.c.
496 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
497 (Ffont_face_attributes, Fopen_font):
498 * image.c (gs_load):
499 * w32font.c (fill_in_logfont):
500 * xdisp.c (calc_pixel_width_or_height):
501 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
502 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
503
c0a17406
KH
5042013-03-20 Kenichi Handa <handa@gnu.org>
505
506 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
507 to 1 (temporary workaround until a bug related to ASCII
508 optimization is fixed).
509
095d384d
DA
5102013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
511
512 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
513 Signal error if window is not internal. Adjust docstring.
514 (delete_all_child_windows): Use combination_limit to save the buffer.
515 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
516 * print.c (syms_of_print): Initialize debugging output not here...
517 (init_print_once): ...but in a new function here.
518 * lisp.h (init_print_once): Add prototype.
519 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 520
748fa866
DA
5212013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
522
523 * window.c (window_resize_check, window_resize_apply)
524 (window_from_coordinates, recombine_windows, set_window_buffer)
525 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
526 (Fsplit_window_internal, Fdelete_window_internal)
527 (freeze_window_starts): Use bool for booleans.
528 * window.h (window_frame_coordinates, resize_frame_windows)
529 (freeze_window_starts, set_window_buffer): Adjust prototypes.
530
81519fd2
SM
5312013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
532
533 * dispnew.c (bitch_at_user): Use `user-error'.
534
6db423a9
KB
5352013-03-17 Ken Brown <kbrown@cornell.edu>
536
537 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
538 as return type of image_background. (Bug#13981)
539 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
540
8f2906f5
JD
5412013-03-16 Jan Djärv <jan.h.d@swipnet.se>
542
960ce480 543 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 544 (ns_select): Don't return with result uninitialized.
960ce480 545
8f2906f5
JD
546 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
547 and getDirectory.
548
81519fd2
SM
549 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
550 New functions.
8f2906f5
JD
551 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
552 directories. If filename is nil, get directory name (Bug#13932).
553 Use getFilename and getDirectory.
554 (getFilename, getDirectory): New methods for EmacsSavePanel and
555 EmacsOpenPanel.
556 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
557
cded56c1
PE
5582013-03-15 Paul Eggert <eggert@cs.ucla.edu>
559
560 * coding.c (decode_coding_gap): Fix typo caught by static checking.
561
251e9147 5622013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
563
564 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
565 (adjust_after_replace): Make it back to static. Delete the third
566 arg text_at_gap_tail. Cancel the code for handling it.
567
568 * coding.h (struct coding_system): New member eol_seen.
569
570 * coding.c (detect_ascii): New function.
571 (detect_coding): Set coding->head_ascii and coding->eol_seen only
572 when the source bytes are actually scanned. On detecting for
573 coding_category_utf_8_auto, call detect_ascii instead of scanning
574 source bytes directly.
575 (produce_chars): Call insert_from_gap with the new arg 0.
576 (encode_coding): Likewise.
577 (decode_coding_gap): Control ASCII optimization by the variable
578 disable_ascii_optimization instead of #ifndef .. #endif.
579 Deccode EOL format according to coding->eol_seen.
580 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
581 variable.
582
8a44e6d1
KH
583 * lisp.h (adjust_after_replace): Cancel externing it.
584 (insert_from_gap): Adjust prototype.
585
5f795e34
EZ
5862013-03-15 Eli Zaretskii <eliz@gnu.org>
587
588 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
589 FULLSCREEN_MAXIMIZED. (Bug#13935)
590
f258b4be
DA
5912013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
592
593 * region-cache.c (find_cache_boundary, move_cache_gap)
594 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
595 Simplify debugging check and convert to eassert. Adjust comment.
596 (pp_cache): Put under ENABLE_CHECKING.
597
a5cc4dde
EZ
5982013-03-14 Eli Zaretskii <eliz@gnu.org>
599
600 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
601 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
602 and WM_ACTIVATEAPP.
603 (w32fullscreen_hook): If the frame is visible, reset
604 f->want_fullscreen flag after changing the frame size. If the
605 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
606 (Bug#13953)
607
3fc5e44a
DC
6082013-03-13 Daniel Colascione <dancol@dancol.org>
609
610 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
611 too so that these builds can use Cygwin's file conversion
612 functions. (We've been building and linking cygw32.o all along
613 and just not using it.)
614
47d7532e
PE
6152013-03-13 Paul Eggert <eggert@cs.ucla.edu>
616
617 File synchronization fixes (Bug#13944).
618 * Makefile.in (LIB_FDATASYNC): New macro.
619 (LIBES): Use it.
620 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
621 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
622 Don't worry about HAVE_FSYNC, since a substitute fsync is
623 available if the system lacks one.
624 (Fwrite_regin): Retry fsync if interrupted.
625
c7ffccaf
EZ
6262013-03-13 Eli Zaretskii <eliz@gnu.org>
627
4e2df81d 628 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
629 activated, call w32fullscreen_hook, to make sure the new frame
630 dimensions are in effect. (Bug#13937)
631
8a7debc1
DA
6322013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
633
634 * xdisp.c (init_iterator): Simplify because both character and byte
635 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
636 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
637 character and byte positions can be obtained from marker.
8a7debc1 638
7fd8c501
PE
6392013-03-13 Paul Eggert <eggert@cs.ucla.edu>
640
d9df6f40
PE
641 Static checking by Sun C 5.12.
642 * alloc.c (buffer_memory_full) [REL_ALLOC]:
643 * bytecode.c (exec_byte_code):
644 * dispnew.c (init_display):
645 * eval.c (error):
646 * fileio.c (Fsubstitute_in_file_name):
647 * keyboard.c (Fevent_convert_list):
648 * keymap.c (Fsingle_key_description):
649 * term.c (maybe_fatal, fatal):
650 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
651 * xsmfns.c (Fhandle_save_session):
652 Omit unreachable code.
653 * keymap.c (map_keymap_char_table_item): Cast void * to
654 a function pointer type; the C Standard requires this.
655
7fd8c501
PE
656 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
657 Include <sys/param.h> unconditionally, as that works elsewhere and
658 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
659 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
660 and FreeBSD now.
661
cb0290df
PE
6622013-03-11 Paul Eggert <eggert@cs.ucla.edu>
663
664 * insdel.c (adjust_after_replace): Use bool for boolean.
665
cbae07d5
SM
6662013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
667
668 * keyboard.c: Move keyboard decoding to read_key_sequence.
669 (decode_keyboard_code): Remove.
670 (tty_read_avail_input): Don't try to decode input.
671 (read_decoded_char): New function.
672 (read_key_sequence): Use it.
673
819e2da9
DC
6742013-03-10 Daniel Colascione <dancol@dancol.org>
675
676 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
677 (GUI_SDATA, guichar_t): Macros to abstract out differences between
678 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
679 w32fns.c.
680
681 * w32term.c (construct_drag_n_drop): Use the above macros to make
682 drag-and-drop work for non-ASCII filenames in cygw32 builds.
683
684 * w32fns.c (x_set_name, x_set_title): Use the above macros to
685 properly display non-ASCII frame titles in cygw32 builds.
686
687 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
688 call ShellExecute in cygw32 builds.
689
690 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
691 common file dialog code.
692
693 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
694 can just use du like other systems.
695
696 * coding.c (from_unicode_buffer): Declare.
697 * coding.c (from_unicode_buffer): Implement.
698
99ec1647
SM
6992013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
700
d2e24f92
SM
701 * lread.c: Minor cleanup.
702 (FROM_FILE_P): New macro.
703 (skip_dyn_bytes, unreadchar, read1): Use it.
704 (read_list): Consolidate duplicated code.
705
99ec1647
SM
706 * bytecode.c (struct byte_stack): Remove `constants' when unused.
707
138c0ae8
EZ
7082013-03-10 Eli Zaretskii <eliz@gnu.org>
709
710 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
711 (redisplay_internal, set_cursor_from_row, try_window)
712 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
713 (display_line, notice_overwritten_cursor)
99ec1647
SM
714 (mouse_face_from_buffer_pos, note_mouse_highlight):
715 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 716 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
717 (mouse_face_from_string_pos, fast_find_string_pos):
718 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
719
720 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
721
722 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
723
724 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
725 MATRIX_MODE_LINE_ROW.
726
727 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
728
c230dd7d
KH
7292013-03-10 handa <handa@gnu.org>
730
731 * lisp.h (adjust_after_replace): Extern it.
732
733 * coding.c (detect_coding): Cound the heading ASCII bytes in the
734 case of detection for coding_category_utf_8_auto.
99ec1647
SM
735 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
736 Skip decoding if all bytes are ASCII.
c230dd7d
KH
737
738 * insdel.c (adjust_after_replace): Make it public. New arg
739 text_at_gap_tail.
740 (adjust_after_insert): Call adjust_after_replace with the new arg
741 value 0.
742
27a98a62
SM
7432013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
744
745 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
746 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
747 from Elisp via unread-command-events.
748
749 * keyboard.c (access_keymap_keyremap): Accept nil return value from
750 functions to mean "no change".
751
457882c2
PE
7522013-03-08 Paul Eggert <eggert@cs.ucla.edu>
753
754 region-cache.c, scroll.c, search.c: Use bool for booleans.
755 * lisp.h (compile_pattern):
756 * scroll.c (do_scrolling, do_direct_scrolling):
757 * search.c (struct regexp_cache, compile_pattern_1)
758 (compile_pattern, string_match_1, search_command)
759 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
760 (search_regs_saved, Fregexp_quote):
761 Use bool for boolean.
762 * region-cache.c (region_cache_forward, region_cache_backward):
763 Fix comments to match code: these functions return int, not boolean.
764
b5426561
DA
7652013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
766
767 * search.c (find_newline): Accept start and end byte positions
768 as arguments and allow -1 if not known.
769 (find_newline_no_quit): Likewise for start position.
770 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
771 * bidi.c (bidi_find_paragraph_start): Pass byte position to
772 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
773 * editfns.c (Fconstrain_to_field): Break long line.
774 Adjust call to find_newline.
b5426561
DA
775 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
776 Use DEC_BOTH to start next search from the previous buffer
777 position, where appropriate.
778 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
779 (get_visually_first_element, move_it_vertically_backward): Likewise.
780 Obtain byte position from the display iterator, where appropriate.
781
0bce5d9e
PE
7822013-03-08 Paul Eggert <eggert@cs.ucla.edu>
783
784 print.c, process.c: Use bool for booleans.
785 * lisp.h (wait_reading_process_output):
786 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
787 (strout, debug_output_compilation_hack, float_to_string, print)
788 (print_object):
789 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
790 (decode_status, status_message, create_process, create_pty)
791 (Fmake_network_process, Fnetwork_interface_info)
792 (wait_reading_process_output, read_process_output)
793 (write_queue_push, write_queue_pop, process_send_signal)
794 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
795 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
796 Use bool for booleans.
797 * process.c (Fnetwork_interface_list): Remove unused local.
798 (connect_counter): Now EMACS_INT, not int.
799
36075a19
DA
8002013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
801
802 * bidi.c (bidi_fetch_char): Swap first and second arguments
803 to match other functions accepting character and byte positions.
804 Adjust comment.
805 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
806 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
807 when you need just to move to the previous buffer position.
808 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
809
4aae1914
EZ
8102013-03-07 Eli Zaretskii <eliz@gnu.org>
811
812 * .gdbinit (prowlims): Display the enabled_p flag of the row.
813
c54aa166
DA
8142013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
815
816 Avoid character to byte conversions in motion subroutines.
817 * indent.h (compute_motion, vmotion): Add byte position argument.
818 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
819 Add eassert.
820 (Fcompute_motion): Break long line. Adjust call to compute_motion.
821 Use list5 for return value.
822 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
823 Adjust comments, style and calls to compute_motion.
824 (Fvertical_motion): Adjust call to vmotion.
825 * window.c (Fdelete_other_windows_internal): Record window start
826 byte position and adjust call to vmotion.
827 (window_scroll_line_based): Likewise with call to compute_motion.
828 Use SET_PT_BOTH.
829 (Frecenter): Adjust calls to vmotion.
830
3de717bd
DA
8312013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
832
833 * lisp.h (list2i, list3i): New functions.
834 (list4i): Move from window.c and make LISP_INLINE.
835 * editfns.c (make_lisp_time):
836 * fns.c (Flocale_info):
837 * keyboard.c (parse_modifiers):
838 * xterm.c (x_ewmh_activate_frame): Use list2i.
839 * instel.c (signal_after_change):
840 * nsfns.m (Fx_server_version, Fxw_color_values):
841 * w32fns.c (Fxw_color_values, Fx_server_version):
842 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
843 * fileio.c (Fvisited_file_modtime):
844 * nsfns.m (Fns_display_usable_bounds):
845 * w32.c (ltime): Use list4i.
846
d26e478e
EZ
8472013-03-06 Eli Zaretskii <eliz@gnu.org>
848
a611149e
EZ
849 * search.c (find_newline_no_quit): Rename from find_next_newline.
850 Add commentary.
851
852 * lisp.h (find_newline_no_quit): Rename prototype.
853
854 * xdisp.c (back_to_previous_line_start)
855 (forward_to_next_line_start, get_visually_first_element)
856 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
857 * indent.c (vmotion): Callers of find_newline_no_quit changed.
858 * bidi.c (bidi_find_paragraph_start): Callers of
859 find_newline_no_quit changed.
860
d26e478e
EZ
861 * msdos.c: Change encoding to cp850. (Bug#13879)
862 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
863
1af1a51a
DA
8642013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
865
866 Coding system support cleanup and minor refactoring.
867 * coding.h (enum coding_result_code): Remove
868 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
869 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
870 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
871 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
872 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
873 (decode_coding_region, encode_coding_region, decode_coding_string):
874 Remove unused compatibility macros.
875 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
876 (record_conversion_result): Adjust user.
877 (syms_of_coding): Likewise.
878 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
879 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
880 (decode_coding_object): Simplify since xrealloc never returns NULL.
881 Add eassert.
882
0bafabe7 8832013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 884
9b1c3271 885 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
886 * sysdep.c (list_system_processes)
887 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 888 Make it a stub in this case; otherwise the build might fail,
0845a75c 889 and this code hasn't been tested on such hosts anyway.
725eb027 890 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
891 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
892 and analyzed by Jérémie Courrèges-Anglas in
893 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 894
ffc65bee
DA
8952013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
896
897 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
898 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
899 (get_visually_first_element, move_it_vertically_backward): Ajust users.
900 * bidi.c (bidi_find_paragraph_start): Likewise.
901 * indent.c (vmotion): Likewise.
902
70743157
PE
9032013-03-05 Paul Eggert <eggert@cs.ucla.edu>
904
905 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
906 * filelock.c: Include <c-ctype.h>.
907 (MAX_LFINFO): New top-level constant.
908 (lock_info_type): Remove members pid, boot_time. Add members at,
909 dot, colon. Change user member to be the entire buffer, not a
910 pointer. This allows us to handle the case where a foreign
911 pid or boot time exceeds the local range. All uses changed.
912 (LINKS_MIGHT_NOT_WORK): New constant.
913 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
914 (defined_WINDOWSNT): Remove.
915 (MAKE_LOCK_NAME, file_in_lock_file_name):
916 Always use .#FILE (not .#-FILE) for the file lock,
917 even if it is a regular file.
918 (rename_lock_file): New function.
919 (create_lock_file): Use it.
920 (create_lock_file, read_lock_data):
921 Prefer a symbolic link for the lock file, falling back on a
922 regular file if symlinks don't work. Do not try to create
923 symlinks on MS-Windows, due to security hassles. Stick with
924 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
925 link, rename, unlink, mkstemp) when creating locks, as a GNUish
926 host may be using a Windowsish file system, and cannot use
927 MS-Windows-only system calls. Fall back on mktemp if mkstemp
928 doesn't work. Don't fail merely because of a symlink-contents
929 length limit in the current file system; fall back on regular
930 files. Increase the symlink contents length limit to 8 KiB, this
931 should be big enough for any real use and doesn't crunch the
932 stack.
933 (create_lock_file, lock_file_1, read_lock_data):
934 Simplify allocation of lock file buffers now that they fit in 8 KiB.
935 (lock_file_1): Return error number, not bool. All callers changed.
936 (ELOOP): New macro, if not already defined.
937 (read_lock_data): Return size of lock file contents, not Lisp object.
938 All callers changed. Handle a race condition if some other process
939 replaces a regular-file lock with a symlink lock or vice versa,
940 while we're trying to read the lock.
941 (current_lock_owner): Parse contents more carefully, to help avoid
942 confusing a regular-file lock with some other application's use
943 of the file. Check for lock file contents being too long, or
944 not parsing correctly.
945 (current_lock_owner, lock_file):
946 Allow foreign pid and boot times that exceed the local range.
947 (current_lock_owner, lock_if_free, lock_file):
948 Simplify allocation of lock file contents.
949 * w32.c (sys_rename_replace): New function, containing most of
950 the contents of the old sys_rename.
951 (sys_rename): Use it.
952 (fchmod): New dummy function.
953 * w32.h (sys_rename_replace, fchmod): New decls.
954
05e193f1
EZ
9552013-03-05 Eli Zaretskii <eliz@gnu.org>
956
957 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
958 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
959 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
960 <dmantipov@yandex.ru>.
961
3bfc46eb
DA
9622013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
963
964 * composite.c (get_composition_id, fill_gstring_header):
965 Use make_uninit_vector where appropriate.
966 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
967 * xselect.c (clean_local_selection_data): Likewise.
968
84ac6f9d
PE
9692013-03-04 Paul Eggert <eggert@cs.ucla.edu>
970
971 Fix misuse of ImageMagick that caused core dump (Bug#13846).
972 * image.c (imagemagick_load_image): Calculate height and width
973 after flattening the image, not before.
974
42926ec8
DA
9752013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
976
977 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
978 * ftfont.c (ftfont_shape_by_flt): Likewise.
979 * w32uniscribe.c (uniscribe_shape): Likewise.
980
b5029e23
PE
9812013-03-02 Paul Eggert <eggert@cs.ucla.edu>
982
983 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
984 The old approach, which fell back on DIR/.#FILE.0 through
985 DIR/.#FILE.9, had race conditions that could not be easily fixed.
986 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
987 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
988 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
989 because the locking mechanism was never reliable in that case).
990 This patch fixes this and other bugs discovered by a code
991 inspection that was prompted by
992 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
993 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
994 to avoid interoperability problems between the MS-Windows and
995 non-MS-Windows implementations. MS-Windows and non-MS-Windows
996 instances of Emacs now ignore each others' locks.
997 * filelock.c (defined_WINDOWSNT): New constant.
998 (MAKE_LOCK_NAME, fill_in_lock_file_name):
999 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1000 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1001 regular files on MS-Windows hosts.
1002 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1003 Use SAFE_ALLOCA to avoid problems with long file names.
1004 (MAX_LFINFO): Now a local constant, not a global macro.
1005 (IS_LOCK_FILE): Remove.
1006 (lock_file_1): Don't inspect errno if symlink call succeeds;
1007 that's not portable.
1008 (lock_file): Document that this function can return if lock
1009 creation fails.
2db41375 1010 (lock_file): Don't access freed storage.
b5029e23 1011
b270d116
AS
10122013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1013
1014 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1015
81c23309
PE
10162013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1017
1018 * textprop.c: Use bool for booleans.
1019 (validate_interval_range, Fadd_text_properties)
1020 (Fremove_text_properties): Prefer bool to int when either works.
1021
18f2ac09
EZ
10222013-03-02 Eli Zaretskii <eliz@gnu.org>
1023
27a98a62
SM
1024 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1025 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1026 modify_region, re-do processing starting from the call to
1027 validate_interval_range. (Bug#13743)
1028
929aeac6 10292013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1030
1031 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1032 (Bug#13546).
1033
531e70ec
EZ
10342013-02-27 Eli Zaretskii <eliz@gnu.org>
1035
1036 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1037 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1038 access to the lock file until it is written and closed.
1039 (Bug#13807)
1040
6e65b9cc
PE
10412013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1042
1043 * callint.c (Qcall_interactively):
1044 * macros.c (Qexecute_kbd_macro):
1045 Now static.
1046
3b166f09
BG
10472013-02-26 Bastien Guerry <bzg@gnu.org>
1048
1049 * window.c (Frecenter): Tiny docstring enhancement.
1050
ecc0fdd4
PE
10512013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1052
1053 Minor textprop integer cleanup.
1054 * intervals.h, textprop.c (add_text_properties_from_list):
1055 Return void, not int, since nobody uses the return value.
1056 * textprop.c (validate_plist, add_properties, remove_properties)
1057 (Fadd_text_properties):
1058 Don't assume list length fits in int.
1059 (interval_has_all_properties, interval_has_some_properties)
1060 (interval_has_some_properties_list, add_properties, remove_properties)
1061 (Fadd_text_properties, Fremove_text_properties)
1062 (Fremove_list_of_text_properties, text_property_stickiness):
1063 Use bool for booleans.
1064 (Fadd_text_properties, Fremove_text_properties):
1065 (Fremove_list_of_text_properties):
1066 Reindent do-while as per GNU style.
1067
0248b0d7
EZ
10682013-02-25 Eli Zaretskii <eliz@gnu.org>
1069
343a2aef
EZ
1070 Implement CLASH_DETECTION for MS-Windows.
1071
1072 * filelock.c [WINDOWSNT]: Include w32.h.
1073 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1074 function of that name. Up-case the macro arguments.
1075 (IS_LOCK_FILE): New macro.
1076 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1077 (create_lock_file): New function, with body extracted from
1078 lock_file_1.
1079 [WINDOWSNT]: Implement lock files by writing a regular file with
1080 the lock information as its contents.
1081 (read_lock_data): New function, on Posix platforms just calls
1082 emacs_readlinkat.
1083 [WINDOWSNT]: Read the lock info from the file.
1084 (current_lock_owner): Call read_lock_data instead of calling
1085 emacs_readlinkat directly.
1086 (lock_file) [WINDOWSNT]: Run the file name through
1087 dostounix_filename.
1088
1089 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1090 just check if the process by that PID exists.
1091
1092 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1093 also present, as doing so will fail to error out if the file
1094 already exists.
1095
1096 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1097
0248b0d7
EZ
1098 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1099 (Fremove_list_of_text_properties): Skip all of the intervals in
1100 the region between START and END that already have resp. don't
27a98a62
SM
1101 have the requested properties, not just the first one.
1102 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1103 properties. (Bug#13743)
1104
b5071fc7
SM
11052013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1106
1107 * callint.c (Fcall_interactively): Use the right lexical environment
1108 for `interactive' specs (bug#13811).
1109 * eval.c (Feval): Accept a lexical environment.
1110
1ddc2bd6
PE
11112013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1112
1113 Simplify data_start configuration (Bug#13783).
1114 This is a followon simplification to the fix for Bug#13650.
1115 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1116 (START_FILES): Remove. All uses removed.
1117 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1118 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1119 (buildobj.h): Use it.
1120 ($(ALLOBJS)): Depend on globals.h.
1121 (temacs$(EXEEXT)): Use $(ALLOBJS).
1122 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1123 * deps.mk (vm-limit.o):
1124 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1125 Do not depend on mem-limits.h.
1126 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1127 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1128 [__GNUC__ && !ORDINARY_LINK]: Remove.
1129 * mem-limits.h, pre-crt0.c: Remove.
1130 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1131 * unexcoff.c (etext): New decl.
1132 (make_hdr): Use DATA_START instead of start_of_data.
1133 * vm-limit.c: Move most of mem-limits.h's contents here.
1134 (data_start): New decl. It's OK if this is approximate,
1135 so simplify-away some unnecessary exactness.
1136 (POINTER): Remove; all uses removed.
1137 (data_space_start): Now char *, to avoid casts.
1138 (exceeds_lisp_ptr): New function, replacing the old
1139 EXCEEDS_LISP_PTR macro. All uses changed.
1140 (check_memory_limits): Simplify and remove casts.
1141 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1142 (memory_warnings): Use data_start instead of start_of_data.
1143
51aa2a8b
AS
11442013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1145
1146 * xdisp.c (set_message): Only check for debug-on-message if STRING
1147 is a string. (Bug#13797)
1148
1938d88c
PE
11492013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1150
1151 Fix regression introduced by July 10 filelock.c patch.
1152 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1153 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1154 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1155 and diagnosed by Andreas Schwab in
1156 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1157
fcee5028
PE
11582013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 Assume C89 or better.
1161 * ralloc.c (SIZE, POINTER, NIL):
1162 * vm-limit.c (POINTER):
1163 Remove, replacing all uses with C89 equivalents. These old
1164 symbols were present only for porting to pre-C89 platforms.
1165
d78cf5ed
CB
11662013-02-22 Claudio Bley <claudio.bley@gmail.com>
1167
1168 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1169 This avoids warning messages reported as part of Bug#13546.
1170
6bcd97a4
KB
11712013-02-21 Ken Brown <kbrown@cornell.edu>
1172
1173 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1174
b6c2bfff
SM
11752013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1176
e11dacb5
SM
1177 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1178
b6c2bfff
SM
1179 * keyboard.c (Qcommand_execute): New var.
1180 (command_loop_1, read_char): Use it.
1181 (Fcommand_execute): Remove, replace by an Elisp implementation.
1182 (syms_of_keyboard): Adjust accordingly.
1183
d69f1120 11842013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1185
d69f1120
DC
1186 * sheap.c (report_sheap_usage): Use message, not message1, so
1187 that we don't try to create a buffer while we're in the middle
1188 of dumping Emacs. Explain why.
b6c2bfff 1189
2a14a4f1 11902013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1191
2a14a4f1
DA
1192 * search.c (find_newline): Return byte position in bytepos.
1193 Adjust comment.
b6c2bfff
SM
1194 (find_next_newline_no_quit, find_before_next_newline):
1195 Add bytepos argument.
2a14a4f1
DA
1196 * lisp.h (find_newline, find_next_newline_no_quit)
1197 (find_before_next_newline): Adjust prototypes.
1198 * bidi.c (bidi_find_paragraph_start):
1199 * editfns.c (Fconstrain_to_field, Fline_end_position):
1200 * indent.c (compute_motion, vmotion):
1201 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1202 (get_visually_first_element, move_it_vertically_backward):
1203 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1204
872faefb 12052013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1206
1207 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1208 resources were not orderly released.
1209
fd80c659
EZ
12102013-02-17 Eli Zaretskii <eliz@gnu.org>
1211
1212 * xdisp.c (x_draw_vertical_border): For a window that is neither
1213 the leftmost nor the rightmost, redraw both the left and the right
1214 vertical borders. (Bug#13723)
1215
2f73da9c
SM
12162013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1217
1218 * xml.c (init_libxml2_functions):
1219 * sound.c (sound_warning):
1220 * sheap.c (report_sheap_usage):
1221 * process.c (wait_reading_process_output):
1222 * msdos.c (XMenuActivate):
1223 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1224 * keyboard.c (top_level_1):
1225 * editfns.c (Fmessage, Fmessage_box):
1226 * callint.c (Fcall_interactively):
1227 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1228
fd9547e8
JD
12292013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1230
1231 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1232 * frame.c (syms_of_frame): ... to here.
1233
f277993b
EZ
12342013-02-16 Eli Zaretskii <eliz@gnu.org>
1235
c7939585
EZ
1236 * w32.c (sys_chown): Remove unused function.
1237
cd91fb4b
EZ
1238 * w32term.c <input_signal_count>: Declare 'volatile'
1239 unconditionally. (Bug#9066)
1240
f277993b
EZ
1241 * w32.c (set_errno): Reset h_errno and don't set it to any other
1242 value. Set errno instead.
1243 (check_errno): Reset h_errno.
1244 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1245 (sys_gethostname, sys_getservbyname, sys_getpeername)
1246 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1247 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1248 h_errno.
1249 (sys_gethostbyname): Set h_errno only errors detected.
1250
e454145b
PE
12512013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1252
1253 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1254
bcf7fe2a
EZ
12552013-02-15 Eli Zaretskii <eliz@gnu.org>
1256
ef9c57e2
EZ
1257 * keyboard.c (read_char): Fix calculation of auto-save time out
1258 when auto-save-timeout is less than 4. (Bug#13720)
1259
ef862e20 1260 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1261 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1262
bcf7fe2a
EZ
1263 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1264 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1265 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1266 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1267 make sure errno is set to an appropriate value. (Bug#13546)
1268 (socket_to_fd): Add assertion against indexing fd_info[] with a
1269 value that is out of bounds.
1270 (sys_accept): If fd is negative, do not set up the child_process
1271 structure for reading.
1272
0063fdb1
DA
12732013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1274
1275 * composite.c (fill_gstring_header): Remove useless prototype.
1276 Break long line.
1277 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1278 * print.c (PRINTDECLARE, print_object):
1279 * search.c (compile_pattern, fast_looking_at, search_buffer):
1280 (simple_search, boyer_moore, Freplace_match):
1281 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1282 (get_overlay_arrow_glyph_row, display_mode_element):
1283 (decode_mode_spec_coding, message3):
1284 * xfaces.c (face_at_string_position): Use bool for booleans.
1285 Adjust comments.
1286
648e5523 12872013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1288
35b3a27e
PE
1289 Fix AIX port (Bug#13650).
1290 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1291 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1292 was #undeffed earlier, so it cannot be used as a macro here.
1293 Use the constant and not the macro.
35b3a27e 1294
648e5523 12952013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1296
0e4e7b74
EZ
1297 * w32proc.c (new_child): If no vacant slots are found in
1298 child_procs[], make another pass looking for slots whose process
1299 has exited or died. (Bug#13546)
1300
6e432f0c
EZ
1301 * w32.c (sys_pipe): When failing due to file descriptors above
1302 MAXDESC, set errno to EMFILE.
1303 (_sys_read_ahead): Update cp->status when failing to read serial
1304 communications input, so that the status doesn't stay at
1305 STATUS_READ_IN_PROGRESS. (Bug#13546)
1306
51b3a99c
JD
13072013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1308
1309 * gtkutil.c (tb_size_cb): New function.
1310 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1311
e31560a7
SM
13122013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1313
1314 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1315 an event.
1316
fe336261
SM
13172013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1318
1319 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1320
5a655b9f
DA
13212013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1322
1323 * font.c (font_range): Add pos_byte argument. Adjust comment
1324 and break long line.
1325 * font.h (font_range): Adjust prototype.
1326 * composite.c (autocmp_chars): Pass byte position to font_range.
1327 Break long line. Remove useless prototype and format comment.
1328
1a359750
GM
13292013-02-13 Glenn Morris <rgm@gnu.org>
1330
1331 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1332
01fcc3a5 13332013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1334
f53f992a
PE
1335 Improve AIX port some more (Bug#13650).
1336 With this, it should be as good as it was in 23.3, though it's
1337 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1338 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1339 * unexaix.c (start_of_text): Remove.
1340 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1341 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1342 (orig_load_scnptr, orig_data_scnptr):
1343 Now off_t, not long, since they are file offsets.
1344 (make_hdr): Use _data, not start_of_data ().
1345 This is the key part of the fix.
1346 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1347 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1348
4458c255
PE
1349 * pre-crt0.c (data_start): Initialize to 1.
1350 This ports to compilers that optimize the external declaration
1351 'int x = 0;' as if it were 'int x;' to shrink the executable.
1352
227be86d
PE
1353 Improve AIX port (Bug#13650).
1354 This doesn't fix the bug, but it makes progress: Emacs builds now.
1355 * unexaix.c: Include inttypes.h, stdarg.h.
1356 (report_error, report_error_1): Mark as _Noreturn.
1357 (report_error): Don't report the wrong errno.
1358 (report_error_1): Now varargs. All callers changed.
1359 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1360 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1361 (write_ptr): Use %p to print address rather than %lx and a cast
1362 to unsigned long. Grow buffer a bit, to be safer.
1363
01fcc3a5 13642013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1365
1366 * bidi.c (bidi_resolve_neutral): After finding the next
1367 non-neutral character, accept NEUTRAL_ON type as well, because
1368 directional control characters, such as LRE and RLE, have their
1369 type converted to that by bidi_resolve_weak. This avoids aborts
1370 when LRE/RLE follows a run of neutrals.
1371 (bidi_move_to_visually_next): Assert that return value of
1372 bidi_peek_at_next_level is non-negative. Negative values will
1373 cause an infloop.
1374
83be8524
PE
13752013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1376
1377 Minor getenv-related fixes.
1378 * callproc.c (Fcall_process_region) [!DOS_NT]:
1379 Avoid unnecessary duplicate call to getenv.
1380 * callproc.c (init_callproc):
1381 * dispnew.c (init_display):
1382 * sysdep.c (sys_subshell):
1383 Omit unnecessary cast of getenv or egetenv.
1384
45b2b768
JB
13852013-02-13 Juanma Barranquero <lekktu@gmail.com>
1386
1387 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1388 Update dependencies.
1389
33b49d71
EZ
13902013-02-12 Eli Zaretskii <eliz@gnu.org>
1391
1392 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1393 marker's position.
1394 (display_line): Set w->region_showing to the value of
1395 it->region_beg_charpos, not to -1. This fixes redisplay
1396 optimization when cursor is moved up after M->. (Bug#13623)
1397 (Bug#13626)
c4131562
EZ
1398 (try_scrolling): Scroll text up more if point is too close to ZV
1399 and inside the scroll margin. This makes sure point is moved
1400 outside the scroll margin in these cases.
33b49d71
EZ
1401
1402 * window.h (struct window): region_showing can no longer be
1403 negative.
1404
b09a4810
PE
14052013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1406
a84b7c53
PE
1407 Tune by using memchr and memrchr.
1408 * doc.c (Fsnarf_documentation):
1409 * fileio.c (Fsubstitute_in_file_name):
1410 * search.c (find_newline, scan_newline):
1411 * xdisp.c (pos_visible_p, display_count_lines):
1412 Use memchr and memrchr rather than scanning byte-by-byte.
1413 * search.c (find_newline): Rename from scan_buffer.
1414 Omit first arg TARGET, as it's always '\n'. All callers changed.
1415
b09a4810
PE
1416 Clean up read_key_sequence a tiny bit more.
1417 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1418 (read_key_sequence): Remove unused locals.
1419
99d0d6dc
SM
14202013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1421
1422 Clean up read_key_sequence a bit; reread active keymaps after first event.
1423 * keyboard.c (read_char, read_char_x_menu_prompt)
1424 (read_char_minibuf_menu_prompt):
1425 Replace nmaps+maps with a single `map' arg.
1426 (follow_key): Operate on a single map.
1427 (active_maps): New function.
1428 (test_undefined): Also return true for nil bindings.
1429 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1430 a single (composed) keymap. Remember `first_event' to choose the right
1431 set of active keymaps. Recompute the set of keymaps after receiving
1432 the first event. Remove GOBBLE_FIRST_EVENT.
1433 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1434 * keyboard.h (read_char): Update declaration.
1435 * lread.c (read_filtered_event): Adjust call to read_char.
1436
f5e1b680
EZ
14372013-02-11 Eli Zaretskii <eliz@gnu.org>
1438
99d0d6dc
SM
1439 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1440 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1441 in the window. (Bug#13675)
1442
f74de345
DA
14432013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1444
1445 * marker.c (set_marker_internal): If desired position is passed
1446 as a marker, avoid call to buf_charpos_to_bytepos.
1447 * window.c (Fset_window_point): Omit redundant type checking.
1448 (Fset_window_start): Likewise. Format comment.
1449 (window_scroll_pixel_based): Use set_marker_restricted_both
1450 with character and byte positions obtained from an iterator.
1451 (Fset_window_configuration): Use set_marker_restricted_both.
1452 * xdisp.c (message_dolog): Likewise.
1453
a4ba3963
EZ
14542013-02-10 Eli Zaretskii <eliz@gnu.org>
1455
99d0d6dc
SM
1456 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1457 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1458 too far. This speeds up some redisplay operations. (Bug#13675)
1459
68643cde
DA
14602013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1461
1462 * syntax.c (scan_sexps_forward): Fix byte position calculation
1463 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1464
7ba11bee
PE
14652013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1466
1467 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1468 that was not needed.
1469
eff1c190
PE
14702013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1471
1472 Minor hashing refactoring.
1473 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1474 (sxhash_float): Return EMACS_UINT, for consistency with the other
1475 hash functions.
1476 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1477 non-static inline function and therefore can't use static vars.
1478 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1479 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1480 with the other hash functions.
1481
6b48c831
EZ
14822013-02-09 Eli Zaretskii <eliz@gnu.org>
1483
4dde2087
EZ
1484 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1485 XXXXXX part of the temporary file pattern is not downcased even
1486 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1487
8549f9e8
EZ
1488 * xdisp.c (decode_mode_spec): Remove handling of %t.
1489
6b48c831
EZ
1490 * msdos.c (careadlinkatcwd): Remove.
1491
75a65c7e
SM
14922013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1493
1494 * lread.c (skip_dyn_bytes): New function (bug#12598).
1495 (read1): Use it. Use getc instead of READCHAR to read bytes.
1496 (load_each_byte): Remove. Update users.
1497
8ca30920
DA
14982013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1499
1500 * search.c (scan_buffer): Calculate end byte position just once.
1501 (scan_newline): Do not recalculate start_byte.
1502 (search_command): Use eassert.
1503 * syntax.c (struct lisp_parse_state): New member location_byte.
1504 (scan_sexps_forward): Record from_byte and avoid redundant
1505 character to byte position calculation ...
1506 (Fparse_partial_sexp): ... here. Break too long line.
1507
25721f5b
DA
15082013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1509
1510 * lisp.h (make_uninit_vector): New function.
1511 * alloc.c (Fvector, Fmake_byte_code):
1512 * ccl.c (Fregister_ccl_program):
1513 * charset.c (Fdefine_charset_internal, define_charset_internal):
1514 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1515 * composite.c (syms_of_composite):
1516 * font.c (Fquery_font, Ffont_info, syms_of_font):
1517 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1518 * ftfont.c (ftfont_shape_by_flt):
1519 * indent.c (recompute_width_table):
1520 * nsselect.m (clean_local_selection_data):
1521 * syntax.c (init_syntax_once):
1522 * w32unsubscribe.c (uniscribe_shape):
1523 * window.c (Fcurrent_window_configuration):
1524 * xfaces.c (Fx_family_fonts):
1525 * xselect.c (selection_data_to_lisp_data): Use it.
1526
9a9d91d9
DA
15272013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1528
1529 * coding.c (Fdefine_coding_system_internal): Use AREF where
1530 argument is known to be a vector.
1531 * fns.c (Flocale_info): Likewise for ASET.
1532 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1533 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1534
6871e574
JD
15352013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1536
1537 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1538 height.
1539
1540 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1541 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1542 updateCollectionBehaviour.
1543
1544 * nsterm.m (NEW_STYLE_FS): Remove.
1545 (ns_last_use_native_fullscreen): New variable.
1546 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1547 (x_set_window_size): Do not take title bar and tool bar into account
1548 if isFullscreen returns YES.
1549 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1550 (check_native_fs): New function.
1551 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1552 (ns_term_init): Remove NEW_STYLE_FS.
1553 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1554 and tool bar if isFullscreen returns NO.
1555 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1556 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1557 with HAVE_NATIVE_FS.
1558 (window:willUseFullScreenPresentationOptions:): New method.
1559 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1560 Hide toolbar if not enabled (Bug#13444).
1561 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1562 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1563 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1564 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1565 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1566 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1567 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1568 (syms_of_nsterm): Add ns-use-native-fullscreen.
1569
3f011c7f
PE
15702013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1571
1572 * fileio.c (Qchoose_write_coding_system): Now static.
1573
86f7c0fe
EZ
15742013-02-04 Eli Zaretskii <eliz@gnu.org>
1575
1576 * xdisp.c (window_buffer_changed): region_showing can be negative,
1577 which still means region is being displayed.
1578 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
1579 whole window when showing region and the mark has changed.
1580 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
1581 (display_line): If it->region_beg_charpos is non-zero, set the
1582 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1583
1584 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1585 not bitfield of 1 bit.
1586
5257b701
DC
15872013-02-03 Daniel Colascione <dancol@dancol.org>
1588
1589 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1590 daemon mode works on cygw32 when Emacs is installed and not just
1591 during development.
1592
8ea41ea9
PE
15932013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1594
1595 Avoid file time stamp bug on MS-Windows (Bug#13149).
1596 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1597 as FAT32 doesn't update time stamps when truncating them.
1598 Also, check that a file time stamp is not a multiple of 100 ns;
1599 this should catch all instances of the problem on MS-Windows,
1600 as its native file system resolution is 100 ns or worse, and
1601 checking for a non-multiple of 100 ns should impose only a small
1602 overhead on systems with ns resolution.
1603
94fbc901 16042013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 1605
e7ac588e
EZ
1606 Avoid encoding file names on MS-Windows when they need to be run
1607 through dostounix_filename.
1608 * w32.c (normalize_filename): Accept an additional argument
1609 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1610 downcase it even if w32-downcase-file-names is non-nil.
1611 (dostounix_filename): Accept an additional argument MULTIBYTE and
1612 pass it to normalize_filename.
1613 (emacs_root_dir): Adjust.
1614
1615 * msdos.h (dostounix_filename): Adjust prototype.
1616
1617 * w32.h (dostounix_filename): Adjust prototype.
1618
1619 * msdos.c (dostounix_filename): Accept an additional argument and
1620 ignore it.
1621 (init_environment): Adjust callers of dostounix_filename.
1622
1623 * fileio.c (Ffile_name_directory, file_name_as_directory)
1624 (directory_file_name, Fexpand_file_name)
1625 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1626 dostounix_filename.
1627 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1628 non-nil.
1629 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1630 variables, as egetenv is case-insensitive for DOS_NT.
1631
1632 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1633 with an encoded file name.
1634
99d0d6dc
SM
1635 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1636 Adjust calls to dostounix_filename.
e7ac588e
EZ
1637
1638 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1639
1640 * unexw32.c (unexec): Adjust call to dostounix_filename.
1641
1642 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1643
1644 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1645 dostounix_filename.
1646
1647 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1648 dostounix_filename.
1649
e7c3fb06
EZ
1650 * callproc.c (Fcall_process): Make sure program name in PATH and
1651 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1652 is passed to exec/spawnve, which fails unless the file-name
1653 encoding is UTF-8.
1654
18a80473
EZ
1655 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1656 even if w32-quote-process-args is nil.
1657
35e85499
PE
16582013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1659
1660 Fix timestamp bug when write-region appends nothing (Bug#13149).
1661 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1662 the file's time stamp doesn't change if Emacs happens to write nothing
1663 to the file, and on a buggy file system this could cause Emacs to
1664 incorrectly infer that the file system doesn't have the bug.
1665 Avoid this problem by inhibiting the inference in this case.
1666
422ff52b
DA
16672013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1668
1669 * window.h (struct window): Convert base_line_number, base_line_pos
1670 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1671 Convert region_showing member from Lisp_Object to bitfield.
1672 Remove sequence_number member. Adjust comments.
1673 * window.c (sequence_number): Remove.
1674 (make_window): Initialize column_number_displayed.
1675 * print.c (print_object): Follow the printed representation of
1676 frames and print window pointer to distinguish between windows.
1677 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1678 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1679 (wset_column_number_displayed, wset_region_showing): Remove.
1680 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1681 (try_scrolling, try_cursor_movement, redisplay_window)
1682 (try_window_reusing_current_matrix, try_window_id, display_line)
1683 (display_mode_lines, decode_mode_spec): Adjust users.
1684 * .gdbinit (pwinx): Do not print sequence_number.
1685
8654f9d7
PE
16862013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1689 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1690 * dired.c: Include <fcntl.h>.
1691 (open_directory): New function, which uses open and fdopendir
1692 rather than opendir. DOS_NT platforms still use opendir, though.
1693 (directory_files_internal, file_name_completion): Use it.
1694 (file_attributes): New function, with most of the old Ffile_attributes.
1695 (directory_files_internal, Ffile_attributes): Use it.
1696 (file_attributes, file_name_completion_stat): First arg is now fd,
1697 not dir name. All uses changed. Use fstatat rather than lstat +
1698 stat.
1699 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1700 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1701 (emacs_readlinkat): New function, with much of the old
1702 Ffile_symlink_p, but with an fd argument for speed.
1703 It uses readlinkat rather than careadlinkatcwd, so that it
1704 need not assume the working directory.
1705 (Ffile_symlink_p): Use it.
1706 * filelock.c (current_lock_owner): Use emacs_readlinkat
1707 rather than emacs_readlink.
1708 * lisp.h (emacs_readlinkat): New decl.
1709 (READLINK_BUFSIZE, emacs_readlink): Remove.
1710 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1711 (emacs_norealloc_allocator, emacs_readlink): Remove.
1712 This stuff is moved to fileio.c.
1713 * w32.c (fstatat, readlinkat): New functions.
1714 (careadlinkat): Don't check that fd == AT_FDCWD.
1715 (careadlinkatcwd): Remove; no longer needed.
1716
9dbda100
GM
17172013-01-31 Glenn Morris <rgm@gnu.org>
1718
1719 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
1720 (Fwrite_region): Update for new choose_write_coding_system args.
1721 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
1722 (syms_of_fileio): Add choose-write-coding-system.
1723
3f82a88a 17242013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
1725
1726 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1727 (sys_close): Zero out the flags for the file descriptor before
1728 closing it. (Bug#13546)
1729
806fed21 1730 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
1731 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1732 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
1733 DBCS. (Bug#13553)
1734
6ee4509a
EZ
1735 * w32.c (w32_get_long_filename, init_environment, readlink):
1736 Support file names encoded in DBCS codepages.
26854e9c
EZ
1737 (readlink): Use the current file-name-coding-system, not the ANSI
1738 codepage, to decode and handle targets of symlinks.
6ee4509a 1739
cf01a359
EZ
17402013-01-28 Eli Zaretskii <eliz@gnu.org>
1741
1742 * w32.c (opendir): Now accepts a 'const char *'.
1743
6fd326b7
DA
17442013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1745
1746 Remove obsolete redisplay code. See the discussion at
1747 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1748 * dispnew.c (preemption_period, preemption_next_check): Remove.
1749 (Vredisplay_preemption_period): Likewise.
1750 (update_frame, update_single_window, update_window, update_frame_1):
1751 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1752 used, following the 2012-06-22 change.
1753
d8cd7742
EZ
17542013-01-25 Eli Zaretskii <eliz@gnu.org>
1755
1756 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1757
266fee4f
DA
17582013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1759
1760 * font.c (num_fonts): Remove the leftover from old
1761 debugging code. Adjust comment style here and there.
59e624b3
DA
1762 * insdel.c (insert_1): Remove.
1763 * lisp.h (insert_1): Remove prototype.
1764 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 1765
830e46e6 17662013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
1767
1768 * w32.c (max_filename_mbslen): New function.
1769 (normalize_filename, readdir): Use it to detect locales where ANSI
1770 encoding of file names uses a double-byte character set (DBCS).
1771 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
1772 CharNextExA, instead of incrementing a 'char *' pointer.
1773 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 1774
81abbb95
EZ
1775 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1776 request of memory reservation to 1.7GB. (Bug#13065)
1777
830e46e6 17782013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
1779
1780 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1781 at check_extra_latin label. (Bug#13505)
1782
fd3ceb09
DA
17832013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1784
1785 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1786 Avoid redundant calls to strlen.
1787
edfa7fa0
DA
17882013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1789
1790 Drop async_visible and async_iconified fields of struct frame.
1791 This is possible because async input is gone; for details, see
1792 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1793 * frame.h (struct frame): Remove async_visible and async_iconified
1794 members, convert garbaged to unsigned bitfield. Adjust comments.
1795 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1796 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1797 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1798 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1799 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1800 * w32term.c: Ditto.
1801 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1802 properly. Likewise for obscured.
1803 * xterm.c: Ditto.
266fee4f 1804 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
1805 properly.
1806 * nsterm.m: Ditto.
1807 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1808
5ad86e34
DA
18092013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1810
1811 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1812 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1813
b09cca6a
SM
18142013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1815
1816 * xdisp.c (message2, message2_nolog): Remove functions.
1817 (message3, message3_nolog): Extract nbytes and multibyteness directly
1818 from the string. Change all callers.
1819 (message3_nolog): Don't set message_enable_multibyte since set_message
1820 will reset it anyway.
1821 (message1, message1_nolog): Use message3.
1822 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1823 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1824 (set_message): Drop all but the second arg, which has to be a string.
1825 (set_message_1): Simplify now that we know that a1 is NULL and the
1826 second arg is a string.
1827 * frame.h (struct frame): Remove `message_buf' field.
1828 Use glyphs_initialized_p instead.
1829 (FRAME_MESSAGE_BUF): Remove macro.
1830 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1831 * lisp.h (message2, message2_nolog): Remove declarations.
1832 (message3, message3_nolog): Update declarations.
1833 * keyboard.c (read_char_minibuf_menu_text)
1834 (read_char_minibuf_menu_width): Remove vars.
1835 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1836 to correctly handle multibyte strings.
1837 * frame.c (delete_frame): Don't free message_buf any more.
1838 * editfns.c (message_text, message_length): Remove vars.
1839 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1840 * fileio.c (auto_save_error): Use message3 instead of message2.
1841 * dispnew.c (adjust_frame_message_buffer): Remove function.
1842
54ab1c5a
EZ
18432013-01-23 Eli Zaretskii <eliz@gnu.org>
1844
1845 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1846 real estate used for the tool bar and the menu bar.
1847
6c27465b
DA
18482013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1849
1850 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1851 hidden buffer is prepared to modification (Bug#13164).
1852
9d93ce29
DA
18532013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1854
1855 * window.h (struct window): Change window_end_valid member from
1856 Lisp_Object to a bitfield. Adjust comments.
1857 (wset_window_end_valid): Remove.
1858 * window.c (adjust_window_count): Clear window_end_valid.
1859 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1860 (Fwindow_line_height, set_window_buffer, Frecenter)
1861 (Fsplit_window_internal, Fdelete_other_windows_internal)
1862 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1863 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1864 * xdisp.c (check_window_end, reconsider_clip_changes)
1865 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1866 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1867 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1868
1dcb8ea2
DA
18692013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1870
1871 * xdisp.c (mark_window_display_accurate): Simplify the loop
1872 assuming that the only one of vchild, hchild or buffer window
1873 slots is non-nil. Call mark_window_display_accurate_1 for
1874 the leaf windows only.
1875 (mark_window_display_accurate_1): Always assume leaf window.
1876 Adjust comment.
1877
b41b8a7e
PE
18782013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1879
593a5f2e
PE
1880 * emacs.c (Qkill_emacs_hook): Now static.
1881
b41b8a7e
PE
1882 * fileio.c (Finsert_file_contents): Simplify.
1883 Remove unnecessary assignments and tests.
1884
84e5ed96
EZ
18852013-01-21 Eli Zaretskii <eliz@gnu.org>
1886
1887 * w32.c (acl_set_file): Don't test for errors unless
1888 set_file_security returns FALSE. Avoids spurious errors when
1889 saving files.
1890
2ef88fd4
DA
18912013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1892
1893 * fileio.c (Finsert_file_contents): Revert code introduced at
1894 2013-01-18 in favor of the simpler and generally better fix.
1895 Save stack space by removing 'buffer' and reusing 'read_buf'
1896 where appropriate.
1897
d7a0a7c9
PE
18982013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1899
1900 * lisp.h (eabs): Define unconditionally (Bug#13419).
1901 The old "#if !defined (eabs)" was an unnecessary revenant of back
1902 when this macro was called "abs". Document 'eabs' better.
1903
795e7a5b 19042013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
1905
1906 * fns.c (Frandom): Doc fix.
1907
59ac2d13
EZ
19082013-01-19 Eli Zaretskii <eliz@gnu.org>
1909
1910 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1911 segfault when there are lots of overlays.
1912
1913 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
1914 when there are lots of overlays.
1915 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
1916 for the details and a way to reproduce.
1917
b3fbb395
PE
19182013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1919
3a955a1f
PE
1920 * fileio.c: Use O_APPEND to append.
1921 This corresponds better to the natural interpretation of "append",
1922 and avoids the need to open the output file twice, or to invoke
1923 lseek when APPEND is neither nil nor a number.
1924 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1925 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1926 file possibly twice, and lseeking to its end; this avoids the
1927 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1928 at the same time: the combination is never needed and apparently
1929 it doesn't work with DOS_NT.
1930
21cd50b8
PE
1931 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1932 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1933
b3fbb395
PE
1934 Allow floating-point file offsets.
1935 Problem reported by Vitalie Spinu in
1936 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1937 * fileio.c (emacs_lseek): Remove.
1938 (file_offset): New function.
1939 (Finsert_file_contents, Fwrite_region): Use it.
1940
73c14218
CY
19412013-01-19 Chong Yidong <cyd@gnu.org>
1942
1943 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1944 aborting on Fsignal (Bug#13289).
1945
6a9465f3
EZ
19462013-01-19 Eli Zaretskii <eliz@gnu.org>
1947
1948 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1949 set_file_security as failure due to insufficient privileges.
1950 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1951 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1952
fa705c99
PE
19532013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1954
9fe43ff6
PE
1955 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1956 The bug was observed on Ubuntu operating inside a virtual machine,
1957 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1958 The workaround introduces a race condition on non-buggy hosts,
1959 but it's an unlikely race and anyway there's a nearly identical
1960 nearby race that can't be fixed.
1961 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1962 New static vars.
1963 (Fwrite_region): Test for file system time stamp bug.
1964 (init_fileio): New function.
1965 * lisp.h (init_fileio): Declare it.
1966 * emacs.c (main): Call it.
1967
fa705c99
PE
1968 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1969 and make it more consistent with other stat-failure diagnostics.
1970
e07469fa
DA
19712013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1972
99d0d6dc
SM
1973 Fix crash when inserting data from non-regular files.
1974 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1975 for the error description produced by valgrind.
1976 * fileio.c (read_non_regular): Rename to read_contents.
1977 Free Lisp_Save_Value object used to pass parameters.
1978 (read_non_regular_quit): Rename to read_contents_quit.
1979 (Finsert_file_contents): Redesign internal file reading loop to adjust
1980 gap and end positions after each read and so help make_gap to work
1981 properly. Do not signal an I/O error too early and so do not leave
1982 not yet decoded characters in a buffer, which was the reason of
1983 redisplay crash. Use list2 to build return value. Adjust comments.
1984
67722112
PE
19852013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 Close a race when statting and reading files (Bug#13149).
1988 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1989 This avoids a race if the file is renamed between stat and open.
1990 This race is not the problem originally noted in Bug#13149;
1991 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1992
468afbac
DA
19932013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1994
1995 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1996 objects, related functions and macros.
1997 (make_save_value): Adjust prototype.
1998 (make_save_pointer): New prototype.
1999 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2000 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2001 * alloc.c (format_save_value): Rename to make_save_value.
2002 (make_save_pointer): New function.
2003 (record_xmalloc): Use make_save_pointer.
2004 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2005 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2006 Change users of make_save_value to make_save_pointer.
2007 Likewise for format_save_value and make_save_value.
2008
0e70695a
DA
20092013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2010
2011 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2012 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2013 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2014 debugging stubs.
2015
963ea40f
PE
20162013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2017
2018 * alloc.c (free_save_value): Now static.
2019
3346c1d0
DA
20202013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2021
2022 * keymap.c (map_keymap_internal): Use format_save_value.
2023 (map_keymap_char_table_item): Adjust accordingly.
2024 * fileio.c (non_regular_fd, non_regular_inserted)
2025 (non_regular_nbytes): Remove.
99d0d6dc
SM
2026 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2027 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2028 (read_non_regular): Use XSAVE_ macros to extract parameters.
2029 Adjust comment.
2030 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2031 format_save_value.
2032 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2033
2b30549c
DA
20342013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2035
2036 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2037 extraction from any Lisp_Save_Value slot. Add type checking.
2038 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2039 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2040 * xselect.c: All users changed.
2041
1b971ac1
DA
20422013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2043
2044 Some convenient bits to deal with Lisp_Save_Values.
2045 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2046 (allocate_misc): Remove prototype.
2047 (format_save_value): New prototype.
2048 * alloc.c (allocate_misc): Revert back to static.
2049 (format_save_value): New function to build Lisp_Save_Value
2050 object with the specified internal structure.
2051 (make_save_value): Reimplement using format_save_value.
2052 * editfns.c (save_excursion_save): Use format_save_value.
2053 (save_excursion_restore): Use XSAVE_OBJECT.
2054
c50cf2ea
PE
20552013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 Avoid needless casts with XSAVE_POINTER.
2058 * alloc.c (mark_object) [GC_MARK_STACK]:
2059 * dired.c (directory_files_internal_unwind):
2060 * fileio.c (do_auto_save_unwind):
2061 * gtkutil.c (pop_down_dialog):
2062 * keymap.c (map_keymap_char_table_item):
2063 * lread.c (load_unwind):
2064 * nsmenu.m (pop_down_menu):
2065 * print.c (print_object) [GC_MARK_STACK]:
2066 * xfns.c (clean_up_file_dialog):
2067 * xmenu.c (cleanup_widget_value_tree):
2068 Omit casts between XSAVE_POINTER and a pointer type.
2069
9d5a1260
DA
20702013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2071
2072 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2073 * eval.c (eval_sub): Protect `form' from being GCed before its
2074 car and cdr becomes protected with the backtrace entry.
2075
73ebd38f
DA
20762013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2077
2078 Make Lisp_Save_Value more versatile storage for up to four objects.
2079 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2080 (struct Lisp_Save_Value): New layout. Adjust comments.
2081 (XSAVE_POINTER): New macro.
2082 (XSAVE_INTEGER): Likewise.
2083 (allocate_misc): Add prototype.
2084 (free_misc): Likewise.
2085 * alloc.c (allocate_misc): Now global.
2086 (free_misc): Likewise. Adjust comment.
2087 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2088 (free_save_value): Likewise.
2089 (mark_object): Likewise.
2090 * editfns.c (save_excursion_save): Pack everything within
2091 Lisp_Save_Value and so avoid xmalloc.
2092 (save_excursion_restore): Adjust to match new layout. Use free_misc
2093 because we do not allocate extra memory any more. Add eassert.
2094 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2095 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2096 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2097 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2098 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2099
b826986f
JD
21002013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2101
2102 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2103 (nsfont_draw): Remove disabling of LCD smoothing.
2104 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2105 Bug#11484 with LCD smoothing on.
b826986f 2106
c0511b57 21072013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2108
b6f960a0
PE
2109 Fix SIGDANGER handlers, for AIX (Bug#13408).
2110 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2111 Move handlers here from emacs.c; they were out of place.
2112
616763d5
JD
21132013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2114
2115 * xterm.c (syms_of_xterm): Adjust documentation for
2116 scroll-bar-adjust-thumb-portion.
2117
0b59090b 21182012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2119
2120 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2121 determine whether scroll bar thumb size should be adjusted or
2122 not. Use variable for MOTIF.
2123
2124 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2125 GTK.
2126
7bc916b4
JD
21272013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2128
eac4d08f
JD
2129 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2130 event is generated.
2131 (doCommandBySelector:): Set processingCompose to NO.
2132
7bc916b4
JD
2133 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2134 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2135 (nsfont_list_family): Add block/unblock_input calls.
2136 (nsfont_open): Move block_input earlier. Add unblock_input before early
2137 return.
2138 (nsfont_draw): Add block/unblock_input calls.
2139
bdc9b756
PE
21402013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2141
2142 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2143 for old_charpos and old_bytepos.
2144
ee56a6dc
PE
21452013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2146
2147 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2148 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2149 Clear tzvalbuf_in_environ if this workaround is in effect.
2150 Problem and fix reported by Kazuhiro Ito.
2151
9fc9a531
AH
21522013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2153
99d0d6dc
SM
2154 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2155 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2156
2157 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2158 doc string cross-reference(s).
2159
2160 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2161 string cross-reference(s).
2162
6020559a
DA
21632013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2164
2165 Avoid unnecessary byte position calculation for the gap movement.
2166 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2167 anyway, all of them should use move_gap_both instead.
2168 * lisp.h (move_gap): Remove prototype.
2169 * insdel.c (move_gap): Remove.
2170 (move_gap_both): Add eassert.
2171 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2172 * xml.c (parse_region): Likewise.
2173
b8956427
PE
21742013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2175
2176 emacsclient -t should not suspend Emacs server (Bug#13387)
2177 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2178 New functions.
2179 * term.c (init_tty): Use them instead of rolling our own code.
2180 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2181 switches from 'signal' to 'pthread_sigmask', which is safer in
2182 multithreaded applications.
2183 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2184 which has already arranged for that.
2185 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2186 This is the main part of the bug fix.
2187
0b59090b 21882013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2189
2190 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2191 x_last_font_name (Bug#13403).
2192
58cc0a01
DA
21932013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2194
2195 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2196 the type of per-buffer values where appropriate.
2197 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2198 predicate, which is how it's really used now. Adjust comment.
2199 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2200 * buffer.c (buffer_slot_type_mismatch): Remove.
2201 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2202 predicate. Adjust comment.
2203 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2204 fill-column, left-margin, tab-width, buffer-saved-size,
2205 left-margin-width, right-margin-width, left-fringe-width,
2206 right-fringe-width, scroll-bar-width and buffer-display-count.
2207 Use Qstringp for default-directory, buffer-file-name,
2208 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2209 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2210 line-spacing.
2211 * data.c (store_symval_forwarding): Adjust to call the predicate.
2212
5104861e
JB
22132013-01-09 Juanma Barranquero <lekktu@gmail.com>
2214
2215 * w32.c (get_name_and_id, acl_set_file):
2216 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2217
eefd7278
DA
22182013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2219
2220 * lisp.h (make_gap_1): New prototype.
2221 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2222 gap size values.
2223 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2224 naming convention.
2225 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2226 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2227 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2228 (make_gap_1): New function to adjust the gap of any buffer.
2229 * coding.c (coding_alloc_by_making_gap): Use it.
2230 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2231 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2232
073ca75b
JL
22332013-01-08 Juri Linkov <juri@jurta.org>
2234
2235 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2236 of (supports :underline (:style wave)). (Bug#13000)
2237
3bace969
AH
22382013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2239
2240 * undo.c (Fprimitive_undo): Move to simple.el.
2241 (syms_of_undo): Remove declarations for Sprimitive_undo.
2242
63a63bd4
SM
22432013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2244
2245 * keyboard.c (echo_add_key): Rename from echo_add_char.
2246
56ed110a
CY
22472013-01-06 Chong Yidong <cyd@gnu.org>
2248
2249 * keyboard.c (echo_add_char): New function, factored out from
2250 echo_char. Don't add a space if the previous echo string was
2251 empty (Bug#13255).
2252 (echo_char): Use it.
2253 (read_key_sequence): When echoing mock input, ensure that the
2254 trailing dash is properly added.
2255
b630991b
EZ
22562013-01-05 Eli Zaretskii <eliz@gnu.org>
2257
2258 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2259 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2260 digits for buffer positions, before misalignment starts.
2261 Display "0" for integer "object" field.
b630991b
EZ
2262 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2263 Display the newline glyph more unambiguously.
2264
f032a318
YM
22652013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2266
2267 * nsterm.m (ns_draw_underwave):
2268 * w32term.c (w32_draw_underwave):
2269 * xterm.c (x_draw_underwave): Make underwave look more triangular
2270 and also degrade gracefully for small fonts. (Bug#13000)
2271
4240dd3c
YM
2272 * nsterm.m (ns_draw_text_decoration):
2273 * w32term.c (x_draw_glyph_string):
2274 * xterm.c (x_draw_glyph_string): Don't use previous underline
2275 thickness and position if previous underline type is underwave.
2276
553081a5
SM
22772013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2278
2279 * fileio.c (Ffile_acl): Undocument return format.
2280
9539d465 22812013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2282
2283 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2284
71376d4b
PE
22852013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 Simplify via eabs.
2288 * dired.c (file_name_completion):
2289 * doc.c (get_doc_string):
2290 * floatfns.c (round2):
2291 * font.c (font_score, font_delete_unmatched):
2292 * fringe.c (compute_fringe_widths):
2293 * lread.c (read_list):
2294 * minibuf.c (Ftry_completion):
2295 * term.c (tty_ins_del_lines):
2296 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2297 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2298
a7f11948
EZ
22992012-12-31 Eli Zaretskii <eliz@gnu.org>
2300
2301 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2302 correctly.
2303 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2304 for the bug this caused.
2305
84cc1ab6
PE
23062012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2307
2308 * coding.c (Qmac): Now static.
2309
5a1d858b
JD
23102012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2311
2312 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2313 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2314 handlebox_widget. Set toolbar_in_hbox to false/true, set
2315 toolbar_is_packed to true.
2316 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2317 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2318 Show all on TOOLBAR_TOP_WIDGET.
2319 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2320 by TOOLBAR_TOP_WIDGET.
2321 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2322 Check toolbar_is_packed.
8b745d92
JD
2323 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2324 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2325 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2326 false.
2327 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2328 (xg_update_menubar): Update title only if
2329 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2330 (xg_update_submenu): Skip tearoff only if
2331 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2332 (xg_initialize): Initialize xg_detached_menus only if
2333 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2334
2335 * xterm.h (struct x_output): Surround handlebox_widget with
2336 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2337 toolbar_in_hbox is bool.
2338
d5e5e7b4 23392012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2340
2341 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2342 (LIBS_GNUSTEP): Define.
2343 (LIBES): Add $(LIBS_GNUSTEP).
2344 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2345
d5e5e7b4 23462012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2347
2348 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2349 continuation glyph on a TTY with an indication of an empty line.
2350 (Bug#13277)
2351
e7ae8039
EZ
23522012-12-29 Eli Zaretskii <eliz@gnu.org>
2353
ccad023b
EZ
2354 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2355 file's SELinux context or ACLs successfully set, nil otherwise.
2356 (Bug#13298)
8d23a331 2357 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2358
e7ae8039
EZ
2359 * w32proc.c (reader_thread): Avoid passing NULL handles to
2360 SetEvent and WaitForSingleObject.
2361
7456e13f
PE
23622012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2363
2364 Port EXTERNALLY_VISIBLE to Clang 3.2.
2365 * conf_post.h (__has_attribute): New macro.
2366 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2367
1ab0c851
GM
23682012-12-27 Glenn Morris <rgm@gnu.org>
2369
2370 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2371 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2372
82e2a1f0 23732012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2374
63a63bd4
SM
2375 * fileio.c (file_name_as_directory, directory_file_name):
2376 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2377 came from a multibyte or a unibyte Lisp string; all callers
2378 adjusted. Don't assume the input string is always multibyte.
2379 (Bug#13262)
2380 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2381 don't ENCODE_FILE them, and return a unibyte string if the input
2382 was unibyte.
2383 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2384 don't assume the input strings will always be multibyte. If the
2385 input strings are multibyte, decode strings obtained from C
2386 library functions.
2387
8847a0de
DA
23882012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2389
2390 * lisp.h (toplevel): Add two notices to the comment about
2391 defining a new Lisp data type.
6cda572a
DA
2392 * print.c (print_object): If Lisp_Save_Value object's pointer
2393 is the address of a memory area containing Lisp_Objects, try
2394 to print them.
2395 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2396
4b298d5a
DA
23972012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2398
2399 * keyboard.c (record_asynch_buffer_change): Initialize an event
2400 only if it's really needed.
2401 * frame.h (enum output_method): Remove output_mac member since
2402 it's a leftover from the deleted code.
2403 * frame.c (Fframep): Adjust user here ...
2404 * terminal.c (Fterminal_live_p): ... and here.
2405 * coding.c (Qmac): Now here because it's only used to denote
2406 end-of-line encoding type.
2407 (syms_of_coding): DEFSYM it.
2408 * frame.h (Qmac): Remove duplicated declaration.
2409
12384b01
PE
24102012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2411
2412 * window.c (select_window_1): Now static, since it's used only here.
2413
f1665bdc
EZ
24142012-12-25 Eli Zaretskii <eliz@gnu.org>
2415
2416 * window.c (window_body_cols): Subtract display margins from the
2417 window body width on TTYs as well. See
2418 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2419 for the original report.
2420
9a0d4f34
DA
24212012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2422
2423 * xdisp.c (redisplay_window): Remove inner local variable
2424 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2425 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2426 set but never used.
2427 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2428 (xg_create_tool_bar): Adjust users.
9a0d4f34 2429
f9e7c67e
DA
24302012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2431
2432 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2433 * buffer.c (Fget_buffer_create): Use it to set compact field of
2434 struct buffer_text to avoid accessing an uninitialized value
2435 when compact_buffer is called for the first time.
2436 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2437 (Fset_buffer_modified_p): Use buffer_window_count to check
2438 whether the buffer is displayed in some window.
2439 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2440
299614f3
EZ
24412012-12-23 Eli Zaretskii <eliz@gnu.org>
2442
40ff07a5
EZ
2443 * w32.c (acl_set_file): If setting the file security descriptor
2444 fails, and the new DACL is identical to the existing one, silently
2445 return success. This fixes problems for users backing up their
2446 own files without having the necessary privileges for setting
2447 security descriptors.
2448
299614f3
EZ
2449 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2450 values.
2451 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2452 after WaitForSingleObject returns normally. This expedites reader
2453 thread shutdown when delete_child triggers it.
2454 (reap_subprocess): More accurate commentary for why we call
2455 delete_child only when cp->fd is negative.
2456
2457 * w32.c (sys_close): Do not call delete_child on a subprocess
2458 whose handle is not yet closed. Instead, set its file descriptor
2459 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2460 delete_child on that subprocess when its SIGCHLD arrives.
2461 This avoids closing handles used for communications between sys_select
299614f3
EZ
2462 and reader_thread, which doesn't give sys_select a chance to
2463 notice that the process exited and invoke the SIGCHLD handler for
2464 it.
2465
cf162aee
JD
24662012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2467
2468 * nsfns.m (Fns_do_applescript): Run event loop until script has
2469 been executed (Bug#12969).
2470 (ns_run_ascript): Chech as_script for nil, set to nil after
2471 executing script.
2472
94900bfe
MR
24732012-12-22 Martin Rudalics <rudalics@gmx.at>
2474
2475 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2476
b2faf49c
EZ
24772012-12-22 Eli Zaretskii <eliz@gnu.org>
2478
2479 * w32term.c (w32fullscreen_hook): New function.
2480 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2481
7efa3fb3
EZ
24822012-12-21 Eli Zaretskii <eliz@gnu.org>
2483
bb085aed
EZ
2484 * fileio.c (Finsert_file_contents): Doc fix.
2485
7efa3fb3
EZ
2486 * w32proc.c (new_child, delete_child, find_child_pid): For a
2487 subprocess, consider its slot being in use as long as its process
2488 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2489 slot when a new process is started immediately after killing
2490 another one, without waiting enough time for the first process to
2491 be reaped and resources allocated for it be orderly freed.
2492 (Bug#13086)
2493 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2494
c1f02afa
CY
24952012-12-21 Chong Yidong <cyd@gnu.org>
2496
2497 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2498
5bec25eb
CY
2499 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2500
a4b0cca1 25012012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2502
2503 * w32.c (get_name_and_id): Always pass NULL as the first argument
2504 of lookup_account_sid. Avoids crashes with UNC file names that
2505 refer to DFS domains, not to specific machine names. (Bug#12621)
2506 Remove now unused argument FNAME; all callers changed.
2507 (get_file_owner_and_group): Remove now unused argument FNAME; all
2508 callers changed.
2509
34b4b7eb
CY
25102012-12-21 Chong Yidong <cyd@gnu.org>
2511
2512 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2513 error for invalid chars, don't check for a nil return value.
2514
13002885
DA
25152012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2516
2517 Avoid calls to CHAR_TO_BYTE if byte position is known.
2518 * editfns.c (make_buffer_string_both): Use move_gap_both.
2519 (Fbuffer_string): Use make_buffer_string_both.
2520 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2521 Adjust comment.
2522 (buf_bytepos_to_charpos): Likewise.
2523 (charpos_to_bytepos): Remove.
2524 * fileio.c (Finsert_file_contents): Use move_gap_both.
2525 * search.c (Freplace_match): Likewise.
9a0d4f34 2526 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2527 names for byte positions.
2528 * lisp.h (charpos_to_bytepos): Remove prototype.
2529 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2530 * insdel.c (move_gap): Likewise.
2531
99e9311c
PE
25322012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2533
2534 * xdisp.c (redisplay_internal): Remove now-unused local.
2535
e02230bf
SM
25362012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2537
2538 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2539 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2540 proper value of frame-local variables (bug#13225).
e02230bf 2541
1687fb14
DA
25422012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2545 Rename 4th argument since it may be buffer or string. Adjust comment.
2546 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2547
a2f07cd2
DA
25482012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2549
2550 * coding.c (Fdetect_coding_region): Do not check start and end with
2551 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2552 (code_convert_region): Likewise.
2553
474d441e
EZ
25542012-12-18 Eli Zaretskii <eliz@gnu.org>
2555
2556 * w32.c (acl_get_file, acl_set_file): Run the file name through
2557 map_w32_filename, and resolve any symlinks in the file name, like
2558 Posix platforms do.
2559 (acl_set_file): Call revert_to_self, if any privileges were
2560 enabled.
2561
8725c076
JB
25622012-12-17 Juanma Barranquero <lekktu@gmail.com>
2563
2564 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2565 ($(BLD)/w32.$(O)): Update dependencies.
2566
1e101a4b
SM
25672012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2568
2569 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2570 propagate redisplay's scrolling (if any) to the right window.
2571 (redisplay_internal): Use ensure_selected_frame.
2572 (display_mode_lines): Complete last fix.
2573 * window.c (select_window_1): New func, extracted from select_window.
2574 (select_window): Use it.
2575 * window.h (select_window_1): Declare.
2576
66447e07
EZ
25772012-12-17 Eli Zaretskii <eliz@gnu.org>
2578
2579 Emulate Posix ACL APIs on MS-Windows.
2580 * w32.c: Include sddl.h and sys/acl.h.
2581 (SDDL_REVISION_1): Define if not already defined.
2582 (g_b_init_get_security_descriptor_dacl)
2583 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2584 (g_b_init_is_valid_security_descriptor)
2585 (g_b_init_set_file_security): New static flags.
2586 (globals_of_w32): Initialize them to zero.
2587 (SetFileSecurity_Name): New string constant.
2588 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2589 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2590 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2591 (IsValidSecurityDescriptor_Proc): New typedefs.
2592 (get_file_security, get_security_descriptor_owner)
2593 (get_security_descriptor_group): Set errno to ENOTSUP.
2594 (set_file_security, get_security_descriptor_dacl)
2595 (is_valid_security_descriptor, convert_sd_to_sddl)
2596 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2597 (acl_free, acl_get_file, acl_set_file): New functions.
2598
2599 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2600
207a7ef0
PE
26012012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2602
2603 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2604 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2605 for some of that bug's symptoms can now cause Emacs to abort.
2606 Remove the workaround.
2607 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2608 The bug that caused SIGCHLD to get lost has been fixed, and the
2609 workaround for it can now cause Emacs to abort.
2610
17fdfc15
PE
26112012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2612
2613 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2614 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2615 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2616
7c3d167f
RF
26172012-12-16 Romain Francoise <romain@orebokech.com>
2618
2619 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2620 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 2621 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
2622 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2623
2624 * Makefile.in (LIBACL_LIBS): New macro.
2625 (LIBES): Use it.
2626
7d80ea23
PE
26272012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2628
2629 * fileio.c (internal_delete_file): Use bool for boolean.
2630
b0728617
EZ
26312012-12-15 Eli Zaretskii <eliz@gnu.org>
2632
2633 Fix bug #13079 on MS-Windows with temp files not being deleted.
2634 * w32.h (_child_process): New members input_file and
2635 pending_deletion.
2636 (register_child): First argument is now pid_t.
2637 (record_infile, record_pending_deletion): New prototypes.
2638
2639 * w32proc.c (new_child): Initialize input_file and
2640 pending_deletion members of the child.
2641 (delete_child): Delete the child's temporary input file, if any,
2642 that is pending deletion.
2643 (register_child): First argument is now pid_t.
2644 (record_infile, record_pending_deletion): New functions.
2645 (reap_subprocess): Fix a typo in DebPrint string.
2646 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2647
2648 * fileio.c (internal_delete_file): Return an int again: non-zero
2649 if delete-file succeeds, zero otherwise.
2650
2651 * lisp.h (internal_delete_file): Adjust prototype.
2652
2653 * callproc.c (Fcall_process): Don't overwrite infile with result
2654 of DECODE_FILE.
2655 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2656 asynchronous subprocess, record the name of the input file name,
2657 if any.
2658 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2659 delete the file, record it as pending deletion when the subprocess
2660 exits.
2661
7e90af26
EZ
26622012-12-14 Eli Zaretskii <eliz@gnu.org>
2663
2664 * editfns.c [HAVE_PWD_H]: Include grp.h.
2665
2666 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2667
97976f9f
PE
26682012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2669
2670 Fix permissions bugs with setgid directories etc. (Bug#13125)
2671 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2672 to mark it as a placeholder. The old value was often wrong.
2673 The only user of this attribute has been changed to use
2674 file-ownership-preserved-p instead, with its new group arg.
2675 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2676
26ec1f49
SM
26772012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2678
ad966fe7
SM
2679 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2680 Keep selected_window and selected_frame in sync.
26ec1f49 2681
5c207910
EZ
26822012-12-14 Eli Zaretskii <eliz@gnu.org>
2683
2684 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2685 try to get accurate owner and group information from NT file
2686 security APIs. This is to make most callers of 'stat' and
2687 'lstat', which don't need that information, much faster.
2688
26ec1f49
SM
2689 * dired.c (Ffile_attributes) [WINDOWSNT]:
2690 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
2691 owner and group information from 'lstat'.
2692
893f52d8
PE
26932012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2694
4c95c9a5
PE
2695 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2696 as that confuses set-auto-coding, so insist on the head-read
2697 returning the full 1024 bytes. Let lseek compute the tail offset;
2698 less work for us. Do not ignore I/O errors when reading the tail.
2699
893f52d8
PE
2700 * xdisp.c: Minor style fixes.
2701 (init_iterator): Hoist assignment out of if-expression.
2702 (markpos_of_region): Callers now test for sign, not for -1.
2703
40d1e434
DA
27042012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2705
2706 Minor redisplay optimization when the region length is zero.
2707 * xdisp.c (markpos_of_region): New function.
2708 (init_iterator): Do not highlight the region of zero length.
2709 (redisplay_window): Check whether the region is of non-zero length.
2710 (try_cursor_movement): Allow if the region length is zero.
2711 (try_window_reusing_current_matrix, try_window_id): Likewise.
2712
727f9739 27132012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
2714
2715 * search.c (search_buffer): Check the inverse translations of each
2716 character in pattern when the buffer being searched is unibyte.
2717 (Bug#13084)
2718
727f9739 27192012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
2720
2721 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2722 files, fixing a regression from 24.2.
645c6a30 2723 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 2724
d20704ef
PE
27252012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2726
2727 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2728 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2729 Remove unnecessary S_ISLNK test, as (contra the comments) this
2730 function can't copy symlinks. Improve quality of error message
2731 when attempting to copy files that are neither regular files nor
2732 directories.
2733
2dd61a9b
DA
27342012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2735
2736 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2737 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2738 * window.c (Frecenter):
2739 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2740 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2741
cc98b684
DC
27422012-12-12 Daniel Colascione <dancol@dancol.org>
2743
1e101a4b 2744 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
2745 the dumped Emacs is not a sparse file, greatly improving Cygwin
2746 "make bootstrap" performance.
2747
38e791fd
MA
27482012-12-11 Michael Albinus <michael.albinus@gmx.de>
2749
2750 * inotify.c (inotify_callback): Generate an Emacs event for every
2751 incoming inotify event.
2752
f9d1448f
EZ
27532012-12-11 Eli Zaretskii <eliz@gnu.org>
2754
2755 * xdisp.c (handle_face_prop): Fix logic of computing
2756 it->start_of_box_run_p.
2757 (append_space_for_newline): If the glyph row is R2L, reset the
2758 iterator's end_of_box_run_p flag before prepending the space glyph.
2759 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2760 iterator's start_of_box_run_p flag before prepending the stretch.
2761 (append_glyph, produce_image_glyph, append_composite_glyph)
2762 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2763 left_box_line_p and right_box_line_p flags of the glyph for R2L
2764 glyph rows. (Bug#13011)
2765
c6afe371
DA
27662012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2767
2768 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2769 if changed buffer is not shown in a window.
2770 * insdel.c (prepare_to_modify_buffer): Likewise.
2771 * window.c (replace_buffer_in_windows_safely): Do nothing
2772 if buffer is not shown in a window.
2773 (Fforce_window_update): Likewise if string or buffer argument
2774 is passed.
2775
1b47babd
EZ
27762012-12-11 Eli Zaretskii <eliz@gnu.org>
2777
2778 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2779 encoded_file_name, which is what it is.
2780
4c1acb95
DA
27812012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2782
2783 Consistently use marker_position and marker_byte_position.
2784 * fringe.c (Ffringe_bitmaps_at_pos):
2785 * indent.c (Fvertical_motion):
2786 * insdel.c (prepare_to_modify_buffer):
2787 * keyboard.c (make_lispy_position):
2788 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2789 (window_scroll_pixel_based, displayed_window_lines)
2790 (Fset_window_configuration):
2791 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2792 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2793 Replace direct access to marker fields with calls
2794 to marker_position and/or marker_byte_position.
2795
0eeb69fe
JB
27962012-12-11 Juanma Barranquero <lekktu@gmail.com>
2797
2798 * makefile.w32-in (SIG2STR_H): New macro.
2799 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2800 ($(BLD)/w32notify.$(O)): Update dependencies.
2801
1cf1bbd5
DC
28022012-12-10 Daniel Colascione <dancol@dancol.org>
2803
8db4b52f
DC
2804 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2805 Windows file notification functionality unless WINDOWSNT.
2806
1cf1bbd5
DC
2807 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2808 declarations.
2809
2810 * w32fns.c (cache_system_info): Initialize the global hinst
2811 variable here so various initialization calls DTRT.
2812
1e101a4b 2813 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
2814 (hinst): Remove unneeded extern declaration.
2815 (_start): Remove initialization of above variables; remove
2816 initialization of hinst, as cache_system_info now does that.
2817
2818 * emacs.c (main): Call cache_system_info early in startup; we
2819 previously weren't calling it in Cygwin builds.
2820
26ec1f49
SM
2821 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2822 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
2823 and link it to Emacs.
2824
98a07056
DA
28252012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2826
2827 Per-buffer window counters.
2828 * buffer.h (struct buffer): New member window_count.
2829 (buffer_window_count): New function.
2830 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2831 Initialize window_count.
2832 (Fkill_buffer): Verify window_count for the buffer being killed.
2833 (modify_overlay): Do not force redisplay if buffer is not shown
2834 in any window.
2835 (init_buffer_once): Initialize window_count for buffer_defaults
2836 and buffer_local_symbols.
2837 * window.h (buffer_shared): Remove declaration.
2838 (wset_buffer): Convert from inline ...
2839 * window.c (wset_buffer): ... to an ordinary function.
2840 (adjust_window_count): New function.
2841 (make_parent_window): Use it.
2842 * xdisp.c (buffer_shared): Remove.
2843 (redisplay_internal, redisplay_window): Adjust users.
2844 (buffer_shared_and_changed): Use per-buffer window counter.
2845
2b8c9064
EZ
28462012-12-10 Eli Zaretskii <eliz@gnu.org>
2847
2848 Support for filesystem notifications on MS-Windows.
2849 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2850 and this is a TTY frame, signal the caller that keyboard input is
2851 available.
2852
2853 * w32xfns.c (drain_message_queue): Now returns an int: an
2854 indication whether any WM_EMACS_FILENOTIFY messages were found in
2855 the queue.
2856
2857 * w32inevt.c (handle_file_notifications): New function.
2858 (w32_console_read_socket): Call it to process file notifications.
2859
2860 * w32console.c (initialize_w32_display): Record the main thread ID
2861 in dwMainThreadId.
2862
2863 * deps.mk (inotify.o): New dependency list.
2864
2865 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2866
2867 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2868 (WM_EMACS_END): Bump value by 1.
2869 (notification_buffer_in_use, file_notifications)
2870 (notifications_size, notifications_desc): Declare.
2871 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2872 Add prototypes.
2873
2874 * w32term.c (lispy_file_action, queue_notifications): New functions.
2875 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2876 <Qrenamed_to>: New symbols.
2877 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2878
2879 * w32notify.c: New file, implements file event notifications for
2880 MS-Windows.
2881
2882 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2883 by posting it to the w32_read_socket queue.
2884
1e101a4b 2885 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
2886
2887 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2888 (GLOBAL_SOURCES): Add w32notify.c
2889 ($(BLD)/w32notify.$(O)): New set of dependencies.
2890
2891 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2892
1e101a4b
SM
2893 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2894 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
2895 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2896 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2897 w32notify-handle-event by default.
2898
2899 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2900 syms_of_w32notify.
2901
81606b10
RS
29022012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2903
2b8c9064 2904 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 2905 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
2906
2907 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2908
2909 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2910 (syms_of_keyboard): DEFSYM it.
2911 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2912 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2913 Qfile_inotify events.
2914 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2915 special-event-map to inotify-handle-event.
2916
2917 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2918
2919 * Makefile.in (base_obj): Add inotify.o.
2920
2921 * inotify.c: New file.
2922
265c2fbf 29232012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
2924
2925 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2926
265c2fbf 29272012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
2928
2929 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2930 DWORD_PTR, for compatibility with 64-bit builds.
2931
a06ae17d 2932 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
2933 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2934 (system_process_attributes): Use SIZE_T rather than DWORD, for
2935 compatibility with 64-bit builds.
2936
265c2fbf 29372012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
2938
2939 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2940
265c2fbf 29412012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
2942
2943 * indent.c (Fvertical_motion): If a display string will be
2944 displayed on the left or the right margin, don't consider it as a
2945 factor in cursor positioning. (Bug#13108)
2946
265c2fbf 29472012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
2948
2949 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2950
5f460827
PE
29512012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2952
2953 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2954 for string length.
2955
a16e75cd
EZ
29562012-12-08 Eli Zaretskii <eliz@gnu.org>
2957
2958 * w32.c (unsetenv): Return 0 if the input string is too long.
2959
5745a7df
PE
29602012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2961
2962 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2963 * alloc.c (xputenv): New function.
2964 * dbusbind.c (Fdbus_init_bus):
2965 * emacs.c (main):
2966 * xterm.c (x_term_init):
2967 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2968 * editfns.c (initial_tz): Move static var decl up.
2969 (tzvalbuf_in_environ): New static var.
2970 (init_editfns): Initialize these two static vars.
2971 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2972 Save old TZ value on stack, if it's small.
2973 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2974 instead, use xputenv+unsetenv to set and restore TZ.
2975 (environbuf): Remove static var. All uses removed.
2976 (Fset_time_zone_rule): Do not save TZ and environ;
2977 no longer needed here.
2978 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2979 Move to inside set_time_zone_rule; they don't need file scope any more.
2980 (set_time_zone_rule): Maintain the TZ=value string separately.
2981 (syms_of_editfns): Don't initialize initial_tz;
2982 init_editfns now does it.
2983 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2984 * lisp.h (xputenv): New decl.
2985
c56efa40
FP
29862012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2987
2988 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2989
75ceee05
EZ
29902012-12-08 Eli Zaretskii <eliz@gnu.org>
2991
2992 * w32.c (unsetenv, sys_putenv): New functions.
2993
1b6dbfeb
CY
29942012-12-08 Chong Yidong <cyd@gnu.org>
2995
2996 * editfns.c (Finsert_char): Make the error message more
2997 informative (Bug#12992).
2998
d983a10b
PE
29992012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3000
7be78020
PE
3001 Simplify get_lim_data.
3002 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3003 Remove USG and vlimit methods; no longer used these days.
3004 Add #error catchall just in case.
3005
d983a10b
PE
3006 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3007 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3008 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3009 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3010 (deleted_pid_list, Fdelete_process, create_process)
3011 (record_child_status_change, handle_child_signal, deliver_child_signal)
3012 (init_process_emacs, syms_of_process):
3013 Assume SIGCHLD is defined.
3014 (parse_signal): Remove. All uses removed.
3015 (abbr_to_signal): New static function.
3016 (Fsignal_process): Use it to convert signal names to ints.
3017 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3018 kill (getpgrp (), ...).
3019 (emacs_sigaction_init): Assume SIGCHLD is defined.
3020 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3021 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3022 * syssignal.h (EMACS_KILLPG): Remove.
3023 All uses replaced by 'kill' with a negative pid.
3024 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3025 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3026
9cdde1e2
PE
30272012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3030 This will cause a production Emacs to dump core instead of
3031 infinite-looping.
3032
822995f8
DA
30332012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 * frame.c (make_frame): Do not set window's buffer to t.
3036 * window.c (Fsplit_window_internal): Likewise. Previously it was
3037 used to indicate that the window is being set up. Now we use
3038 set_window_buffer for all new windows, so the condition in ...
3039 (Fset_window_buffer): ... is always true and can be removed.
3040
ed08365b
DA
30412012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3042
3043 Convenient macro to check whether the buffer is hidden.
3044 * buffer.h (BUFFER_HIDDEN_P): New macro.
3045 * frame.c (make_frame): Use it. Adjust comment.
3046 * buffer.c (candidate_buffer): New function.
3047 (Fother_buffer, other_buffer_safely): Use it.
3048
e86f5134
EZ
30492012-12-06 Eli Zaretskii <eliz@gnu.org>
3050
3051 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3052 if the child process is still running. Instead, exit the wait
3053 loop and return zero. (Bug#13086)
3054
1700db3c
DA
30552012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3056
3057 * frame.h (x_char_width, x_char_height): Remove prototypes.
3058 * w32term.h (x_char_width, x_char_height): Likewise.
3059 * xfns.c (x_char_width, x_char_height): Remove.
3060 * w32fns.c (x_char_width, x_char_height): Likewise.
3061 * nsfns.c (x_char_width, x_char_height): Likewise.
3062 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3063 all window frames.
3064 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3065 * keyboard.c (command_loop_1): Remove prototype.
3066 (command_loop_2, top_level_1): Add static to match prototype.
3067
35fb8050
PE
30682012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3069
3070 Fix a recently-introduced delete-process race condition.
3071 * callproc.c, process.h (record_kill_process):
3072 New function, containing part of the old call_process_kill.
3073 (call_process_kill): Use it.
3074 This does not change call_process_kill's behavior.
3075 * process.c (Fdelete_process): Use record_kill_process to fix a
3076 race condition that could cause Emacs to lose track of a child.
3077
565212e5
DA
30782012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3079
3080 Avoid code duplication between prev_frame and next_frame.
3081 * frame.c (candidate_frame): New function. Add comment.
3082 (prev_frame, next_frame): Use it. Adjust comment.
3083
d8ad4d3f 30842012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3085
3086 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3087 fails, signal an error instead of continuing with an empty
3088 string. (Bug#13079)
7c2fcf9b
EZ
3089 Encode expanded temp file pattern before passing it to mkstemp or
3090 mktemp.
d3cefd13 3091
2e7cddd3
EZ
3092 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3093 Encode the file name before passing it to dostounix_filename, in
3094 case it will downcase it (under w32-downcase-file-names).
3095 (Bug#12933)
3096
644d3f0d
PE
30972012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3098
3099 Minor call-process cleanups.
3100 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3101 at the same time as other platforms, to simplify analysis.
3102 No need for fd0_volatile since we have synch_process_fd.
3103 Avoid needless emacs_close; arg is always negative.
3104
396376f1
AS
31052012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3106
3107 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3108 processes.
3109
350f51ad
DA
31102012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3111
3112 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3113 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3114 and mouse_face_hidden members to a bitfields.
3115 * frame.h (struct frame): Remove set-but-not-used space_width member.
3116 (FRAME_SPACE_WIDTH): Remove.
3117 * nsterm.m, w32term.c, xterm.c: Adjust users.
3118 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3119 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3120 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3121 members to a bitfields.
3122
bc9dbce6
PE
31232012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3124
bb5f74ee
PE
3125 Don't let call-process be a zombie factory (Bug#12980).
3126 Fixing this bug required some cleanup of the signal-handling code.
3127 As a side effect, this change also fixes a longstanding rare race
3128 condition whereby Emacs could mistakenly kill unrelated processes,
3129 and it fixes a bug where a second C-g does not kill a recalcitrant
3130 synchronous process in GNU/Linux and similar platforms.
3131 The patch should also fix the last vestiges of Bug#9488,
3132 a bug which has mostly been fixed on the trunk by other changes.
3133 * callproc.c, process.h (synch_process_alive, synch_process_death)
3134 (synch_process_termsig, sync_process_retcode):
3135 Remove. All uses removed, to simplify analysis and so that
3136 less consing is done inside critical sections.
3137 * callproc.c (call_process_exited): Remove. All uses replaced
3138 with !synch_process_pid.
3139 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3140 These take the role of what used to be in unwind-protect arg.
3141 All uses changed.
3142 (block_child_signal, unblock_child_signal):
3143 New functions, to avoid races that could kill innocent-victim processes.
3144 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3145 (call_process_kill): Record killed processes as deleted, so that
3146 zombies do not clutter up the system. Do this inside a critical
3147 section, to avoid a race that would allow the clutter.
3148 (call_process_cleanup): Fix code so that the second C-g works again
3149 on common platforms such as GNU/Linux.
3150 (Fcall_process): Create the child process in a critical section,
3151 to fix a race condition. If creating an asynchronous process,
3152 record it as deleted so that zombies do not clutter up the system.
3153 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3154 light of these changes. Omit unnecessary call to emacs_close
3155 before failure, as the unwind-protect code does that.
3156 * callproc.c (call_process_cleanup):
3157 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3158 * process.c (record_deleted_pid): New function, containing
3159 code refactored out of Fdelete_process.
3160 (Fdelete_process): Use it.
3161 (process_status_retrieved): Remove. All callers changed to use
3162 child_status_change.
3163 (record_child_status_change): Remove, folding its contents into ...
3164 (handle_child_signal): ... this signal handler. Now, this
3165 function is purely a handler for SIGCHLD, and is not called after
3166 a synchronous waitpid returns; the synchronous code is moved to
3167 wait_for_termination. There is no need to worry about reaping
3168 more than one child now.
3169 * sysdep.c (get_child_status, child_status_changed): New functions.
3170 (wait_for_termination): Now takes int * status and bool
3171 interruptible arguments, too. Do not record child status change;
3172 that's now the caller's responsibility. All callers changed.
3173 Reimplement in terms of get_child_status.
3174 (wait_for_termination_1, interruptible_wait_for_termination):
3175 Remove. All callers changed to use wait_for_termination.
3176 * syswait.h: Include <stdbool.h>, for bool.
3177 (record_child_status_change, interruptible_wait_for_termination):
3178 Remove decls.
3179 (record_deleted_pid, child_status_changed): New decls.
3180 (wait_for_termination): Adjust to API changes noted above.
3181
bc9dbce6
PE
3182 * bytecode.c, lisp.h (Qbytecode): Remove.
3183 No longer needed after 2012-11-20 interactive-p changes.
3184
3cf3c607
EZ
31852012-12-03 Eli Zaretskii <eliz@gnu.org>
3186
3187 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3188 the scroll margin, move point outside the margin. (Bug#13055)
3189
005c8d13
JD
31902012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3191
3192 * gtkutil.c (my_log_handler): New function.
3193 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3194
20edc1c9
DA
31952012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3196
3197 * lisp.h (modify_region): Rename to...
3198 (modify_region_1): ...new prototype.
3199 * textprop.c (modify_region): Now static. Adjust users.
3200 * insdel.c (modify_region): Rename to...
3201 (modify_region_1): ...new function to work with current buffer.
3202 Adjust comment and users. Use true and false for booleans.
3203
62c2e5ed
DA
32042012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3205
3206 * alloc.c (free_save_value): New function.
3207 (safe_alloca_unwind): Use it.
3208 * lisp.h (free_save_value): New prototype.
3209 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3210 Add comment.
3211 (save_excursion_restore): Adjust to match saved data structure.
3212 Use free_save_value to offload some work from GC. Drop obsolete
3213 #if 0 code.
3214
c5bc2d1d 32152012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3216
3217 * fileio.c (Vauto_save_list_file_name): Doc fix.
3218
c5bc2d1d 32192012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3220
3221 * w32fns.c: Remove prototype of atof.
1e101a4b 3222 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3223 builds.
1e101a4b 3224 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3225
3226 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3227 with 64-bit builds.
3228
3229 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3230 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3231 defined.
3232
c5bc2d1d 32332012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3234
a9de9f0c 3235 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3236
21e54a94
PE
32372012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3238
2dd2e622
PE
3239 Fix xpalloc confusion after memory is exhausted.
3240 * alloc.c (xpalloc): Comment fix.
3241 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3242 and signals an error, do not clear charset_table_size, as
3243 charset_table is still valid.
3244 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3245
21e54a94
PE
3246 Use execve to avoid need to munge environ (Bug#13054).
3247 * callproc.c (Fcall_process):
3248 * process.c (create_process):
3249 Don't save and restore environ; no longer needed.
3250 * callproc.c (child_setup):
3251 Use execve, not execvp, to preserve environ.
3252
3e5490f7
PE
32532012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3254
3255 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3256
75b4f59c
YM
32572012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3258
3259 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3260 display for sliced images (Bug#10500).
3261
3262 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3263
f8aff4c6
JB
32642012-11-30 Juanma Barranquero <lekktu@gmail.com>
3265
3266 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3267 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3268
3940b924
DA
32692012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3270
3271 * xdisp.c (window_outdated): Remove eassert since it hits
3272 some suspicious corner cases (see Bug#13007 and Bug#13012).
3273 (mode_line_update_needed): New function.
3274 (redisplay_internal, redisplay_window): Use it.
3275 (ensure_selected_frame): New function.
3276 (redisplay_internal, unwind_redisplay): Use it.
3277 (redisplay_internal): Move comment about buffer_shared...
3278 (buffer_shared_and_changed): ...near to its real use.
3279
4a9204fe
PE
32802012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 * callproc.c (Fcall_process): Don't misreport vfork failure.
3283
60aeceb8
PE
32842012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3285
3286 * callproc.c (Fcall_process): Fix vfork portability problems.
3287 Do not assume that fd[0], count, filefd, and save_environ survive
3288 vfork. Fix bug whereby wrong errno value could be reported for
3289 pipe failure. Some minor cleanups, too, as follows. Move buf and
3290 bufsize to the context where they're needed. Change new_argv to
3291 be of type char **, as this is more convenient and avoids casts.
3292 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3293 Now local constants, not macros.
3294
00dc3ead
KH
32952012-11-18 Kenichi Handa <handa@gnu.org>
3296
3297 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3298 for the variable "f".
3299
e1bf05c1
KH
33002012-11-13 Kenichi Handa <handa@gnu.org>
3301
3302 * font.c (font_unparse_xlfd): Exclude special characters from the
3303 generating XLFD name.
3304
22626a85
PE
33052012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3306
350e0088
PE
3307 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3308 * dired.c (stat_uname, stat_gname):
3309 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3310
22626a85
PE
3311 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3312 * dired.c (directory_files_internal, file_name_completion):
3313 Assume EAGAIN and EINTR are defined.
350e0088 3314
22626a85
PE
3315 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3316 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3317 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3318 * lread.c (readbyte_from_file): Assume EINTR is defined.
3319 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3320 Assume EIO and EAGAIN are defined.
3321 * unexcoff.c (write_segment): Assume EFAULT is defined.
3322
5c9cf0a3 33232012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3324
3325 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3326 (Bug#11964)
3327
22294a56
EZ
3328 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3329 highlighting on the frame was cleared. Prevents assertion
3330 violations when repeatedly clicking on the "Top" link of the
3331 "bread-crumbs" in Info buffers.
3332
5fbab051
PE
33332012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3334
3335 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3336
bcd77a2b
KB
33372012-11-24 Ken Brown <kbrown@cornell.edu>
3338
3339 * keyboard.c (HAVE_MOUSE):
3340 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3341 were always defined.
3342
d125ca15 33432012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3344
24becea4
EZ
3345 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3346 between bpos_covered and bpos_max. This fixes cursor display when
3347 several display strings follow each other.
3348
8654a41b
EZ
3349 * .gdbinit (pgx): If the glyph's object is a string, display the
3350 pointer to string data, rather than the value of the string object
3351 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3352
cb5867b1
EZ
3353 * indent.c (Fvertical_motion): If the starting position is covered
3354 by a display string, return to one position before that, to avoid
3355 overshooting it inside move_it_to. (Bug#12930)
3356
f418b22e
DA
33572012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3358
3359 * frame.h (struct frame): Remove display_preempted member
3360 since all users are dead long ago.
3361 * nsterm.h (struct x_output): Use the only dummy member.
3362 * w32menu.c (pending_menu_activation): Remove since not
3363 really used.
3364 (set_frame_menubar): Adjust user.
3365 * w32term.h (struct x_output): Drop outdated #if 0 code.
3366 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3367 asked_for_visible and menubar_active members.
3368 Drop unused pending_menu_activation member.
f418b22e
DA
3369 * xterm.h (struct x_output): Drop outdated #if 0 code.
3370 Use bitfields for explicit_parent, asked_for_visible,
3371 has_been_visible and net_wm_state_hidden_seen members.
3372
a879f0ea
EZ
33732012-11-23 Eli Zaretskii <eliz@gnu.org>
3374
3375 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3376 of a literal "/". (Bug#12955)
3377 (gl-stamp): Invoke fc.exe directly, not through cmd.
3378
95ef7787
PE
33792012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3380
3381 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3382 * dired.c: Assume HAVE_DIRENT_H.
3383 (NAMLEN): Remove, replacing with ...
3384 (dirent_namelen): New function. All uses changed. Use the GNU macro
3385 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3386 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3387 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3388 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3389 $(NT_INC)/dirent.h.
3390 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3391 * ndir.h: Rename to ../nt/inc/dirent.h.
3392 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3393 Do not include <dirent.h>; no longer needed.
3394 * w32.c: Include <dirent.h> rather than "ndir.h".
3395
12645ae6
CY
33962012-11-23 Chong Yidong <cyd@gnu.org>
3397
3398 * xftfont.c (xftfont_open): Remove duplicate assignment.
3399
5c747675
DA
34002012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3401
3402 * alloc.c (Fgarbage_collect): Unblock input after clearing
3403 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3404 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3405 * msdos.c (IT_frame_up_to_date): Use it here...
3406 * w32term.c (w32_frame_up_to_date): ...here...
3407 * xterm.c (XTframe_up_to_date): ...and here...
3408 * nsterm.m (ns_frame_up_to_date): ...but not here.
3409 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3410 Adjust users.
3411 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3412 Do not check whether GC is in progress.
3413
6ceeb5f1
DA
34142012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 * xdisp.c (window_buffer_changed): New function.
3417 (update_menu_bar, update_tool_bar): Use it to
3418 simplify large 'if' statements.
3419 (redisplay_internal): Generalize commonly used
3420 'tail' and 'frame' local variables.
3421
ec84768f
EZ
34222012-11-22 Eli Zaretskii <eliz@gnu.org>
3423
3424 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3425 with Windows system header.
3426
9239d970
PE
34272012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3428
3429 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3430 * alloc.c: Assume unistd.h exists.
3431 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3432 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3433 (getwd) [USG]: Remove; no longer needed.
3434 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3435 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3436 * w32.h (getcwd): Remove decl.
3437
954bba56
SM
34382012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3439
3440 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3441 Make it set selected_window as well.
3442 (update_tool_bar): Use it.
3443
6ef2e5ef 34442012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3445
3446 * emacs.c (main): Set the G_SLICE environment variable for all
3447 Cygwin builds, not just GTK builds. See
3448 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3449
6ef2e5ef 34502012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3451
3452 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3453 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3454 Define for the MSVC compiler.
3455
6ef2e5ef 3456 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3457
3458 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3459 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3460 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3461 dostounix_filename assumes it gets a unibyte string.
3462 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3463 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3464
eadf1faa
SM
34652012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3466
3467 Conflate Qnil and Qunbound for `symbol-function'.
3468 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3469 * lread.c (init_obarray): Set `function' fields to Qnil.
3470 * eval.c (Fcommandp): Ignore Qunbound.
3471 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3472 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3473 Test NILP rather than Qunbound.
3474 (Ffmakunbound): Set to Qnil.
3475 (Fsymbol_function): Never signal an error.
3476 (Finteractive_form): Ignore Qunbound.
3477
b83fdfa9
PE
34782012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 * eval.c (interactive_p): Remove no-longer-used decl.
3481
952580c5
DA
34822012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3483
3484 * xdisp.c (buffer_shared): Adjust comment.
3485 (buffer_shared_and_changed): New function.
3486 (prepare_menu_bars, redisplay_internal): Use it to
3487 decide whether all windows or frames should be updated.
ea6de9b1
DA
3488 (window_outdated): New function.
3489 (text_outside_line_unchanged_p, redisplay_window): Use it.
3490 (redisplay_internal): Likewise. Fix indentation.
952580c5 3491
23ba2705
SM
34922012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3493
3494 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3495 (syms_of_eval): Remove corresponding defsubr.
3496 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3497
6e9f7997
DC
34982012-11-19 Daniel Colascione <dancol@dancol.org>
3499
3500 * w32fns.c (Fx_file_dialog):
3501 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3502 cygwin_convert_file_name*.
3503
3504 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3505 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3506
552a1590
PE
35072012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3508
3509 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3510
2ac9538d 35112012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3512
3513 * w32select.c: Include w32common.h before w32term.h, so that
3514 windows.h gets included before w32term.h uses some of its
3515 features, see below.
3516
23ba2705
SM
3517 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3518 New typedefs.
3519 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3520 New prototypes.
d8715cdf
EZ
3521 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3522
2ac9538d 35232012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3524
3525 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3526 (ns_select): Return at once if events are held (Bug#12834).
3527
2ac9538d 35282012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3529
3530 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3531 Needed following 2012-10-20 change. (Bug#12902)
3532
c1f7ba3a
JB
35332012-11-18 Juanma Barranquero <lekktu@gmail.com>
3534
3535 * w32proc.c (waitpid): Remove unused label get_result.
3536
a75ce9d3
JB
35372012-11-17 Juanma Barranquero <lekktu@gmail.com>
3538
3539 * makefile.w32-in (SYSWAIT_H): New macro.
3540 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3541 ($(BLD)/sysdep.$(O)): Update dependencies.
3542
49cdacda
PE
35432012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3544
3545 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3546 * callproc.c (relocate_fd): Assume F_DUPFD.
3547 * emacs.c, term.c (O_RDWR): Remove.
3548 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3549 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3550 * nsterm.m: Assume <fcntl.h> exists.
3551 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3552 (create_pty, Fmake_network_process, server_accept_connection)
3553 (wait_reading_process_output, init_process_emacs):
3554 Assume O_NONBLOCK.
3555 (wait_reading_process_output): Put in a special case for WINDOWSNT
3556 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3557 It's not clear this is needed, but it's a more-conservative change.
3558 (create_process): Assume FD_CLOEXEC.
3559 (create_process, create_pty): Assume O_NOCTTY.
3560 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3561 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3562 Omit if not DOS_NT, since F_GETFL is not defined there.
3563 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3564 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3565 (O_NOCTTY): Remove.
3566 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3567 lack it, since gnulib guarantees this.
3568 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3569
22bae83f
EZ
35702012-11-17 Eli Zaretskii <eliz@gnu.org>
3571
6ad30855
EZ
3572 * w32.c (faccessat): Pretend that directories have the execute bit
3573 set. Emacs expects that, e.g., in files.el:cd-absolute.
3574
22bae83f
EZ
3575 * w32proc.c (create_child): Don't clip the PID of the child
3576 process to fit into an Emacs integer, as this is no longer a
3577 restriction.
3578 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3579 reaping only the process specified by PID argument, if that is
3580 positive. Use PID instead of dead_child to know which process to
3581 reap. Wait for the child to die only if WNOHANG is not in
3582 OPTIONS.
3583 (sys_select): Don't set dead_child.
3584
3585 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3586 as it is no longer needed.
3587
3588 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3589 no longer needed.
3590 (record_child_status_change): Remove the setting of
3591 record_at_most_one_child for the !WNOHANG case.
3592
a631d0e0
PE
35932012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3594
3595 Fix problems in ns port found by static checking.
3596 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3597 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3598 not to process group.
3599 (ns_select): Use emacs_write, not write, as that's more robust
3600 in the presence of signals.
3601 (fd_handler:): Check for read errors.
3602
d56f2e49
GM
36032012-11-16 Glenn Morris <rgm@gnu.org>
3604
3605 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3606
96e05507 36072012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
3608
3609 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3610
96e05507 36112012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
3612
3613 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3614 use the same value of thread handle.
3615 (start_timer_thread): If the timer thread exited (due to error),
3616 clean up by closing the two handles it used. Duplicate the caller
3617 thread's handle here, so it gets duplicated only once, when
3618 launching the timer thread. Set priority of the timer thread, not
3619 the caller thread.
3620 (getitimer): Don't duplicate the caller thread's handle here.
3621 (Bug#12832)
3622
96e05507 36232012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
3624
3625 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3626 called (Bug#12834).
3627
3d082a26
PE
36282012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3629
3630 Remove no-longer-used pty_max_bytes variable.
3631 * process.c (pty_max_bytes): Remove; unused.
3632 (send_process): Do not set it.
3633
b72c161c
JB
36342012-11-15 Juanma Barranquero <lekktu@gmail.com>
3635
3636 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3637 Update dependencies.
3638
bf20ea80
PE
36392012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3640
3641 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3642 This follows up on the 2012-09-29 patch that removed indirection
3643 for the 'function' field. Reported by Sergey Vinokurov in
3644 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3645
14f20728
EZ
36462012-11-14 Eli Zaretskii <eliz@gnu.org>
3647
3648 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3649 different name, as the MS runtime does not have such a function,
3650 and probably never will.) All callers changed. Ignore DIRFD
3651 value if PATH is an absolute file name, to match Posix spec
3652 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3653 symlinks.
3654
77731919
DA
36552012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3656
3657 * xdisp.c (echo_area_display, redisplay_internal):
3658 Omit redundant check whether frame_garbaged is set.
3659
73dcdb9f
PE
36602012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3661
3662 Use faccessat, not access, when checking file permissions (Bug#12632).
3663 This fixes a bug that has been present in Emacs since its creation.
3664 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3665 which must set some sort of record. (Torek's bug report was against
3666 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3667 same common flaw.) See Torek's Usenet posting
3668 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3669 Posted: Fri Apr 8 14:18:56 1983.
3670 * Makefile.in (LIB_EACCESS): New macro.
3671 (LIBES): Use it.
3672 * callproc.c (init_callproc):
3673 * charset.c (init_charset):
3674 * fileio.c (check_existing, check_executable, check_writable)
3675 (Ffile_readable_p):
3676 * lread.c (openp, load_path_check):
3677 * process.c (allocate_pty):
3678 * xrdb.c (file_p):
3679 Use effective UID when checking permissions, not real UID.
3680 * callproc.c (init_callproc):
3681 * charset.c (init_charset):
3682 * lread.c (load_path_check, init_lread):
3683 Test whether directories are accessible, not merely whether they exist.
3684 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3685 * fileio.c (check_existing, check_executable, check_writable)
3686 (Ffile_readable_p):
3687 Use symbolic names instead of integers for the flags, as they're
3688 portable now.
3689 (check_writable): New arg AMODE. All uses changed.
3690 Set errno on failure.
3691 (Ffile_readable_p): Use faccessat, not stat + open + close.
3692 (Ffile_writable_p): No need to call check_existing + check_writable.
3693 Just call check_writable and then look at errno. This saves a syscall.
3694 dir should never be nil; replace an unnecessary runtime check
3695 with an eassert. When checking the parent directory of a nonexistent
3696 file, check that the directory is searchable as well as writable, as
3697 we can't create files in unsearchable directories.
3698 (file_directory_p): New function, which uses 'stat' on most platforms
3699 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3700 (Ffile_directory_p, Fset_file_times): Use it.
3701 (file_accessible_directory_p): New function, which uses a single
3702 syscall for efficiency.
3703 (Ffile_accessible_directory_p): Use it.
3704 * xrdb.c (file_p): Use file_directory_p.
3705 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3706 * lread.c (openp): When opening a file, use fstat rather than
3707 stat, as that avoids a permissions race. When not opening a file,
3708 use file_directory_p rather than stat.
3709 (dir_warning): First arg is now a usage string, not a format.
3710 Use errno. All uses changed.
3711 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3712 that merely introduced a race.
3713 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3714 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3715 and similarly for the other O_* flags.
3716 * w32.c (sys_faccessat): Rename from sys_access and switch to
3717 faccessat's API. All uses changed.
3718 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3719 (magic_db): Rename from magic_file_p.
3720 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3721 char *, so that we don't have to test for file existence
3722 separately from opening the file for reading. This removes a race
3723 fixes a permission-checking problem, and simplifies the code.
3724 All uses changed.
3725 (file_p): Remove; no longer needed.
3726
2a14f83b
DA
37272012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3728
3729 Omit glyphs initialization at startup.
3730 * dispnew.c (glyphs_initialized_initially_p): Remove.
3731 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3732 (Fredraw_frame): Move actual code from here...
c7085245 3733 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
3734 (Fredraw_display): Use redraw_frame.
3735 * xdisp.c (clear_garbaged_frames): Likewise.
3736
f78ee6af 37372012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
3738
3739 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3740 passed to pint2str and pint2hrstr to be at most the size of the
3741 frame's decode_mode_spec_buffer. This avoids crashes with very
3742 large values of FIELD_WIDTH argument to decode_mode_spec.
3743 (Bug#12867)
3744
b95a9c0c
PE
37452012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3746
3747 Fix a race with verify-visited-file-modtime (Bug#12863).
3748 Since at least 1991 Emacs has ignored an mtime difference of no
3749 more than one second, but my guess is that this was to work around
3750 file system bugs that were fixed long ago. Since the race is
3751 causing problems now, let's remove that code.
3752 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3753 whose time stamp is off by no more than a second. Insist that the
3754 file time stamps match exactly.
3755
be49ba74
DA
37562012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3757
3758 * frame.h (struct frame): Convert external_tool_bar member to
3759 1-bit unsigned bitfield.
3760 * termhooks.h (struct terminal): Remove mouse_moved member since
3761 all users are long dead. Adjust comment on mouse_position_hook.
3762
5b04e9f9
DA
37632012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3764
3765 Simplify by using FOR_EACH_FRAME here and there.
3766 * frame.c (next_frame, prev_frame, other_visible_frames)
3767 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3768 * w32term.c (x_window_to_scroll_bar): Likewise.
3769 * window.c (window_list): Likewise.
3770 * xdisp.c (x_consider_frame_title): Likewise.
3771 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3772 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3773 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3774 * xmenu.c (menubar_id_to_frame): Likewise.
3775 * xselect.c (frame_for_x_selection): Likewise.
3776 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3777 (x_window_to_menu_bar): Likewise.
3778 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3779
76ae24d7
PE
37802012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3781
12cc4337
PE
3782 * data.c (Qdefalias_fset_function): Now static.
3783
76ae24d7
PE
3784 Another tweak to vectorlike_header change.
3785 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3786 Remove, and replace all uses with ...
3787 (next_in_free_list, set_next_in_free_list):
3788 New functions, which respect C's aliasing rules better.
3789
1479c557
PE
37902012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3791
3792 * window.c (list4i): Rename from 'quad'. All uses changed.
3793 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3794
11235c03
JB
37952012-11-11 Juanma Barranquero <lekktu@gmail.com>
3796
3797 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3798 warning about mixing declarations and code in ISO C90.
3799
6baf66d5 38002012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
3801
3802 * window.c (Fsplit_window_internal): Set combination limit of
3803 new parent window to t iff Vwindow_combination_limit is t;
3804 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 3805 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 3806
6baf66d5 38072012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
3808
3809 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3810 amount when the scroll margins are too large. When scrolling
3811 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
3812 scroll margin within a reasonable number of screen lines.
3813 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
3814 point is positioned many lines beyond the window top/bottom.
3815 (Bug#12811)
3816
508f51f5
EZ
3817 * ralloc.c (relinquish): If real_morecore fails to return memory
3818 to the system, don't crash; instead, leave the last heap
3819 unchanged and return. (Bug#12774)
3820
32e5c58c
SM
38212012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3822
3823 * lisp.h (AUTOLOADP): New macro.
3824 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3825 * data.c (Ffset): Remove special ad-advice-info handling.
3826 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3827 (Fsubr_arity): CSE.
3828 (Finteractive_form): Simplify.
3829 (Fquo): Don't insist on having at least 2 arguments.
3830 (Qdefalias_fset_function): New var.
3831
719b0aa5
JD
38322012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3833
4ab15c3e
JD
3834 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3835
719b0aa5
JD
3836 * nsfont.m (Qcondensed, Qexpanded): New variables.
3837 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3838 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3839
535cc8e9
DA
38402012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3841
3842 Fix recently introduced crash on MS-Windows (Bug#12839).
3843 * w32term.h (struct scroll_bar): Use convenient header.
3844 (SCROLL_BAR_VEC_SIZE): Remove.
3845 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3846
7d377c48
DA
38472012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 Tweak last vectorlike_header change.
3850 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3851 vectorlike object on the free list. This is introduced to avoid
3852 some (but not all) pointer casting and aliasing problems, see
3853 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3854 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3855 objects.
3856 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3857
7ad27466
JD
38582012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3859
32e5c58c 3860 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
3861 been removed, so remove them here also.
3862
57618ecf
SM
38632012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3864
3865 * doc.c (Fdocumentation): Handle new property
3866 dynamic-docstring-function to replace the old ad-advice-info.
3867
53371430
PE
38682012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3869
3870 * fns.c (Qeql, hashtest_eq): Now static.
3871
61ddb1b9
SM
38722012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3873
3874 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3875 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3876 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3877 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3878
04a2d0d3
PE
38792012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3880
3881 Use same hash function for hashfn_profiler as for hash_string etc.
3882 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3883 * lisp.h (sxhash_combine): New inline function, with the contents
3884 of the old SXHASH_COMBINE.
3885 * profiler.c (hashfn_profiler): Use it, instead of having a
3886 special hash function containing a comparison that always yields 1.
3887
de5ef41a
SM
38882012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3889
3890 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3891 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3892 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3893 Remove unused vars.
3894
a23c4171
JD
38952012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3896
3897 * image.c (xpm_make_color_table_h): Fix compiler error because
3898 make_hash_table changed.
3899
0b59090b 39002012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
3901
3902 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3903
b7432bb2
SM
39042012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3905
3906 Use ad-hoc comparison function for the profiler's hash-tables.
3907 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3908 (make_log): Use them.
3909 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3910 call Fequal any more.
3911 (Ffunction_equal): New function.
3912 (cmpfn_profiler, hashfn_profiler): New functions.
3913 (syms_of_profiler): Initialize them.
3914 * lisp.h (struct hash_table_test): New struct.
3915 (struct Lisp_Hash_Table): Use it.
3916 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3917 * fns.c (make_hash_table): Take a struct to describe the test.
3918 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3919 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3920 (hash_lookup, hash_remove_from_table): Move assertion checking of
3921 hashfn result here. Check hash-equality before calling cmpfn.
3922 (Fmake_hash_table): Adjust call to make_hash_table.
3923 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3924 (syms_of_fns): Initialize them.
3925 * emacs.c (main): Move syms_of_fns earlier.
3926 * xterm.c (syms_of_xterm):
3927 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3928 * print.c (print_object): Adjust to new hash-table struct.
3929 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3930
88002743
EZ
39312012-11-08 Eli Zaretskii <eliz@gnu.org>
3932
3933 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3934 value of w32-scroll-lock-modifier is neither nil nor one of the
3935 known key modifiers. (Bug#12806)
3936
914adc42
DA
39372012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3938
3939 Shrink struct vectorlike_header to the only size field.
3940 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3941 Adjust comment.
3942 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3943 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3944 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3945 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3946 information from the vector header. Adjust comment.
3947 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3948 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3949 layout.
3950 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3951 (struct vectorlike_header): Remove next member. Adjust comment.
3952 (struct Lisp_Subr): Add convenient header. Adjust comment.
3953 (allocate_pseudovector): Adjust prototype.
3954 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3955 (sweep_string, lisp_malloc): Remove useless prototypes.
3956 (enum mem_type): Adjust comment.
3957 (NEXT_IN_FREE_LIST): New macro.
3958 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3959 (Fmake_bool_vector): Likewise.
3960 (struct large_vector): New type to represent allocation unit for
3961 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3962 (large_vectors): Change type to struct large_vector.
3963 (allocate_vector_from_block): Simplify.
3964 (PSEUDOVECTOR_NBYTES): Replace with...
3965 (vector_nbytes): ...new function. Adjust users.
3966 (sweep_vectors): Adjust processing of large vectors.
3967 (allocate_vectorlike): Likewise.
3968 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3969 Add easserts. Adjust XSETPVECTYPESIZE usage.
3970 (allocate_buffer): Use BUFFER_PVEC_INIT.
3971 (live_vector_p): Adjust to match large vector.
3972 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3973 * buffer.h (struct buffer): Add next member.
3974 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3975 New macros.
3976 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3977 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3978 (copy_hash_table): Adjust to match vector header change.
3979 * lread.c (defsubr): Use XSETPVECTYPE.
3980 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3981 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3982 (xvecsize): New command.
3983
c66f21ea
DA
39842012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3985
3986 * keyboard.c (event_to_kboard): Do not dereference
3987 frame_or_window field of SELECTION_REQUEST_EVENT
3988 and SELECTION_CLEAR_EVENT events (Bug#12814).
3989 * xterm.h (struct selection_input_event): Adjust comment.
3990
eb147960
EZ
39912012-11-07 Eli Zaretskii <eliz@gnu.org>
3992
dab72075
EZ
3993 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3994 such as Scroll Lock, if the respective keys are treated as
3995 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3996 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3997
5890e400
DA
39982012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3999
4000 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4001
b6b3b294
PE
40022012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4003
4004 Restore some duplicate definitions (Bug#12814).
4005 This undoes part of the 2012-11-03 changes. Some people build
4006 with plain -g rather than with -g3, and they need the duplicate
4007 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4008 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4009 Define as macros, as well as as enums or as constants.
4010
e770aad5
JD
40112012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4012
4013 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4014 to keypad keys (Bug#12816).
4015
68f8f1c0
PE
40162012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4017
4018 Minor adjustments of recently-changed frame functions.
4019 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4020 known to be a frame (we're in the FRAMEP branch).
4021 * lisp.h (Qframep): Remove decl. frame.h declares this.
4022 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4023 since they're meant for Lisp fixnum values.
4024
72f94d4b
DA
40252012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4026
4027 * window.c (Fwindow_combination_limit): Revert to the only
4028 required argument and adjust docstring as suggested in
4029 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4030 by Martin Rudalics <rudalics@gmx.at>.
4031
d9f07150
DA
40322012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4033
4034 Widely used frame validity and checking functions.
4035 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4036 * frame.c (decode_live_frame, decode_any_frame): New functions.
4037 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4038 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4039 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4040 (Fframe_pointer_visible_p): Use decode_any_frame.
4041 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4042 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4043 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4044 (Fframe_focus): Likewise. Allow zero number of arguments.
4045 Adjust docstring.
4046 (frame_buffer_list, frame_buffer_predicate): Remove.
4047 * lisp.h (frame_buffer_predicate): Remove prototype.
4048 * buffer.c (Fother_buffer): Use decode_any_frame.
4049 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4050 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4051 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4052 (Fclose_font, Ffont_info): Use decode_live_frame.
4053 * fontset.c (check_fontset_name): Likewise.
4054 * terminal.c (Fframe_terminal): Likewise.
4055 * w32fns.c (check_x_frame): Likewise.
4056 * window.c (Fminibuffer_window, Fwindow_at)
4057 (Fcurrent_window_configuration): Likewise.
4058 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4059 Likewise. Allow zero number of arguments. Adjust docstring.
4060 * dispnew.c (Fredraw_frame): Likewise.
4061 * xfaces.c (frame_or_selected_frame): Remove.
4062 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4063 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4064 (Fframe_face_alist): Use decode_live_frame.
4065 * xfns.c (check_x_frame): Likewise.
4066
89bc0592
DA
40672012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4068
4069 * window.c (quad): New function.
4070 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4071 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4072 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4073 (Fwindow_line_height): Use it.
4074 (Fwindow_fringes): Use list3.
4075 (Fwindow_scroll_bars): Use list4.
4076 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4077 (Fwindow_combination_limit): Allow zero number of arguments.
4078
c8e3a9c3
EZ
40792012-11-05 Eli Zaretskii <eliz@gnu.org>
4080
4081 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4082
8e2417bf 4083 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4084 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4085 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4086
209c6a58
CY
40872012-11-05 Chong Yidong <cyd@gnu.org>
4088
4089 * process.c (wait_reading_process_output): Revert previous change.
4090
8148369c
PE
40912012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4092
dd0333b6
PE
4093 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4094 This removes code that has been obsolete since around 1990.
4095 * callproc.c (Fcall_process):
4096 * emacs.c (main):
4097 * process.c (create_process):
4098 * term.c (dissociate_if_controlling_tty):
4099 Assume setsid exists.
4100 * callproc.c (child_setup): Assume setpgid exists and behaves as
4101 per POSIX.1-1988 or later.
4102 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4103 * emacs.c (shut_down_emacs):
4104 * sysdep.c (sys_suspend, init_foreground_group):
4105 Assume getpgrp behaves as per POSIX.1-1998 or later.
4106 * msdos.c (setpgrp): Remove.
4107 (tcgetpgrp, setpgid, setsid): New functions.
4108 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4109 * term.c (no_controlling_tty): Remove; unused.
4110 * w32proc.c (setpgrp): Remove.
4111 (setsid, tcgetpgrp): New functions.
4112
8148369c
PE
4113 Simplify by assuming __fpending.
4114 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4115 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4116 Do not assume that __fpending's result fits in int.
4117
76abf5e5
PE
41182012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4119
06b63c9b
PE
4120 Remove EMACS_OUTQSIZE+sleep hack.
4121 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4122 than 2400 bps, which throttled Emacs by having it sleep.
4123 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4124 was added, and anyway those old terminals are long dead.
4125 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4126 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4127
76abf5e5
PE
4128 Fix data-loss with --version (Bug#9574).
4129 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4130 as we can't assume that emacs_strerror is initialized, and strerror
4131 is good enough here.
4132 (main): Invoke atexit earlier, to catch earlier instances of
4133 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4134
8f31e74b
MM
41352012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4136
4137 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4138 (keyDown): Remap keypad keys to X11 virtual key codes.
4139
0d879dca
PE
41402012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4141
7ccfb720
PE
4142 Fix data-loss with --batch (Bug#9574).
4143 * emacs.c: Include <close-stream.h>.
4144 (close_output_streams): New function.
4145 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4146 and handles errors appropriately.
4147 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4148 does that now.
4149
0b3d4a47
PE
4150 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4151 The symptom is a diagnostic "GLib-WARNING **: In call to
4152 g_spawn_sync(), exit status of a child process was requested but
4153 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4154 waitpid(), so exit status can't be returned." The diagnostic
4155 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4156 The real bug is a race condition between Emacs and glib: Emacs
4157 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4158 so that glib can't find it. Work around the bug by invoking
4159 waitpid only on subprocesses that Emacs itself creates.
4160 * process.c (create_process, record_child_status_change):
4161 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4162 know the pid rather than having the callee infer it.
4163 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4164 (create_process): Set new 'alive' member if child is created.
4165 (process_status_retrieved): New function.
4166 (record_child_status_change): Use it.
4167 Accept negative 1st argument, which means to wait for the
4168 processes that Emacs already knows about. Move special-case code
4169 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4170 processes that have already been waited for, by testing and
4171 clearing new 'alive' member.
4172 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4173 now does this internally.
4174 (handle_child_signal): Let record_child_status_change do all
4175 the work, since we do not want to reap all exited child processes,
4176 only the child processes that Emacs itself created.
4177 * process.h (Lisp_Process): New boolean member 'alive'.
4178
0d879dca
PE
4179 Omit duplicate definitions no longer needed with gcc -g3.
4180 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4181 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4182 Define only as macros. There's no longer any need to also define
4183 these symbols as enums or as constants, since we now assume
4184 gcc -g3 when debugging.
4185
3478f4b5
EZ
41862012-11-03 Eli Zaretskii <eliz@gnu.org>
4187
4188 * lisp.mk: Adjust comments to the fact that term/internal is now
4189 loaded from loadup.el.
4190
4191 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4192 (msdos_fatal_signal): New function.
4193 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4194 its argument list.
4195
4196 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4197 for GCC versions before 4.
4198 (emacs_raise): Define to call msdos_fatal_signal.
4199
4200 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4201 iterator when starting in the middle of a display or overlay
4202 string. (Bug#12745)
4203
85fabcb7
CY
42042012-11-03 Chong Yidong <cyd@gnu.org>
4205
4206 * process.c (wait_reading_process_output): Clean up the last
4207 change.
4208
893cc455
CY
42092012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4210
4211 * process.c (wait_reading_process_output): Avoid a race condition
4212 with SIGIO delivery (Bug#11536).
4213
0f7b074f
CY
42142012-11-03 Chong Yidong <cyd@gnu.org>
4215
4216 * buffer.c (cursor_type): Untabify docstring.
4217
3737fee7
DA
42182012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4219
4220 * frame.h (struct frame): Drop can_have_scroll_bars member
4221 which is meaningless for a long time. Adjust comments.
4222 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4223 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4224
b6a9e8b1
DA
42252012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4226
4227 * window.c (decode_next_window_args): Update window arg after
4228 calling decode_live_window and so fix crash reported at
4229 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4230 by Juanma Barranquero <lekktu@gmail.com>.
4231 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4232 * font.c (Ffont_at): Likewise.
4233
600d4768
JD
42342012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4235
4236 * widget.c (resize_cb): New function.
4237 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4238 (EmacsFrameResize): Check if all is up to date before changing frame
4239 size.
4240
1005b4b9
EZ
42412012-11-02 Eli Zaretskii <eliz@gnu.org>
4242
4243 Implement backtrace output for fatal errors on MS-Windows.
4244 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4245 (BACKTRACE_LIMIT_MAX): New macro.
4246 (w32_backtrace): New function.
4247 (emacs_abort): Use w32_backtrace when the user chooses not to
4248 attach a debugger. Update the text of the abort dialog.
4249
b9e9df47
DA
42502012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Window-related stuff cleanup here and there.
4253 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4254 Use decode_any_window.
4255 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4256 * xdisp.c (Fformat_mode_line): Likewise.
4257 * font.c (Ffont_at): Use decode_live_window.
4258 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4259 * window.c (decode_next_window_args): Likewise.
4260 (decode_any_window): Remove static.
4261 * window.h (decode_any_window): Add prototype.
4262 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4263 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4264 respectively.
4265
2b371ff7
DA
42662012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4267
4268 Remove pad from struct input_event.
4269 * termhooks.h (struct input_event): Remove padding field.
4270 Adjust comment.
4271 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4272 member is never cons for a long time. Adjust comment.
4273 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4274 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4275 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4276 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4277
7e8b50d9
EZ
42782012-11-01 Eli Zaretskii <eliz@gnu.org>
4279
4280 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4281
322aea6d
PE
42822012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4283
4284 Fix crash when using Emacs as commit editor for git (Bug#12697).
4285 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4286 and it is configured in conf_post.h.
4287 (Fcall_process): Don't invoke both setsid and setpgid; the former
4288 is enough, if it exists.
4289 * callproc.c (Fcall_process, child_setup):
4290 * process.c (create_process): Use setpgid.
4291 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4292 for the real thing.
4293 * dispnew.c (init_display): Initialize the foreground group
4294 if we are running a tty display.
4295 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4296 * lisp.h (init_foreground_group): New decl.
4297 * sysdep.c (inherited_pgroup): New static var.
4298 (init_foreground_group, tcsetpgrp_without_stopping)
4299 (narrow_foreground_group, widen_foreground_group): New functions.
4300 (init_sys_modes): Narrow foreground group.
4301 (reset_sys_modes): Widen foreground group.
4302
220cb2bd
MA
43032012-10-31 Michael Albinus <michael.albinus@gmx.de>
4304
4305 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4306
218e997a
MR
43072012-10-31 Martin Rudalics <rudalics@gmx.at>
4308
4309 * minibuf.c (read_minibuf): Restore current buffer since
4310 choose_minibuf_frame calling Fset_frame_selected_window may
4311 change it (Bug#12766).
4312
02615da0
JD
43132012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4314
4315 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4316
aee5b18e
KH
43172012-10-30 Kenichi Handa <handa@gnu.org>
4318
4319 * font.c (Ffont_at): If WINDOW is specified and it is not
4320 displaying the current buffer, signal an error.
4321
ba116008
DC
43222012-10-29 Daniel Colascione <dancol@dancol.org>
4323
de5ef41a
SM
4324 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4325 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4326 here...
4327
4328 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4329 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4330 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4331
640bf8ad
EZ
43322012-10-28 Eli Zaretskii <eliz@gnu.org>
4333
4334 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4335 (timer_loop, getitimer, setitimer): Use it instead of
4336 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4337 'clock'.
4338 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4339 literal 10000.
4340
64ccff5f
JD
43412012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4342
4343 * nsterm.m (NO_APPDEFINED_DATA): New define.
4344 (last_appdefined_event_data): New variable
4345 (last_appdefined_event): Remove.
4346 (ns_select): Initialize t from last_appdefined_event_data instead
4347 of [last_appdefined_event data1].
4348 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4349 remove last_appdefined_event (Bug#12698).
4350
e483264c
SM
43512012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4352
4353 * frame.c (x_set_font): Catch internal error.
4354
6c16c13e
EZ
43552012-10-27 Eli Zaretskii <eliz@gnu.org>
4356
e483264c
SM
4357 Avoid overflow in w32 implementation of interval timers.
4358 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4359 actually executes.
4360 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4361 'volatile ULONGLONG' types. All the other data which was
4362 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4363 (GetThreadTimes_Proc): New typedef.
4364 (w32_get_timer_time): New function, returns a suitable time value
4365 for the timer.
4366 (timer_loop): Enter critical section when accessing ULONGLONG
4367 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4368 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4369 Remove unused variable.
6c16c13e
EZ
4370 (init_timers): Initialize s_pfn_Get_Thread_Times.
4371 (start_timer_thread): Don't assign itimer->caller_thread here.
4372 (getitimer): Assign itimer->caller_thread here.
4373 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4374 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4375
ccc83f50
EZ
43762012-10-26 Eli Zaretskii <eliz@gnu.org>
4377
4378 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4379 mouse movement events if the menu bar is active. This avoids
4380 producing a busy "hour-glass" cursor by Windows if the mouse
4381 pointer is positioned over a tooltip shown for some menu item.
4382
69deda53
PE
43832012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4384
4385 Don't assume process IDs fit in int.
4386 * emacs.c (shut_down_emacs) [!DOS_NT]:
4387 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4388 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4389 Use pid_t, not int, to store process IDs, as 'int'
4390 is not wide enough on a few platforms (e.g., AIX and IRIX).
4391
7e70a152
KH
43922012-10-23 Kenichi Handa <handa@gnu.org>
4393
4394 The following change is to make face-font-rescale-alist work
4395 correctly for non-ASCII fonts.
4396
4397 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4398 (font_open_for_lface): Handle Vface_font_rescale_alist.
4399
49238e7f
CY
44002012-10-23 Chong Yidong <cyd@gnu.org>
4401
4402 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4403
5ec86886
JD
44042012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4405
ef446959
JD
4406 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4407 for screen font.
4408 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4409
5ec86886
JD
4410 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4411 event (Bug#12681).
4412
ee7a418d
GM
44132012-10-21 Glenn Morris <rgm@gnu.org>
4414
4415 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4416
4973679b
PE
44172012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4418
4419 Port to OpenBSD 5.1.
4420 * frame.c (Fmouse_position, Fmouse_pixel_position):
4421 * xdisp.c (produce_stretch_glyph):
4422 Declare local vars only when they're needed.
4423 This is clearer and avoids a warning on OpenBSD about unused vars.
4424 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4425 This is safer, and avoids OpenBSD warnings about unused vars.
4426 * keyboard.c (record_menu_key): Remove unnecessary decl.
4427 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4428 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4429 as our definition clashes with OpenBSD's.
4430 * xfaces.c (load_face_colors, check_lface_attrs)
4431 (get_lface_attributes_no_remap, get_lface_attributes)
4432 (lface_fully_specified_p, x_supports_face_attributes_p)
4433 (tty_supports_face_attributes_p, face_fontset, realize_face)
4434 (realize_x_face, realize_tty_face):
4435 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4436 merely Lisp_Object *. This is more informative and avoids
4437 a warning on OpenBSD about accessing beyond an object's size.
4438
c664f463
CY
44392012-10-20 Chong Yidong <cyd@gnu.org>
4440
4441 * lread.c (Fload): Doc fix (Bug#12592).
4442
6ec83f92 44432012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4444
4445 * font.c (Ffont_at): Fix previous change.
4446
d2824928
EZ
44472012-10-19 Eli Zaretskii <eliz@gnu.org>
4448
e483264c
SM
4449 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4450 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4451 for the reasons.
4452
d2824928
EZ
4453 * alloc.c (NSTATICS): Decrease to 0x800.
4454
f60d391f
SM
44552012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4456
4a0e1924 4457 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4458 error (bug#12677).
4459
1a9327d5
JD
44602012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4461
4462 * nsterm.m (ns_select): Check writefds before call to
4463 FD_ISSET (Bug#12668).
4464
14145a1e
DC
44652012-10-18 Daniel Colascione <dancol@dancol.org>
4466
4467 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4468 (staticpro): If we run out of staticpro slots, die with an
4469 informative error instead of just calling emacs_abort.
4470
1f76f6f5
MR
44712012-10-18 Martin Rudalics <rudalics@gmx.at>
4472
4473 Fix two flaws reported by Dmitry Antipov.
4474 * window.c (Ftemp_output_buffer_show): Remove.
4475 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4476 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4477
fcf14875
EZ
44782012-10-17 Eli Zaretskii <eliz@gnu.org>
4479
1f76f6f5
MR
4480 * makefile.w32-in ($(BLD)/w32.$(O)):
4481 ($(BLD)/vm-limit.$(O)):
4482 ($(BLD)/term.$(O)):
4483 ($(BLD)/unexw32.$(O)):
4484 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4485 ($(BLD)/dispnew.$(O)): Update dependencies.
4486
4487 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4488 Add prototypes.
4489
4490 * w32proc.c: Include ctype.h.
4491
4492 * w32.h (init_environment, check_windows_init_file)
4493 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4494 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4495 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4496 (sys_link): Add prototypes.
4497
4498 * w32.c: Include w32select.h.
4499 (sys_access, e_malloc, sys_select): Add prototypes.
4500 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4501
4502 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4503
4504 * unexw32.c: Include lisp.h and w32.h.
4505
4506 * term.c [WINDOWSNT]: Include w32term.h.
4507
4508 * process.c [WINDOWSNT]: Add prototype of sys_select.
4509
4510 * fileio.c [WINDOWSNT]: Include w32.h.
4511
4512 * dispnew.c [WINDOWSNT]: Include w32.h.
4513
fcf14875
EZ
4514 * cygw32.c (Fcygwin_convert_path_to_windows)
4515 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4516 Lisp_Object values. (Bug#12661)
4517
4518 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4519 to Lisp_Object. (Bug#12661)
4520
fe0b1ec4
KH
45212012-10-17 Kenichi Handa <handa@gnu.org>
4522
4523 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4524 invalidate.
4525
d556ebf9
DA
45262012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4527
4528 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4529 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4530
f0863a54
DA
45312012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4532
4533 Do not verify indirection counters of killed buffers (Bug#12579).
4534 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4535 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4536
12fbe755
DA
45372012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4538
4539 * alloc.c (Fmake_byte_code): Fix typo in comment.
4540 * print.c (print_interval): Define as static to match prototype.
4541 * indent.c (disptab_matches_widthtab, recompute_width_table):
4542 Convert to eassert.
4543
61655b89
DA
45442012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4545
4546 * editfns.c (get_system_name): Remove.
4547 * lisp.h (get_system_name): Remove prototype.
4548 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4549 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4550
9520f2f2
DC
45512012-10-15 Daniel Colascione <dancol@dancol.org>
4552
4553 * dbusbind.c: Add comment explaining reason for previous change.
4554
dca778d5
MR
45552012-10-15 Martin Rudalics <rudalics@gmx.at>
4556
4557 * window.c (Fwindow_end): Rewrite check whether cached position
4558 can be used (Bug#12600).
4559 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4560 Set windows_or_buffers_changed.
4561
3e0341b0
DC
45622012-10-15 Daniel Colascione <dancol@dancol.org>
4563
4564 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4565 enabled by undefining the symbol "interface", which the platform
4566 headers define to something incompatible.
4567
33d4113c
DC
45682012-10-14 Daniel Colascione <dancol@dancol.org>
4569
4570 * image.c (init_tiff_functions, init_imagemagick_functions)
4571 (init_svg_functions): Fix cygw32 build break by using these
4572 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4573
a36fb15e
JD
45742012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4575
4576 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4577
537f336d
JD
45782012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4579
4580 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4581
0ba06a77
KH
45822012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4583
4584 * coding.c (detect_coding): Set coding->id before calling
4585 this->detector.
4586
ce2fe65a
AS
45872012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4588
4589 * fileio.c: Formatting fixes.
4590
d6453ce4
PE
45912012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4592
4593 Fix some stat-related races.
4594 * fileio.c (Fwrite_region): Avoid race condition if a file is
4595 removed or renamed by some other process immediately after Emacs
4596 writes it but before Emacs stats it. Do not assume that stat (or
4597 fstat) succeeds.
4598 * image.c (slurp_file): Resolve the file name with fopen + fstat
4599 rather than stat + fopen.
4600 (pbm_read_file) [0]: Remove unused code with stat race.
4601 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4602 Remove ineffective code with stat race.
4603
06485aa8
SM
46042012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4605
4606 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4607
167e3640
JD
46082012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4609
4610 * nsterm.m (hold_event_q): New static variable.
4611 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4612 ! q_event_ptr.
4613 (hold_event): New function.
4614 (ns_read_socket): If hold_event_q have events, store them and
4615 return (Bug#12384).
4616 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4617 is zero (Bug#12384).
4618
c40239df
JB
46192012-10-12 Juanma Barranquero <lekktu@gmail.com>
4620
4621 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4622
bb385a92
EZ
46232012-10-12 Eli Zaretskii <eliz@gnu.org>
4624
2a9f1099
EZ
4625 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4626
bb385a92
EZ
4627 * fileio.c (check_existing): New function.
4628 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4629 instead of calling 'stat', when what's needed is to check whether
4630 a file exists. This avoids expensive system calls on MS-Windows.
4631 (Bug#12587)
4632
8599b23a 4633 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
4634
4635 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4636 determine whether a file exists and is not a directory.
4637
4638 * lisp.h (check_existing): Add prototype.
4639
2b9c2e68
JD
46402012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4641
4642 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4643
81749a23
GM
46442012-10-12 Glenn Morris <rgm@gnu.org>
4645
4646 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4647
5253a5fd
SM
46482012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4649
389a94a5
SM
4650 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4651
5253a5fd
SM
4652 * eval.c (Fautoload): Remember previous autoload status in load-history.
4653
7cded46f
PE
46542012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4655
4656 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4657 * lread.c (load_each_byte, new_backquote_flag, readchar)
4658 (read_filtered_event, lisp_file_lexically_bound_p)
4659 (safe_to_load_version, Fload, complete_filename_p, openp)
4660 (build_load_history, readevalloop, read_escape, read1)
4661 (string_to_number, read_vector, read_list):
4662 * macros.c (Fstart_kbd_macro):
4663 * marker.c (CONSIDER):
4664 * menu.c (parse_single_submenu, digest_single_submenu)
4665 (find_and_return_menu_selection, Fx_popup_menu):
4666 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4667 (Ftry_completion):
4668 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4669 (ns_menu_show):
4670 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4671 (xmenu_show, xdialog_show):
4672 Use bool for booleans.
4673 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4674 as it's not a predicate. All uses changed. Omit unnecessary
4675 buffer termination.
4676
549c3414
DA
46772012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4678
4679 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4680 (save_excursion_restore): Do not restore mark if it was not saved.
4681
e85aafe7
PE
46822012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4683
fd2f90cf
PE
4684 * marker.c (cached_modiff): EMACS_INT, not int.
4685
c1af190b
PE
4686 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4687 instead of having a wrong decl.
e85aafe7
PE
4688 * nsmenu.m (waiting_for_input): Remove wrong decl.
4689
e738ca56
PE
46902012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4691
9fa1de30
PE
4692 keyboard.c, keymap.c: Use bool for booleans.
4693 * dispnew.c (sit_for): Distinguish between 3-way display_option
4694 and boolean do_display.
4695 * keyboard.c (single_kboard, this_command_key_count_reset)
4696 (waiting_for_input, echoing, immediate_quit, input_pending)
4697 (interrupt_input, interrupts_deferred, pop_kboard)
4698 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4699 (command_loop_1, adjust_point_for_property)
4700 (safe_run_hooks_error, input_polling_used, read_char):
4701 (help_char_p, readable_events, kbd_buffer_events_waiting)
4702 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4703 (lucid_event_type_list_p, get_input_pending):
4704 (gobble_input, menu_separator_name_p, menu_bar_item)
4705 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4706 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4707 (keyremap_step, test_undefined, read_key_sequence)
4708 (detect_input_pending, detect_input_pending_ignore_squeezables)
4709 (detect_input_pending_run_timers, requeued_events_pending_p)
4710 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4711 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4712 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4713 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4714 (accessible_keymaps_1, Fkey_description, push_key_description):
4715 (shadow_lookup, struct where_is_internal_data)
4716 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4717 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4718 (describe_map, describe_vector):
4719 * menu.c (single_menu_item):
4720 * nsmenu.m (ns_update_menubar):
4721 * process.c (wait_reading_process_output):
4722 * search.c (scan_buffer, scan_newline):
4723 Use bool for boolean.
4724 * keyboard.c (timers_run, swallow_events)
4725 (detect_input_pending_run_timers):
4726 * process.c (wait_reading_process_output):
4727 Use unsigned for counter where wraparound-on-overflow is desired,
4728 since unsigned is guaranteed to have that behavior and signed is not.
4729 (read_char): Use ptrdiff_t for string length.
4730 (get_input_pending): Remove first argument, since it was always
4731 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4732 and behave as if it had that value. Return new value of
4733 input_pending. All callers changed.
4734 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4735 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4736 a string length.
4737 * keymap.c (push_key_description): Omit last arg, which was always 1.
4738 All callers changed.
4739
e738ca56
PE
4740 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4741
29f21cdf
JB
47422012-10-10 Juanma Barranquero <lekktu@gmail.com>
4743
4744 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4745 ($(BLD)/term.$(O)): Update dependencies.
4746
6aea7528
DA
47472012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4748
4749 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4750 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4751 initializer for PVEC_NORMAL_VECTOR.
4752
5f3f57be
PE
47532012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4754
4755 Clean out old termopts cruft.
4756 * termopts.h (flow_control, meta_key): Remove unused decls.
4757 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4758 Don't include termopts.h.
4759
3e98c68e
DA
47602012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4761
4762 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4763
77e344e5
PE
47642012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4765
4766 * commands.h (immediate_quit): Remove duplicate decl.
4767
5683d7cd
JD
47682012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4769
4770 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4771 caching.
4772 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 4773 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 4774
cf5fc6db
EZ
47752012-10-09 Eli Zaretskii <eliz@gnu.org>
4776
b15736e6
EZ
4777 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4778 match what GetLastError returns. Explain why the function is
4779 needed.
4780
cf5fc6db
EZ
4781 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4782 'is_tooltip_frame', to avoid confusion with its global namesake.
4783
f99714ce
DC
47842012-10-08 Daniel Colascione <dancol@dancol.org>
4785
4786 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
4787 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4788 build that caused Emacs to display the hourglass cursor forever.
f99714ce 4789
fd59cb29
GM
4790 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4791 which is broken under remote desktop, calculate the number of
4792 colors available for a display based on the display's number of
4793 planes and number of bits per pixel per plane. (bug#10397).
4794
62c480c9 47952012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 4796
62c480c9
JD
4797 * nsfont.m (Vfonts_in_cache): New variable.
4798 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4799 are used. Add cached fonts to Vfonts_in_cache.
4800 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4801
607446ba
JB
48022012-10-08 Juanma Barranquero <lekktu@gmail.com>
4803
fd5125ad
JB
4804 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4805 in nt/config.nt.
46979e0b
JB
4806 (FONT_H): Define after FRAME_H.
4807 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4808 Update dependencies.
fd5125ad 4809
607446ba
JB
4810 * w32term.c: Remove leftover declaration of keyboard_codepage.
4811
b6f4e300
EZ
48122012-10-08 Eli Zaretskii <eliz@gnu.org>
4813
c54ebba4
EZ
4814 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4815 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4816 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4817 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
4818 ($(BLD)/unexw32.$(O)):
4819 ($(BLD)/w32.$(O)):
4820 ($(BLD)/w32console.$(O)):
4821 ($(BLD)/w32fns.$(O)):
4822 ($(BLD)/w32heap.$(O)):
4823 ($(BLD)/w32menu.$(O)):
15c720a3 4824 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 4825
b6f4e300
EZ
4826 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4827 'const char *'.
4828 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4829
501199a3
DC
48302012-10-08 Daniel Colascione <dancol@dancol.org>
4831
4832 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4833 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4834 accidental message numbering hole. Change other messages to
4835 match.
4836
4837 * w32select.h (HAVE_W32SELECT): Remove.
4838
4839 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 4840 w32common.h instead of w32heap.h.
501199a3
DC
4841
4842 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4843 (get_allocation_unit, get_processor_type, get_w32_major_version)
4844 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4845 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4846 (OS_NT, os_subtype, cache_system_info): Move declarations to
4847 w32common.
4848
4849 * w32heap.c: Include w32common.h.
4850 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
4851 (w32_minor_version, w32_build_number, w32_subtype):
4852 Remove duplicate definitions.
501199a3
DC
4853
4854 * w32fns.c: Include w32common.h; include w32heap.h only in
4855 WINDOWSNT.
4856
4857 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4858 Use `report_file_error' instead of `error' in order to better
4859 inform users of what went wrong. Increase NTGUI_UNICODE file
4860 dialog box file name length to 32k, the maximum allowed by the NT
4861 kernel.
4862
4863 * w32common.h: New file.
4864 (ROUND_UP, ROUND_DOWN, get_page_size)
4865 (get_allocation_unit, get_processor_type, get_w32_major_version)
4866 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4867 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4868 (OS_NT, os_subtype, cache_system_info): Move here.
4869
4870 * unexw32.c, unexcw.c: Include w32common.h.
4871
4872 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4873 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4874 to call syms_of_w32select.
4875
4876 * cygw32.h: Remove obsolete EXFUN declarations.
4877
4878 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4879
4880 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4881 of w32inevt.o from SOME_MACHINE_OBJECTS.
4882
93aa5c81
DC
48832012-10-08 Daniel Colascione <dancol@dancol.org>
4884
4885 * image.c: Permanent fix for JPEG compilation issue --- limit
4886 jpeglib `boolean' redefinition to Cygwin builds.
4887
d424f3d8
EZ
48882012-10-08 Eli Zaretskii <eliz@gnu.org>
4889
8ee4c6ce
EZ
4890 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4891
d424f3d8
EZ
4892 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4893 Cygwin.
4894
e08348a0
DC
48952012-10-08 Daniel Colascione <dancol@dancol.org>
4896
4897 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4898 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4899 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4900 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4901 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4902 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4903 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4904 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4905 now a supported configuration.
4906
4907 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 4908 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
4909
4910 * conf_post.h:
4911 (_DebPrint) declare tracing facility for W32 debugging. We need
4912 to unify tracing later.
4913
4914 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4915 unconditional use of W32 Unicode functions. Cygwin runs only on
4916 100% Unicode operating systems.
4917
4918 * cygw32.c: New file. Define Cygwin-specific facilities.
4919 (Fcygwin_convert_path_to_windows)
4920 (Fcygwin_convert_path_from_windows): New user functions for
4921 accessing Cygwin path-munging routines.
4922
4923 * cygw32.h: New file.
4924 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4925 UTF-16LE strings temporarily inside non-Lisp-visible string
4926 objects.
4927
4928 (w32_strerror): Just what it says on the tin.
4929
4930 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4931 also run for Cygwin; both systems have the same problem with using
4932 GUI facilities in a forked child. Also call syms_of_cygw32,
4933 syms_of_w32select in correct places.
4934
4935 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4936 needs fork-then-exec for daemon launching.
4937
4938 * font.h: Include frame.h.
4939
4940 * image.c: Use the image library cache machinery only when we're
4941 compiling for native WINDOWSNT; Cygwin can use shared libraries
4942 like any other Unixlike system.
4943
4944 * keyboard.c: Clarify a comment regarding the input loop.
4945
4946 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4947 functions directly instead of trying to detect at runtime that our
4948 host operating system supports them. We make this change for two
4949 reasons: Cygwin lacks support for the multibyte character
4950 conversion functions used by the legacy menu code, and Cygwin
4951 never needs to rely on non-Unicode APIs.
4952
4953 * unexw32.c (hinst): Declare extern.
4954
4955 * w32.c: Change header order;
4956 (w32_strerror): Move to w32fns.c because we need it for
4957 non-WINDOWSNT builds.
4958
4959 * w32.h: Add #error macro to make sure we don't include w32.h for
4960 Cygwin builds. Remove w32select declarations.
4961
4962 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4963 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4964
4965 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4966 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4967 POSIXy alternative.
4968 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4969 (w32_major_version, w32_minor_version, w32_build_number)
4970 (os_subtype, sound_type): Define here
4971 (w32_defined_color): Make color parameter const for consistency
4972 with other _defined_color functions.
4973 (w32_createwindow): Unconditionally call w32_init_class instead of
4974 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4975 through the code is complex and unnecessary because class
4976 registration is practically free.
4977 (w32_name_of_message): New EMACSDEBUG-only function.
4978 (Fset_message_beep): Move here
4979 (Fx_open_connection): Require that the display name for Windows be
4980 "w32" for consistency, emacsclient disambiguation, and maybe, one
4981 day, multi-window-system support.
4982 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4983 Cygwin files for W32 GUI facilities, since these clearly don't
4984 expect Cygwin names.
4985 (_DebPrint): Define.
4986 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4987 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4988 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4989 (w32_last_error): Remove.
4990
4991 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4992
4993 * w32heap.c (syspage_mask): Declare here.
4994 (cache_system_info): Remove.
4995
4996 * w32inevt.c (faked_key): Define globally, not statically.
4997 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4998 (w32_console_toggle_lock_key): Move to w32fns.c.
4999
5000 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5001
5002 * w32proc.c (_DebPrint): Move to w32fns.c.
5003 * w32select.c: Include string.h, stdio.h for Cygwin.
5004 * w32select.h: New File.
5005
5006 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5007 get_osfhandle.
5008 (w32_message_fd): New variable. Under Cygwin, holds the file
5009 descriptor the system used to tell us about pending thread
5010 messages.
5011
5012 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5013 that prevented compilation under non-WINDOWSNT systems.
5014
5015 (w32_initialize): Open /dev/windows and assign it to
5016 w32_message_fd. Provide w32 feature.
5017
5018 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5019 (WM_EMACS_INPUT_READY): add.
5020 (prepend_msg, w32_message_fd): Declare globally.
5021
5022 * w32xfns.c:
5023 (keyboard_handle): Use only when WINDOWSNT.
5024 (notify_msg_ready): New function. Posts a message to the main
5025 thread's message queue under CYGWIN, which wakes up the main
5026 thread from select(2) by making the /dev/windows file descriptor
5027 ready. Under WINDOWSNT, it sets an event the same way the old
5028 code did.
5029
5030 (post, prepend_msg): Actually call notify_msg_ready instead of
5031 setting the input event directly.
5032
98daa893
EZ
50332012-10-07 Eli Zaretskii <eliz@gnu.org>
5034
5035 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5036 but it still has blocs in it, don't return it to the system,
5037 instead of aborting. (Bug#12402)
5038
3bc0a2f7
JD
50392012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5040
8ad5b73b 5041 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5042
335f5ae4
JD
5043 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5044 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5045 (syms_of_nsterm): Remove comment about Panther and above for
5046 ns-antialias-text.
335f5ae4
JD
5047 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5048 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5049 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5050
5051 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5052 MAC_OS_X_VERSION_10_4.
5053
8ad5b73b
JD
5054 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5055 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5056
5057 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5058
5059 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5060 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5061
3bc0a2f7
JD
5062 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5063 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5064 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5065 Remove ns_in_resize check.
3bc0a2f7
JD
5066 (ns_clear_frame_area): Remove resize handle code.
5067
5068 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5069 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5070 Remove ns_in_resize check.
3bc0a2f7 5071
c622b48f
PE
50722012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5073
5074 Improve sys_siglist detection.
5075 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5076 defined as a macro, as is done in Solaris.
5077 (sys_siglist_entries): New macro.
5078 (save_strsignal): Use it.
5079 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5080 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5081
04fafa46
JD
50822012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5083
5084 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5085 fullscreen/Fullscreen.
5086
5087 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5088 tobar_height is new.
5089
5090 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5091 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5092 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5093 (windowDidResize:): Check for correct window if old style fullscreen.
5094 Capitalize word in comment. Remove incorrect comment.
5095 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5096 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5097 error in drawing background.
1f9f395d 5098 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5099 Set toolbar values to zero, save old height in tobar_height.
5100 Restore tool bar height when leaving fullscreen.
5101 (canBecomeMainWindow): New function.
5102
c6e21c03
PE
51032012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5104
5105 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5106
0d9f584b
EZ
51072012-10-05 Eli Zaretskii <eliz@gnu.org>
5108
a65fbb5f
EZ
5109 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5110
0d9f584b 5111 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5112 that time stamps of directories could also be changed.
5113 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5114 FILE_WRITE_ATTRIBUTES access rights.
5115
5116 * fileio.c (Fset_file_times): Special-case ignoring errors for
5117 directories only on MSDOS, not on MS-Windows.
5118
e8757f09 51192012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5120
5121 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5122
7604f298
EZ
51232012-10-04 Eli Zaretskii <eliz@gnu.org>
5124
5125 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5126 see whether CreateFile failed.
5127
88d69b7d
PE
51282012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5129
5130 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5131 to avoid similar races.
5132 * keyboard.c (pending_signals): Now bool, not int.
5133
7509f454
PE
5134 Port timers to OpenBSD, plus check for timer failures.
5135 OpenBSD problem reported by Han Boetes.
5136 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5137 and/or setitimer.
5138 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5139 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5140 like OpenBSD, which has timer_settime but does not declare it.
5141 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5142 whether to use itimerspec-related primitives. All uses of
5143 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5144
a3c5c0c5
PE
51452012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5146
5147 * profiler.c (handle_profiler_signal): Fix a malloc race
5148 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5149
914e743b
JD
51502012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5151
5152 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5153
d8ab37a8
EZ
51542012-10-02 Eli Zaretskii <eliz@gnu.org>
5155
5156 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5157 consistent with the change in return value of 'safe_strsignal'.
5158
b3ecad33
PE
51592012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5160
0a99eee1
PE
5161 Prefer plain 'static' to 'static inline' (Bug#12541).
5162 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5163 (bidi_set_sor_type, bidi_push_embedding_level)
5164 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5165 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5166 (bidi_cache_search, bidi_cache_ensure_space)
5167 (bidi_cache_iterator_state, bidi_cache_find)
5168 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5169 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5170 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5171 Now 'static', not 'static inline'.
5172
b3ecad33
PE
5173 Count overruns when profiling; change units to ns.
5174 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5175 Give extra weight to samples after overruns, to attempt to count
5176 the time more accurately.
5177 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5178 the underlying primitives nominally do ns.
5179 (Fprofiler_cpu_start): Document the change. Mention that
5180 the sampling intervals are only approximate.
5181
090cf9db
SM
51822012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5183
5184 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5185
5186 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5187 case for the special 0 coding-system.
5188
5189 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5190 (Fmake_overlay): Remove redundant tests.
64edc777 5191 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5192
81550bf4
JB
51932012-10-02 Juanma Barranquero <lekktu@gmail.com>
5194
5195 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5196 Update dependencies.
5197
aa1ba90e
PE
51982012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5199
5200 Fix a malloc race condition involving strsignal.
5201 A signal can arrive in the middle of a malloc, and Emacs's signal
5202 handler can invoke strsignal, which can invoke malloc, which is
5203 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5204 Fix it by altering the signal handler so that it does not invoke
5205 strsignal.
5206 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5207 * process.c (status_message): Use const pointer, in case strsignal
5208 is #defined to safe_strsignal.
5209 * sysdep.c (sys_siglist, init_signals): Always define and
5210 initialize a substitute sys_siglist if the system does not define
5211 one, even if HAVE_STRSIGNAL.
5212 (safe_strsignal): Rename from strsignal. Always define,
5213 using sys_siglist. Return a const pointer.
5214 * syssignal.h (safe_strsignal): New decl.
5215 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5216
ace917bd
EZ
52172012-10-01 Eli Zaretskii <eliz@gnu.org>
5218
5219 * w32proc.c (timer_loop): Fix code that waits for timer
5220 expiration, to avoid high CPU usage.
5221
9eb71b9c
SM
52222012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5223
5224 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5225 (sweep_weak_table): Remove redundant prototypes.
5226
b3317662
FP
52272012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5228
5229 * emacs.c: Move the inclusion of TERM_HEADER after including
5230 windows.h on WINDOWSNT. This avoids compilation problems with
5231 MSVC.
5232
f0e5f225
EZ
52332012-10-01 Eli Zaretskii <eliz@gnu.org>
5234
2d7d1608
EZ
5235 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5236 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5237 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5238 as the previous version used 'void *'.
5239
5240 * ralloc.c (ROUNDUP): Fix last change.
5241 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5242 'size_t'.
5243
f0e5f225
EZ
5244 * w32proc.c <disable_itimers>: New static flag.
5245 (init_timers): Initialize it to zero, after creating the critical
5246 sections used by the timer threads.
5247 (term_timers): Set to 1 before deleting the critical sections.
5248 (getitimer, setitimer): If disable_itimers is non-zero, return an
5249 error indication without doing anything. Reported by Fabrice
5250 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5251 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5252 return results.
5253 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5254 support timers.
f0e5f225
EZ
5255
5256 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5257 term_ntproc after all the other bookkeeping, to get timers working
5258 as long as possible.
5259
82ef37c1
PE
52602012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5261
b3a4c387
PE
5262 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5263 Suggested by Juri Linkov in
5264 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5265
b0ab8123
PE
5266 Prefer plain 'static' to 'static inline' (Bug#12541).
5267 With static functions, modern compilers inline pretty well by
5268 themselves; advice from programmers often hurts as much as it helps.
5269 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5270 this change shrinks the text size of the Emacs executable by 1.1%
5271 without affecting CPU significantly in my benchmark.
5272 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5273 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5274 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5275 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5276 (bset_auto_fill_function, bset_auto_save_file_format)
5277 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5278 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5279 (bset_cache_long_line_scans, bset_case_fold_search)
5280 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5281 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5282 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5283 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5284 (bset_header_line_format, bset_indicate_buffer_boundaries)
5285 (bset_indicate_empty_lines, bset_invisibility_spec)
5286 (bset_left_fringe_width, bset_major_mode, bset_mark)
5287 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5288 (bset_name, bset_overwrite_mode, bset_pt_marker)
5289 (bset_right_fringe_width, bset_save_length)
5290 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5291 (bset_scroll_up_aggressively, bset_selective_display)
5292 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5293 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5294 (set_buffer_overlays_after):
5295 * category.c (bset_category_table):
5296 * charset.c (read_hex):
5297 * coding.c (produce_composition, produce_charset)
5298 (handle_composition_annotation, handle_charset_annotation)
5299 (char_encodable_p):
5300 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5301 (assign_row, set_frame_matrix_frame, make_current)
5302 (add_row_entry):
5303 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5304 * fns.c (maybe_resize_hash_table):
5305 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5306 * gmalloc.c (register_heapinfo):
5307 * image.c (lookup_image_type):
5308 * intervals.c (set_interval_object, set_interval_left)
5309 (set_interval_right, copy_interval_parent, rotate_right)
5310 (rotate_left, balance_possible_root_interval):
5311 * keyboard.c (kset_echo_string, kset_kbd_queue)
5312 (kset_keyboard_translate_table, kset_last_prefix_arg)
5313 (kset_last_repeatable_command, kset_local_function_key_map)
5314 (kset_overriding_terminal_local_map, kset_real_last_command)
5315 (kset_system_key_syms, clear_event, set_prop):
5316 * lread.c (digit_to_number):
5317 * marker.c (attach_marker, live_buffer, set_marker_internal):
5318 * nsterm.m (ns_compute_glyph_string_overhangs):
5319 * process.c (pset_buffer, pset_command)
5320 (pset_decode_coding_system, pset_decoding_buf)
5321 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5322 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5323 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5324 * syntax.c (bset_syntax_table, dec_bytepos):
5325 * terminal.c (tset_param_alist):
5326 * textprop.c (interval_has_some_properties)
5327 (interval_has_some_properties_list):
5328 * window.c (wset_combination_limit, wset_dedicated)
5329 (wset_display_table, wset_hchild, wset_left_fringe_width)
5330 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5331 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5332 (wset_right_fringe_width, wset_right_margin_cols)
5333 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5334 (wset_vertical_scroll_bar_type, wset_window_parameters):
5335 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5336 (wset_column_number_displayed, wset_region_showing)
5337 (window_box_edges, run_window_scroll_functions)
5338 (append_glyph_string_lists, prepend_glyph_string_lists)
5339 (append_glyph_string, set_glyph_string_background_width)
5340 (append_glyph, append_composite_glyph)
5341 (take_vertical_position_into_account):
5342 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5343 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5344 (lface_hash, lface_same_font_attributes_p, lookup_face):
5345 * xml.c (libxml2_loaded_p):
5346 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5347 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5348 Now 'static', not 'static inline'.
5349
05584c31
PE
5350 * bidi.c: Tune.
5351 (bidi_copy_it): Do the whole copy with a single memcpy.
5352 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5353
86ec63ba
PE
5354 Revert the FOLLOW-SYMLINKS change for file-attributes.
5355 Doing it right would require several changes to Tramp, and there's
5356 not enough time to get that tested before the freeze today.
5357 * dired.c (directory_files_internal, Ffile_attributes):
5358 Undo last change.
5359
82ef37c1
PE
5360 * frame.c (x_report_frame_params): Port better to wider ints.
5361 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5362 or that pointers can be printed in 15 decimal digits.
5363 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5364
62aba0d4
FP
53652012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5366
5367 Support x64 build on MS-Windows.
5368 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5369 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5370 compatibility with x64.
5e4daaf3 5371 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5372
5373 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5374 defining an XRectangle structure.
5375
5376 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5377 arithmetics for compatibility with x64.
5378
5379 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5380 compatibility with x64.
5381
5382 * w32heap.h: Adjust prototypes and declarations.
5383
5384 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5385 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5386 DWORD, long, and unsigned long, for compatibility with x64.
5387 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5388 (sbrk): Argument is now of type ptrdiff_t.
5389
5390 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5391 less than 0x0500.
5392 (w32_msg_pump): Use WPARAM type for 'result'.
5393
5394 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5395 architecture.
5396 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5397 compatibility with x64.
5398
5399 * vm-limit.c (lim_data): Now size_t.
5400 (check_memory_limits): Adjust prototypes of real_morecore and
5401 __morecore to receive argument of type ptrdiff_t. Use size_t for
5402 five_percent and data_size.
5403
5404 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5405 variables, for compatibility with x64.
5406 (rva_to_section, offset_to_section, relocate_offset)
5407 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5408 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5409 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5410 for compatibility with x64.
5411
5412 * sysdep.c (STDERR_FILENO): Define if not already defined.
5413
5414 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5415 (__morecore): Argument type is now ptrdiff_t.
5416 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5417 (relinquish): Use ptrdiff_t type for 'excess'.
5418 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5419
5420 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5421 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5422 instead of a literal number.
5423
5424 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5425 (min): Define only if not already defined.
5426
5427 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5428 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5429 hosts.
5430
5431 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5432 'bitmaps' is a pointer.
5433
5434 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5435
5436 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5437
e7a2937b
PE
54382012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5439
5440 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5441 * dired.c (directory_files_internal, Ffile_attributes):
5442 New arg follow_symlinks. All uses changed.
5443
b43d62ae
SM
54442012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5445
5446 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5447
c06c382a
EZ
54482012-09-30 Eli Zaretskii <eliz@gnu.org>
5449
5450 Support atimers and CPU profiler via profile.c on MS-Windows.
5451 * w32proc.c (sig_mask, crit_sig): New static variables.
5452 (sys_signal): Support SIGALRM and SIGPROF.
5453 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5454 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5455 sigfillset, and sigprocmask are no longer no-ops.
5456 (sigismember): New function.
5457 (struct itimer_data): New definition.
5458 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5459 (crit_prof): New static variables.
5460 (MAX_SINGLE_SLEEP): New definition.
5461 (timer_loop, stop_timer_thread, term_timers, init_timers)
5462 (start_timer_thread, getitimer, setitimer): New functions.
5463 (alarm): No longer a no-op, calls setitimer.
5464
5465 * w32.c (term_ntproc): Call term_timers.
5466 (init_ntproc): Make sure all signals are unblocked at startup, to
5467 erase any traces of dumping. Call init_timers.
5468
5469 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5470 Windows-specific code to display the hourglass mouse pointer is no
5471 longer used.
5472 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5473 to hourglass timer expiration.
5474 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5475 Remove, no longer used.
b43d62ae
SM
5476 (w32_note_current_window, show_hourglass, hide_hourglass):
5477 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5478 window systems.
5479 (syms_of_w32fns): Don't initialize hourglass_timer.
5480
5481 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5482 WINDOWSNT as well.
5483 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5484
5485 * w32.h (init_timers, term_timers): Add prototypes.
5486
95402d5f
KH
54872012-09-30 Kenichi Handa <handa@gnu.org>
5488
5489 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5490 to the buffer relocation which may be caused by ccl_driver.
5491
dd946752
JD
54922012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5493
d7e642cc
JD
5494 * xfns.c (Fx_file_dialog): Update comment.
5495
5496 * w32fns.c (Fx_file_dialog): Update comment.
5497
5498 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5499 Initialize panel name field if OSX >= 10.6.
5500
5501 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5502
dd946752
JD
5503 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5504
5505 * nsterm.m (NEW_STYLE_FS): New define.
5506 (ns_fullscreen_hook, windowWillEnterFullScreen)
5507 (windowDidEnterFullScreen, windowWillExitFullScreen)
5508 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5509 (setFSValue): New functions.
5510 (EmacsFSWindow): New implementation.
5511 (canBecomeKeyWindow): New function for EmacsFSWindow.
5512 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5513 (dealloc): Release nonfs_window if in fullscreen.
5514 (updateFrameSize:): Call windowDidMove to update top/left.
5515 (windowWillResize:toSize:): Check if frame is still maximized.
5516 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5517 next_maximized, maximized_width, maximized_height and nonfs_window.
5518 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5519 tbar_height.
5520 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5521 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5522
5523 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5524 (EmacsView): Add variables for fullscreen.
5525 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5526 (EmacsFSWindow): New interface for fullscreen.
5527
427730eb
JB
55282012-09-30 Juanma Barranquero <lekktu@gmail.com>
5529
5530 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5531
48de8b12
CY
55322012-09-30 Chong Yidong <cyd@gnu.org>
5533
5534 * fns.c (Frandom): Doc fix.
5535
5938d519
MR
55362012-09-30 Martin Rudalics <rudalics@gmx.at>
5537
5538 * window.c (Vwindow_combination_limit): New default value.
5539 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5540
cb5b0266
PE
55412012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5542
5543 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5544 Suggested by Eli Zaretskii in
5545 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5546
84f72efd
EZ
55472012-09-30 Eli Zaretskii <eliz@gnu.org>
5548
5549 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5550 HAVE_TIMER_SETTIME is defined.
5551
9d4dcdc9
PE
55522012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5553
d89460ed
PE
5554 Profiler improvements: more-accurate timers, overflow checks.
5555 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5556 signal.h, setjmp.h. Include systime.h instead.
5557 (saturated_add): New function.
5558 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5559 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5560 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5561 New static vars.
84f72efd 5562 (enum profiler_cpu_running): New enum.
d89460ed
PE
5563 (profiler_cpu_running): Now of that enum type, not bool.
5564 All uses changed to store the new value.
5565 (handle_profiler_signal): Rename from sigprof_handler_1,
5566 for consistency with other handlers. Do not check whether
5567 cpu_log is a hash-table if garbage collecting, since it
5568 doesn't matter in that case.
5569 (deliver_profiler_signal): Rename from sigprof_handler,
5570 for consistency with other handlers.
5571 (setup_cpu_timer): New function, with much of what used to be in
5572 Fprofiler_cpu_start. Check for out-of-range argument.
5573 Prefer timer_settime if available, and prefer
5574 thread cputime clocks, then process cputime clocks, then
5575 monotonic clocks, to the old realtime clock. Use make_timeval
5576 to round more-correctly when falling back to setitimer.
5577 (Fprofiler_cpu_start): Use it.
5578 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5579 Don't assume that passing NULL as the 2nd argument of setitimer
5580 is the same as passing a pointer to all-zero storage.
5581 Ignore SIGPROF afterwards.
5582 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5583 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5584 non-fatal signal handlers. Ignore SIGPROF on startup.
5585 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5586 in profiler.c, since sysdep.c now uses it.
5587
9d4dcdc9
PE
5588 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5589 Suggested by Eli Zaretskii in
5590 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5591
8e5691a0
JB
55922012-09-29 Juanma Barranquero <lekktu@gmail.com>
5593
5594 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5595
e7c1b6ef
SM
55962012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5597
5598 * lisp.h (struct backtrace): Remove indirection for `function' field.
5599 * xdisp.c (redisplay_internal):
5600 * profiler.c (record_backtrace, sigprof_handler_1):
5601 * alloc.c (Fgarbage_collect):
5602 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5603 (Fbacktrace_frame): Adjust accordingly.
5604
e61d39cd 56052012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
5606
5607 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5608 (Frun_hook_with_args_until_failure): Doc fixes.
5609
404043ea
EZ
56102012-09-28 Eli Zaretskii <eliz@gnu.org>
5611
5612 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5613 Qautomatic_redisplay and change the symbol name. All users changed.
5614
704d3f45
TM
56152012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5616
5617 * profiler.c (sigprof_handler): Fix race condition.
5618
757140ff
GM
56192012-09-28 Glenn Morris <rgm@gnu.org>
5620
5621 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5622
a615a3ae
PE
56232012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5624
5625 Check more robustly for timer_settime.
89d17fd0
PE
5626 * Makefile.in (LIB_TIMER_TIME): New macro.
5627 (LIBES): Add it.
a615a3ae
PE
5628 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5629 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5630 call timer_settime.
5631
3670daf7
TM
56322012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5633
5634 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5635
6a586b7f
JB
56362012-09-26 Juanma Barranquero <lekktu@gmail.com>
5637
5638 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5639
41c8bfcf
PE
56402012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5641
5642 * character.h (MAYBE_UNIFY_CHAR): Remove.
5643 * charset.c, charset.h (maybe_unify_char): Now static.
5644 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5645 Since this stuff is now private to charset.c, there's no need for
5646 a public macro and no need to inline by hand.
5647
3a880af4 56482012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
5649 Stefan Monnier <monnier@iro.umontreal.ca>
5650 Juanma Barranquero <lekktu@gmail.com>
611b7507 5651
3a880af4
SM
5652 * profiler.c: New file.
5653 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5654 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5655 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5656 * emacs.c (main): Call syms_of_profiler.
5657 * alloc.c (Qautomatic_gc): New constant.
5658 (MALLOC_PROBE): New macro.
5659 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5660 (total_bytes_of_live_objects): New function.
5661 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5662 Call malloc_probe for the memory profiler.
5663 (syms_of_alloc): Define Qautomatic_gc.
5664 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5665 race condition.
5666 (struct backtrace): Move definition...
5667 * lisp.h (struct backtrace): ..here.
5668 (Qautomatic_gc, profiler_memory_running): Declare vars.
5669 (malloc_probe, syms_of_profiler): Declare functions.
5670 * xdisp.c (Qautomatic_redisplay): New constant.
5671 (redisplay_internal): Record itself in backtrace_list.
5672 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 5673
5938d519 56742012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
56752012-09-25 Juanma Barranquero <lekktu@gmail.com>
5676
5677 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5678
e26fd2e4
PE
56792012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 Prefer POSIX timers if available.
5682 They avoid a race if the timer is too close to the current time.
5683 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5684 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 5685 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 5686
eedec3ee
EZ
56872012-09-25 Eli Zaretskii <eliz@gnu.org>
5688
5689 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5690 CHAR_STRING_ADVANCE.
5691 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5692 STRING_CHAR_ADVANCE.
5693
aa15c6bb
JB
56942012-09-25 Juanma Barranquero <lekktu@gmail.com>
5695
5696 Move Vlibrary_cache to emacs.c and reset before dumping.
5697
5698 * lisp.h (reset_image_types): Declare.
5699 [WINDOWSNT] (Vlibrary_cache): Declare.
5700
5701 * image.c (reset_image_types): New function.
5702
5703 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5704 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5705 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5706
5707 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5708 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5709
5710 * w32.h (Vlibrary_cache): Do not declare.
5711
54d629be
EZ
57122012-09-25 Eli Zaretskii <eliz@gnu.org>
5713
16b22fef
EZ
5714 * w32proc.c (sys_signal): Handle all signals defined by the
5715 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5716 handlers for signals supported by Windows. Don't override
5717 term_ntproc as the handler for SIGABRT.
5718 (sigaction): Rewrite to call sys_signal instead of duplicating its
5719 code.
5720 (sys_kill): Improve commentary.
5721
5722 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5723 consistency with a signature of a signal handler. All callers
5724 changed.
5725 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5726 install term_ntproc as a signal handler for SIGABRT, as that
5727 should be done by the dumped Emacs.
5728
5729 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5730
5731 * w32select.c (term_w32select): Protect against repeated
5732 invocation by setting clipboard_owner to NULL after calling
5733 DestroyWindow.
5734
5735 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5736 and term_ntproc to their modified signatures.
5737
54d629be
EZ
5738 * character.c (char_string, string_char): Remove calls to
5739 MAYBE_UNIFY_CHAR. See the discussion starting at
5740 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5741 for the details.
5742
59f7af81
CY
57432012-09-25 Chong Yidong <cyd@gnu.org>
5744
5745 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5746
22e8cf4a
SM
57472012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5748
5749 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5750 when encountering an unknown bytecode.
5751
578098f3
PE
57522012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5753
5754 image.c, indent.c: Use bool for booleans.
5755 * dispextern.h (struct image_type): Members valid_p, load, init
5756 now return bool, not int. All uses changed.
5757 * image.c: Omit unnecessary static decls.
5758 (x_create_bitmap_mask, x_build_heuristic_mask):
5759 Return void, not int, since callers don't care about the return value.
5760 (x_create_bitmap_mask, define_image_type, valid_image_p)
5761 (struct image_keyword, parse_image_spec, image_spec_value)
5762 (check_image_size, image_background)
5763 (image_background_transparent, x_clear_image_1)
5764 (postprocess_image, lookup_image, x_check_image_size)
5765 (x_create_x_image_and_pixmap, xbm_image_p)
5766 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5767 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5768 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5769 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5770 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5771 (png_image_p, init_png_functions, png_load_body, png_load)
5772 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5773 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5774 (init_gif_functions, gif_load, imagemagick_image_p)
5775 (imagemagick_load_image, imagemagick_load, svg_image_p)
5776 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5777 (gs_load):
5778 * nsimage.m (ns_load_image):
5779 * nsterm.m (ns_defined_color):
5780 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5781 * xfns.c (x_defined_color):
5782 * xterm.c (x_alloc_lighter_color_for_widget)
5783 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5784 (x_alloc_lighter_color):
5785 * indent.c (disptab_matches_widthtab, current_column)
5786 (scan_for_column, string_display_width, indented_beyond_p)
5787 (compute_motion, vmotion, Fvertical_motion):
5788 Use bool for booleans.
5789
a5f2b6ec
CY
57902012-09-24 Chong Yidong <cyd@gnu.org>
5791
5792 * chartab.c (Fset_char_table_default): Obsolete function removed.
5793
18e27ea8
PE
57942012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5795
afea8a8a
PE
5796 Move pid_t related decls out of lisp.h.
5797 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5798 (interruptible_wait_for_termination):
5799 Move these decls from lisp.h to syswait.h, since they use pid_t.
5800 Needed on FreeBSD; see Herbert J. Skuhra in
5801 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5802 * callproc.c: Include syswait.h.
5803
18e27ea8
PE
5804 gnutls.c, gtkutil.c: Use bool for boolean.
5805 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5806 (emacs_gnutls_handle_error):
5807 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5808 (xg_hide_tooltip, xg_create_frame_widgets)
5809 (create_dialog, xg_uses_old_file_dialog)
5810 (xg_get_file_with_chooser, xg_get_file_with_selection)
5811 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5812 (xg_item_label_same_p, xg_update_menubar)
5813 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5814 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5815 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5816 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5817 (update_frame_tool_bar, free_frame_tool_bar):
5818 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5819 * nsmenu.m (ns_update_menubar):
5820 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5821 * xfns.c (Fx_show_tip) [USE_GTK]:
5822 Use bool for boolean.
5823 * gtkutil.c (xg_update_frame_menubar):
5824 * xmenu.c (update_frame_menubar):
5825 Return void, not int, since caller ignores return value.
5826 * gtkutil.c (xg_change_toolbar_position):
5827 Return void, not 1.
5828
af0e9f75
JB
58292012-09-23 Juanma Barranquero <lekktu@gmail.com>
5830
5831 * makefile.w32-in (BLOCKINPUT_H): Remove.
5832 (SYSSIGNAL_H): New macro.
5833 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5834 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5835 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5836 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5837 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5838 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5839 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5840 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5841 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5842 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5843 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5844 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5845 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5846 ($(BLD)/w32xfns.$(O)): Update dependencies.
5847
5101529e
EZ
58482012-09-23 Eli Zaretskii <eliz@gnu.org>
5849
5850 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5851 fatal_error_backtrace.
5852
5853 * w32proc.c (sys_kill): Undo last change: don't do anything when
5854 invoked to deliver SIGABRT to our own process. This is now
5855 handled by emacs_raise.
5856
2c3ee0ad
JB
58572012-09-23 Juanma Barranquero <lekktu@gmail.com>
5858
5859 * w32term.c (w32_read_socket): Remove leftover reference to
5860 interrupt_input_pending.
5861
62a1d661
PE
58622012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5863
5864 Do not use SA_NODEFER.
5865 Problem reported by Dani Moncayo in
5866 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5867 * alloc.c (die):
5868 * sysdep.c (emacs_abort): Do not reset signal handler.
5869 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5870 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5871 wanted even on POSIXish hosts, and it doesn't work on Windows.
5872
a0942b9a
JD
58732012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5874
5875 * xterm.c (x_term_init): Call fixup_locale before and after calling
5876 gtk_init (Bug#12392).
5877
d07ff9db
CY
58782012-09-23 Chong Yidong <cyd@gnu.org>
5879
5880 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5881 Vdynamic_library_alist.
5882
5883 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5884 (Fgnutls_available_p): Caller changed.
5885
5886 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5887 (Flibxml_parse_xml_region): Likewise.
5888
5889 * dispextern.h (struct image_type): Remove arg from init function.
5890
5891 * image.c (Finit_image_library, lookup_image_type)
5892 (define_image_type): Remove now-unneeded second arg.
5893 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5894 (init_tiff_functions, init_gif_functions, init_svg_functions):
5895 Arglist and w32_delayed_load calling convention changed.
5896 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 5897 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 5898
4d7e6e51
PE
58992012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5900
5901 Simplify and avoid signal-handling races (Bug#12471).
5902 * alloc.c (die):
5903 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5904 Avoid recursive loop if there's a fatal error in the function itself.
5905 * atimer.c (pending_atimers):
5906 * blockinput.h: Don't include "atimer.h"; no longer needed.
5907 (interrupt_input_pending): Remove. All uses removed.
5908 pending_signals now counts both atimers and ordinary interrupts.
5909 This is less racy than having three separate pending-signal flags.
5910 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5911 (input_blocked_p):
5912 Rename from their upper-case counterparts BLOCK_INPUT,
5913 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5914 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5915 This makes it easier to access volatile variables more accurately.
5916 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5917 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5918 that's more reliable if the code is buggy and sets
5919 interrupt_input_blocked to a negative value. All uses changed.
5920 * atimer.c (deliver_alarm_signal):
5921 Remove. No need to deliver this to the parent; any thread can
5922 handle this signal now. All uses replaced by underlying handler.
5923 * atimer.c (turn_on_atimers):
5924 * dispnew.c (handle_window_change_signal):
5925 * emacs.c (handle_danger_signal):
5926 * keyboard.c (kbd_buffer_get_event):
5927 Don't reestablish signal handler; not needed with sigaction.
5928 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5929 (UNBLOCK_INPUT_TO):
5930 Rework to avoid unnecessary accesses to volatile variables.
5931 (UNBLOCK_INPUT_TO): Now a function.
5932 (totally_unblock_input, unblock_input): New decls.
5933 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5934 (init_data): Remove. Necessary stuff now done in init_signal.
5935 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5936 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5937 (fatal_error_code): Remove; no longer needed.
5938 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5939 it doesn't always backtrace. All uses changed. No need to reset
5940 signal to default, since sigaction and/or die does that for us now.
5941 Use emacs_raise (FOO), not kill (getpid (), FOO).
5942 (main): Check more-accurately whether we're dumping.
5943 Move fatal-error setup to sysdep.c
5944 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5945 * gtkutil.c (xg_get_file_name, xg_get_font):
5946 Remove no-longer-needed signal-mask manipulation.
5947 * keyboard.c, process.c (POLL_FOR_INPUT):
5948 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5949 * keyboard.c (read_avail_input): Remove.
5950 All uses replaced by gobble_input.
5951 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5952 (kbd_buffer_store_event_hold, gobble_input):
5953 (record_asynch_buffer_change) [USABLE_SIGIO]:
5954 (store_user_signal_events):
5955 No need to mess with signal mask.
5956 (gobble_input): If blocking input and there are terminals, simply
5957 set pending_signals to 1 and return. All hooks changed to not
5958 worry about whether input is blocked.
5959 (process_pending_signals): Clear pending_signals before processing
5960 them, in case a signal comes in while we're processing.
5961 By convention callers now test pending_signals before calling us.
5962 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5963 New functions, to support changes to blockinput.h.
5964 (handle_input_available_signal): Now extern.
5965 (reinvoke_input_signal): Remove. All uses replaced by
5966 handle_async_input.
5967 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5968 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5969 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5970 Clear sigmask reliably, even if Fsignal returns, which it can.
5971 Omit unnecessary accesses to volatile var.
5972 (quit_throw_to_read_char): No need to restore sigmask.
5973 * keyboard.c (gobble_input, handle_user_signal):
5974 * process.c (wait_reading_process_output):
5975 Call signal-handling code rather than killing ourselves.
5976 * lisp.h: Include <float.h>, for...
5977 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5978 (pending_signals): Now volatile.
5979 (syms_of_data): Now const if IEEE floating point.
5980 (handle_input_available_signal) [USABLE_SIGIO]:
5981 (terminate_due_to_signal, record_child_status_change): New decls.
5982 * process.c (create_process): Avoid disaster if memory is exhausted
5983 while we're processing a vfork, by tightening the critical section
5984 around the vfork.
5985 (send_process_frame, process_sent_to, handle_pipe_signal)
5986 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5987 ignores SIGPIPE.
5988 (send_process): No need for setjmp/longjmp any more, since the
5989 SIGPIPE stuff is now gone. Instead, report an error if errno
5990 is EPIPE.
5991 (record_child_status_change): Now extern. PID and W are now args.
5992 Return void, not bool. All callers changed.
5993 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5994 Remove. All uses removed. This bug should be fixed now in a
5995 different way.
5996 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5997 and record the child status change directly. This avoids the
5998 need to futz with the signal mask.
5999 (process_fatal_action): Move here from emacs.c.
6000 (emacs_sigaction_flags): New function, containing
6001 much of what used to be in emacs_sigaction_init.
6002 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6003 caught by emacs, to make races less likely.
6004 (deliver_process_signal): Rename from handle_on_main_thread.
6005 All uses changed.
6006 (BACKTRACE_LIMIT_MAX): Now at top level.
6007 (thread_backtrace_buffer, threadback_backtrace_pointers):
6008 New static vars.
6009 (deliver_thread_signal, deliver_fatal_thread_signal):
6010 New functions, for more-accurate delivery of thread-specific signals.
6011 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6012 (deliver_arith_signal): Handle in this thread, not
6013 in the main thread, since it's triggered by this thread.
6014 (maybe_fatal_sig): New function.
6015 (init_signals): New arg DUMPING so that we can be more accurate
6016 about whether we're dumping. Caller changed.
6017 Treat thread-specific signals differently from process-general signals.
6018 Block all signals while handling fatal error; that's safer.
6019 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6020 on IEEE hosts.
6021 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6022 Ignore SIGPIPE unless batch.
6023 (emacs_backtrace): Output backtrace for the appropriate thread,
6024 which is not necessarily the main thread.
6025 * syssignal.h: Include <stdbool.h>.
6026 (emacs_raise): New macro.
6027 * xterm.c (x_connection_signal): Remove; no longer needed
6028 now that we use sigaction.
6029 (x_connection_closed): No need to mess with sigmask now.
6030 (x_initialize): No need to reset SIGPIPE handler here, since
6031 init_signals does this for us now.
6032
8f4635e9
JD
60332012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6034
6035 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6036 background rect may be larger (Bug#12245).
8f4635e9 6037
3296976d
CY
60382012-09-23 Chong Yidong <cyd@gnu.org>
6039
6040 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6041
d41e491e
PE
60422012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6043
6044 * .gdbinit: Just stop at fatal_error_backtrace.
6045 See Stefan Monnier's request in
6046 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6047 Remove no-longer-used query of system type.
6048
c88b867f
CY
60492012-09-22 Chong Yidong <cyd@gnu.org>
6050
6051 * search.c (Freplace_match): Doc fix (Bug#12325).
6052
6053 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6054
6055 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6056 (Fline_end_position): Doc fix.
6057
6058 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6059
bb4d86b4
CY
60602012-09-22 Chong Yidong <cyd@gnu.org>
6061
6062 * dispextern.h (struct image_type): Add new slot, storing a type
6063 initialization function.
6064
6065 * image.c (define_image_type): Call the image initializer function
6066 if it is defined. Arguments and return value changed.
6067 (valid_image_p, make_image): Callers changed.
6068 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6069 (gif_type, imagemagick_type, svg_type, gs_type):
6070 Add initialization functions.
bb4d86b4
CY
6071 (Finit_image_library): Call lookup_image_type.
6072 (CHECK_LIB_AVAILABLE): Macro deleted.
6073 (lookup_image_type): Call define_image_type here, rather than via
6074 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6075 (syms_of_image): Move define_image_type calls for xbm_type and
6076 pbm_type to lookup_image_type.
6077
df9685f3
EZ
60782012-09-22 Eli Zaretskii <eliz@gnu.org>
6079
6080 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6081 'idle_timers' from here ...
6082 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6083 lists, to avoid infloops when the timer does something stupid,
6084 like reinvoke itself with the same or smaller time-out.
6085 (Bug#12447)
6086
8e17c9ba
MR
60872012-09-22 Martin Rudalics <rudalics@gmx.at>
6088
6089 * window.c (Fsplit_window_internal): Handle only Qt value of
6090 Vwindow_combination_limit separately.
6091 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6092 (Vwindow_combination_limit): New default value.
6093 Rewrite doc-string.
8e17c9ba 6094
589bd69b
EZ
60952012-09-22 Eli Zaretskii <eliz@gnu.org>
6096
6097 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6098 the new overlay string. (Bug#10159)
6099
01108e3f
PE
61002012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6103 or that fprintf is async-signal-safe. POSIX doesn't require
6104 either assumption.
6105
82f8cd94
CY
61062012-09-22 Chong Yidong <cyd@gnu.org>
6107
6108 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6109 (Bug#8207).
6110
3cccbd87
KH
61112012-09-22 Kenichi Handa <handa@gnu.org>
6112
6113 * composite.c (composition_reseat_it): Handle the case that a
6114 grapheme cluster is not covered by a single font (Bug#12352).
6115
09c01941
CY
61162012-09-21 Chong Yidong <cyd@gnu.org>
6117
6118 * image.c (define_image_type): Avoid adding duplicate types to
6119 image_types (Bug#12463). Suggested by Jörg Walter.
6120
acfa068f 61212012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6122
6123 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6124 (print_load_command_name): Add case LC_DATA_IN_CODE.
6125 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6126
acfa068f 61272012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6128
6129 * eval.c (Frun_hook_with_args_until_success)
6130 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6131
acfa068f 61322012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6133
6134 * fileio.c (Ffile_selinux_context): Only call freecon when
6135 lgetfilecon succeeded.
6136 (Fset_file_selinux_context): Likewise. (Bug#12444)
6137
acfa068f 61382012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6139
6140 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6141 reordering, locate the cursor by calling set_cursor_from_row; if
6142 that fails, clear the desired glyph matrix before returning a
6143 failure indication to the caller. Fixes leaving garbled display
6144 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6145 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6146 scrolling through multibyte text.
aa36e4d2 6147
e99f70c8
SM
61482012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6149
6150 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6151 calling mark_vectorlike since that's the one that marks the window.
6152 (mark_discard_killed_buffers): Mark the final cdr.
6153 * window.h (struct window): Move prev/next_buffers to the
6154 non-standard fields.
6155 * window.c (make_window): Initialize prev/next_buffers manually.
6156
f75beb47
PE
61572012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6158
6159 Omit unused arg EXPECTED from socket hooks.
6160 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6161 * nsterm.m (ns_term_init):
6162 * termhooks.h (struct terminal.read_socket_hook):
6163 * w32inevt.c (w32_console_read_socket):
6164 * w32term.c (w32_read_socket):
6165 * xterm.c (XTread_socket):
6166 Omit unused arg EXPECTED. All callers changed.
6167 (store_user_signal_events): Return void, not int, since callers no
6168 longer care about the return value. All uses changed.
6169
b019b76a
JB
61702012-09-20 Juanma Barranquero <lekktu@gmail.com>
6171
6172 * w32gui.h (XParseGeometry): Do not declare.
6173
05642592
PE
61742012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6175
e4bce92a 6176 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6177 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6178 <http://bugs.gnu.org/12471#8> (last line).
6179
05642592
PE
6180 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6181 (XParseGeometry): Now static. Substitute extremal values for
6182 values that are out of range.
6183
e543ae91
JD
61842012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6185
6186 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6187
6188 * nsfns.m (XParseGeometry): Remove.
6189 (Fx_create_frame): Call x_set_offset to correctly interpret
6190 top_pos in geometry.
6191
3a880af4 6192 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6193 (Fx_parse_geometry): If there is a space in string, call
6194 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6195
45ba16c7
EZ
61962012-09-17 Eli Zaretskii <eliz@gnu.org>
6197
c8b9f1bc
EZ
6198 * search.c (scan_buffer): Use character positions in calls to
6199 region_cache_forward and region_cache_backward, not byte
6200 positions. (Bug#12196)
6201
b4c932a2
EZ
6202 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6203 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6204
45ba16c7
EZ
6205 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6206 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6207 emacs_blocked_malloc, now deleted.
6208
eeceac93
PE
62092012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6210
6211 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6212 The workaround was for improving performance on Solaris 2.4, but
6213 is getting in the way now. Emacs will still work if someone is
6214 still running Solaris 2.4 in a museum somewhere; Sun dropped
6215 support for Solaris 2.4 in 2003.
6216 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6217 * process.c (create_process) [HAVE_WORKING_VFORK]:
6218 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6219 since Emacs no longer uses vfork on that platform.
6220
78f83752
GM
62212012-09-17 Glenn Morris <rgm@gnu.org>
6222
6223 * emacs.c: Use COPYRIGHT.
6224
634b8cac
PE
62252012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6226
0caaedb1
PE
6227 Remove configure's --without-sync-input option (Bug#12450).
6228 When auditing signal-handling in preparation for cleaning it up,
6229 I found that SYNC_INPUT has race conditions and would be a real
6230 pain to fix. Since it's an undocumented and deprecated
6231 configure-time option, now seems like a good time to remove it.
6232 Also see <http://bugs.gnu.org/11080#16>.
6233 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6234 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6235 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6236 (malloc_hysteresis):
6237 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6238 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6239 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6240 (dont_register_blocks, bytes_used_when_reconsidered)
6241 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6242 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6243 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6244 Remove. All uses removed.
0caaedb1
PE
6245 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6246 implementation, one that depends on whether the new macro
6247 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6248 is defined.
6249 * atimer.c (run_timers, handle_alarm_signal):
6250 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6251 (handle_async_input, process_pending_signals)
6252 (handle_input_available_signal, init_keyboard):
6253 * nsterm.m (ns_read_socket):
6254 * process.c (wait_reading_process_output):
6255 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6256 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6257 (emacs_write):
6258 * xterm.c (XTread_socket):
6259 Assume SYNC_INPUT.
6260 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6261 * eval.c (handling_signal): Remove. All uses removed.
6262 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6263 All uses replaced with the SYNC_INPUT version.
6264 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6265 Remove decls.
6266 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6267 Now static.
6268
634b8cac
PE
6269 * font.c (Ffont_shape_gstring): Remove unused local.
6270
83da1b55
GM
62712012-09-16 Glenn Morris <rgm@gnu.org>
6272
518650a5
GM
6273 * Makefile.in (clean): No longer run nextstep's clean.
6274
83da1b55
GM
6275 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6276 (ns_frag): Remove.
6277 (ns-app): Move here from ns.mk, and simplify.
6278 (clean): Simplify nextstep entry.
6279 * ns.mk: Remove file.
6280
85a43e2e
KH
62812012-09-17 Kenichi Handa <handa@gnu.org>
6282
6283 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6284 not covert the last few charactes.
6285
ba13e616 62862012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6287
6288 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6289 here, but just check the validity of glyphs in the glyph-string.
6290
a8c729af
MR
62912012-09-16 Martin Rudalics <rudalics@gmx.at>
6292
3a880af4
SM
6293 * window.c (Fwindow_parameter, Fset_window_parameter):
6294 Accept any window as argument (Bug#12452).
a8c729af 6295
c077c059
JD
62962012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6297
6298 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6299 to ns_term_init to avoid memory leak.
6300
6301 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6302 explicit retain/release.
6303 (ns_term_init): Only allow one display. Initialize outerpool and
6304 ns_*_types.
6305
39a57ad0
PE
63062012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6307
6308 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6309 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6310 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6311 the Microsoft problem in a different way, by altering ../nt/config.nt.
6312
7105c8cb
EZ
63132012-09-15 Eli Zaretskii <eliz@gnu.org>
6314
6315 * w32xfns.c:
6316 * w32uniscribe.c:
6317 * w32term.c:
6318 * w32select.c:
6319 * w32reg.c:
6320 * w32proc.c:
6321 * w32menu.c:
6322 * w32inevt.c:
6323 * w32heap.c:
6324 * w32font.c:
6325 * w32fns.c:
6326 * w32console.c:
6327 * w32.c:
6328 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6329 by lisp.h. This completes removal of setjmp.h inclusion
6330 erroneously announced in the previous commit. (Bug#12446)
6331
6332 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6333 more accurate.
6334
6335 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6336 not defined as a macro. The latter happens on MS-Windows.
6337 (Bug#12446)
6338
0328b6de
PE
63392012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6342 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6343 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6344 only reason for the instance was because "lisp.h" was included.
6345 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6346 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6347 and _longjmp with the new symbols. Emacs already uses _setjmp if
6348 available, so this change affects only POSIXish hosts that have
6349 sigsetjmp but not _setjmp, such as some versions of Solaris and
6350 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6351 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6352 (png_load_body) [HAVE_PNG]:
6353 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6354 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6355 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6356 since PNG requires jmp_buf. This is the only exception to the
6357 general rule that we now use sys_setjmp and sys_longjmp.
6358 This exception is OK since this code does not change the signal
6359 mask or longjmp out of a signal handler.
6360
2af03429
PE
63612012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6362
6363 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6364 Include "syssignal.h", for 'main_thread'.
6365
2f294edf
DA
63662012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6367
6368 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6369 * insdel.c (replace_range, replace_range_2):
6370 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6371 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6372 Remove redundant check before calling offset_intervals.
6373
6b533e9c
MR
63742012-09-14 Martin Rudalics <rudalics@gmx.at>
6375
6376 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6377 current buffer (Bug#12387).
6378
2a7931e3
JB
63792012-09-14 Juanma Barranquero <lekktu@gmail.com>
6380
6381 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6382
c18e885b
PE
63832012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6384
6385 Use a more backwards-compatible timer format (Bug#12430).
6386 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6387 vector element, not from the 4th, since PSECS is now at the end.
6388 (Fcurrent_idle_time): Doc fix.
6389
d59a1afb
DA
63902012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6391
6392 Function to mark objects and remove killed buffers at once.
6393 * alloc.c (discard_killed_buffers): Rename to ...
6394 (mark_discard_killed buffers) ... new name. Add marking
6395 of remaining objects. Fix comment. Adjust users.
6396 (mark_object): Do not touch frame buffer lists here.
6397 * frame.c (delete_frame): Reset frame buffer lists here.
6398
5f0cb45a
PE
63992012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6400
8ea47e3a
PE
6401 Better workaround for GNOME bug when --enable-gcc-warnings.
6402 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6403 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6404 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6405
4a4bbad2
PE
6406 Simplify SIGIO usage (Bug#12408).
6407 The code that dealt with SIGIO was crufty and confusing, e.g., it
6408 played tricks like "#undef SIGIO" but these tricks were not used
6409 consistently. Simplify mostly by not #undeffing standard symbols,
6410 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6411 or not as we please) rather than "defined SIGIO" (standard symbol
6412 that we probably shouldn't #undef).
6413 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6414 Modules that need it can include it.
6415 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6416 * dispextern.h (ignore_sigio): New decl.
6417 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6418 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6419 * emacs.c (shut_down_emacs):
6420 * keyboard.c (kbd_buffer_store_event_hold):
6421 Use ignore_sigio rather than invoking 'signal' directly.
6422 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6423 for FIONREAD.
6424 (FIONREAD, SIGIO): Do not #undef.
6425 (tty_read_avail_input): Use #error rather than a syntax error.
6426 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6427 for I_PIPE, used by SETUP_SLAVE_PTY.
6428 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6429 * sysdep.c (croak): Remove; no longer needed. This bit of
6430 temporary code, with Fred N. Fish's comment that it's temporary,
6431 has been in Emacs since at least 1992!
6432 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6433 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6434 * syssignal.h (croak): Remove decl.
6435 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6436 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6437 now that we're termios-only.
6438 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6439 * term.c (dissociate_if_controlling_tty): Use #error rather than
6440 a run-time error.
6441
5f0cb45a
PE
6442 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6443 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6444 to work around GNOME bug 683906.
6445 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6446 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6447 This works around GCC bug 54561.
6448
40bce90b
PE
64492012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6450
6451 More fixes for 'volatile' and setjmp/longjmp.
6452 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6453 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6454 (png_load_body) [HAVE_PNG]:
6455 (jpeg_load_body) [HAVE_JPEG]:
6456 New function, with most of the old parent function's body.
6457 (png_load) [HAVE_PNG]:
6458 (jpeg_load) [HAVE_JPEG]:
6459 Invoke the new function, to avoid longjmp munging our locals.
6460 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6461 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6462 longjmp is passed 2, as the C standard doesn't guarantee this.
6463 Instead, store the failure code into mgr->failure_code.
6464
bfeae2cf
SM
64652012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6466
6467 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6468 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6469 (syms_of_keyboard): Remove support for unread-command-char.
6470
8099e36b
EZ
64712012-09-12 Eli Zaretskii <eliz@gnu.org>
6472
6473 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6474 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6475 violation. (Bug#12426)
6476
92547ff9
PE
64772012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6480
45b82ad0
SM
64812012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6482
6483 * eval.c: Add `inhibit-debugger'.
6484 (Qinhibit_debugger): New symbol.
6485 (call_debugger): Bind it instead of Qdebug_on_error.
6486 (maybe_call_debugger): Test Vinhibit_debugger.
6487 (syms_of_eval): Define inhibit-debugger.
6488 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6489 (syms_of_xdisp): Remove inhibit-debug-on-message.
6490
5779a1dc
PE
64912012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6492
50f2e553
PE
6493 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6494 If a nonvolatile local variable is written before a _longjmp to
6495 the frame containing the variable, and is read after the _longjmp,
6496 the value read is indeterminate. Some local variables of type
6497 'struct handler' and 'struct catchtag' are used in this way, so
6498 mark each of their slots as volatile if the slot can be set before
6499 _longjmp and read afterwards.
6500 * lisp.h (struct handler): var and chosen_clause are now volatile.
6501 (struct catchtag): val, next, and pdlcount are now volatile.
6502
ae1d87e2
PE
6503 * bidi.c (bidi_push_it, bidi_pop_it):
6504 * fns.c (copy_hash_table):
6505 * image.c (define_image_type):
6506 * keyboard.c (kbd_buffer_store_event_hold):
6507 * process.c (Fprocess_send_eof):
6508 * xfaces.c (x_create_gc) [HAVE_NS]:
6509 * xgselect.c (xg_select):
6510 Prefer assignment to memcpy when either will do.
6511
5779a1dc
PE
6512 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6513 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6514 time an item is removed. No need to mark this function 'inline';
6515 the compiler knows better than we do.
6516
c4c9756b
JD
65172012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6518
6519 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6520 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6521 to change_frame_size (Bug#12388).
6522 (windowDidResize:): Pass YES to updateFrameSize.
6523
6524 * nsterm.h: Add delay parameter to updateFrameSize.
6525
d73e321c
DA
65262012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6527
6528 Discard killed buffers from deleted window and frame objects.
6529 This reduces an amount of references to killed buffers and
6530 helps GC to reclaim them faster.
6531 * alloc.c (discard_killed_buffers): New function.
6532 (mark_object): Use it for deleted windows and frames.
6533 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6534 or deleted frame, restore its global binding.
d73e321c
DA
6535 * data.c (swap_in_global_binding): Add GC notice.
6536 (swap_in_symval_forwarding): Use convenient set_blv_where.
6537 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6538 * window.h: ... to here.
6539
e578f381
DA
65402012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6541
6542 Convenient macro to check whether the buffer is live.
6543 * buffer.h (BUFFER_LIVE_P): New macro.
6544 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6545 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6546
3057e615
YM
65472012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6548
6549 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6550 composition cases (Bug#12364).
6551
6552 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6553 overhang of succeeding glyphs overlapping box cursor.
6554
6555 * w32term.c (x_draw_glyph_string): Likewise.
6556
6fda35f2
PE
65572012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6558
c990426a
PE
6559 Simplify, document, and port floating-point (Bug#12381).
6560 The porting part of this patch fixes bugs on non-IEEE platforms
6561 with frexp, ldexp, logb.
6562 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6563 Now static.
6564 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6565 support, by removing commented-out code and briefly listing the
6566 C89 functions excluded. The commented-out stuff was confusing
6567 maintenance, e.g., we thought we needed cbrt but it was commented out.
6568 (logb): Remove decl; no longer needed.
6569 (isfinite): New macro, if not already supplied.
6570 (isnan): Don't replace any existing macro.
6571 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6572 are present on all C89 platforms.
6573 (Ffrexp): Do not special-case zero, as frexp does the right thing
6574 for that case.
6575 (Flogb): Do not use logb, as it doesn't have the desired meaning
6576 on hosts that use non-base-2 floating point. Instead, stick with
6577 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6578 frexp, to avoid getting an unspecified result.
6579
6fda35f2
PE
6580 * xdisp.c (Qinhibit_debug_on_message): Now static.
6581
16130a58
JD
65822012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6583
6584 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6585 NSBezierPath (Bug#12131).
6586
d105a573
CY
65872012-09-10 Chong Yidong <cyd@gnu.org>
6588
6589 * fns.c (Fdelq, Fdelete): Doc fix.
6590
ff55dfe8
PE
65912012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6592
6593 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6594 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6595
e7032e7c
SM
65962012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6597
6598 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6599 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6600 Use it.
6601
e9957956
EZ
66022012-09-09 Eli Zaretskii <eliz@gnu.org>
6603
aba05ce9
EZ
6604 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6605 left fringe if the window has a left margin. This avoids leaving
6606 traces of the cursor because its leftmost pixel is not drawn over.
6607
e9957956
EZ
6608 * dispnew.c (update_window_line): When the left margin area of a
6609 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6610 that screen line. (Bug#12277)
6611
f6196b87
PE
66122012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6613
6614 Assume C89 or later for math functions (Bug#12381).
6615 This simplifies the code, and makes it a bit smaller and faster,
6616 and (most important) makes it easier to clean up signal handling
6617 since we can stop worring about floating-point exceptions in
6618 library code. That was a problem before C89, but the problem
6619 went away many years ago on all practical Emacs targets.
6620 * data.c, image.c, lread.c, print.c:
6621 Don't include <math.h>; no longer needed.
6622 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6623 might be autoconfigured, as that never happens.
6624 * data.c (fmod):
6625 * doprnt.c (DBL_MAX_10_EXP):
6626 * print.c (DBL_DIG):
6627 Remove. C89 or later always defines these.
6628 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6629 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6630 (arith_error, domain_error, domain_error2):
6631 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6632 no longer needed -- we simply return what C returns. All uses removed.
6633 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6634 the wrapped code.
6635 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6636 Remove. All uses expanded, as these macros are no longer used
6637 more than once and are now more trouble than they're worth.
6638 (Ftan): Use tan, not sin / cos.
6639 (Flogb): Assume C89 frexp.
6640 (fmod_float): Assume C89 fmod.
6641 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6642 (init_floatfns): Remove. All uses removed.
6643
9d7f1863
JD
66442012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6645
6646 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6647 compositeToPoint for OSX < 10.6 (Bug#12390).
6648
eabf0404
PE
66492012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6652 This produces more-accurate results.
6653
0b3b1d23
JD
66542012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6655
6656 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6657 changes (Bug#12088).
6658
6dcef6ec
CY
66592012-09-08 Chong Yidong <cyd@gnu.org>
6660
6661 * syntax.c (Fstring_to_syntax): Doc fix.
6662
aa7d57c5
JD
66632012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6664
6665 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6666 in the internal border.
6667 (x_set_window_size): Remove static variables and their usage.
6668 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
6669 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6670 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
6671 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6672 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6673 (ns_fix_rect_ibw): Remove.
6674 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6675 (ns_dumpglyphs_box_or_relief): Ditto.
6676 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6677 adjustment.
6678 (ns_dumpglyphs_image): Ditto.
fc0c31f8 6679 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
6680 border adjustment.
6681 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6682 their usage. Add fringe_extended_p and its use as in other terms.
6683 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6684 scroll bar was removed.
6685 (updateFrameSize): New function.
6686 (windowDidResize): Move code to updateFrameSize and call it.
6687
6688 * nsterm.h (EmacsView): Add updateFrameSize.
6689
1a5432bc
CY
66902012-09-07 Chong Yidong <cyd@gnu.org>
6691
b4f5313e
CY
6692 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6693
1a5432bc
CY
6694 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6695
1a4f1e9b
PE
66962012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
6699 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6700 Problem introduced when merging patches. Noted by Eli Zaretskii in
6701 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
6702 * floatfns.c: Comment fix.
6703 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6704 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6705 and anyway the declaration is harmless even if SIGDANGER is not defined.
6706 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6707 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6708 source files not surprisingly expected syssignal.h to define, or
6709 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6710 Include <sys/ioctl.h>, for FIONREAD.
6711 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6712 This eliminates a problem whereby other files mysteriously had
6713 to include "syssignal.h" before including "systty.h" if they
6714 wanted to use "#ifdef SIGIO".
6715
bc8000ff
EZ
67162012-09-07 Eli Zaretskii <eliz@gnu.org>
6717
3e6d6928
EZ
6718 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6719
6720 * w32.c (sigemptyset): Empty the set.
6721 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6722
bc8000ff
EZ
6723 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6724
b4fa72f2
DA
67252012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6726
6727 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6728 (mark_object): Likewise for frame objects.
6729
30730c93
PE
67302012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 * syssignal.h (handle_on_main_thread): Always declare,
6733 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6734 This ports to platforms without HAVE_PTHREAD.
6735
2fe28299
PE
67362012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6737
6738 Signal-handler cleanup (Bug#12327).
6739 Emacs's signal handlers were written in the old 4.2BSD style with
6740 sigblock and sigmask and so forth, and this led to some
6741 inefficiencies and confusion. Rewrite these to use
6742 pthread_sigmask etc. without copying signal sets around. Also,
6743 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6744 'signal', and instead use functions that do not attempt to take
6745 over the system name space. This patch causes Emacs's text
6746 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6747 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6748 Do not include <signal.h> or "syssignal.h", as these
6749 modules do not use signals.
6750 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6751 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6752 Do not include <signal.h>, as "syssignal.h" does that for us now.
6753 * atimer.c (sigmask_atimers): New function.
6754 (block_atimers, unblock_atimers): New functions,
6755 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6756 All uses replaced.
6757 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6758 no longer needed here.
6759 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 6760 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
6761 * sysdep.c (struct save_signal): New member 'action', replacing
6762 old member 'handler'.
6763 (save_signal_handlers, restore_signal_handlers):
6764 Use sigaction instead of 'signal' to save and restore.
6765 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6766 New function. All users of 'signal' modified to use set_sighandler
6767 if they're writeonly, and to use sys_signal if they're read+write.
6768 (emacs_sigaction_init, forwarded_signal): New functions.
6769 (sys_signal): Remove. All uses replaced by calls to sigaction
6770 and emacs_sigaction_init, or by direct calls to 'signal'.
6771 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6772 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6773 all uses replaced by pthread_sigmask etc. calls.
6774 * syssignal.h: Include <signal.h>.
6775 (emacs_sigaction_init, forwarded_signal): New decls.
6776 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6777 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6778 (sigmask, sys_sigmask): Remove; no longer needed.
6779 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6780 (sigblock, sigunblock, sigfree):
6781 (sigsetmask) [!defined sigsetmask]:
6782 Remove. All uses replaced by pthread_sigmask.
6783 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6784 no longer need to be replaced, and its typical old uses
6785 are now done via emacs_sigaction_init and sigaction.
6786 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6787 (sys_sigdel): Remove; unused.
6788 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6789
0216c128
EZ
67902012-09-06 Eli Zaretskii <eliz@gnu.org>
6791
6792 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6793 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6794
c752cfa9
DA
67952012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6796
6797 Explicitly mark buffer_defaults and buffer_local_symbols.
6798 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6799 mark_local_symbols here.
6800 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6801 since special buffers aren't marked here any more.
6802 (allocate_buffer): Chain new buffer with all_buffers here...
6803 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6804 not here.
6805 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6806 (syms_of_buffer): Remove staticpro of the above.
6807 (init_buffer_once): Set names for buffer_defaults and
6808 buffer_local_symbols.
6809
a864ef14
PE
68102012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6811
6812 Use bool for booleans in font-related modules.
6813 * font.c (font_intern_prop, font_style_to_value)
6814 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6815 (generate_otf_features, font_check_otf_features, font_check_otf)
6816 (font_match_p, font_list_entities, font_at):
6817 * fontset.c (fontset_id_valid_p, reorder_font_vector
6818 (fontset_find_font, Fset_fontset_font)
6819 (face_suitable_for_char_p) [0]:
6820 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6821 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6822 (m17n_flt_initialized, ftfont_shape_by_flt):
6823 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6824 * nsfont.m (nsfont_draw):
6825 * w32font.c (w32font_draw):
6826 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6827 Use bool for booleans.
6828 * font.h: Adjust to above API changes.
6829 (struct font, struct font_driver, struct font_driver_list):
6830 Use bool for booleans.
6831 (struct font): Remove useless member encoding_type.
6832 All users removed.
6833 * fontset.c, xftfont.c: Omit unnecessary static decls.
6834
0699fc18
DA
68352012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6836
6837 * alloc.c (mark_object): Revert window marking code
6838 since it's unsafe for the Fset_window_configuration.
6839
20ef56db
PE
68402012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6841
2fe28299 6842 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
6843 Be more systematic about preserving errno whenever a signal
6844 handler returns, even if it's not in the main thread. Do this by
6845 renaming signal handlers to distinguish between signal delivery
6846 and signal handling. All uses changed.
6847 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6848 * data.c (deliver_arith_signal): Rename from arith_error.
6849 * dispnew.c (deliver_window_change_signal): Rename from
6850 window_change_signal.
6851 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6852 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6853 * keyboard.c (deliver_input_available_signal): Rename from
6854 input_available_signal.
6855 (deliver_user_signal): Rename from handle_user_signal.
6856 (deliver_interrupt_signal): Rename from interrupt_signal.
6857 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6858 (deliver_child_signal): Rename from sigchld_handler.
6859 * atimer.c (handle_alarm_signal):
6860 * data.c (handle_arith_signal):
6861 * dispnew.c (handle_window_change_signal):
6862 * emacs.c (handle_fatal_signal, handle_danger_signal):
6863 * keyboard.c (handle_input_available_signal):
6864 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6865 * process.c (handle_pipe_signal, handle_child_signal):
6866 New functions, with the actual signal-handling code taken from the
6867 original respective signal handlers, sans the sporadic attempts to
6868 preserve errno, since that's now done by handle_on_main_thread.
6869 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6870 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6871 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6872 Move to sysdep.c.
6873 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6874 Move initialization of main_thread to sysdep.c's init_signals.
6875 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6876 our usage, and simplifies the mainline code.
6877 (record_child_status_change): New static function, as a helper
6878 for handle_child_signal, and with most of the old child handler's
6879 contents.
6880 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6881 (handle_child_signal): Use the above.
6882 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6883 Moved here from emacs.c.
6884 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6885 code moved here from emacs.c's main function.
6886 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
6887 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6888 This lets callers save and restore errno properly.
20ef56db 6889
e3ccf108
DA
68902012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6891
6892 Remove redundant or unused things here and there.
6893 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6894 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6895 * editfns.c (Fcompare_buffer_substrings): Likewise.
6896 * frame.h (struct terminal, struct font_driver_list):
6897 Remove redundant declarations.
6898 * window.h (Qleft, Qright): Likewise.
6899
697e1e39
DA
69002012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6901
6902 Do not mark objects from deleted buffers, windows and frames.
6903 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6904 (mark_object): Likewise for windows and frames.
6905
c1ca42ca
DA
69062012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6907
6908 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6909 buffer_defaults and buffer_local_symbols as valid objects.
6910 Return special value to denote them.
6911
014d93be
PE
69122012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6913
f75d7a91
PE
6914 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6915 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6916 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6917 (file_name_absolute_p, Fsubstitute_in_file_name):
6918 (check_executable, check_writable, Ffile_accessible_directory_p)
6919 (Fset_file_selinux_context, Fdefault_file_modes)
6920 (Finsert_file_contents, choose_write_coding_system)
6921 (Fwrite_region, build_annotations, a_write, e_write)
6922 (Fdo_auto_save):
6923 * filelock.c (boot_time_initialized, get_boot_time)
6924 (get_boot_time_1, lock_file_1, within_one_second):
6925 * floatfns.c (in_float):
6926 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6927 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6928 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6929 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6930 * window.c (compare_window_configurations):
6931 Use bool for booleans.
6932 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6933 (Fdefault_file_modes): Now mode_t, not int, for modes.
6934 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6935 (internal_delete_file): Now returns void, not a (boolean) int,
6936 since nobody was looking at the return value.
6937 * lisp.h, window.h: Adjust to above API changes.
6938
014d93be
PE
6939 * xdisp.c (set_message): Simplify and reindent last change.
6940
776f29e1
JB
69412012-09-05 Juanma Barranquero <lekktu@gmail.com>
6942
6943 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6944
7f7e0167
LI
69452012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6946
6947 * eval.c (call_debugger): Make the function non-static so that we
6948 can call it from set_message.
6949
6950 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6951 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6952
cf29dd84
PE
69532012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6954
6955 Give more-useful info on a fatal error (Bug#12328).
6956 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6957 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6958 of doing the work ourselves.
6959 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6960 do most of the work.
6961 (fatal_error_backtrace): New function, taken from the guts
6962 of the old fatal_error_signal, but with a new option to output
6963 a backtrace.
6964 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6965 info about the signal than just its number.
6966 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6967 * sysdep.c: Include <execinfo.h>
6968 (emacs_backtrace): New function, taken partly from the previous
6969 code of the 'die' function.
6970 (emacs_abort): Call fatal_error_backtrace rather than abort.
6971
972debf2
SM
69722012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6973
6974 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6975 eager (load-time) macro-expansion.
6976 * lisp.mk (lisp): Add macroexp.
6977
1088b922
PE
69782012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 Simplify redefinition of 'abort' (Bug#12316).
6981 Do not try to redefine the 'abort' function. Instead, redo
6982 the code so that it calls 'emacs_abort' rather than 'abort'.
6983 This removes the need for the NO_ABORT configure-time macro
6984 and makes it easier to change the abort code to do a backtrace.
6985 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6986 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6987 Remove; sysdep.c's emacs_abort now takes its place.
6988 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6989 'abort' changed to use 'emacs_abort'.
6990 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6991 (abort) [!defined abort]: Rename to ...
6992 (emacs_abort): ... new name.
6993 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6994 the place of the old 'abort' in emacs.c.
6995 * w32.c, w32fns.c (abort): Do not #undef.
6996 * w32.c (emacs_abort): Rename from w32_abort.
6997
30934d33
EZ
69982012-09-04 Eli Zaretskii <eliz@gnu.org>
6999
7000 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7001 offsets[j].dv, since the y axis of the screen coordinates points
7002 down, while the y axis of the font definition coordinates points
7003 up. This fixes display of Arabic diacritics such as KASRA and
7004 KASRATAN. (Bug#11860)
7005
af26b72c
PE
70062012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7007
7008 Be more systematic about _setjmp vs setjmp.
7009 * alloc.c (test_setjmp, mark_stack):
7010 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7011 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7012 (png_load, my_error_exit, jpeg_load):
7013 * process.c (send_process_trap, send_process):
7014 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7015 The underscored versions are up to 30x faster on some hosts.
7016 Formerly, the code used setjmp+longjmp sometimes and
7017 _setjmp+_longjmp at other times, with no particular reason to
7018 prefer setjmp+longjmp.
7019
26d4541d
PE
70202012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7021
d42f4f0f 7022 Fix minor problem found by static checking.
26d4541d 7023 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7024
c5e28e39
MR
70252012-09-03 Martin Rudalics <rudalics@gmx.at>
7026
7027 * buffer.c (Fdelete_all_overlays): New function.
7028
3eab3ca9
CY
70292012-09-03 Chong Yidong <cyd@gnu.org>
7030
7031 * gtkutil.c: Add extern decl for Qxft.
7032
c04889f8
PE
70332012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7034
1882aa38
PE
7035 * emacs.c, eval.c: Use bool for boolean.
7036 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7037 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7038 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7039 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7040 (main, decode_env_path, Fdaemon_initialized):
7041 * eval.c (call_debugger, Finteractive_p, interactive_p):
7042 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7043 (maybe_call_debugger, Fbacktrace):
7044 * process.c (read_process_output, exec_sentinel):
7045 Use bool for booleans.
7046 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7047 All callers changed.
7048 * eval.c (interactive_p): Omit always-true boolean argument
7049 EXCLUDE_SUBRS_P. All callers changed.
7050 * dispextern.h, lisp.h: Reflect above API changes.
7051 * firstfile.c (dummy): Use the address of 'main', whose signature
7052 won't change, instead of the address of 'initialize', whose
7053 signature just changed from int to bool.
7054 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7055 * msdos.c (fatal_error_in_progress): ... from here.
7056 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7057 of incrementing it.
7058 (redisplay_internal, unwind_redisplay): Simply clear
7059 REDISPLAYING_P when unwinding, instead of saving its previous,
7060 always-false value and then restoring it.
7061
a411ac43
PE
7062 Clean up some extern decls.
7063 Mostly, this hoists extern decls out of .c files and into .h files.
7064 That way, we're more likely to catch errors if the interfaces change.
7065 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7066 declare xg_mark_data.
7067 * dispextern.h (x_frame_parm_handlers):
7068 * font.h (Qxft):
7069 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7070 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7071 (Qultra_bold, Qoblique, Qitalic):
7072 Move extern decl here from .c file.
7073 * alloc.c (xg_mark_data) [USE_GTK]:
7074 * doc.c (Qclosure):
7075 * eval.c (Qlexical_binding):
7076 * fns.c (time) [!HAVE_UNISTD_H]:
7077 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7078 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7079 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7080 * lread.c (Qinternal_interpreter_environment):
7081 * minibuf.c (Qbuffer):
7082 * process.c (QCfamily, QCfilter):
7083 * widget.c (free_frame_faces):
7084 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7085 * xfont.c (x_clear_errors):
7086 * xterm.c (x_frame_parm_handlers):
7087 Remove now-redundant extern decls.
7088 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7089 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7090 Now static.
7091 * xfaces.c: Remove unnecessary static decls.
7092 * xterm.c (updating_frame): Remove decl of nonexistent object.
7093
c04889f8
PE
7094 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7095 when building globals.h, as the objects that are not built on
7096 this host are not needed to compile C files on this host.
7097
8b339673
JD
70982012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7099
7100 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7101
7102 * frame.h: Add missing prototype for x_wm_set_size_hint.
7103
a08d4ba7
PE
71042012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7105
7106 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7107 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7108 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7109 (Fsubstitute_command_keys):
7110 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7111 (save_excursion_save, save_excursion_restore)
7112 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7113 (format_time_string, general_insert_function)
7114 (make_buffer_string, make_buffer_string_both)
7115 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7116 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7117 (copy_text, insert_1, insert_1_both, insert_from_string)
7118 (insert_from_string_before_markers, insert_from_string_1)
7119 (insert_from_buffer, insert_from_buffer_1, replace_range)
7120 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7121 (del_range_2, modify_region):
7122 * intervals.c (intervals_equal, balance_possible_root_interval)
7123 (adjust_intervals_for_insertion, merge_properties_sticky)
7124 (graft_intervals_into_buffer, lookup_char_property)
7125 (adjust_for_invis_intang, set_point_both)
7126 (get_property_and_range, compare_string_intervals)
7127 (set_intervals_multibyte_1, set_intervals_multibyte):
7128 * keyboard.c (decode_timer):
7129 Use bool for boolean.
7130 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7131 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7132
48c948de
CY
71332012-09-02 Chong Yidong <cyd@gnu.org>
7134
7135 * keymap.c (push_key_description): Print M-TAB as C-M-i
7136 (Bug#11758).
7137
6c49a40b
JB
71382012-09-02 Juanma Barranquero <lekktu@gmail.com>
7139
7140 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7141 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7142 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7143 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7144 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7145 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7146 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7147
4dfbd238
EZ
71482012-09-01 Eli Zaretskii <eliz@gnu.org>
7149
7e510e28
EZ
7150 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7151 more than one grapheme cluster passed to the shaper: compute the
7152 offset adjustment values separately for each cluster. (Bug#11860)
7153
4dfbd238
EZ
7154 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7155 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7156 about implicit conversions from integer to pointer.
7157
86571ae0
DC
71582012-09-01 Daniel Colascione <dancol@dancol.org>
7159
7160 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7161 system used too early.
7162
0e23ef9d
PE
71632012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7164
7165 Better seed support for (random).
7166 * emacs.c (main): Call init_random.
7167 * fns.c (Frandom): Set the seed from a string argument, if given.
7168 Remove long-obsolete Gentzel cruft.
7169 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7170 (init_random): New function.
7171
17a2cbbd
DC
71722012-09-01 Daniel Colascione <dancol@dancol.org>
7173
7174 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7175 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7176 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7177 x_wm_set_size_hint, x_query_colors, x_real_positions,
7178 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7179 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7180 all of which have been moved to common code.
7181
7182 * xfaces.c: Include TERM_HEADER instead of listing all possible
7183 window-system headers.
7184
7185 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7186 to match header.
7187
7188 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7189 directly accessing frame internals.
7190
f18cbb28 7191 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7192 globals_of_w32font.
7193
7194 * process.c: Include TERM_HEADER instead of listing all possible
7195 window-system headers.
7196
3a880af4
SM
7197 * nsterm.h: Remove declarations now in frame.h.
7198 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7199
7200 * menu.c: Include TERM_HEADER instead of listing all possible
7201 window-system headers.
7202
7203 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7204 window system.
7205
7206 * keyboard.c: Include TERM_HEADER instead of listing all possible
7207 window-system headers.
7208
7209 * image.c: Include TERM_HEADER instead of listing all possible
7210 window-system headers. Declare Vlibrary_cache when compiling for
7211 Windows.
7212
7213 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7214 window system declarations.
7215
7216 * frame.h: Move common functions here: set_frame_menubar,
7217 x_set_window_size, x_sync, x_get_focus_frame,
7218 x_set_mouse_position, x_set_mouse_pixel_position,
7219 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7220 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7221 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7222 x_activate_menubar, x_real_positions, x_bitmap_icon,
7223 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7224 and x_query_colors.
7225
7226 * frame.c: Include TERM_HEADER instead of listing all possible
7227 window-system headers.
7228
7229 * font.c: Include TERM_HEADER instead of listing all possible
7230 window-system headers.
7231
7232 * emacs.c: Include TERM_HEADER.
7233
f18cbb28
EZ
7234 * dispnew.c: Include TERM_HEADER instead of listing all possible
7235 window-system headers.
17a2cbbd 7236
f18cbb28 7237 * ccl.h: Include character.h.
17a2cbbd
DC
7238
7239 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7240 the current window system; include in list of objects to link into
7241 Emacs.
7242
c650a5de
DA
72432012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7244
7245 Remove mark_ttys function and fix tty_display_info initialization.
7246 * lisp.h (mark_ttys): Remove prototype.
7247 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7248 to mark_ttys because all possible values of 'top_frame' slot are
7249 the frames which are reachable from Vframe_list.
7250 * term.c (mark_ttys): Remove.
7251 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7252
4e0f6479
DA
72532012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7254
7255 Change struct frame bitfields from unsigned char to unsigned.
7256 * frame.h (struct frame): Change type of 'display_preempted',
7257 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7258 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7259 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7260 bitfields from unsigned char to unsigned.
7261
8b96a52c
DA
72622012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7263
7264 Remove unused member of struct x_output and struct w32_output.
7265 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7266 * w32term.h (struct w32_output): Likewise.
7267
b4444c8a
JD
72682012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7269
7270 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7271 does not become zero (Bug#12234).
7272
b98521db
PE
72732012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7274
7275 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7276 for GCC 4.7.1 x86-64.
7277
31d02438
GM
72782012-08-30 Glenn Morris <rgm@gnu.org>
7279
7280 * lread.c (init_lread): For out-of-tree builds, only add the
7281 source directory's site-lisp dir to the load-path if it exists,
7282 consistent with in-tree builds. (Bug#12302)
7283
7f8941d8
JD
72842012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7285
7286 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7287 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7288 (windowShouldClose:): Set window_closed.
7289 (dealloc): New member, free button_values.
fc0c31f8
JB
7290 (process_dialog:): Make member function. Remove window argument,
7291 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7292 in button_values.
7293 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7294 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7295 (addString:row:): Remove return self, declare return value as void.
7296 (addSplit): Remove return self, declare return value as void.
7297 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7298 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7299 (initFromContents:isQuestion:): Adjust call to process_dialog.
7300 Code formatting change.
7301 (timeout_handler:): Set timer_fired to YES.
7302 (runDialogAt:): Set timer_fired to NO.
7303 Handle click on close button as quit.
7304
7305 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7306 Add window_closed and button_values. Add void as return value for
7307 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7308 Add process_dialog as new member.
7309
eada0861 73102012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7311
eada0861
GM
7312 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7313 is not one of the heaps we manage. (Bug#12242)
7314
73152012-08-28 Glenn Morris <rgm@gnu.org>
7316
7317 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7318
457294dd
MR
73192012-08-28 Martin Rudalics <rudalics@gmx.at>
7320
7321 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7322 auto-buffer-name window parameter. Install revision of reverted
7323 fix.
457294dd 7324
4f2daf31
DA
73252012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7326
7327 Do not allow to set major mode for a dead buffer.
7328 * buffer.c (Fset_buffer_major_mode): Signal an error
7329 if the buffer is dead.
7330 (Fother_buffer, other_buffer_safely): Remove redundant
7331 nested declaration.
7332
66322887
DA
73332012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7334
7335 Always use set_buffer_if_live to restore original buffer at unwind.
7336 * buffer.h (record_unwind_current_buffer): New function.
7337 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7338 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7339 * undo.c, window.c: Adjust users.
7340 * buffer.c (set_buffer_if_live): Fix comment.
7341
a3d794a1
DA
73422012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7343
7344 Fix usage of set_buffer_internal.
7345 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7346 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7347 * coding.c (decode_coding): Omit redundant test.
7348 * fileio.c (decide_coding_unwind): Likewise.
7349 * fns.c (secure_hash): Likewise.
7350 * insdel.c (modify_region): Likewise.
7351 * keyboard.c (command_loop_1): Likewise.
7352 * print.c (PRINTFINISH): Likewise.
7353 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7354
59ea14cd
PE
73552012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7356
7357 * dispnew.c: Use bool for boolean.
7358 (frame_garbaged, display_completed, delayed_size_change)
7359 (fonts_changed_p, add_window_display_history)
7360 (add_frame_display_history, verify_row_hash)
7361 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7362 (row_equal_p, realloc_glyph_pool)
7363 (allocate_matrices_for_frame_redisplay)
7364 (showing_window_margins_p)
7365 (adjust_frame_glyphs_for_frame_redisplay)
7366 (build_frame_matrix_from_leaf_window, make_current)
7367 (mirrored_line_dance, mirror_line_dance, update_frame)
7368 (update_window_tree, update_single_window)
7369 (check_current_matrix_flags, update_window, update_text_area)
7370 (update_window_line, set_window_update_flags, scrolling_window)
7371 (update_frame_1, scrolling, buffer_posn_from_coords)
7372 (do_pending_window_change, change_frame_size)
7373 (change_frame_size_1, sit_for):
7374 Use bool for boolean.
7375 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7376 and remove last int (actually boolean) argument, which was always 0.
7377 All callers changed.
7378 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7379 * dispextern.h (struct composition_it): Use bool for boolean.
7380 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7381 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7382 * dired.c (file_name_completion):
7383 Use bool for boolean. (This was missed in an earlier change.)
7384
95072a94
MR
73852012-08-27 Martin Rudalics <rudalics@gmx.at>
7386
7387 * window.c (Fset_window_configuration): Revert first part of
7388 last change.
7389
0f19feff
JD
73902012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7391
7392 * nsterm.h (NSPanel): New class variable dialog_return.
7393
3a880af4
SM
7394 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7395 Initialize dialog_return.
0f19feff
JD
7396 (windowShouldClose:): Use stop instead of stopModalWithCode.
7397 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7398 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7399 event.
7400 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7401 modal loop returns.
7402
f10fe38f
PE
74032012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7404
de1339b0
PE
7405 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7406 * composite.c (find_composition, composition_gstring_p)
7407 (composition_reseat_it, find_automatic_composition):
7408 * data.c (let_shadows_buffer_binding_p)
7409 (let_shadows_global_binding_p, set_internal, make_blv)
7410 (Fmake_variable_buffer_local, Fmake_local_variable)
7411 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7412 (cons_to_signed, arith_driver):
7413 * dbusbind.c (xd_in_read_queued_messages):
7414 * dired.c (directory_files_internal, file_name_completion):
7415 Use bool for booleans.
7416 * dired.c (file_name_completion):
7417 * process.h (fd_callback):
7418 Omit int (actually boolean) argument. It wasn't being used.
7419 All uses changed.
7420 * composite.h, lisp.h: Reflect above API changes.
7421
f10fe38f
PE
7422 * cmds.c, coding.c: Use bool for booleans.
7423 * cmds.c (move_point, Fself_insert_command):
7424 * coding.h (struct composition status, struct coding_system):
7425 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7426 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7427 (emacs_mule_char, decode_coding_emacs_mule)
7428 (encode_coding_emacs_mule, detect_coding_iso_2022)
7429 (decode_coding_iso_2022, encode_invocation_designation)
7430 (encode_designation_at_bol, encode_coding_iso_2022)
7431 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7432 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7433 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7434 (encode_coding_raw_text, detect_coding_charset)
7435 (decode_coding_charset, encode_coding_charset, detect_eol)
7436 (detect_coding, get_translation_table, produce_chars)
7437 (consume_chars, reused_workbuf_in_use)
7438 (make_conversion_work_buffer, code_conversion_save)
7439 (decode_coding_object, encode_coding_object)
7440 (detect_coding_system, char_encodable_p)
7441 (Funencodable_char_position, code_convert_region)
7442 (code_convert_string, code_convert_string_norecord)
7443 (Fset_coding_system_priority):
7444 * fileio.c (Finsert_file_contents):
7445 Use bool for booleans.
7446 * coding.h, lisp.h: Reflect above API changes.
7447 * coding.c: Remove unnecessary static function decls.
7448 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7449 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7450 not a boolean 'int', since callers never look at the return value.
7451 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7452 * coding.h (decoding_buffer_size, encoding_buffer_size)
7453 (emacs_mule_string_char): Remove unused extern decls.
7454 (struct iso_2022_spec, struct coding_system):
7455 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7456 (struct emacs_mule_spec): Remove unused field 'full_support'.
7457 All initializations removed.
7458 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7459
5474c384
DA
74602012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7461
f10fe38f 7462 Fix spare memory change (Bug#12286).
5474c384
DA
7463 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7464 (valid_lisp_object_p): Likewise.
7465
c4b6914d
MR
74662012-08-27 Martin Rudalics <rudalics@gmx.at>
7467
7468 * window.c (Fset_window_configuration): Record any window's old
7469 buffer if it's replaced (see Bug#8789). If the new current
7470 buffer doesn't appear in the selected window, go to its old
7471 point (Bug#12208).
7472
35aaa1ea
DA
74732012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7474
7475 Special MEM_TYPE_SPARE to denote reserved memory.
7476 * alloc.c (enum mem_type): New memory type.
7477 (refill_memory_reserve): Use new type for spare memory.
7478 This prevents live_cons_p and live_string_p from incorrect
7479 detection of uninitialized objects from spare memory as live.
7480
6af64513
PE
74812012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7482
8b2e00a3
PE
7483 Spelling fixes.
7484 * Makefile.in (.PHONY): versioclean -> versionclean.
7485
b52d6985
PE
7486 Remove unused external symbols.
7487 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7488 * window.c (Qwindow_valid_p, decode_valid_window):
7489 Now static, not extern.
7490 * data.c (Qinterval): Remove; unused.
7491 (syms_of_data): Do not define 'interval'.
7492 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7493 * window.h (decode_valid_window):
7494 Remove decls.
7495
d5172d4f
PE
7496 * character.c, charset.c, chartab.c: Use bool for booleans.
7497 * character.c (lisp_string_width, string_count_byte8)
7498 (string_escape_byte8):
7499 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7500 (load_charset_map_from_file, map_charset_chars)
7501 (Fdefine_charset_internal, define_charset_internal)
7502 (Fdeclare_equiv_charset, find_charsets_in_text)
7503 (Ffind_charset_region, char_charset, Fiso_charset):
7504 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7505 (sub_char_table_set, sub_char_table_set_range)
7506 (char_table_set_range, optimize_sub_char_table)
7507 (map_sub_char_table):
7508 Use bool for boolean.
7509 * character.c (str_to_unibyte): Omit last boolean argument; it was
7510 always 0. All callers changed.
7511 * character.h, charset.h: Adjust to match previous changes.
7512 * character.h (char_printable_p): Remove decl of nonexistent function.
7513 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7514 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7515 are all boolean, so make them single-bit bitfields.
7516
6af64513
PE
7517 * lisp.h (ASET): Remove attempt to detect side effects.
7518 It was meant to be temporary and it often doesn't work,
7519 because when IDX has side effects the behavior of IDX==IDX
7520 is undefined. See Stefan Monnier in
7521 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7522
e1f29348
BR
75232012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7524
7525 * lisp.h (functionp): New function (extracted from Ffunctionp).
7526 (FUNCTIONP): Use it.
7527 * eval.c (Ffunctionp): Use it.
7528
17c05d74
PE
75292012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7530
0f46bc75
PE
7531 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7532 as that's faster and simpler than static storage. Don't bother
7533 with the g_main_context_query overhead if g_main_context_pending
7534 says no events are pending.
7535 (gfds, gfds_size): Remove these static vars.
7536 (xgselect_initialize): Remove; no longer needed.
7537 All uses and decls removed.
7538
ee4c0f69
PE
7539 * emacs.c (fatal_error_signal_hook): Remove.
7540 All uses removed. This leftover from old code was always 0.
7541
17c05d74
PE
7542 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7543 * casefiddle.c (casify_object, casify_region):
7544 * casetab.c (set_case_table):
7545 * category.c, category.h (word_boundary_p):
7546 * category.h (CHAR_HAS_CATEGORY):
7547 Use bool for booleans, instead of int.
7548
391ceac5
EZ
75492012-08-25 Eli Zaretskii <eliz@gnu.org>
7550
7551 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7552
2f221583
PE
75532012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7554
f4a681b0
PE
7555 On assertion failure, print backtrace if available.
7556 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7557 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7558 * Makefile.in (LIB_EXECINFO): New macro.
7559 (LIBES): Use it.
7560
2f221583
PE
7561 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7562 * bytecode.c (exec_byte_code):
7563 * callint.c (check_mark, Fcall_interactively):
7564 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7565 (getenv_internal, sync_process_alive, call_process_exited):
7566 * lisp.h (USE_SAFE_ALLOCA):
7567 Use bool for booleans, instead of int.
7568 * lisp.h, process.h: Adjust prototypes to match above changes.
7569 * callint.c (Fcall_interactively): Don't assume the mark's
7570 offset fits in 'int'.
7571
37ef52bb
PE
75722012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * buffer.c, buffer.h: Use bool for boolean.
7575 * buffer.c (reset_buffer_local_variables)
7576 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7577 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7578 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7579 (overlay_touches_p, overlay_strings, Foverlay_put)
7580 (report_overlay_modification, call_overlay_mod_hooks):
7581 (mmap_enlarge, mmap_set_vars):
7582 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7583 Use bool for booleans, instead of int.
7584 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7585 since the 1-or-0 return value is always ignored anyway.
7586 (mmap_initialized_p):
7587 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7588 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7589
2cc21167
PE
75902012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7591
7592 * bidi.c: Use bool for boolean.
7593 This is a bit more readable, and makes the text segment of bidi.o
7594 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7595 Presumably it's faster too.
7596 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7597 Now bool.
7598 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7599 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7600 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7601 (bidi_explicit_dir_char, bidi_level_of_next_char)
7602 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7603 Use bool for booleans, instead of int.
7604 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7605 (bidi_unshelve_cache): Adjust decls to match code.
7606
7db4ddf4
MR
76072012-08-23 Martin Rudalics <rudalics@gmx.at>
7608
7609 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7610 argument.
7611
b1bb8011
PE
76122012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7613
7614 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7615 * atimer.h: Include <stdbool.h>.
7616
ff687885
DN
76172012-08-22 Dan Nicolaescu <dann@gnu.org>
7618
7619 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7620 compile time tests instead of run time tests on systems that do
7621 not use them.
7622 (FRAME_MAC_P): Remove leftover from deleted code.
7623 * frame.c (syms_of_frame): Remove leftover from deleted code.
7624
4ce7a138
JD
76252012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7626
7627 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7628
d733ec6d
PE
76292012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7630
7631 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7632 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 7633 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
7634 (fontset_add): Return void, for FONTSET_ADD.
7635
d0d2d26f
PE
76362012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7637
fce31d69
PE
7638 * alloc.c: Use bool for booleans.
7639 (gc_in_progress, abort_on_gc)
7640 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7641 (dont_register_blocks) [GC_MALLOC_CHECK]:
7642 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7643 (check_string_bytes, make_specified_string, memory_full)
7644 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7645 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7646 (mark_stack, valid_pointer_p, make_pure_string)
7647 (Fgarbage_collect, survives_gc_p, gc_sweep):
7648 Use bool for booleans, instead of int.
7649 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7650 Remove unused local.
7651 * alloc.c (PURE_POINTER_P):
7652 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7653 * editfns.c (Fformat):
7654 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7655 (Fdo_auto_save):
7656 * fns.c (sweep_weak_table):
7657 * lisp.h (suppress_checking, push_message, survives_gc_p)
7658 (make_pure_string, gc_in_progress, abort_on_gc):
7659 * lread.c (readchar, read1):
7660 * print.c (Fprin1_to_string):
7661 * xdisp.c (push_message):
7662 Use bool for booleans affected directly or indirectly by
7663 alloc.c's changes.
7664
d0d2d26f
PE
7665 Make recently-introduced setters macros.
7666 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7667 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7668 (set_fontset_default, set_fontset_fallback): Rename from their
7669 upper-case counterparts, and make them functions rather than macros.
7670 This is more consistent with the other recently-introduced setters.
7671 These don't need to be inline, since they're local.
7672
d18e2bb6
JD
76732012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7674
7675 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7676 the loop (Bug#12247).
7677
1b9d9d16
PE
76782012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7679
7680 * lisp.h (vcopy): Use memcpy rather than our own loop.
7681 This fixes a performance regression introduced by the recent
7682 addition of vcopy. This means 'vcopy' will need to be modified
7683 for a copying collector, but that's OK. Also, tighten the
7684 checking in the assertion.
7685
b2f09701
EZ
76862012-08-21 Eli Zaretskii <eliz@gnu.org>
7687
7688 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7689 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7690 non-base glyph for the width of the base character, according to
e1f29348
BR
7691 what x_draw_composite_glyph_string_foreground expects.
7692 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
7693 expectations, to produce correct width of the composed character.
7694 Reverse the sign of the DU offset produced by ScriptPlace.
7695
9b994fed
PE
76962012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7697
7698 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7699
086ca913
DA
77002012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7701
7702 Avoid direct writes to contents member of struct Lisp_Vector.
7703 * lisp.h (vcopy): New function to copy data into vector.
7704 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7705 * fns.c (Ffillarray): Use ASET.
7706 * keyboard.c (timer_check_2): Use AREF and ASET.
7707 (append_tool_bar_item, Frecent_keys): Use vcopy.
7708 * lread.c (read_vector): Use ASET.
7709 * msdos.c (Frecent_doskeys): Use vcopy.
7710 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7711 (Finternal_merge_in_global_face): Use ASET and vcopy.
7712 * xfont.c (xfont_list_pattern): Likewise.
7713
5481664a
MR
77142012-08-21 Martin Rudalics <rudalics@gmx.at>
7715
7716 * window.c (Fwindow_point): For the selected window always return
7717 the position of its buffer's point.
7718 (Fset_window_point): For the selected window always go in its
7719 buffer to the specified position.
7720
6d470bdd
DA
77212012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7722
7723 Setter macros for fontsets.
7724 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7725 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7726 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7727 Adjust users.
7728
24564fe1
GM
77292012-08-20 Glenn Morris <rgm@gnu.org>
7730
7731 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7732 Don't assume that `ln -f' works.
7733
0a05a035
EZ
77342012-08-20 Eli Zaretskii <eliz@gnu.org>
7735
7736 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7737 and later about non-assignments with no effect. See discussion at
7738 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7739 details.
7740
e46f2325
DA
77412012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7742
7743 Inline setter functions for Lisp_Objects slots of struct specbinding.
7744 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7745 Adjust users.
7746
734fbd86
MR
77472012-08-20 Martin Rudalics <rudalics@gmx.at>
7748
7749 * window.c (select_window): Always make selected window's buffer
7750 current.
7751
f1a95992
DA
77522012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7753
7754 Use AREF and ASET for docstrings of category tables.
7755 * category.h (CATEGORY_DOCSTRING): Use AREF.
7756 (SET_CATEGORY_DOCSTRING): Use ASET.
7757 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7758
e83064be
DA
77592012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7760
7761 Inline setter functions for hash table members.
7762 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7763 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7764 (set_hash_key_and_value, set_hash_index, set_hash_next)
7765 (set_hash_hash): New functions.
7766 * charset.c, fns.c: Adjust users.
7767
4ce60d2e
DA
77682012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7769
7770 Inline getter and setter functions for per-buffer values.
7771 * buffer.h (per_buffer_default, set_per_buffer_default)
7772 (per_buffer_value, set_per_buffer_value): New functions.
7773 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7774 * buffer.c, data.c: Adjust users.
7775
c06c9690
JB
77762012-08-20 Juanma Barranquero <lekktu@gmail.com>
7777
7778 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7779
32bd4250
PE
77802012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7781
bad03192 7782 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
7783 as gnulib does this if the system doesn't.
7784 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
7785 Remove declaration. MS-Windows declares it on stdlib.h which is
7786 included by conf_post.h.
b69a6d22
PE
7787 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7788 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7789 * vm-limit.c: Include <unistd.h>, for 'environ'.
7790
22d7feb2
PE
7791 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7792 (start_of_data): Remove decl; mem-limits.h provides it.
7793
32bd4250
PE
7794 * xdisp.c (handle_invisible_prop): Make it a bit faster
7795 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7796
450809af
CY
77972012-08-19 Chong Yidong <cyd@gnu.org>
7798
7799 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7800 ends (Bug#3874).
7801
9e677988
AS
78022012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7803
6b1319ce
AS
7804 * .gdbinit: Use call instead of set when calling a function in the
7805 inferior.
7806
9e677988
AS
7807 * data.c (set_internal): Don't use set_blv_found.
7808 (Fkill_local_variable): Likewise.
7809
d7191076
AA
78102012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7811
7812 * nsfont.m (ns_ascii_average_width): Ensure the string
7813 ascii_printable is initialized with a null-terminated character
7814 array. Otherwise, it can contain undesired extra characters.
7815
e757f1c6
PE
78162012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7817
7818 port new setting code to Sun C 5.8 2005/10/13
7819 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7820 Return void, not Lisp_Object. Otherwise, the compiler
7821 complains about (A?B:C) where B is void and C is Lisp_Object
7822 when compiling CHAR_TABLE_SET, due to the recent change to
7823 the API of sub_char_table_set_contents.
7824
a999ce26
CY
78252012-08-18 Chong Yidong <cyd@gnu.org>
7826
7827 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7828 for the string case (Bug#3874).
7829
3f22b86f
PE
78302012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7831
39eb03f1
PE
7832 * buffer.h (BSET): Remove (Bug#12215).
7833 Replace all uses with calls to new setter functions.
7834 (bset_bidi_paragraph_direction, bset_case_canon_table)
7835 (bset_case_eqv_table, bset_directory, bset_display_count)
7836 (bset_display_time, bset_downcase_table)
7837 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7838 (bset_last_selected_window, bset_local_var_alist)
7839 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7840 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7841 (bset_width_table):
7842 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7843 (bset_auto_fill_function, bset_auto_save_file_format)
7844 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7845 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7846 (bset_cache_long_line_scans, bset_case_fold_search)
7847 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7848 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7849 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7850 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7851 (bset_header_line_format, bset_indicate_buffer_boundaries)
7852 (bset_indicate_empty_lines, bset_invisibility_spec)
7853 (bset_left_fringe_width, bset_major_mode, bset_mark)
7854 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7855 (bset_name, bset_overwrite_mode, bset_pt_marker)
7856 (bset_right_fringe_width, bset_save_length)
7857 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7858 (bset_scroll_up_aggressively, bset_selective_display)
7859 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7860 (bset_word_wrap, bset_zv_marker):
7861 * category.c (bset_category_table):
7862 * syntax.c (bset_syntax_table):
7863 New setter functions.
7864
6a09a33b
PE
7865 * process.h (PSET): Remove (Bug#12215).
7866 Replace all uses with calls to new setter functions.
7867 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7868 (PROCESS_INLINE): New macro.
7869 (pset_childp): New setter function.
7870 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7871 * process.c (PROCESS_INLINE):
7872 Define to EXTERN_INLINE, so that the corresponding functions
7873 are compiled into code.
7874 (pset_buffer, pset_command, pset_decode_coding_system)
7875 (pset_decoding_buf, pset_encode_coding_system)
7876 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7877 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7878 (pset_type, pset_write_queue): New setter functions.
7879
e8c17b81
PE
7880 * window.h (WSET): Remove (Bug#12215).
7881 Replace all uses with calls to new setter functions.
7882 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7883 (WINDOW_INLINE): New macro.
7884 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7885 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7886 (wset_total_lines, wset_vertical_scroll_bar)
7887 (wset_window_end_pos, wset_window_end_valid)
7888 (wset_window_end_vpos): New setter functions.
7889 * window.c (WINDOW_INLINE):
7890 Define to EXTERN_INLINE, so that the corresponding functions
7891 are compiled into code.
7892 (wset_combination_limit, wset_dedicated, wset_display_table)
7893 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7894 (wset_new_normal, wset_new_total, wset_next_buffers)
7895 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7896 (wset_prev_buffers, wset_right_fringe_width)
7897 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7898 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7899 (wset_window_parameters):
7900 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7901 (wset_column_number_displayed, wset_region_showing):
7902 New setter functions.
7903
3f22b86f
PE
7904 * termhooks.h (TSET): Remove (Bug#12215).
7905 Replace all uses with calls to new setter functions.
7906 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7907 (TERMHOOKS_INLINE): New macro.
7908 (tset_charset_list, tset_selection_alist): New setter functions.
7909 * terminal.c (TERMHOOKS_INLINE):
7910 Define to EXTERN_INLINE, so that the corresponding functions
7911 are compiled into code.
7912 (tset_param_alist): New setter function.
7913
742af32f
PE
79142012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7915
15dbb4d6
PE
7916 * keyboard.h (KSET): Remove (Bug#12215).
7917 Replace all uses with calls to new setter functions.
7918 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7919 (KEYBOARD_INLINE): New macro.
7920 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7921 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7922 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7923 New setter functions.
7924 * keyboard.c (KEYBOARD_INLINE):
7925 Define to EXTERN_INLINE, so that the corresponding functions
7926 are compiled into code.
7927 (kset_echo_string, kset_kbd_queue)
7928 (kset_keyboard_translate_table, kset_last_prefix_arg)
7929 (kset_last_repeatable_command, kset_local_function_key_map)
7930 (kset_overriding_terminal_local_map, kset_real_last_command)
7931 (kset_system_key_syms): New setter functions.
7932
f00af5b1
PE
7933 * frame.h (FSET): Remove (Bug#12215).
7934 Replace all uses with calls to new setter functions.
7935 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7936 (FRAME_INLINE): New macro.
7937 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7938 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7939 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7940 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7941 (fset_param_alist, fset_root_window, fset_scroll_bars)
7942 (fset_selected_window, fset_title, fset_tool_bar_items)
7943 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7944 * frame.c (FRAME_INLINE):
7945 Define to EXTERN_INLINE, so that the corresponding functions
7946 are compiled into code.
7947 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7948
0c94c8d6
PE
7949 A few more naming-convention fixes for getters and setters.
7950 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7951 and rename from buffer_overlays_set_before.
7952 (set_buffer_overlays_after): Move here from buffer.h, and rename
7953 from buffer_overlays_set_after.
7954 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7955 All uses changed.
7956 (set_buffer_intervals): Rename from buffer_set_intervals.
7957 * intervals.c (set_interval_object): Move here from intervals.h,
7958 and rename from interval_set_object.
7959 (set_interval_left): Move here from intervals.h, and rename from
7960 interval_set_left.
7961 (set_interval_right): Move here from intervals.h, and rename from
7962 interval_set_right.
7963 (copy_interval_parent): Move here from intervals.h, and rename from
7964 interval_copy_parent.
7965 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7966 (set_interval_plist): Rename from interval_set_plist.
7967 Return void, not Lisp_Object, since no caller uses the result.
7968 * lisp.h (string_intervals): Rename from string_get_intervals.
7969 (set_string_intervals): Rename from string_set_intervals.
7970
34dabdb7
PE
7971 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7972 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7973 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7974 All uses changed. See the end of
7975 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7976
742af32f
PE
7977 * lisp.h (CSET): Remove (Bug#12215).
7978 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7979 (set_char_table_purpose): New functions,
7980 replacing CSET. All uses changed. For example, replace
7981 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7982 "set_char_table_parent (char_table, parent);".
742af32f
PE
7983 The old version was confusing because it used the same name
7984 'parent' for two different things.
7985
a04e2c62
DA
79862012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7987
7988 Functions to get and set Lisp_Object fields of buffer-local variables.
7989 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7990 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7991 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7992 * data.c, eval.c, frame.c: Adjust users.
7993
383dcbf9
CY
79942012-08-17 Chong Yidong <cyd@gnu.org>
7995
7996 * xfaces.c (merge_face_vectors): If the target font specfies a
7997 font spec, make the font's attributes take precedence over
7998 directly-specified attributes.
7999 (merge_face_ref): Recognize :font.
8000
44386687
DA
80012012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8002
8003 Do not use memcpy for copying intervals.
8004 * intervals.c (reproduce_interval): New function.
8005 (reproduce_tree, reproduce_tree_obj): Use it.
8006 (reproduce_tree_obj): Remove prototype.
8007
927c7216
PE
80082012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8009
8010 * lisp.h (duration_to_sec_usec): Remove unused decl.
8011
93044f7b
AA
80122012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8013
8014 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8015 to an allocated instance of NSString, not to the class itself.
8016
9851e4a5
JB
80172012-08-17 Juanma Barranquero <lekktu@gmail.com>
8018
8019 * makefile.w32-in (C_CTYPE_H): New macro.
8020 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8021 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8022 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8023
620f13b0
PE
80242012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8025
8026 Use ASCII tests for character types.
8027 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8028 * xfns.c, xterm.c:
8029 Don't include <ctype.h>; was not needed.
8030 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8031 * sysdep.c, xfaces.c:
8032 Include <c-ctype.h> instead of <ctype.h>.
8033 * nsterm.m: Include <c-ctype.h>.
8034 * charset.c (read_hex):
8035 * doc.c (Fsnarf_documentation):
8036 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8037 (DRIVE_LETTER) [DOS_NT]:
8038 (Ffile_name_directory, Fexpand_file_name)
8039 (Fsubstitute_in_file_name):
8040 * font.c (font_parse_xlfd, font_parse_fcname):
8041 * frame.c (x_set_font_backend):
8042 * gtkutil.c (xg_get_font):
8043 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8044 * nsimage.m (hexchar):
8045 * nsterm.m (ns_xlfd_to_fontname):
8046 * sysdep.c (system_process_attributes):
8047 * xfaces.c (hash_string_case_insensitive):
8048 Use C-locale tests instead of locale-specific tests for character
8049 types, since we want the ASCII interpretation here, not the
8050 interpretation suitable for whatever happens to be the current locale.
8051
52162052
MR
80522012-08-16 Martin Rudalics <rudalics@gmx.at>
8053
8054 Consistently check windows for validity/liveness
8055 (Bug#11984, Bug#12025, Bug#12026).
8056 * lisp.h (CHECK_VALID_WINDOW): New macro.
8057 * window.c (decode_window): Rename to decode_live_window.
8058 (decode_valid_window, Fwindow_valid_p): New functions.
8059 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8060 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8061 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8062 (Fwindow_prev_sibling, Fwindow_combination_limit)
8063 (Fset_window_combination_limit, Fwindow_use_time)
8064 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8065 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8066 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8067 (Fwindow_hscroll, Fset_window_hscroll)
8068 (Fwindow_redisplay_end_trigger)
8069 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8070 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8071 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8072 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8073 (Fwindow_end, Fset_window_point, Fset_window_start)
8074 (Fpos_visible_in_window_p, Fwindow_line_height)
8075 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8076 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8077 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8078 (Fset_window_parameter, Fwindow_display_table)
8079 (Fset_window_display_table, Fdelete_other_windows_internal)
8080 (Fset_window_buffer, Fset_window_new_total)
8081 (Fset_window_new_normal, Fdelete_window_internal)
8082 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8083 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8084 (Fwindow_scroll_bars): Check whether argument window is a valid or
8085 live window. Update doc-strings.
8086 (syms_of_window): New symbol Qwindow_valid_p.
8087 * keyboard.c (Fposn_at_x_y): Check whether argument
8088 frame_or_window denotes a valid window.
8089
2751c80f
DA
80902012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8091
8092 Fix previous char table change.
8093 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8094 * chartab.c (optimize_sub_char_table): Likewise.
8095
032a42c8
CY
80962012-08-16 Chong Yidong <cyd@gnu.org>
8097
a2d19368
CY
8098 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8099
032a42c8
CY
8100 * xfont.c (xfont_open):
8101 * xftfont.c (xftfont_open): Set the font's max_width field.
8102
8103 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8104 min_width to space_width and average_width to the average over
8105 printable ASCII characters.
8106 (ns_char_width): Code cleanup.
8107 (ns_ascii_average_width): New utility function.
8108
8109 * font.h (struct font): Update comments.
8110
a098c930
DA
81112012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8112
032a42c8 8113 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8114 * lisp.h (CSET): New macro.
8115 (char_table_set_extras, char_table_set_contents)
8116 (sub_char_table_set_contents): New function.
8117 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8118 * syntax.c: Adjust users.
8119
8be3a09c
SM
81202012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8121
8122 * eval.c (eval_sub): Bind lexical-binding.
8123 * lread.c (Qlexical_binding): Make non-static.
8124
ac4845a6
JD
81252012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8126
ddee6515
JD
8127 * nsmenu.m (popupSession): Remove.
8128 (pop_down_menu): Remove endModalSession.
8129 (timeout_handler:): New method.
8130 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8131 Call runModalForWindow. Check timer_fired when it returns.
8132 If not set, cancel timer and break out of loop.
8133 Otherwise loop again, with a new timeout.
8134
8135 * nsterm.m: Include fcntl.h if present.
8136 (fd_entry, t_readfds, inNsSelect): Remove.
8137 (select_writefds, select_valid, select_timeout, selfds)
8138 (select_mutex, apploopnr): Add.
8139 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8140 Otherwise call kbd_buffer_store_event.
8141 (ns_send_appdefined): Remove release of fd_entry.
8142 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8143 Increment and decrement apploopnr.
8144 (ns_select): If no file descriptors, just do a NSTimer.
8145 Otherwise copy read/write masks and start select thread (fd_handler).
8146 Start main loop and wait for application defined event.
8147 Inform select thread to stop selecting after main loop is exited.
8148 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8149 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8150 (fd_handler:): Loop forever, wait for info from the main thread
8151 to either start or stop selecting. When select returns, send
8152 and appdefined event.
8153 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8154 If not call kbd_buffer_store_event.
8155
8156 * nsterm.h (EmacsApp): fd_handler takes id argument.
8157 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8158
ac4845a6
JD
8159 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8160
eb424fe3
EZ
81612012-08-15 Eli Zaretskii <eliz@gnu.org>
8162
8163 * region-cache.c (move_cache_gap): Update gap_len using the actual
8164 growth of the boundaries array. Do not change cache_len.
8165 (Bug#12196)
8166
4e6a86c6
DA
81672012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8168
8169 Generalize and cleanup font subsystem checks.
8170 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8171 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8172 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8173
5bf192ca
DA
81742012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8175
8176 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8177
f2045622
CY
81782012-08-15 Chong Yidong <cyd@gnu.org>
8179
8be3a09c
SM
8180 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8181 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8182 extract the font descriptor instead of just the font name.
8183 In that case, return a font spec instead of a string.
f2045622
CY
8184 (x_last_font_name): Move to this file from xfns.c.
8185
8186 * xfns.c (Fx_select_font): The return value can also be a font
8187 spec. Move x_last_font_name management to gtkutil.c.
8188
8189 * xfaces.c: Make font weight and style symbols non-static.
8190
7f6feb56
SM
81912012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8192
8193 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8194 (bug#12117).
8195
fecbd8ff
SM
81962012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8197
8198 * alloc.c (Fgarbage_collect): Use plural form consistently.
8199
9b8d5165
EZ
82002012-08-14 Eli Zaretskii <eliz@gnu.org>
8201
8202 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8203 iteration through the command loop. Fixes a problem whereby mouse
8204 movements are ignored until the first mouse click.
8205
f5d9e83a
PE
82062012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8207
8208 Use bool, not int, for Lisp booleans.
8209 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8210 makes Emacs a bit smaller and presumably a bit faster.
8211 * lisp.h: Include <stdbool.h>.
8212 (struct Lisp_Boolfwd, defvar_bool):
8213 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8214 * regex.c [!emacs]: Include <stdbool.h>.
8215 (false, true): Remove; <stdbool.h> does this for us now.
8216
55802e4a
CY
82172012-08-14 Chong Yidong <cyd@gnu.org>
8218
4abcdac8
CY
8219 * character.c (Fcharacterp): Doc fix (Bug#12076).
8220
8221 * data.c (Findirect_variable): Doc fix (Bug#11040).
8222
55802e4a
CY
8223 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8224
8225 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8226 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8227
8e99d072
BR
82282012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8229
8230 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8231 (bug#12022).
8232
08908aca
MR
82332012-08-14 Martin Rudalics <rudalics@gmx.at>
8234
8235 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8236 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8237 * minibuf.c (choose_minibuf_frame, read_minibuf):
8238 * w32fns.c (x_create_tip_frame):
8239 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8240 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8241
56120d6f
PE
82422012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8243
8244 * intervals.c (offset_intervals): Remove obsolete comment.
8245
67b77c0b
AS
82462012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8247
8248 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8249
f48b82fd
GR
82502012-08-14 Gergely Risko <gergely@risko.hu>
8251
8252 * coding.c (decode_coding): Record buffer modification before
8253 disabling undo_list (Bug#11773).
8254
fd318b54
DA
82552012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8256
8257 Revert and cleanup some recent overlay changes.
8258 * buffer.h (enum overlay_type): Remove.
8259 (buffer_get_overlays, buffer_set_overlays): Likewise.
8260 (buffer_set_overlays_before, buffer_set_overlays_after):
8261 New function. Adjust users.
8262 (unchain_both): Add eassert.
8263
41a62dd9
DA
82642012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8265
8266 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8267
5884c324
PE
82682012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8269
8270 * gtkutil.c (xg_mark_data): Don't assume C99.
8271
ca06f160
JD
82722012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8273
8274 * gtkutil.c (xg_frame_tb_info): New struct.
8275 (TB_INFO_KEY): New define.
8276 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8277 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8278 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8279 if not present.
8280 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8281 is up to date. Otherwise store new data.
ca06f160
JD
8282 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8283
7864a3f7
DA
82842012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8285
8286 Use KSET for write access to Lisp_Object members of struct kboard.
8287 * keyboard.h (KSET): New macro.
8288 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8289 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8290 * xterm.c: Adjust users.
8291
4c31be61
DA
82922012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8293
8294 Use BSET for write access to Lisp_Object members of struct buffer.
8295 * buffer.h (BSET): New macro.
8296 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8297 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8298 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8299 * window.c, xdisp.c, xfns.c: Adjust users.
8300
14ae4239
BT
83012012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8302
8303 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8304
32bcadb4
JD
83052012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8306
3d29b2ce 8307 * nsterm.m (not_in_argv): New function.
fc0c31f8 8308 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8309 (application:openFileWithoutUI:, application:openFiles:): Open file
8310 if not_in_argv returns non-zero (bug#12171).
8311
32bcadb4 8312 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8313 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8314 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8315 (xg_get_font_name): Use those functions/macros here.
8316 Reported by Frans Oilinki <moilinki@gmail.com>.
8317
9ff9402d 83182012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8319
8320 * unexmacosx.c (copy_data_segment): Copy initialized data in
8321 statically linked libraries from input file rather than memory.
8322
db74a5fc
YM
8323 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8324 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8325 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8326
25e65510
GM
83272012-08-10 Glenn Morris <rgm@gnu.org>
8328
8329 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8330 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8331
7961135c
DA
83322012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8333
8334 Fix last change to allow compilation with low optimization levels.
8335 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8336 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8337
42b3a444
DA
83382012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8339
8340 Use common inline syntax in intervals.h.
8341 * intervals.h (INTERVALS_INLINE): New macro.
8342 Change all users from LISP_INLINE.
8343
9fb0c957
DA
83442012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8345
8346 Define Qnone once for all platforms.
8347 * frame.c (Qnone): Define here.
8348 (syms_of_frame): DEFSYM it.
8349 * lisp.h (Qnone): New declaration.
8350 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8351 * xfns.c: Remove duplication. Adjust users.
8352
65e8ee52
DA
83532012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8354
8355 Remove unused macros from intervals.h.
8356 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8357 * intervals.c: Adjust comment.
8358
9b855fd6
EZ
83592012-08-10 Eli Zaretskii <eliz@gnu.org>
8360
8361 * w32fns.c <w32_unicode_gui>: New static variable.
8362 (globals_of_w32fns): Initialize it according to os_subtype.
8363 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8364 testing os_subtype.
8365
39cb9e56 83662012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8367 Eli Zaretskii <eliz@gnu.org>
8368
8369 Fix bug #10299 with Unicode characters sent by customized
8370 keyboards created by MSKLC.
8371 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8372 (w32_init_class): Use it to initialize the Emacs class with either
8373 ANSI or Unicode API calls.
8374 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8375 later.
8376 (w32_wnd_proc): If the character code sent by WM_CHAR or
8377 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8378 original message. Call DefWindowProcW on NT and later.
8379
9374581a
GM
83802012-08-10 Glenn Morris <rgm@gnu.org>
8381
4b94e8cf
GM
8382 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8383
9374581a
GM
8384 * lisp.h (DIRECTORY_SEP): Let configure set it.
8385
a2752828
DA
83862012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8387
8388 Use TSET for write access to Lisp_Object slots of struct terminal.
8389 * termhooks.h (TSET): New macro.
8390 * coding.c, terminal.c, xselect.c: Adjust users.
8391
cc92c454
SM
83922012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8393
8394 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8395 the failing expression, include them in the error message.
8396 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8397 * lisp.h (internal_condition_case_n): Update declaration.
8398
4cb3e6b3
DA
83992012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8400
8401 Inline functions to examine and change buffer overlays.
8402 * buffer.c (unchain_both): New function.
8403 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8404 (buffer_has_overlays): New function.
8405 (enum overlay_type): New enum.
8406 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8407 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8408
8707c1e5
DA
84092012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8410
8411 Inline functions to examine and change buffer intervals.
8412 * alloc.c (mark_interval_tree): Remove.
8413 (MARK_INTERVAL_TREE): Simplify.
8414 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8415 * intervals.c (buffer_balance_intervals): New function.
8416 (graft_intervals_into_buffer): Adjust indentation.
8417 (set_intervals_multibyte): Simplify.
8418 * buffer.h (BUF_INTERVALS): Remove.
8419 (buffer_get_intervals, buffer_set_intervals): New function.
8420 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8421 * intervals.c, textprop.c: Adjust users.
8422
ad8c997f
DA
84232012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8424
8425 Inline functions to examine and change string intervals.
8426 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8427 (string_get_intervals, string_set_intervals): New function.
8428 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8429 * lread.c, print.c, textprop.c: Adjust users.
8430
32ac3a6b
GM
84312012-08-08 Glenn Morris <rgm@gnu.org>
8432
8433 * lisp.mk (lisp): Remove language/persian.elc.
8434
77c7bcb1
DA
84352012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8436
8437 Cleanup intervals.
8438 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8439 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8440 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8441 Adjust comment. Move under #if 0.
77c7bcb1
DA
8442 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8443 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8444
9c08a8d4
DA
84452012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8446
8447 Check total length of intervals with eassert.
8448 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8449 * intervals.c: Change all users to eassert.
8450
26d16b35
EZ
84512012-08-07 Eli Zaretskii <eliz@gnu.org>
8452
14ae4239
BT
8453 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8454 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8455 INTERNAL_FIELD in Lisp_Cons.
8456
c644523b
DA
84572012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8458
8459 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8460 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8461 name since all xname users are fixed long time ago. Do not
8462 use INTERNAL_FIELD.
8463 (set_symbol_name, set_symbol_function, set_symbol_plist):
8464 (set_symbol_next, set_overlay_plist): New function.
8465 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8466 (struct Lisp_Overlay): Likewise.
8467 (CVAR, MVAR, SVAR): Remove.
8468 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8469 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8470 * xterm.c: Adjust users.
8471 * .gdbinit: Change to use name field of struct Lisp_Symbol
8472 where appropriate.
8473
6a3d20cc
DA
84742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8475
8476 Basic functions to set Lisp_Object and pointer slots of intervals.
8477 * intervals.h (interval_set_parent, interval_set_object):
8478 (interval_set_left, interval_set_right, interval_set_plist):
8479 (interval_copy_parent): New function.
8480 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8481 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8482 Adjust indentation.
6a3d20cc
DA
8483 (INTERVAL_SIZE): Remove. Adjust users.
8484 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8485
4d2b044c
DA
84862012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8487
8488 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8489 * process.h (PGET): Remove.
8490 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8491 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8492
d3d50620
DA
84932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8494
8495 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8496 * window.h (WGET): Remove.
8497 (struct window): Do not use INTERNAL_FIELD.
8498 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8499 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8500 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8501 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8502 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8503 Adjust users.
8504
d10a51dc
CY
85052012-08-07 Chong Yidong <cyd@gnu.org>
8506
8507 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8508 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8509 (Fdelete_window_internal): Signal an error if the window is not on
8510 a live frame (Bug#12025).
8511
e69b0960
DA
85122012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8513
8514 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8515 * frame.h (FGET): Remove.
8516 (struct frame): Do not use INTERNAL_FIELD.
8517 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8518 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8519 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8520 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8521
25a20a3a
JB
85222012-08-06 Juanma Barranquero <lekktu@gmail.com>
8523
8524 * w32.c: Silence compiler warnings.
8525 (map_w32_filename): Remove unused variable `is_fat'.
8526 (chase_symlinks): Add parentheses around expression.
8527
1c6f11f4
GM
85282012-08-06 Glenn Morris <rgm@gnu.org>
8529
1db4583a
GM
8530 * sysdep.c: Respect BROKEN_GETWD.
8531
1c6f11f4
GM
8532 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8533 Let configure handle it.
8534 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8535
2b90362b
DA
85362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8537
8538 Use GCALIGNMENT where appropriate.
8539 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8540 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8541 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8542
5f50daf2
EZ
85432012-08-06 Eli Zaretskii <eliz@gnu.org>
8544
14ae4239
BT
8545 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8546 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8547
cbcc7007
SM
85482012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8549
8550 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8551 that should be sufficient for everyone.
8552
4d365fa4
JD
85532012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8554
8555 * keyboard.c (timer_check_2): Add break so timer_check returns next
8556 timeout.
8557
dd86bd82
DA
85582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8559
8560 Fix Windows build errors introduced after converting to WGET and WSET.
8561 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8562 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8563
054e1668
JD
85642012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8565
8566 * nsterm.m (ns_frame_rehighlight): Use FSET.
8567
8568 * nsmenu.m (ns_update_menubar): Use FSET.
8569
21238f11
DA
85702012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8571
8572 Separate read and write access to Lisp_Object slots of Lisp_Process.
8573 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8574 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8575
077288cf
DA
85762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8577
8578 Separate read and write access to Lisp_Object slots of struct window.
8579 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8580 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8581 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8582 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8583 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8584 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8585 Adjust users.
8586
71688bd7
DA
85872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8588
8589 Fix Windows build errors introduced after converting to FGET and FSET.
8590 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8591 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8592 (w32_judge_scroll_bars): Change to use FSET.
8593 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8594
f99bac93
DA
85952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8596
8597 Fix replacement typo.
8598 * window.c (replace_window): Set root_window instead of
8599 selected_window. This fixes a total window subsystem
8600 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8601
8c2a0f2d
GM
86022012-08-06 Glenn Morris <rgm@gnu.org>
8603
8604 * lisp.mk (lisp): Add language/persian.elc.
8605
edd74c35
DA
86062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8607
8608 Separate read and write access to Lisp_Object slots of struct frame.
8609 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8610 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8611 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8612 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8613 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8614
8671676c
AS
86152012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8616
8617 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8618
663e2b3f
DA
86192012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8620
8621 Generalize common compile-time constants.
8622 * lisp.h (header_size, bool_header_size, word_size): Now here.
8623 (struct Lisp_Vector): Add comment.
8624 (struct Lisp_Bool_Vector): Move up to define handy constants.
8625 (VECSIZE, PSEUDOVECSIZE): Simplify.
8626 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8627 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8628 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8629 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8630 * xfont.c, xmenu.c: Use word_size where appropriate.
8631
d32e47af
LM
86322012-08-05 Lawrence Mitchell <wence@gmx.li>
8633
8634 * search.c (Freplace_match): Treat \? in the replacement text
8635 literally (Bug#8161).
8636
e5d9c0d1
CY
86372012-08-05 Chong Yidong <cyd@gnu.org>
8638
8639 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8640 * frame.c (Vdelete_frame_functions):
8641 * emacs.c (Vkill_emacs_hook): Doc fix.
8642
8da0576b
EZ
86432012-08-04 Eli Zaretskii <eliz@gnu.org>
8644
8645 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8646 --with-x-toolkit=no builds.
8647 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8648
02676e5d
CY
86492012-08-04 Chong Yidong <cyd@gnu.org>
8650
8651 * syntax.c (Fmodify_syntax_entry): Doc fix.
8652
97147da9
EZ
86532012-08-04 Eli Zaretskii <eliz@gnu.org>
8654
76151e2c
EZ
8655 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8656 * w32.c (init_environment): Change the default values of many
8657 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8658 them into environment when they were not already defined.
8659 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8660 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8661 (check_windows_init_file): Now external, not static.
8662 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8663 called when Vload_path is already set up.
8664
8665 * w32.h (check_windows_init_file): Add prototype.
8666
8667 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8668 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8669 compatibility with Posix platforms.
8670 (main): Move the call to check_windows_init_file to here from
8671 w32.c.
8672 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8673 any, in the DEFALT argument into the root of the Emacs build or
8674 installation tree, as appropriate.
8675
8676 * callproc.c (init_callproc_1): Call decode_env_path instead of
8677 doing its equivalent by hand.
8678 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8679 the code that sets Vexec_path run on MS-Windows.
8680
8681 * lread.c (init_lread): Add comments to #ifdef's.
8682
97147da9
EZ
8683 * msdos.c (dos_set_window_size, IT_update_begin)
8684 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8685 instead of direct references.
8686
185ee146
PE
86872012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8688
8689 Export DEFAULT_REHASH_* to GDB.
8690 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8691 Now constants, not macros.
8692
8834c57a
PE
86932012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8694
98c6f1e3
PE
8695 Remove unnecessary casts involving pointers.
8696 These casts are no longer needed now that we assume C89 or later,
8697 since they involve casting to or from void *.
8698 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8699 (make_pure_float, make_pure_vector):
8700 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8701 * macros.c (Fstart_kbd_macro):
8702 * menu.c (find_and_return_menu_selection):
8703 * minibuf.c (read_minibuf_noninteractive):
8704 * sysdep.c (closedir):
8705 * xdisp.c (x_produce_glyphs):
8706 * xfaces.c (compare_fonts_by_sort_order):
8707 * xfns.c (x_real_positions, select_visual):
8708 * xselect.c (x_stop_queuing_selection_requests)
8709 (x_get_window_property, x_get_window_property_as_lisp_data):
8710 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8711 Remove unnecessary pointer casts.
8712 * alloc.c (record_xmalloc): New function.
8713 * lisp.h (record_xmalloc): New decl.
8714 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8715 more like a function. This is because the pointer cast is not
8716 needed. All uses changed.
8717 * print.c (print_string, print_error_message): Avoid length recalc.
8718
8834c57a
PE
8719 Improve fix for macroexp crash with debugging (Bug#12118).
8720 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8721 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8722 not supposed to be invoked from the garbage collector.
8723 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8724 (gc_aset): New function, which is like ASET but can be
8725 used in the garbage collector.
8726 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8727 (set_hash_index): Use it instead of ASET.
8728
6dad7178
EZ
87292012-08-03 Eli Zaretskii <eliz@gnu.org>
8730
8731 Support symlinks on latest versions of MS-Windows.
8732 * w32.c: Include winioctl.h and aclapi.h.
8733 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8734 (revert_to_self): Forward declarations of static functions.
8735 <static BOOL g_b_init_get_security_info>:
8736 <g_b_init_create_symbolic_link>: New static flags.
8737 (globals_of_w32): Initialize them to zero.
8738 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8739 (map_w32_filename): Improve commentary. Simplify switch.
8740 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8741 headers (most versions of MinGW w32api don't).
8742 (get_security_info, create_symbolic_link)
8743 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8744 New functions.
8745 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8746 in the argument file name.
8747 (sys_access): Call unc_volume_file_attributes only if
8748 GetFileAttributes fails with network-related error codes.
8749 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8750 have the required privileges.
14ae4239 8751 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
8752 get_file_security_desc.
8753 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
8754 with addition of handling of symlinks and support for 'lstat'.
8755 If possible, get file's attributes and security information by
6dad7178
EZ
8756 handle, not by name. Produce S_IFLNK bit for symlinks, when
8757 called from 'lstat'.
8758 (stat, lstat): New functions, call 'stat_worker'.
8759 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8760 symlinks when the underlying filesystem supports them.
8761
f162bcc3
PE
87622012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8763
79ea6c20
PE
8764 Fix macroexp crash on Windows with debugging (Bug#12118).
8765 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8766 checking subscripts; problem introduced with the recent
8767 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8768 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8769 since it's used in non-static inline functions now.
8770
c0ce93fd
PE
8771 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8772 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 8773
f162bcc3
PE
8774 Use C99-style 'extern inline' if available.
8775 * buffer.h (BUFFER_INLINE):
8776 * category.h (CATEGORY_INLINE):
8777 * character.h (CHARACTER_INLINE):
8778 * charset.h (CHARSET_INLINE):
8779 * composite.h (COMPOSITE_INLINE):
8780 * dispextern.h (DISPEXTERN_INLINE):
8781 * lisp.h (LISP_INLINE):
8782 * systime.h (SYSTIME_INLINE):
8783 New macro, replacing 'static inline' in this header.
8784 * buffer.h, category.h, character.h, charset.h, composite.h:
8785 * dispextern.h, lisp.h, systime.h:
8786 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8787 * alloc.c (LISP_INLINE):
8788 * buffer.c (BUFFER_INLINE):
8789 * category.c (CATEGORY_INLINE):
8790 * character.c (CHARACTER_INLINE):
8791 * charset.c (CHARSET_INLINE):
8792 * composite.c (COMPOSITE_INLINE):
8793 * dispnew.c (DISPEXTERN_INLINE):
8794 * sysdep.c (SYSTIME_INLINE):
8795 Define to EXTERN_INLINE, so that the corresponding functions
8796 are compiled into code.
8797 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8798 (INLINE_HEADER_END): New macros.
8799 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8800 since it's used in non-static inline functions now.
a8333d03 8801 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 8802
837b365b
GM
88032012-08-02 Glenn Morris <rgm@gnu.org>
8804
d66b744d
GM
8805 * s/: Remove empty directory.
8806
837b365b
GM
8807 * s/ms-w32.h: Move to ../nt/inc.
8808 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8809 Update for new ms-w32.h location.
8810
13294f95
PE
88112012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8812
8813 Port to Solaris 8.
8814 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8815
90df0db3
GM
88162012-08-02 Glenn Morris <rgm@gnu.org>
8817
8818 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8819 hard-coding the path separator.
8820
4939150c
PE
88212012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8822
8823 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8824 This how ASET and AREF are supposed to work, and makes
8825 it easier to think about future improvements. See
8826 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8827 * charset.h (set_charset_attr): New function.
8828 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8829 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8830 (aref_addr): New function. All uses of &AREF(...) changed.
8831 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8832 (set_hash_index): New functions. All lvalue-style uses of
8833 HASH_KEY etc. changed.
8834 * keyboard.c (set_prop): New function. All lvalue-style uses
8835 of PROP changed.
8836
947b2afd
AA
88372012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8838
8839 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8840 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 8841 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
8842 * nsfns.m (ns_set_name_as_filename): Likewise.
8843 * nsmenu.m (ns_update_menubar): Likewise.
8844 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8845
4f5d0325
EZ
88462012-08-01 Eli Zaretskii <eliz@gnu.org>
8847
2008beae
EZ
8848 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8849 Adapt to latest changes in field names of the corresponding Lisp
288479f6 8850 objects.
2008beae 8851
4f5d0325
EZ
8852 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8853
fe3cc771
GM
88542012-08-01 Glenn Morris <rgm@gnu.org>
8855
8856 * s/msdos.h: Remove file.
8857 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8858 * Makefile.in (S_FILE): Remove.
8859 (config_h): Remove S_FILE.
8860
c90acc54
JB
88612012-08-01 Juanma Barranquero <lekktu@gmail.com>
8862
8863 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8864 Remove; moved to nt/config.nt.
8865
d8a05828
DA
88662012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8867
8868 Use INTERNAL_FIELD for conses and overlays.
8869 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8870 Remove obsolete comment.
8871 (MVAR): New macro.
8872 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8873 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8874
8271d590
DA
88752012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8876
8877 Use INTERNAL_FIELD for symbols.
8878 * lisp.h (SVAR): New macro. Adjust users.
8879 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8880 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8881
3193acd2
DA
88822012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8883
8884 Use INTERNAL_FIELD for processes.
8885 * process.h (PVAR): New macro. Adjust style.
8886 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8887 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8888
3a45383a
DA
88892012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8890
8891 Use INTERNAL_FIELD for windows.
8892 * window.h (WVAR): New macro.
8893 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8894 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8895 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8896 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8897 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8898 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8899
c1dbc63c
PE
89002012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8903
5c0c0e8a
GM
89042012-08-01 Glenn Morris <rgm@gnu.org>
8905
8906 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8907 Move to configure.ac.
8908
552a99b4
JB
89092012-08-01 Juanma Barranquero <lekktu@gmail.com>
8910
8911 * makefile.w32-in (CONFIG_H): Update dependencies.
8912 (CONF_POST_H): New macro.
8913
8914 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8915
8d8e2dfe
GM
89162012-07-31 Glenn Morris <rgm@gnu.org>
8917
bc96620a
GM
8918 * Makefile.in (S_FILE): No longer set by configure.
8919
476b1b2d
GM
8920 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8921 is available.
8922 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8923
b2c7a106
GM
8924 * process.h (NULL_DEVICE):
8925 * emacs.c (SEPCHAR):
8926 * editfns.c (USER_FULL_NAME): Let configure set them.
8927
d53d062a
GM
8928 * s/README, s/template.h: Remove files.
8929
4515017f
GM
8930 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8931
8d8e2dfe
GM
8932 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8933 Move to configure.ac.
8934
5b20b3cc
EZ
89352012-07-31 Eli Zaretskii <eliz@gnu.org>
8936
1e0afd9a
EZ
8937 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8938 resulting renaming of 'struct frame' members.
8939
5b20b3cc
EZ
8940 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8941
8942 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8943 after introduction of FVAR.
8944
f1310128
JD
89452012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8946
79e721e0
JD
8947 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8948
8949 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8950 instead of compositeToPoint.
8951 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8952
8d7c7eed 8953 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8954
e34f7f79
DA
89552012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8956
8957 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8958 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8959 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8960 (BVAR): Change to use INTERNAL_FIELD.
8961 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8962 (KVAR): Change to use INTERNAL_FIELD.
8963 * frame.h (FVAR): New macro.
8964 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8965 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8966 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8967 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8968 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8969
c09bfb2f
DA
89702012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8971
8972 Miscellaneous fixes for non-default X toolkits.
8973 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8974 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8975 Move under #ifdef USE_LUCID.
8976 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8977 definition and usage to avoid warnings.
8978
14c114ae
JD
89792012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8980
8981 * nsterm.m (openFiles): Fix previous checkin.
8982
3bd21e82
PE
89832012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8984
8985 * indent.c (compute_motion): Remove unused local.
8986
c1529ded
GM
89872012-07-31 Glenn Morris <rgm@gnu.org>
8988
400d5621
GM
8989 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8990
268e2432
GM
8991 * conf_post.h [USG5_4]:
8992 Move remaining contents of s/usg5-4-common.h here.
8993 * s/usg5-4-common.h: Remove file.
8994
7552f3ee
GM
8995 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8996 * s/irix6-5.h: Remove file.
8997
6a381852
GM
8998 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8999 * s/darwin.h: Remove file.
9000
c1529ded
GM
9001 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9002 * s/hpux10-20.h: Remove file, which is now empty.
9003
b429a4ee
GM
90042012-07-30 Glenn Morris <rgm@gnu.org>
9005
9006 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9007 * Makefile.in (config_h): Add conf_post.h.
9008 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9009
adff3182
JD
90102012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9011
9012 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9013 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9014 (openFile, openTempFile, openFileWithoutUI, openFiles):
9015 Open files only if ns_do_open_file.
adff3182 9016
c32af1e4
PE
90172012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9018
7393bcbb
PE
9019 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9020 This no-op macro hasn't been needed for many years.
9021 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9022
c32af1e4
PE
9023 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9024 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9025 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9026 gdb_make_enums_visible.
9027 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9028 (DIRECTORY_SEP): Now a constant, not a macro.
9029
302fc036
EZ
90302012-07-30 Eli Zaretskii <eliz@gnu.org>
9031
9032 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9033 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9034
9035 * w32term.c <w32_keyboard_codepage>: Renamed from
9036 keyboard_codepage and now external. All users changed.
9037
9038 * w32term.h: Add declaration of w32_keyboard_codepage.
9039
9040 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9041 the codepage to translate keys to Unicode. If this argument is
9042 -1, use the value returned by GetConsoleCP. All callers changed.
9043
88fb40b4
PE
90442012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9045
0aee6912
PE
9046 Update .PHONY listings in makefiles.
9047 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9048 bootstrap-clean, distclean, maintainer-clean, versioclean,
9049 extraclean, frc.
9050
88fb40b4
PE
9051 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9052 This is a bit clearer. Fix some commentary typos.
9053
0a763bd1
GM
90542012-07-30 Glenn Morris <rgm@gnu.org>
9055
32bac6d6
GM
9056 * s/netbsd.h: Let configure include signal.h if needed.
9057 Remove file, which is now empty.
9058
b65e7c46
GM
9059 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9060 Let configure set them.
9061 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9062 No more need to undefine.
0a763bd1 9063
169304bd
AS
90642012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9065
9066 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9067 non-single-byte char when adding meta modifier. (Bug#12090)
9068
6cd7a139
DA
90692012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9070
9071 Convert safe_call to use variable number of arguments.
9072 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9073 (safe_call2): Fix comment.
9074 * lisp.h (safe_call): Adjust prototype.
9075 * coding.c (encode_coding_object): Change to use safe_call2.
9076 * xfaces.c (merge_face_heights): Change to use safe_call1.
9077
d34d6ffc
GM
90782012-07-30 Glenn Morris <rgm@gnu.org>
9079
7b8a48e4 9080 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9081 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9082
d34d6ffc
GM
9083 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9084 Remove empty files.
9085
03a660a6
PE
90862012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9087
9088 Export to GDB most of lisp.h's remaining object-like macros.
9089 * lisp.h (min, max): Move earlier, because they're used earlier now.
9090 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9091 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9092 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9093 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9094 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9095 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9096 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9097 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9098 Now constants, for GDB. They need not be macros.
9099 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9100 Now constants, for GDB, as well as macros, for static initializers.
9101 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9102 Move to after the definition of struct Lisp_Char_Table,
9103 since the former now needs that type defined.
9104 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9105 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9106 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9107 New enums, for gdb_make_enums_visible.
9108 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9109 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9110 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9111 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9112 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9113 enum maxargs, enum MAX_ALLOCA.
9114 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9115 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9116 no longer needed, now that they are done in lisp.h.
9117
e499d0ee
DA
91182012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9119
9120 Cleanup string bytes checking.
9121 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9122 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9123 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9124 (check_sblock, compact_small_strings): Simplify.
9125
d5040d2d
PE
91262012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9129 These macros are confusing and no longer need to be defined, as
9130 the enum values now suffice. All uses replaced with definiens.
9131 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9132
7f259ae6
JB
91332012-07-29 Juanma Barranquero <lekktu@gmail.com>
9134
9135 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9136 ($(BLD)/w32console.$(O)): Update dependencies.
9137
7e63e0c3
DA
91382012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9139
9140 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9141 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9142 time. Adjust users.
9143 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9144
ffd817eb
JD
91452012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9146
9147 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9148 setting sitelisp (Bug#12010).
9149
417a7a0e
EZ
91502012-07-29 Eli Zaretskii <eliz@gnu.org>
9151
14ae4239 9152 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9153
9154 * w32heap.c (cache_system_info):
9155 * w32.c (sys_rename):
9156 * w32proc.c (find_child_console, sys_kill): All users changed.
9157
387d4d92
PE
91582012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9159
9160 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9161
55a6cca6
EZ
91622012-07-29 Eli Zaretskii <eliz@gnu.org>
9163
9164 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9165
dbcf001c
DA
91662012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9167
9168 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9169 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9170 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9171
e2688e4a
DA
91722012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9173
9174 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9175 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9176 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9177 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9178 (replace_range, replace_range_2, del_range_2): Change to eassert.
9179 * marker.c (byte_char_debug_check): Adjust style.
9180
b46a6a83
PE
91812012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9182
9183 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9184 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9185 long-ago-commented-out code that talks about "WIN32".
9186 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9187 All uses changed.
9188
e32a5799
PE
91892012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9190
9191 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9192 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9193 Simplify by using alignof.
9194 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9195 * lisp.h: Include <stdalign.h>.
9196 (GCALIGNMENT): New macro and constant.
9197 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9198 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9199 (stdalign): New macro, if not already defined.
9200
df81cd29
EZ
92012012-07-28 Eli Zaretskii <eliz@gnu.org>
9202
01bd1b0d
EZ
9203 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9204 * w32inevt.c: Include w32inevt.h.
9205 (w32_read_console_input): New inline function, calls either
9206 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9207 w32_console_unicode_input.
9208 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9209 (w32_kbd_patch_key, key_event): Use the codepage returned by
9210 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9211 (key_event): use uChar.UnicodeChar only if
9212 w32_console_unicode_input is non-zero.
9213
9214 * w32console.c: Include w32heap.h.
9215 <w32_console_unicode_input>: New global variable.
9216 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9217 family of Windows, zero otherwise.
9218
9219 * w32inevt.h: Declare w32_console_unicode_input.
9220
df81cd29
EZ
9221 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9222 --without-x. (Bug#11742)
9223
c20fdd9e
PE
92242012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9225
9226 Adjust GDB to reflect pvec_type changes (Bug#12036).
9227 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9228 2012-07-04 changes to pseudovector representation.
9229 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9230
32770973 92312012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9232
9233 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9234 bus address.
9235 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9236
3438fe21
EZ
92372012-07-27 Eli Zaretskii <eliz@gnu.org>
9238
bcfbc9de
EZ
9239 * alloc.c (listn): Fix the order the arguments are consed onto the
9240 list.
9241
3438fe21
EZ
9242 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9243 enumeration constants, as PURE and HEAP are too general, and clash
9244 with other headers and sources, such as gmalloc.c and the
9245 MS-Windows system headers. All users changed.
9246
eeaea515
DA
92472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9248
9249 Revert last save_excursion_save and save_excursion_restore changes.
9250 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9251 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9252
073c88c2
DA
92532012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9254
9255 Fix recently-introduced typos in Windows port.
9256 Reported by Martin Rudalics <rudalics@gmx.at>.
9257 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9258 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9259
4706125e
PE
92602012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 Improve GDB symbol export (Bug#12036).
9263 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9264 arms of an 'if', not using conditional expressions; otherwise GDB
9265 complains about the types in the unevaluated arm when the argument
9266 is an integer literal.
9267 (xgetint): Simplify expression.
9268 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9269 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9270 Zaretskii in <http://bugs.gnu.org/12036#13>.
9271 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9272 needed now that we have gdb_make_enums_visible.
9273 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9274 (enum enum_USE_LSB_TAG):
9275 New enum types, packaging up enums that need to be exported to GDB.
9276
694b6c97
DA
92772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9278
9279 Utility function to make a list from specified amount of objects.
9280 * lisp.h (enum constype): New datatype.
9281 (listn): New prototype.
9282 * alloc.c (listn): New function.
9283 (Fmemory_use_count, syms_of_alloc): Use it.
9284 * buffer.c (syms_of_buffer): Likewise.
9285 * callint.c (syms_of_callint): Likewise.
9286 * charset.c (define_charset_internal): Likewise.
9287 * coding.c (syms_of_coding): Likewise.
9288 * keymap.c (syms_of_keymap): Likewise.
9289 * search.c (syms_of_search): Likewise.
9290 * syntax.c (syms_of_syntax): Likewise.
9291 * w32.c (init_environment): Likewise.
9292 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9293 * xdisp.c (syms_of_xdisp): Likewise.
9294 * xfns.c (syms_of_xfns): Likewise.
9295
6195f384
DA
92962012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9297
9298 Fast save_excursion_save and save_excursion_restore.
9299 * lisp.h (struct Lisp_Excursion): New data type.
9300 (PVEC_EXCURSION): New pseudovector type.
9301 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9302 to deal with it. Adjust comments.
9303 (init_marker, attach_marker): New prototype.
9304 (unchain_marker): Adjust prototype.
9305 * marker.c (attach_marker): Change to global.
9306 (init_marker): New function.
9307 * alloc.c (Fmake_marker, build_marker): Use it.
9308 (build_marker): More easserts.
9309 (mark_object): Handle struct Lisp_Excursion.
9310 * editfns.c (save_excursion_save, save_excursion_restore):
9311 Reimplement to use struct Lisp_Excursion. Add comments.
9312
5eceb8fb
PE
93132012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 Fix export of symbols to GDB (Bug#12036).
9316 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9317 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9318 emacs.c, as this is a more-suitable home. Had this been done earlier
9319 the fix for 12036 would have avoided some of the problems noted in
9320 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9321 would have been more obvious.
562157c8
PE
9322 * emacs.c: Do not include <verify.h>; no longer needed.
9323 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9324 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9325 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9326 Remove; now done in lisp.h.
9327 * lisp.h (PUBLISH_TO_GDB): New macro.
9328 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9329 (DATA_SEG_BITS): Use it.
9330 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9331 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9332 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9333 not be usable in #if. This simplifies things.
9334
d6749401
JB
93352012-07-26 Juanma Barranquero <lekktu@gmail.com>
9336
9337 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9338
1781b9e9
PE
93392012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9340
d89518db 9341 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9342 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9343 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9344 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9345 Adjust to changes in lisp.h and emacs.c, by using
9346 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9347 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9348 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9349 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9350 instead of gdb_valbits.
9351 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9352 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9353 instead of gdb_array_mark_flag.
9354 (xboolvector): Get size from $->size, not $->header.size.
9355 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9356 (xreload, hook-run, hookpost-run): Remove.
9357 * emacs.c: Include <verify.h>.
9358 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9359 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9360 Remove.
9361 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9362 (gdb_USE_LSB_TAG): New enum constants.
9363 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9364 Also define these as enum constants, so they're visible to GDB.
9365 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9366 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9367 as constants, so they're visible to GDB.
9368 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9369 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9370 Now enum constants, not macros, so they're visible to GDB.
9371 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9372 more convenient now. All uses changed.
9373 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9374 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9375
3628596a
DA
93762012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9377
9378 Explicitly free restriction data that are not needed anymore.
9379 * editfns.c (save_restriction_restore): Free restriction data.
9380
7abaf5cc
SM
93812012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9382
9383 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9384 add argument, tune behavior, and adjust all callers.
9385
71f88e00
PE
93862012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9387
9388 Use typedef for EMACS_INT, EMACS_UINT.
9389 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9390 than macros. This simplifies debugging in the usual case, since
9391 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9392 and it allows expressions involving EMACS_INT casts.
9393 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9394
57ec3034
JD
93952012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9396
9397 * nsterm.m (ns_read_socket): Return early if there is a modal
9398 window (Bug#12043).
9399
8137e7b3
MR
94002012-07-25 Martin Rudalics <rudalics@gmx.at>
9401
9402 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9403 that FOCUS-FRAME can be omitted.
9404
04e9897c
DA
94052012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9406
9407 Adjust buffer text indirection counters at the end of Fkill_buffer.
9408 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9409 buffer is definitely dead. This should really fix an issue reported
9410 by Christoph Scholtes again. (Bug#12007).
9411 (init_buffer_once): Initialize indirection counters of
9412 buffer_defaults and buffer_local_symbols (for sanity and safety).
9413
8a0484e1
EZ
94142012-07-24 Eli Zaretskii <eliz@gnu.org>
9415
9416 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9417 and continuation glyphs on tooltip frames, leave them at zero.
9418 Avoids continued lines in tooltips. (Bug#11832)
9419
fa691a83
DA
94202012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9421
9422 Simplify copy_overlay.
04e9897c 9423 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9424 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9425
436bc8e0
EZ
94262012-07-23 Eli Zaretskii <eliz@gnu.org>
9427
9428 * print.c (print_object): Don't crash when a frame's name is nil
9429 or invalid. (Bug#12025)
9430
9431 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9432 it signals an error when a tooltip frame is being created.
9433
d7a7fda3
DA
94342012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9435
9436 Cleanup miscellaneous objects allocation and initialization.
9437 * alloc.c (allocate_misc): Change to static. Add argument to
9438 specify the subtype. Adjust comment and users.
9439 (build_overlay): New function.
9440 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9441 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9442 (allocate_misc): Remove prototype.
9443 (build_overlay): Add prototype.
9444
94452012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9446
9447 Swap buffer text indirection counters in Fbuffer_swap_text.
9448 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9449 This avoids crash reported by Christoph Scholtes at
9450 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9451
9d7fa573
JD
94522012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9453
9454 * nsmenu.m (Popdown_data): New struct.
9455 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9456 free Popdown_data.
9457 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9458 (initWithContentRect): Make imgView and contentView non-static
9459 and autorelease them. Also autorelease img and matrix (Bug#12005).
9460 (dealloc): Remove (Bug#12005).
9461
0dd6d66d
DA
94622012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9463
9464 Adjust consing_since_gc when objects are explicitly freed.
9465 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9466 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9467 (free_cons, free_misc): Subtract object size from consing_since_gc.
9468
d36d71df
DA
94692012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9470
9471 Simplify and cleanup markers positioning code.
9472 * marker.c (attach_marker): More useful eassert.
9473 (live_buffer, set_marker_internal): New function.
9474 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9475 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9476
fb9ea40f
PE
94772012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9478
9479 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9480 as it's limited by the amount of memory, not by INT_MAX.
9481
2d5c5f7d
EZ
94822012-07-21 Eli Zaretskii <eliz@gnu.org>
9483
07fb592e
EZ
9484 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9485 in special-event-map. See the discussion at
9486 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9487 for the reasons.
9488
37a9eac8 9489 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9490 info.dwItemData. Fixes crashes on 64-bit Windows.
9491 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9492
c4328746
JD
94932012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9494
fc0c31f8 9495 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9496 (conversationIdentifier): Return value is NSInteger.
784051c4 9497 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9498
6e5d1c12
CY
94992012-07-21 Chong Yidong <cyd@gnu.org>
9500
9501 * window.c (decode_any_window): Signal an error if the window is
9502 on a dead frame (Bug#11984).
9503
9928463d
DA
95042012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9505
9506 Add indirection counting to speed up Fkill_buffer.
9507 * buffer.h (struct buffer): New member.
9508 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9509 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9510 base buffer indirection counter.
9511 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9512 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9513 through buffer list if indirection counter is 0.
9514
f8643a6b
DA
95152012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9516
9517 Extend the value returned by Fgarbage_collect with heap statistics.
9518 * alloc.c (Qheap): New symbol.
9519 (syms_of_alloc): DEFSYM it.
9520 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9521 (Fmemory_free): Remove.
9522 (syms_of_alloc): Don't defsubr it.
9523 * buffer.c (Fcompact_buffer): Remove.
9524 (syms_of_buffer): Don't defsubr it.
9525
dac616ff
DA
95262012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9527
9528 Make maybe_gc inline.
9529 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9530 * lisp.h (consing_since_gc, gc_relative_threshold)
9531 (memory_full_cons_threshold): Revert declaration.
9532 (maybe_gc): Remove prototype, define as inline.
9533 * alloc.c: Remove old commented-out code.
9534 (consing_since_gc, gc_relative_threshold)
9535 (memory_full_cons_threshold): Revert to global.
9536 (maybe_gc): Remove.
9537
d7ea76b4
DA
95382012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9539
9540 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9541 * lisp.h (build_unibyte_string): New function.
9542 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9543 * sysdep.c, w32fns.c, xfns.c: Use it.
9544 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9545 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9546 Adjust users accordingly.
9547 * font.h (font_open_by_name): Adjust prototype.
9548
765e61e3
DA
95492012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9550
9551 Cleanup calls to Fgarbage_collect.
9552 * lisp.h (maybe_gc): New prototype.
9553 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9554 Remove declarations.
9555 * alloc.c (maybe_gc): New function.
9556 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9557 Make them static.
9558 * bytecode.c (MAYBE_GC): Use maybe_gc.
9559 * eval.c (eval_sub, Ffuncall): Likewise.
9560 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9561 to avoid dependency from auto-save feature.
9562
52b852c7
PE
95632012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9566 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9567 'for_each_per_buffer_object_at'.
9568 All uses changed. It's better to use upper-case for macros that
9569 cannot be implemented as functions, to give the reader a clue
9570 that they're special.
9571
5db81e33
SM
95722012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9573
9574 * alloc.c (Fgarbage_collect): Tweak docstring.
9575
5b835e1d
DA
95762012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9577
9578 Tweak the value returned from Fgarbage_collect again.
9579 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9580 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9581 Adjust documentation.
9582 (total_vector_bytes): Rename to total_vector_slots, adjust
9583 accounting.
9584 (total_free_vector_bytes): Rename to total_free_vector_slots,
9585 adjust accounting.
9586 (Qstring_bytes, Qvector_slots): New symbols.
9587 (syms_of_alloc): DEFSYM them.
9588
9cd47b72
DA
95892012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9590
9591 Buffer compaction primitive which may be used from Lisp.
9592 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9593 (syms_of_buffer): Register Fcompact_buffer.
9594 * alloc.c (Fgarbage_collect): Use compact_buffer.
9595 * buffer.h (compact_buffer): New prototype.
9596 (struct buffer_text): New member.
9597
d17337e5
DA
95982012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9599
9600 New macro to iterate over all buffers, miscellaneous cleanups.
9601 * lisp.h (all_buffers): Remove declaration.
9602 * buffer.h (all_buffers): Add declaration, with comment.
9603 (for_each_buffer): New macro.
9604 * alloc.c (Fgarbage_collect, mark_object): Use it.
9605 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9606 (init_buffer): Likewise.
9607 * data.c (Fset_default): Likewise.
9608 * coding.c (code_conversion_restore): Remove redundant check
9609 for dead buffer.
9610 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9611
60cfd278
AS
96122012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9613
9614 Fix bug that created negative-length intervals.
9615 * intervals.c (merge_interval_right, merge_interval_left):
9616 Do not zero out this interval if it is absorbed by its children,
9617 as this interval's total length doesn't change in that case. See
9618 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9619
d06714cb
PE
96202012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9621
83713154
PE
9622 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9623 when invoking (make-bool-vector N t) and N is a positive
9624 multiple of 8 -- the last 8 bits were mistakenly cleared.
9625
d06714cb
PE
9626 Remove some struct layout assumptions in bool vectors.
9627 * alloc.c (bool_header_size): New constant.
9628 (header_size, word_size): Move earlier, as they're now used earlier.
9629 Use 'word_size' in a few more places, where it's appropriate.
9630 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9631 padding before the data member of a bool vector.
9632 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9633 than doing the check by hand with an abort ().
9634
464d5a5e
SM
96352012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9636
5fbc0409
SM
9637 * eval.c (Fdefvar): Don't check constants since we only set the var if
9638 it's not yet defined anyway (bug#11904).
9639
464d5a5e
SM
9640 * lisp.h (last_undo_boundary): Declare new var.
9641 * keyboard.c (command_loop_1): Set it.
9642 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9643 were auto-added by the command loop (bug#11774).
9644
8dc2e44a
AS
96452012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9646
9647 * w32font.c (Qsymbol): Remove local definition.
9648 (syms_of_w32font): Don't DEFSYM it.
9649
169925ec
DA
96502012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9651
9652 Fix sweep_vectors to handle large bool vectors correctly.
9653 * alloc.c (sweep_vectors): Account total_vector_bytes for
9654 bool vectors larger than VBLOCK_BYTES_MAX.
9655
5fbfb018
CY
96562012-07-18 Chong Yidong <cyd@gnu.org>
9657
9658 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9659 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9660
3ab6e069
DA
96612012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9662
9663 Return more descriptive data from Fgarbage_collect.
9664 Suggested by Stefan Monnier in
9665 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9666 * alloc.c (bounded_number): New function.
9667 (total_buffers, total_vectors): New variable.
9668 (total_string_size): Rename to total_string_bytes, adjust users.
9669 (total_vector_size): Rename to total_vector_bytes, adjust users.
9670 (sweep_vectors): Account total_vectors and total_vector_bytes.
9671 (Fgarbage_collect): New return value. Adjust documentation.
9672 (gc_sweep): Account total_buffers.
9673 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9674 (VECTOR_SIZE): Remove.
9675 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9676 (Qinterval, Qmisc): New symbols.
9677 (syms_of_data): Initialize them.
9678 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9679 (Qcons, Qbuffer): New declarations.
9680
6d02fe5b
PE
96812012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9682
9683 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9684 Round up, not down. Improve doc.
9685
b7ffe040
DA
96862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9687
9688 Restore old code in allocate_string_data to avoid Faset breakage.
9689 Reported by Julien Danjou <julien@danjou.info> in
9690 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9691 * alloc.c (allocate_string_data): Restore old code with minor
9692 adjustments, fix comment to explain this subtle issue.
9693
4dc7c8d5
SM
96942012-07-17 Eli Zaretskii <eliz@gnu.org>
9695
9696 Remove FILE_SYSTEM_CASE.
9697 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9698
9699 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9700 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9701 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9702 call-process-region passes it through expand-file-name.
9703
9704 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9705
97062012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9707
9708 Fix crash when creating indirect buffer (Bug#11917)
9709 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9710 Don't handle unbound variables specially if non-zero.
9711 (Fbuffer_local_variables): Pass zero.
9712 (clone_per_buffer_values): Pass non-zero.
9713
97142012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9715
9716 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9717 to make the loop interruptible.
9718
97192012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9720
9721 * gnutls.c (emacs_gnutls_handshake): Only retry if
9722 GNUTLS_E_INTERRUPTED.
9723
cce7fefc
DA
97242012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9725
9726 Cleanup and convert miscellaneous checks to eassert.
9727 * alloc.c (mark_interval): Fix comment, partially rephrase
9728 old comment from intervals.h (see below).
9729 * intervals.c (find_interval, adjust_intervals_for_insertion)
9730 (delete_interval, adjust_intervals_for_deletion)
9731 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9732 Convert to eassert.
9733 (adjust_intervals_for_insertion, make_new_interval):
9734 Remove obsolete and unused code.
9735 * intervals.h (struct interval): Remove obsolete comment.
9736 * textprotp.c (erase_properties): Remove unused code.
9737 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9738 (Fremove_list_of_text_properties): Convert to eassert.
9739
9ea10cc3
CY
97402012-07-17 Chong Yidong <cyd@gnu.org>
9741
9742 * editfns.c (Finsert_char): Doc fix.
9743
3900d5de
DA
97442012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9745
9746 Fix previous change to make Fmemory_free always accurate.
9747 * alloc.c (make_interval): Update total_free_intervals.
9748 (make_float): Likewise for total_free_floats.
9749 (free_cons, Fcons): Likewise for total_free_conses.
9750 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9751 Likewise for total_free_vector_bytes.
9752 (Fmake_symbol): Likewise for total_free_symbols.
9753 (bytes_free): Remove.
9754
7098646f
DA
97552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9756
9757 Simple free memory accounting feature.
9758 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9759 (sweep_vectors): Accumulate size of free vectors.
9760 (Fgarbage_collect): Setup bytes_free.
9761 (Fmemory_free): New function.
9762 (syms_of_alloc): Register it.
9763
22657b40
DA
97642012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9765
9766 Cleanup overlays checking.
9767 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9768 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9769 eassert and OVERLAYP.
9770 (sort_overlays): Change to use OVERLAYP.
9771
ddfc8813
RK
97722012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9773
9774 * editfns.c (Finsert_char): Make it interactive, and make the
9775 second arg optional. Copy interactive spec and docstring from
9776 ucs-insert.
9777
7c26cf3c
PE
97782012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9779
9780 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9781 Unlike the other wrapped functions, fabs has an unspecified
9782 effect on errno.
9783
5d127af9
JD
97842012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9785
9786 * nsterm.m (keyDown): Interpret flags without left/right bits
9787 as the left key (Bug#11670).
9788
6a0dd1d7
DA
97892012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9790
9791 Remove empty and useless init functions.
9792 * lisp.h (init_character_once, init_fns, init_image)
9793 (init_filelock, init_sound): Remove prototype.
9794 * character.c (init_character_once): Remove.
9795 * filelock.c (init_filelock): Likewise.
9796 * fns.c (init_fns): Likewise.
9797 * image.c (init_image): Likewise.
9798 * sound.c (init_sound): Likewise.
9799 * emacs.c (main): Adjust accordingly.
9800
7a6136fd
DA
98012012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9802
9803 * gtkutil.h: Tiny cleanups.
9804 (use_old_gtk_file_dialog): Remove useless declaration.
9805 (xg_uses_old_file_dialog): Add suggested const attribute.
9806
ce811ad9
EZ
98072012-07-15 Eli Zaretskii <eliz@gnu.org>
9808
9809 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9810 (bidi_paragraph_init): Use it to limit search forward for a strong
9811 directional character in abnormally large paragraphs full of
9812 neutral or weak characters. (Bug#11943)
9813
c9adfeaa
SF
98142012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9815
9816 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9817 the toolbar (Bug#9451).
9818 (xg_make_tool_item): Give the widget event box a transparent
9819 background.
9820
fff62aa9
DA
98212012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9822
9823 Cleanup basic allocation variables and functions.
9824 * alloc.c (ignore_warnings, init_intervals, init_float)
9825 (init_cons, init_symbol, init_marker): Remove.
9826 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9827 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9828 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9829 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9830 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9831 (staticidx, init_alloc_once, init_strings, free_ablock):
9832 Remove redundant initialization.
9833 * fns.c (init_weak_hash_tables): Remove.
9834 * lisp.h (init_weak_hash_tables): Remove prototype.
9835
9730daca
DA
98362012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9837
9838 Use zero_vector where appropriate.
9839 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9840 accordingly.
9841 * lisp.h (zero_vector): New declaration.
9842 * font.c (null_vector): Remove.
9843 (syms_of_font): Remove initialization and staticpro.
9844 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9845 * keymap.c (Faccessible_keymaps): Likewise.
9846
2e2d2a13
LL
98472012-07-15 Leo Liu <sdl.web@gmail.com>
9848
9849 * fringe.c: Fix typo in comments.
9850
cd276f6e
LL
98512012-07-14 Leo Liu <sdl.web@gmail.com>
9852
9853 * fringe.c: Add a new bitmap exclamation-mark.
9854
5a1131d9
EZ
98552012-07-14 Eli Zaretskii <eliz@gnu.org>
9856
9857 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9858
9859 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9860 (HAVE_MENUS): Don't define, defined by editing config.in with
9861 msdos/sed2v2.inp.
9862 (GMALLOC_INHIBIT_VALLOC): Don't define.
9863 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9864
22e983b7
JB
98652012-07-14 Juanma Barranquero <lekktu@gmail.com>
9866
9867 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9868
5b3f250f
GM
98692012-07-14 Glenn Morris <rgm@gnu.org>
9870
9871 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9872 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9873 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9874
33d63ff4
GM
98752012-07-13 Glenn Morris <rgm@gnu.org>
9876
5b633342
GM
9877 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9878
33d63ff4
GM
9879 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9880 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9881
b55b9f85
JD
98822012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9883
0dc8cf50
JD
9884 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9885 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9886 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9887 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9888 where appropriate.
9889 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9890 as boolean expression.
9891 (x_set_window_size): Remove unused variable toolbar.
9892 (ns_get_color_default, ns_mod_to_lisp): Remove.
9893 (ns_mouse_position): Remove unused variables xchar and ychar.
9894 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9895 (ns_set_vertical_scroll_bar): Remove unused variable count.
9896 (ns_delete_terminal): Remove unused variable i.
9897 (ns_term_init): Remove unused variables r, g and b.
9898 (mouseDown): Remove unused variable window.
9899 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9900 (initFrameFromEmacs): Remove unused variable vbextra.
9901 (mouseEntered): Remove unused variables p and dpyinfo.
9902 (mouseExited): Remove unused variables p and r.
9903 (ns_define_frame_cursor, ns_clear_frame_area)
9904 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9905 (menuDown): Assign [sender tag] to variable and cast the variable.
9906
9907 * nsterm.h (menuDown): Add id as type to argument sender.
9908 (ns_display_info_for_name): Add Lisp_Object argument.
9909 (ns_term_init): Add Lisp_Object argument.
9910 (ns_map_event_to_object): Add void argument.
9911 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9912 prototype with arguments and only declare if __OBJC__.
9913 (nxatoms_of_nsselect): Add void argument.
9914 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9915 (ns_alloc_autorelease_pool): Add void argument.
9916 (ns_release_autorelease_pool): Add void* argument.
9917 (ns_get_defaults_value): Add const char* argument.
9918
9919 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9920 (initFromContents): Use SSDATA where appropriate.
9921 (ns_update_menubar): Add braces to ambigous if-else.
9922 (initWithTitle): Put () around assignment in if statement.
9923 (ns_menu_show): Remove unused variables window and keymap.
9924 (update_frame_tool_bar): Remove unused variable selected_p.
9925 (initWithContentRect): Remove unused variable this_cmd_name.
9926
9927 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9928 appropriate.
9929 (setXBMColor): Remove unused variable len.
9930 (setPixmapData): Put () around assignment in loop statement.
9931
9932 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9933 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9934 where appropriate.
9935 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9936 around assignment in loop statement.
9937 (nsfont_open): Remove unused variable i.
9938 (nsfont_open): Remove unused variable len.
9939 (nsfont_draw): Remove unused variable cs.
9940
9941 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9942 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9943 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9944 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9945 (Fns_font_name, Fns_perform_service)
9946 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9947 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9948 (ns_set_name): Remove unused variable view.
9949 (x_set_menu_bar_lines): Remove unused variable olines.
9950 (x_set_tool_bar_lines): Remove unused variable root_window.
9951 (Fns_list_colors): Put () around assignment in while statement.
9952 (Fns_perform_service): Remove unused variable len.
9953 (Fns_display_usable_bounds): Remove unused variable top.
9954 (syms_of_nsfns): Remove unused variable i.
9955
b55b9f85
JD
9956 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9957 memcpy (Bug#11907).
9958
ed9265fc 99592012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9960
9961 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9962 and free it with DestroyExceptionInfo (Bug#11558).
9963
ef099b57
JB
99642012-07-13 Juanma Barranquero <lekktu@gmail.com>
9965
9966 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9967 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9968 Set here, not in nt/config.nt.
9969
ea814a5d
EZ
99702012-07-13 Eli Zaretskii <eliz@gnu.org>
9971
9972 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9973 cursor overflow into the last glyph on display line when the right
9974 fringe is off. (Bug#11832)
9975
1a952767
PE
99762012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9977
9978 * xdisp.c (produce_special_glyphs): Now static.
9979 * dispextern.h (produce_special_glyphs): Remove decl.
9980
983188fd
GM
99812012-07-13 Glenn Morris <rgm@gnu.org>
9982
8d7c7eed 9983 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9984 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9985
983188fd
GM
9986 * s/usg5-4-common.h (USG, USG5):
9987 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9988 * s/sol2-6.h (SOLARIS2):
9989 * s/irix6-5.h (IRIX6_5):
9990 * s/hpux10-20.h (USG, USG5, HPUX):
9991 * s/gnu-linux.h (USG, GNU_LINUX):
9992 * s/freebsd.h (BSD_SYSTEM):
9993 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9994 * s/cygwin.h (CYGWIN):
9995 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9996 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9997
d1e68667 99982012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9999
10000 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10001
6de0e799
GM
100022012-07-13 Glenn Morris <rgm@gnu.org>
10003
739ae010
GM
10004 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10005
dbee5793
GM
10006 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10007
6de0e799
GM
10008 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10009 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10010
b82da769
GM
100112012-07-12 Glenn Morris <rgm@gnu.org>
10012
4fae5a7a 10013 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10014
10015 * process.c (init_process_emacs): Rename from init_process.
10016 The old name is also the name of a Mach system call.
10017 * lisp.h, emacs.c: Update for this name change.
10018 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10019 longer needed.
10020
5a979817
EZ
100212012-07-12 Eli Zaretskii <eliz@gnu.org>
10022
10023 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10024 memmove call that removes glyphs covered by the left truncation
10025 glyph. Improve commentary.
10026 (display_line): Fix display of continuation glyphs on GUI frames
10027 when the right fringe is turned off and variable-size fonts are
10028 used in the window. Move the code that appends a stretch glyph to
10029 produce_special_glyphs, so that it could be used for truncation
10030 and continuation glyphs alike.
10031 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10032 glyph of a suitably computed width, to align the special glyphs at
10033 the window margin. Code moved from display_line. (Bug#11832)
10034
3e91a053
GM
100352012-07-12 Glenn Morris <rgm@gnu.org>
10036
ba9e4b84
GM
10037 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10038
10039 * s/gnu-linux.h, s/hpux10-20.h:
10040 Do not unconditionally define HAVE_XRMSETDATABASE.
10041
3e91a053
GM
10042 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10043
b300b1f4
PE
100442012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 Fix typos that broke OS X build.
10047 Reported by Randal L. Schwartz in
10048 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10049 * nsterm.m (ns_timeout): Add missing local decl.
10050 (ns_get_color): snprintf -> sprintf, to fix typo.
10051
6e777848
GM
100522012-07-12 Glenn Morris <rgm@gnu.org>
10053
3f922c37
GM
10054 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10055 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10056 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10057 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10058
0ab7b23a
GM
10059 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10060 Move PTY_OPEN to configure.
10061
6e777848
GM
10062 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10063 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10064 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10065
4a7edc24
DA
100662012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10067
10068 Use empty_unibyte_string where applicable.
10069 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10070 * lread.c (read1): Likewise.
10071 * xsettings.c (syms_of_xsettings): Likewise.
10072
308aab79
GM
100732012-07-12 Glenn Morris <rgm@gnu.org>
10074
42bd1719
GM
10075 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10076 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10077 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10078 * s/hpux10-20.h (RUN_TIME_REMAP):
10079 * s/bsd-common.h (TABDLY): Move to configure.
10080
10081 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10082
10083 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10084
ea0bbd17 10085 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10086 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10087
10088 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10089
308aab79
GM
10090 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10091 * s/template.h: Move NARROWPROTO to configure.
10092
ee1cf5cf
GM
100932012-07-11 Glenn Morris <rgm@gnu.org>
10094
30fe9bf4
GM
10095 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10096 unused since 2011-01-17 change to systty.h.
10097
ee1cf5cf
GM
10098 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10099 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10100 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10101
63e47e07
PE
101022012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10103
10104 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10105
c43fb4c3
GM
101062012-07-11 Glenn Morris <rgm@gnu.org>
10107
10108 * s/darwin.h, s/gnu-linux.h, s/template.h:
10109 Move INTERRUPT_INPUT to configure.
10110
e8df9267
DA
101112012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10112
10113 Minor adjustments to interning code.
10114 * lisp.h (intern, intern_c_string): Redefine as static inline
10115 wrappers for intern_1 and intern_c_string_1, respectively.
10116 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10117 * lread.c (intern_1, intern_c_string_1, oblookup):
10118 Simplify Vobarray checking.
e8df9267
DA
10119 * font.c (font_intern_prop): Likewise. Adjust comment.
10120 * w32font.c (intern_font_name): Likewise.
10121
34348bd4
AS
101222012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10123
d96a1e0c
AS
10124 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10125
34348bd4
AS
10126 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10127 of Fcar/Fcdr if possible.
10128 * font.c (check_otf_features): Likewise.
10129 * fontset.c (Fnew_fontset): Likewise.
10130 * gnutls.c (Fgnutls_boot): Likewise.
10131 * minibuf.c (read_minibuf): Likewise.
10132 * msdos.c (IT_set_frame_parameters): Likewise.
10133 * xmenu.c (Fx_popup_dialog): Likewise.
10134 * w32menu.c (Fx_popup_dialog): Likewise.
10135
c8add24e
GM
101362012-07-11 Glenn Morris <rgm@gnu.org>
10137
4b575b3c
GM
10138 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10139 since nothing has defined it on these platforms.
10140
09f4e3b0
GM
10141 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10142 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10143
172bedef
GM
10144 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10145 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10146 Move CLASH_DETECTION to configure.
10147
249685df
GM
10148 * s/gnu.h: Remove file, which is now empty.
10149
c8add24e
GM
10150 * s/gnu.h, s/gnu-linux.h:
10151 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10152
b41253a3
JW
101532012-07-11 John Wiegley <johnw@newartisans.com>
10154
10155 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10156 function attribute, so we only use it if it exists in the
10157 compiler.
10158
d923b542
DA
101592012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10160
10161 Avoid call to strlen in fast_c_string_match_ignore_case.
10162 * search.c (fast_c_string_match_ignore_case): Change to use
10163 length argument. Adjust users accordingly.
10164 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10165
5ebbef1d
PE
101662012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10167
bb352260
PE
10168 Assume mkdir, rmdir.
10169 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10170 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10171
57054ddd
PE
10172 Assume rename.
10173 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10174
b747d3f7
PE
10175 Assume perror.
10176 * s/hpux10-20.h (HAVE_PERROR): Remove.
10177 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10178 Remove dummy definition, as this problem was obsolete long ago.
10179
5ebbef1d
PE
10180 Assume strerror.
10181 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10182
984e7f30
DA
101832012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10184
10185 Avoid calls to strlen in font processing functions.
10186 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10187 (font_open_by_name): Change to use length argument.
10188 Adjust users accordingly.
d923b542
DA
10189 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10190 Adjust prototypes.
10191 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10192 Change to return ptrdiff_t.
984e7f30
DA
10193 (xfont_list_pattern, xfont_match): Use length returned by
10194 xfont_decode_coding_xlfd.
10195 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10196
20e94fdd
GM
101972012-07-11 Glenn Morris <rgm@gnu.org>
10198
9d596af3
GM
10199 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10200 Move DONT_REOPEN_PTY to configure.
10201
20e94fdd
GM
10202 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10203 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10204
e99a530f
PE
102052012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10206
22ffb973
PE
10207 Remove "#define unix" that is no longer needed (Bug#11905).
10208 * s/aix4-2.h (unix): Remove; no longer needed.
10209
e9a9ae03
PE
10210 EMACS_TIME simplification (Bug#11875).
10211 This replaces macros (which typically do not work in GDB)
10212 with functions, typedefs and enums, making the code easier to debug.
10213 The functional style also makes code easier to read and maintain.
10214 * systime.h: Include <sys/time.h> on all hosts, not just if
10215 WINDOWSNT, since 'struct timeval' is needed in general.
10216 (EMACS_TIME): Now a typedef, not a macro.
10217 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10218 not macros.
10219 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10220 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10221 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10222 (EMACS_TIME_LE): Now functions, not macros.
10223 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10224 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10225 which are not functions. All uses rewritten to use:
10226 (make_emacs_time): New function.
10227 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10228 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10229 not functions. All uses rewritten to use the following, respectively:
10230 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10231 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10232 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10233 * fileio.c (Fcopy_file):
10234 * xterm.c (XTflash): Get the current time closer to when it's used.
10235 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10236
ffacb126
PE
10237 * bytecode.c (targets): Suppress -Woverride-init warnings.
10238
e99a530f
PE
10239 Simplify by avoiding confusing use of strncpy etc.
10240 * doc.c (Fsnarf_documentation):
10241 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10242 * frame.c (Fmake_terminal_frame):
10243 * gtkutil.c (get_utf8_string):
10244 * lread.c (openp):
10245 * nsmenu.m (ns_update_menubar):
10246 * regex.c (regerror):
10247 Prefer memcpy to strncpy and strncat when either will do.
10248 * fileio.c (Fsubstitute_in_file_name):
10249 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10250 (menu_separator_name_p):
10251 * nsmenu.m (ns_update_menubar):
10252 Prefer memcmp to strncmp when either will do.
10253 * nsterm.m: Include <ftoastr.h>.
10254 (ns_get_color):
10255 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10256 Prefer snprintf to strncpy.
10257 * nsterm.m (ns_term_init):
10258 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10259 * nsterm.m (ns_term_init):
10260 Avoid the need for strncpy, by using build_string or
10261 make_unibyte_string directly. Use dtoastr, not snprintf.
10262 * process.c (Fmake_network_process): Diagnose service names that
10263 are too long, rather than silently truncating them or creating
10264 non-null-terminated names.
10265 (Fnetwork_interface_info): Likewise, for interface names.
10266 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10267 Prefer sprintf to strncat.
10268 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10269 Prefer vsnprintf to vsprintf + strncpy.
10270
c59592b3
GM
102712012-07-10 Glenn Morris <rgm@gnu.org>
10272
10273 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10274 Clarify fallback case.
10275
7d7bbefd
DA
102762012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10277
10278 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10279 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10280 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10281 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10282 where argument type is known to be a Lisp_Cons.
10283
3a4c8000
TT
102842012-07-10 Tom Tromey <tromey@redhat.com>
10285
10286 * bytecode.c (BYTE_CODE_THREADED): New macro.
10287 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10288 (enum byte_code_op): New type.
10289 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10290 (exec_byte_code): Use them. Use token threading when applicable.
10291
2a0213a6
DA
102922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10293
10294 Optimize pure C strings initialization.
10295 * lisp.h (make_pure_string): Fix prototype.
10296 (build_pure_c_string): New function, defined as static inline. This
10297 provides a better opportunity to optimize away calls to strlen when
10298 the function is called with compile-time constant argument.
10299 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10300 argument, adjust users accordingly. Use build_pure_c_string where
10301 appropriate.
10302 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10303 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10304 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10305
cb1caeaf
DA
103062012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10307
10308 Avoid calls to strlen in miscellaneous functions.
10309 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10310 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10311 * lread.c (openp): Likewise.
10312
c293e30c
DA
103132012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10314
10315 Avoid calls to strlen in path processing functions.
10316 * fileio.c (file_name_as_directory): Add comment. Change to add
10317 srclen argument and return the length of result. Adjust users
10318 accordingly.
10319 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10320 swap 1st and 2nd arguments to obey the common convention.
10321 Adjust users accordingly.
c293e30c
DA
10322 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10323
9e059e3f
GM
103242012-07-10 Glenn Morris <rgm@gnu.org>
10325
d02eb359
GM
10326 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10327 Move PENDING_OUTPUT_COUNT definition to configure.
10328
882cf227
GM
10329 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10330 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10331 * s/gnu.h (DATA_START): Move definitions to configure.
10332
af6e839f
GM
10333 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10334 We include usg5-4-common.h, which defines them both.
10335
40289a12
GM
10336 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10337 O_RDONLY already includes it).
10338
9e059e3f
GM
10339 Stop ns builds setting the EMACSLOADPATH environment variable.
10340 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10341 Now it does not set EMACSLOADPATH, just returns the load-path string.
10342 * nsterm.h: Update accordingly.
10343 * lread.c [HAVE_NS]: Include nsterm.h.
10344 (init_lread) [HAVE_NS]: Use ns_load_path.
10345 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10346
7c4e8ec0
GM
103472012-07-09 Glenn Morris <rgm@gnu.org>
10348
d4f600ff
GM
10349 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10350 since the included bsd-common.h does so.
10351
cbb31951
GM
10352 Stop ns builds setting the EMACSPATH environment variable.
10353 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10354 (ns_init_paths): Do not set EMACSPATH.
10355 * nsterm.h (ns_exec_path): Add it.
10356 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10357 Use ns_exec_path.
10358
7c4e8ec0
GM
10359 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10360
26bccfae
PE
103612012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10362
a0bee46f
PE
10363 * process.c (wait_reading_process_output): 'waitchannels' was unset
10364 when read_kbd || !NILP (wait_for_cell); fix this.
10365
5994c183
PE
10366 Add GCC-style 'const' attribute to functions that can use it.
10367 * character.h (char_resolve_modifier_mask):
10368 * keyboard.h (make_ctrl_char):
10369 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10370 (init_character_once, next_almost_prime, init_fns, init_image)
10371 (flush_pending_output, init_sound):
10372 * mem-limits.h (start_of_data):
10373 * menu.h (finish_menu_items):
10374 Add ATTRIBUTE_CONST.
10375 * emacs.c (DEFINE_DUMMY_FUNCTION):
10376 Declare the dummy function with ATTRIBUTE_CONST.
10377 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10378 Add decls with ATTRIBUTE_CONST.
10379
26bccfae
PE
10380 Minor improvements to make_formatted_string.
10381 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10382 where int is good enough, as vsprintf returns an int.
10383 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10384
a8290ec3
DA
103852012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10386
10387 Use make_formatted_string to avoid double length calculation.
10388 * lisp.h (make_formatted_string): New prototype.
10389 * alloc.c (make_formatted_string): New function.
10390 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10391 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10392 * editfns.c (Fcurrent_time_zone): Likewise.
10393 * filelock.c (get_boot_time): Likewise.
10394 * frame.c (make_terminal_frame, set_term_frame_name)
10395 (x_report_frame_params): Likewise.
10396 * image.c (gs_load): Likewise.
10397 * minibuf.c (get_minibuffer): Likewise.
10398 * msdos.c (dos_set_window_size): Likewise.
10399 * process.c (make_process): Likewise.
10400 * xdisp.c (ensure_echo_area_buffers): Likewise.
10401 * xsettings.c (apply_xft_settings): Likewise.
10402
d01ba2f1
GM
104032012-07-09 Glenn Morris <rgm@gnu.org>
10404
10405 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10406 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10407 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10408 * nsterm.h (ns_etc_directory): Add it.
10409 * callproc.c [HAVE_NS]: Include nsterm.h.
10410 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10411
f1f924b6
DA
104122012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10413
10414 Move marker debugging code under MARKER_DEBUG.
10415 * marker.c (MARKER_DEBUG): Move marker debugging code under
10416 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10417 for bootstrap with --enable-checking (~3x slowdown reported
10418 by Juanma Barranquero <lekktu@gmail.com>).
10419 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10420
ab531b66
PE
104212012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10422
10423 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10424 See <http://bugs.gnu.org/11825#29>.
10425
c4b3bc8a
EZ
104262012-07-08 Eli Zaretskii <eliz@gnu.org>
10427
10428 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10429 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10430 (display_line): Add commentary about displaying truncation glyphs
10431 on GUI frames.
10432 (produce_special_glyphs): Move here from term.c.
10433
10434 * term.c (produce_special_glyphs): Move to xdisp.c.
10435
10436 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10437 section.
c4b3bc8a 10438
b676b881
AS
104392012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10440
f17c5273
AS
10441 * xdisp.c (display_line): Avoid warning about implicit declaration
10442 of FRAME_FONT.
10443
298819b9
AS
10444 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10445
b676b881
AS
10446 * lisp.h: Remove empty conditional.
10447
6045c4fd
PE
104482012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10449
b3350bf9
PE
10450 * lread.c (load_path_check): Now static.
10451
6045c4fd
PE
10452 Fix some minor --with-ns problems found by static checking.
10453 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10454 (x_set_font) [!HAVE_X_WINDOWS]:
10455 * image.c (xpm_load_image) [HAVE_NS]:
10456 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10457 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10458 Remove unused local.
10459 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10460 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10461 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10462 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10463 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10464 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10465 Fix pointer signedness problem.
10466 * xfaces.c (FRAME_X_FONT_TABLE):
10467 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10468
929e7845
GM
104692012-07-07 Glenn Morris <rgm@gnu.org>
10470
10471 * lread.c (load_path_check): New function, split from init_lread.
10472 (init_lread): Reorganize. Motivation:
10473 If EMACSLOADPATH is set, check/warn about that rather than the
10474 defaults, which we are not going to use. Hence we can remove
10475 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10476 Don't warn if site-lisp directories are missing.
10477 If not installed, start from a blank load-path, since
10478 PATH_LOADSEARCH refers to the eventual installation directories.
10479
58dd0aa4
EZ
104802012-07-07 Eli Zaretskii <eliz@gnu.org>
10481
10482 Support truncation and continuation glyphs on GUI frames, when
10483 fringes are disabled. (Bug#11832)
10484 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10485 continuation glyphs even if on GUI frames.
10486 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10487 or both, are absent.
10488 (start_display, move_it_in_display_line_to): Handle the case of a
10489 GUI frame without a fringe to display continuation or truncation
10490 glyphs.
10491 (insert_left_trunc_glyphs): Support GUI frames: make sure
10492 truncation glyphs overwrite enough glyphs from the current line to
10493 have sufficient space in pixels.
10494 (display_line): Support truncation and continuation glyphs on GUI
10495 frames. If some spare pixels are left on the line after inserting
10496 the truncation glyphs, fill that space with a stretch glyph of a
10497 suitably computed width.
10498
10499 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10500 produce_glyphs, to support GUI sessions.
10501
31571fd7
PE
105022012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10503
5a16b9bc
PE
10504 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10505
f3047c75
PE
10506 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10507
31571fd7
PE
10508 Do not require float-time's arg to fit in time_t (Bug#11825).
10509 This works better on hosts where time_t is unsigned, and where
10510 float-time is applied to the (negative) difference between two times.
10511 * editfns.c (decode_time_components): Last arg is now double *,
10512 not int *, and means to store all the result as a double, without
10513 worrying about whether the seconds part fits in time_t.
10514 All callers changed.
10515 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10516 All callers changed.
10517 (Ffloat_time): Do not fail merely because the specified time falls
10518 outside of time_t range.
10519
4516fbef
GM
105202012-07-07 Glenn Morris <rgm@gnu.org>
10521
10522 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10523 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10524 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10525
07adc2c6
JB
105262012-07-07 Juanma Barranquero <lekktu@gmail.com>
10527
10528 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10529 Update dependencies.
10530
10531 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10532
fd573f31
PE
105332012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10534
fee5959d
PE
10535 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10536 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10537 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10538 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10539 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10540 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10541
fd573f31
PE
10542 * xfont.c (compare_font_names): Redo to omit the need for casts.
10543
ddadbc0e
AS
105442012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10545
fca8d6b6
AS
10546 * xfns.c (Fx_change_window_property): Doc fix.
10547 * w32fns.c (Fx_change_window_property): Doc fix.
10548
ddadbc0e
AS
10549 * w32fns.c (Fx_window_property): Accept the same arguments as the
10550 X Windows version. Doc fix.
10551 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10552
ed9265fc 105532012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10554 Eli Zaretskii <eliz@gnu.org>
10555
10556 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10557 Windows-specific code from nt/config.nt moved here.
10558 Obsolete settings removed.
10559
216ee680
PE
105602012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10561
10562 * process.c: Avoid unnecessary calls to gettime.
10563 (wait_reading_process_output): Don't get the time of day
10564 when gobbling data immediately and not waiting, as there's no need
10565 for it in that case. This removes a FIXME.
10566
bdd091e4
JD
105672012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10568
10569 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10570 is defined (Bug#11768).
10571
9d44f8ce
DA
105722012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10573
10574 Fix marker debugging code.
10575 * marker.c (byte_char_debug_check): Do not perform the check
10576 if buffer is not multibyte.
090bd7cb
JB
10577 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10578 Call byte_char_debug_check with correct arguments.
9d44f8ce 10579
90fc4786
DA
105802012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10581
10582 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
10583 * marker.c (byte_char_debug_check, count_markers):
10584 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
10585 (byte_debug_flag): Remove.
10586 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10587 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10588
7b7ae965
DA
105892012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10590
4e57b342
DA
10591 Avoid code repetition in marker-related functions.
10592 * marker.c (attach_marker): New function.
10593 (Fset_marker, set_marker_restricted, set_marker_both)
10594 (set_marker_restricted_both): Use it.
10595 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10596 Consistently rename charno to charpos.
10597 (marker_position): Add eassert.
10598 (marker_byte_position): Convert to eassert.
10599
106002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10601
10602 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 10603 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 10604 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 10605
657924ff
DA
106062012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10607
10608 Introduce fast path for the widely used marker operation.
10609 * alloc.c (build_marker): New function.
10610 * lisp.h (build_marker): New prototype.
10611 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10612 * composite.c (autocmp_chars): Likewise.
10613 * editfns.c (buildmark): Remove.
10614 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10615 (save_restriction_save): Use build_marker.
10616 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10617 * window.c (save_window_save): Likewise.
10618
041a49a6
DA
106192012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10620
10621 Do not use Fdelete_overlay in delete_all_overlays
10622 to avoid redundant calls to unchain_overlay.
10623 * buffer.c (drop_overlay): New function.
10624 (delete_all_overlays, Fdelete_overlay): Use it.
10625 * minibuf.c (get_minibuffer): Fix comment.
10626
7dca65a4
PE
106272012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10628
10629 Port to OpenBSD 5.1 amd64.
10630 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10631 This is needed for OpenBSD, and should be harmless on all BSD systems.
10632 Also, include <sys/sysctl.h>, as it should be available on all
10633 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10634 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10635 use p_pid member, not kp_proc.pid.
10636
8eb876e2
GM
106372012-07-06 Glenn Morris <rgm@gnu.org>
10638
10639 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10640
38182d90
PE
106412012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 More xmalloc and related cleanup.
10644 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10645 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10646 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10647 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10648 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10649 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10650 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10651 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10652 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10653 * xterm.c:
10654 Omit needless casts involving void * pointers and allocation.
10655 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10656 as the former is more robust if P's type is changed.
10657 Prefer xzalloc to xmalloc + memset 0.
10658 Simplify malloc-or-realloc to realloc.
10659 Don't worry about xmalloc returning a null pointer.
10660 Prefer xstrdup to xmalloc + strcpy.
10661 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10662 growing it.
10663 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10664 alloca of a constant.
10665
6dd5a677
EZ
106662012-07-05 Eli Zaretskii <eliz@gnu.org>
10667
10668 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10669 hscroll is larger than the line width. Fixes long and futile
10670 looping inside extend_face_to_end_of_line (on a TTY) producing
10671 glyphs that are not needed and thrown away.
10672
6b312f0f
DA
106732012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10674
10675 * marker.c (set_marker_restricted_both): Simplify by using
10676 clip_to_bounds.
10677
f520ef9b
PE
106782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10681
383b7c95
JD
106822012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10683
10684 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10685 not defined (Bug#11768).
10686 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10687 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10688 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10689 followed by gtk_box_set_homogeneous (Bug#11768).
10690 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
10691 (update_theme_scrollbar_width, xg_create_scroll_bar):
10692 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
10693 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10694 (is_box_type): New function (Bug#11768).
10695 (xg_tool_item_stale_p): Call is_box_type.
5293d758 10696 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
10697 with default display (Bug#11768).
10698
d6e7bf45
EZ
106992012-07-05 Eli Zaretskii <eliz@gnu.org>
10700
10701 * xdisp.c (window_hscroll_limited): New function.
10702 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10703 coordinates when window's hscroll is set to insanely large
10704 values. (Bug#11857)
10705
431391ec
JB
107062012-07-05 Juanma Barranquero <lekktu@gmail.com>
10707
10708 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10709 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10710
23f86fce
DA
107112012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10712
10713 Cleanup xmalloc.
10714 * lisp.h (xzalloc): New prototype. Omit needless casts.
10715 * alloc.c (xzalloc): New function. Omit needless casts.
10716 * charset.c: Omit needless casts. Convert all calls to
10717 xmalloc with following memset to xzalloc.
10718 * dispnew.c: Likewise.
10719 * fringe.c: Likewise.
10720 * image.c: Likewise.
10721 * sound.c: Likewise.
10722 * term.c: Likewise.
10723 * w32fns.c: Likewise.
10724 * w32font.c: Likewise.
10725 * w32term.c: Likewise.
10726 * xfaces.c: Likewise.
10727 * xfns.c: Likewise.
10728 * xterm.c: Likewise.
10729 * atimer.c: Omit needless casts.
10730 * buffer.c: Likewise.
10731 * callproc.c: Likewise.
10732 * ccl.c: Likewise.
10733 * coding.c: Likewise.
10734 * composite.c: Likewise.
10735 * doc.c: Likewise.
10736 * doprnt.c: Likewise.
10737 * editfns.c: Likewise.
10738 * emacs.c: Likewise.
10739 * eval.c: Likewise.
10740 * filelock.c: Likewise.
10741 * fns.c: Likewise.
10742 * gtkutil.c: Likewise.
10743 * keyboard.c: Likewise.
10744 * lisp.h: Likewise.
10745 * lread.c: Likewise.
10746 * minibuf.c: Likewise.
10747 * msdos.c: Likewise.
10748 * print.c: Likewise.
10749 * process.c: Likewise.
10750 * region-cache.c: Likewise.
10751 * search.c: Likewise.
10752 * sysdep.c: Likewise.
10753 * termcap.c: Likewise.
10754 * terminal.c: Likewise.
10755 * tparam.c: Likewise.
10756 * w16select.c: Likewise.
10757 * w32.c: Likewise.
10758 * w32reg.c: Likewise.
10759 * w32select.c: Likewise.
10760 * w32uniscribe.c: Likewise.
10761 * widget.c: Likewise.
10762 * xdisp.c: Likewise.
10763 * xmenu.c: Likewise.
10764 * xrdb.c: Likewise.
10765 * xselect.c: Likewise.
10766
0497dc44
PE
107672012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 * fileio.c (time_error_value): Check the right error number.
10770 Problem reported by Troels Nielsen in
10771 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10772
356e7178
PE
107732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10774
4e71fd89
PE
10775 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10776 This should be fixed in a better way; see Eli Zaretskii in
10777 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10778 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10779
f0941253
PE
10780 * fileio.c (time_error_value): Rename from special_mtime.
10781 The old name's problems were noted by Eli Zaretskii in
10782 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10783
065c9eb4
PE
10784 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10785 This variable's comment says Emacs needs at least one GDB-visible
10786 symbol of type enum pvec_type, to work around GDB problems.
10787 The symbol's value doesn't matter.
10788
356e7178
PE
10789 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10790 that causes compilation to fail on pre-C99 compilers.
10791
ed9265fc 107922012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
10793
10794 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10795 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10796
3884d954
DA
107972012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10798
d209e2fb 10799 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
10800 headers for buffer_defaults and buffer_local_symbols.
10801 Reported by Juanma Barranquero <lekktu@gmail.com>.
10802
ee28be33
SM
108032012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10804
10805 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10806 * lisp.h (enum pvec_type): Use fewer bits.
10807 (PSEUDOVECTOR_SIZE_BITS): New constant.
10808 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10809 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10810 change in pvec_type.
10811 (PSEUDOVECTOR_TYPEP): New macro.
10812 (TYPED_PSEUDOVECTORP): Use it.
10813 * fns.c (internal_equal): Adapt code to extract pvectype.
10814 * emacs.c (gdb_pvec_type): Update type.
10815 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10816 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10817 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10818 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10819 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10820 abusing vector->header.next.nbytes.
10821 (live_vector_p): Use PVEC_TYPE.
10822 (mark_object): Adapt code to extract pvectype. Use switch.
10823
c7f2cd7f
PE
108242012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10827 Tighten new eassert a bit.
10828
8ce70ed2
DA
108292012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10830
10831 Fix compilation with --enable-gcc-warnings and -O1
10832 optimization level.
10833 * doprnt.c (doprnt): Change type of tem to int, initialize
10834 to avoid compiler warning. Add eassert.
10835 * search.c (simple_search): Initialize match_byte to avoid
10836 compiler warning. Add eassert.
10837
dea7f1e5
PE
108382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10839
24a212eb
PE
10840 Avoid weird behavior with large horizontal scrolls.
10841 Without this change, for example, large hscroll values would
10842 mess up Emacs's display on Fedora 15 x86, presumably due to
10843 overflows in int calculations in the display code.
10844 Also, if buffers had long lines, Emacs would freeze.
10845 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10846 (set_window_hscroll): New function, containing the old guts of
10847 Fset_window_hscroll. Return the clipped value.
10848 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10849 This avoids the need to check against PTRDIFF_MAX.
10850
dea7f1e5
PE
10851 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10852
76046526
DA
108532012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10854
10855 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10856
39adff0d
PE
108572012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10858
63807d47
PE
10859 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10860 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10861 since GCC 4.4.6 issues a bogus warning for them.
10862
39adff0d
PE
10863 Fix bugs in file timestamp newness comparisons.
10864 * fileio.c (Ffile_newer_than_file_p):
10865 * lread.c (Fload): Use full timestamp resolution of files,
10866 not just the 1-second resolution, so that files that are only
10867 slightly newer still count as newer.
10868 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10869 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10870
dbeed9a6
PE
108712012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10872
10873 * fileio.c: Improve handling of file time marker. (Bug#11852)
10874 (special_mtime): New function.
10875 (Finsert_file_contents, Fverify_visited_file_modtime):
10876 Use it to set special mtime values consistently.
10877
636334d6
AS
108782012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10879
10880 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10881 marker for non-existing file. (Bug#11852)
10882
e2017fe2
GM
108832012-07-03 Glenn Morris <rgm@gnu.org>
10884
10885 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10886 and did not make it into globals.h).
10887
404dbd37
TT
108882012-07-03 Tom Tromey <tromey@redhat.com>
10889
10890 * window.c (Fset_window_margins, Fset_window_fringes)
10891 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10892 * textprop.c (Fprevious_property_change): No longer static.
10893 * syntax.c (Fsyntax_table_p): No longer static.
10894 * process.c (Fget_process, Fprocess_datagram_address): No longer
10895 static.
10896 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10897 * keyboard.c (Fcommand_execute): No longer static.
10898 Remove EXFUN.
10899 * insdel.c (Fcombine_after_change_execute): No longer static.
10900 * image.c (Finit_image_library): No longer static.
10901 * fileio.c (Fmake_symbolic_link): No longer static.
10902 * eval.c (Ffetch_bytecode): No longer static.
10903 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
10904 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10905 No longer static.
404dbd37
TT
10906 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10907 static.
10908 * dired.c (Ffile_attributes): No longer static.
10909 * composite.c (Fcomposition_get_gstring): No longer static.
10910 * callproc.c (Fgetenv_internal): No longer static.
10911
10912 * ccl.h: Remove EXFUNs.
10913 * buffer.h: Remove EXFUNs.
10914 * dispextern.h: Remove EXFUNs.
10915 * intervals.h: Remove EXFUNs.
10916 * fontset.h: Remove EXFUN.
10917 * font.h: Remove EXFUNs.
10918 * dosfns.c (system_process_attributes): Remove EXFUN.
10919 * keymap.h: Remove EXFUNs.
10920 * lisp.h: Remove EXFUNs.
10921 * w32term.h: Remove EXFUNs.
10922 * window.h: Remove EXFUNs.
10923 * xsettings.h: Remove EXFUN.
10924 * xterm.h: Remove EXFUN.
10925
8e4fd1e1
GM
109262012-07-03 Glenn Morris <rgm@gnu.org>
10927
10928 * lisp.h (Frandom): Make it visible to C.
10929 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10930 buffer for invisible buffers. (Bug#1229)
10931
ca95b3eb
DA
109322012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10933
10934 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10935 values which aren't power of 2.
14ae4239 10936 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 10937 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
10938 accordingly.
10939
7555c33f
SM
109402012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10941
10942 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10943
10944 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10945
d12e8f5a
DA
109462012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10947
10948 * alloc.c (allocate_vector_block): Remove redundant
10949 calls to mallopt if DOUG_LEA_MALLOC is defined.
10950 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10951 avoid calls to mallopt if zero_vector is returned.
10952
296094c3
DA
109532012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10954
10955 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10956 is enabled, avoid dereferencing NULL current_sblock if
10957 running undumped.
10958
36429c89
DA
109592012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10960
10961 Cleanup basic buffer management.
10962 * buffer.h (struct buffer): Change layout to use generic vector
10963 marking code. Fix some comments. Change type of 'clip_changed'
10964 to bitfield. Remove unused #ifndef old.
10965 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10966 (GET_OVERLAYS_AT): Fix indentation.
10967 (for_each_per_buffer_object_at): New macro.
10968 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10969 (Fbuffer_local_variables): Use it.
10970 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10971 * alloc.c (allocate_buffer): Adjust to match new layout of
10972 struct buffer. Fix comment.
10973 (mark_overlay): New function.
10974 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10975 Lisp area of struct buffer.
10976 (mark_object): Use it. Adjust marking of misc objects
10977 and related comments.
10978
3b3e4cac
PE
109792012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10980
10981 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10982 wrapper that is not needed because the wrapped code is a no-op (zero
10983 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10984 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10985
cf5c0175
DA
109862012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10987
10988 * alloc.c (mark_buffer): Simplify. Remove prototype.
10989 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10990 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10991 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10992 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10993
ca26824c
GM
109942012-06-30 Glenn Morris <rgm@gnu.org>
10995
2e4c5312
GM
10996 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10997
ca26824c
GM
10998 * epaths.in (PATH_SITELOADSEARCH): New.
10999 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11000 This is rather than relying on --enable-locallisppath elements
11001 having "site-lisp" in their names. (Bug#10208#25, 11658)
11002
0d23c240
EZ
110032012-06-30 Eli Zaretskii <eliz@gnu.org>
11004
c9240d7a
EZ
11005 * w32proc.c (sys_select): Accept and ignore one more argument.
11006
11007 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11008
0d23c240 11009 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11010 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11011
11012 * sysdep.c: Don't include dos.h and dosfns.h.
11013
11014 * process.c (sys_select):
11015 * msdos.c (sys_select): Accept one more argument and ignore it.
11016
11017 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11018 adapt data types and code to that.
11019
11020 * dosfns.c:
11021 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11022 which clashes with the gnulib function of the same name.
11023
af5a5a98
AS
110242012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11025
c5e4379c
AS
11026 * font.c (font_style_to_value, font_style_symbolic)
11027 (font_prop_validate_style): Add type checks for values in
11028 font_style_table.
11029
af5a5a98
AS
11030 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11031 argument.
11032 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11033 uses.
11034
8d38f461
EZ
110352012-06-29 Eli Zaretskii <eliz@gnu.org>
11036
2e5a6631
EZ
11037 * xdisp.c (try_window_id): Undo last change.
11038
8d38f461
EZ
11039 * w32.c (getwd): Adjust commentary about startup_dir.
11040 (init_environment): Always call sys_access, even in non-MSVC
11041 builds. Don't chdir to the directory of the Emacs executable.
11042 This undoes code from 1997 which was justified by the need to
11043 "avoid conflicts when removing and renaming directories". But its
11044 downside was that every relative file name was being interpreted
11045 relative to the directory of the Emacs executable, which can never
11046 be TRT. In particular, it broke sys_access when called with
11047 relative file names.
11048 (sys_access): Map GetLastError to errno.
11049
2af3565e
DA
110502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11051
11052 * window.h (struct window): Change type of 'fringes_outside_margins'
11053 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11054 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11055 Adjust comment.
11056 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11057 to ptrdiff_t.
11058
c8d3a25c 110592012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11060
c8d3a25c
GM
11061 * gnutls.c (emacs_gnutls_handshake):
11062 Add QUIT to make the loop interruptible.
57570cd3 11063
c8d3a25c 110642012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11065
c8d3a25c
GM
11066 * charset.c (init_charset): Make lack of etc/charsets fatal.
11067
3e984ee8
DA
110682012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11069
11070 * editfns.c (region_limit): Fix type mismatch.
11071
ef884f23
DA
110722012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11073
11074 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11075 undefined. Convert from xassert to eassert.
11076 * nsmenu.m: Convert from xassert to eassert.
11077 * nsterm.m: Likewise.
11078
7d7e0027
SM
110792012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11080
11081 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11082
aa754e6a
PE
110832012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11084
11085 Avoid integer overflow on scroll-left and scroll-right.
11086 * window.c (HSCROLL_MAX): New macro.
11087 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11088 overflow when requested scroll falls outside ptrdiff_t range.
11089
80b00b08
DA
110902012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11091
11092 * window.h (struct window): Change type of 'hscroll',
11093 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11094 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11095 Adjust users accordingly.
11096 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11097 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11098 from EMACS_INT to ptrdiff_t.
11099 (make_window): Omit redundant initialization.
11100
62b2bcf6
JB
111012012-06-28 Juanma Barranquero <lekktu@gmail.com>
11102
11103 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11104
45942c7d
DA
111052012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11106
11107 * window.h (struct window): Change type of 'use_time' and
11108 'sequence_number' from Lisp_Object to int.
11109 * frame.c (make_frame): Adjust users accordingly.
11110 * print.c (print_object): Likewise.
11111 * window.c (select_window, Fwindow_use_time, make_parent_window)
11112 (make_window): Likewise.
11113
e509cfa6
DA
111142012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11115
11116 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11117 enabled with --enable-checking=[all,glyphs] configure option.
11118 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11119 adjust comments accordingly.
11120 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11121 undefined, adjust comments accordingly.
11122 * image.c: Likewise.
11123 * scroll.c: Likewise.
11124 * w32fns.c: Likewise.
11125 * w32term.c: Likewise.
11126 * xdisp.c: Likewise.
11127 * xfaces.c: Likewise.
11128 * xfns.c: Likewise.
11129 * xterm.c: Likewise.
11130
a54e2c05
DA
111312012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11132
11133 Generalize run-time debugging checks.
11134 * dispextern.h (XASSERTS): Remove.
11135 * fontset.c (xassert): Remove.
11136 Convert from xassert to eassert.
11137 * alloc.c: Convert from xassert to eassert.
11138 * bidi.c: Likewise.
11139 * dispnew.c: Likewise.
11140 * fns.c: Likewise.
11141 * fringe.c: Likewise.
11142 * ftfont.c: Likewise.
11143 * gtkutil.c: Likewise.
11144 * image.c: Likewise.
11145 * keyboard.c: Likewise.
11146 * menu.c: Likewise.
11147 * process.c: Likewise.
11148 * scroll.c: Likewise.
11149 * sound.c: Likewise.
11150 * term.c: Likewise.
11151 * w32console.c: Likewise.
11152 * w32fns.c: Likewise.
11153 * w32term.c: Likewise.
11154 * window.c: Likewise.
11155 * xdisp.c: Likewise.
11156 * xfaces.c: Likewise.
11157 * xfns.c: Likewise.
11158 * xselect.c: Likewise.
11159 * xterm.c: Likewise.
11160
1ec4b7b2
SM
111612012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11162
11163 * fns.c (maybe_resize_hash_table): Output message when growing the
11164 purify-hashtable.
11165
2014308a
DA
111662012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11167
11168 * alloc.c (allocate_string_data): Remove dead code.
11169 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11170 avoid GCC warning about unused macro.
11171
246155eb
DA
111722012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11173
11174 * alloc.c (allocate_string): Omit intervals initialization.
11175 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11176 as in make_pure_string and make_pure_c_string.
11177
43184b7b
DA
111782012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11179
d209e2fb 11180 * alloc.c (allocate_string): Fix last change.
43184b7b 11181
3fe6dd74
DA
111822012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11183
d209e2fb 11184 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11185 to memset, add explicit initialization where appropriate.
11186
1ba6038a
GM
111872012-06-27 Glenn Morris <rgm@gnu.org>
11188
11189 * lisp.mk (lisp): Remove paths.elc.
11190
c89926a5
CY
111912012-06-27 Chong Yidong <cyd@gnu.org>
11192
11193 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11194
ed6b3510
JW
111952012-06-26 John Wiegley <johnw@newartisans.com>
11196
1ec4b7b2 11197 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11198 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11199
ed6b3510
JW
11200 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11201 when building with Clang.
11202
8edd4a2b
SM
112032012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11204
11205 * eval.c (Fapply): Allow calling it with a single argument.
11206
f6f62d1b
EZ
112072012-06-26 Eli Zaretskii <eliz@gnu.org>
11208
11209 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11210 _stricmp and _strnicmp.
11211 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11212
62efea5e
DA
112132012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11214
11215 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11216 allocated window.
11217 (allocate_process): Likewise for new process.
8edd4a2b 11218 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11219 (allocate_frame): Likewise.
11220 * frame.c (make_frame): Omit redundant initialization.
11221 * window.c (make_parent_window): Use memset.
11222 (make_window): Omit redundant initialization.
11223 * process.c (make_process): Omit redundant initialization.
11224 * terminal.c (create_terminal): Likewise.
11225
42997f4d
DA
112262012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11227
11228 * term.c (delete_tty): Remove redundant call to memset.
11229
1130ecfc
DA
112302012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11231
11232 * alloc.c: Remove build_string.
11233 * lisp.h: Define build_string as static inline. This provides
11234 a better opportunity to optimize away calls to strlen when the
11235 function is called with compile-time constant argument.
11236 * image.c (imagemagick_error): Convert to build_string.
11237 * w32proc.c (sys_spawnve): Likewise.
11238 * xterm.c (x_term_init): Likewise.
11239
cf38a720
PE
112402012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11241
99027bdd
PE
11242 Use sprintf return value instead of invoking strlen on result.
11243 In the old days this wasn't portable, since some sprintf
11244 implementations returned char *. But they died out years ago and
11245 Emacs already assumes sprintf returns int.
11246 Similarly for float_to_string.
11247 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11248 * ccl.c (ccl_driver):
11249 * character.c (string_escape_byte8):
11250 * data.c (Fnumber_to_string):
11251 * doprnt.c (doprnt):
11252 * print.c (print_object):
11253 * xdisp.c (message_dolog):
11254 * xfns.c (syms_of_xfns):
11255 Use sprintf or float_to_string result to avoid need to call strlen.
11256 * data.c (Fnumber_to_string):
11257 Use make_unibyte_string, since the string must be ASCII.
11258 * lisp.h, print.c (float_to_string): Now returns int length.
11259 * term.c (produce_glyphless_glyph):
11260 Use sprintf result rather than recomputing it.
11261
cf38a720
PE
11262 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11263 * Makefile.in (ALL_CFLAGS):
11264 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11265 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11266
3511c784
DA
112672012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11268
0a08eb21 11269 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11270 strcasecmp if available.
11271 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11272
fb7da12e
AS
112732012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11274
11275 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11276 Avoid comma operator.
11277 * menu.c (push_submenu_start, push_submenu_end)
11278 (push_left_right_boundary, push_menu_pane): Likewise.
11279 * msdos.c (dos_rawgetc): Likewise.
11280
afa2ffd8
DA
112812012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11282
11283 * xfns.c (xic_create_fontsetname): Remove redundant calls
11284 to memset.
11285
b3b4476b
PE
112862012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11287
4495ff38
PE
11288 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11289 sprintf already null-terminates its output.
11290
b3b4476b
PE
11291 * xfns.c (x_window): Remove redundant cast.
11292
b00876c9
DA
112932012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11294
11295 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11296 `const char *' to `char *' to avoid compiler warning.
11297
d188e26b
PE
112982012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11299
885d1d74
PE
11300 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11301 instead of truncating it to 63 (admittedly a generous limit).
11302
d188e26b
PE
11303 * process.c: Fix spelling and caps in comments.
11304
e2f560b1
DN
113052012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11306
e86db54b 11307 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11308 * sysdep.c (setpgrp): Remove definition, not used in this file.
11309
7583a3a1
JB
113102012-06-24 Juanma Barranquero <lekktu@gmail.com>
11311
11312 * makefile.w32-in: Update dependencies.
11313
696056c2
EZ
113142012-06-24 Eli Zaretskii <eliz@gnu.org>
11315
11316 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11317 (SYSTIME_H): Add nt/inc/sys/time.h.
11318
11319 * systime.h [WINDOWSNT]: Include sys/time.h.
11320
11321 * s/ms-w32.h (struct timespec): Definition moved from
11322 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11323
845ca893
PE
113242012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11325
11326 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11327 * buffer.h (buffer_slot_type_mismatch):
11328 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11329 * eval.c (unwind_to_catch):
11330 * image.c (my_png_error, my_error_exit):
11331 * keyboard.c (quit_throw_to_read_char, user_error)
11332 (Fexit_recursive_edit, Fabort_recursive_edit):
11333 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11334 (wrong_type_argument, buffer_overflow, __executable_start)
11335 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11336 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11337 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11338 (fatal):
11339 (child_setup) [!DOS_NT]:
11340 * lread.c (end_of_file_error, invalid_syntax):
11341 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11342 * puresize.h (pure_write_error):
11343 * search.c (matcher_overflow):
11344 * sound.c (sound_perror, alsa_sound_perror):
11345 * sysdep.c, syssignal.h (croak):
11346 * term.c (maybe_fatal, vfatal):
11347 * textprop.c (text_read_only):
11348 * undo.c (user_error):
11349 * unexmacosx.c (unexec_error):
11350 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11351 Use _Noreturn rather than NO_RETURN.
11352 No need for separate decl merely because of _Noreturn.
11353 * sound.c (sound_warning, parse_sound):
11354 Remove unnecessary forward decls.
11355
f1dd8073
PE
113562012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11357
11358 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11359 * lisp.h (WAIT_READING_MAX): New macro.
11360 * dispnew.c (Fsleep_for, sit_for):
11361 * keyboard.c (kbd_buffer_get_event):
11362 * process.c (Faccept_process_output):
11363 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11364 This improves on the previous patch, which introduced a bug
11365 when time_t is unsigned and as wide as intmax_t.
11366 See <http://bugs.gnu.org/9000#51>.
11367
b82c1755
EZ
113682012-06-23 Eli Zaretskii <eliz@gnu.org>
11369
11370 * dispnew.c (sit_for, Fsleep_for):
11371 * keyboard.c (kbd_buffer_get_event):
11372 * process.c (Faccept_process_output): Avoid compiler warnings when
11373 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11374
ca300656
JB
113752012-06-23 Juanma Barranquero <lekktu@gmail.com>
11376
049ec95b
JB
11377 * makefile.w32-in: Update dependencies.
11378
ca300656
JB
11379 * w32.c (ltime): Add return type and declare static.
11380 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11381
db7b8d06
PE
113822012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11383
11384 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11385 Privately reported by Herbert J. Skuhra.
11386 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11387 All uses changed.
11388 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11389 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11390
0bd8297f
EZ
113912012-06-23 Eli Zaretskii <eliz@gnu.org>
11392
96512555
EZ
11393 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11394 last argument of make_unibyte_string.
11395
0bd8297f
EZ
11396 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11397 language ID in the event parameters.
11398
11399 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11400 event.code, not the obscure "character set ID".
11401
63def6b6
CY
114022012-06-23 Chong Yidong <cyd@gnu.org>
11403
11404 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11405
e8a02204
EZ
114062012-06-23 Eli Zaretskii <eliz@gnu.org>
11407
388cdec0
EZ
11408 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11409 * w32.c (fdutimens): New function.
11410
11411 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11412
11413 * s/ms-w32.h (pselect): Redirect to sys_select.
11414
11415 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11416
e8a02204
EZ
11417 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11418 in the logic of incrementing and decrementing the value of
11419 use_relocatable_buffers.
11420
d054f3fb
PE
114212012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11422
11423 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11424 Privately reported by Herbert J. Skuhra.
11425 [__FreeBSD__]: Remove "*/" typo after "#include".
11426 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11427 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11428 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11429 Don't assume EMACS_TIME and struct timeval are the same type.
11430
d35af63c
PE
114312012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11432
11433 Support higher-resolution time stamps (Bug#9000).
11434 The time stamps are only nanosecond-resolution at the C level,
11435 since that's the best that any real-world system supports now.
11436 But they are picosecond-resolution at the Lisp level, as that's
11437 easy, and leaves room for future OS improvements.
11438
11439 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11440 (LIBES): Use it.
11441
11442 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11443 Don't get current time unless it's needed.
11444
11445 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11446 now provides it if it's absent.
11447 (start_atimer): Port to higher-res time stamps.
11448 Check for time stamp overflow. Don't get current time more
11449 often than is needed.
11450
11451 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11452 Include systime.h, not time.h.
11453 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11454
11455 * dired.c: Include stat-time.h.
11456 (Ffile-attributes): File times now have higher resolution.
11457
11458 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11459 (struct image): Timestamp now has higher resolution.
11460
11461 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11462 has at least microseconds now. All uses removed.
11463 (update_frame, update_single_window, update_window, update_frame_1)
11464 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11465 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11466
11467 * editfns.c (time_overflow): Now extern.
11468 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11469 (float-time, Fformat_time_string, Fcurrent_time_string)
11470 (Fcurrent_time_zone): Accept and generate higher-resolution
11471 time stamps.
11472 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11473 (decode_time_components, lisp_seconds_argument): New functions.
11474 (make_time): Now static.
11475 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11476 Report an error if the time is invalid, rather than having the caller
11477 do that.
11478
11479 * fileio.c: Include <stat-time.h>
11480 (Fcopy_file): Copy higher-resolution time stamps.
11481 Prefer to set the time stamp via a file descriptor if that works.
11482 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11483 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11484 (Fvisited_file_modtime, Fset_visited_file_modtime):
11485 Support higher-resolution time stamps.
11486
11487 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11488
11489 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11490
11491 * image.c (prepare_image_for_display, clear_image_cache)
11492 (lookup_image): Port to higer-resolution time stamps.
11493
11494 * keyboard.c (start_polling, bind_polling_period):
11495 Check for time stamp overflow.
11496 (read_char, kbd_buffer_get_event, timer_start_idle)
11497 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11498 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11499 Port to higher-resolution time stamps. Do not assume time_t is signed.
11500 (decode_timer): New function. Timers are now vectors of length 9,
11501 not 8, to accommodate the picosecond component.
11502 (timer_check_2): Use it.
11503
11504 * nsterm.m (select_timeout, timeval_subtract): Remove.
11505 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11506 as they're a bit more accurate and handle overflow better.
11507 (ns_select): Change prototype to be compatible with pselect.
11508 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11509 * nsterm.h (ns_select): Adjust prototype.
11510
11511 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11512 us-resolution time stamps.
11513 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11514
11515 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11516
11517 * lisp.h (time_overflow): New decl.
11518 (wait_reading_process_output): First arg is now intmax_t, not int,
11519 to accommodate larger waits.
11520
11521 * process.h (struct Lisp_Process.read_output_delay):
11522 Now counts nanoseconds, not microseconds.
11523 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11524 EMACS_HAS_USECS.
11525 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11526 (wait_reading_process_output):
11527 Port to ns-resolution time stamps.
11528 (Faccept_process_output, wait_reading_process_output):
11529 Check for time stamp overflow. Do not assume time_t is signed.
11530 (select_wrapper): Remove; we now use pselect.
11531 (Fprocess_attributes): Now generates ns-resolution time stamps.
11532
11533 * sysdep.c: Include utimens.h. Don't include utime.h
11534 or worry about struct utimbuf; gnulib does that for us now.
11535 (gettimeofday): Remove; gnulib provides a substitute.
11536 (make_timeval): New function.
11537 (set_file_times): Now sets ns-resolution time stamps.
11538 New arg FD; all uses changed.
11539 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11540 (system_process_attributes):
11541 Now returns ns-resolution time stamp. All uses changed.
11542 Check for time stamp overflow.
11543
11544 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11545 provides a substitute now.
11546
11547 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11548 since it guarantees struct timespec.
11549 (EMACS_TIME): Now struct timespec, so that we can support
11550 ns-resolution time stamps.
11551 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11552 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11553 (EMACS_USECS): Remove.
11554 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11555 so multiply the arg by 1000 before storing it.
11556 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11557 New macros.
11558 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11559 Port to ns-resolution time stamps.
11560 (EMACS_TIME_NEG_P): Remove; replaced by....
11561 (EMACS_TIME_SIGN): New macro.
11562 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11563 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11564 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11565 (make_timeval, make_lisp_time, decode_time_components): New decls.
11566 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11567 that it mishandled time_t overflow. You can't compare by subtracting!
11568 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11569 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11570
11571 * term.c: Include <sys/time.h>.
11572 (timeval_to_Time): New function, for proper overflow wraparound.
11573 (term_mouse_position, term_mouse_click): Use it.
11574
11575 * undo.c (record_first_change): Support higher-resolution time stamps
11576 in the undo buffer.
11577 (Fprimitive_undo): Use them when restoring time stamps.
11578
11579 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11580 (w32_get_internal_run_time):
11581 Port to higher-resolution Emacs time stamps.
11582 (ltime): Now accepts single 64-bit integer, as that's more convenient
11583 for callers.
11584
11585 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11586
11587 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11588 for compatibility with pselect. Support ns-resolution time stamps.
11589
11590 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11591
11592 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11593 Check for time stamp overflow, and support ns-resolution time stamps.
11594
11595 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11596 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11597 (timeval_subtract): Remove; no longer needed.
11598 (XTflash, XTring_bell, x_wait_for_event):
11599 Port to ns-resolution time stamps. Don't assume time_t is signed.
11600
b6a92dfe
CY
116012012-06-22 Chong Yidong <cyd@gnu.org>
11602
11603 * xdisp.c (x_consider_frame_title): Revert last change.
11604
d251c37c
EZ
116052012-06-22 Eli Zaretskii <eliz@gnu.org>
11606
11607 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11608 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11609 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11610 staticidx goes up to 1597 out of 1600 = 0x640.)
11611
f10deafb
PE
116122012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11613
11614 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11615 Otherwise, the umask might be mistakenly 0 while handling input signals.
11616
ec6de1e2
SM
116172012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11618
11619 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11620
28be1ada
DA
116212012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11622
11623 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11624 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11625 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11626 access to `contents' member of Lisp_Vector objects with AREF and ASET
11627 where appropriate.
11628
c6bf3022
CY
116292012-06-19 Chong Yidong <cyd@gnu.org>
11630
11631 * frame.c (delete_frame): When selecting a frame on a different
11632 text terminal, do not alter the terminal's top-frame.
11633
11634 * xdisp.c (format_mode_line_unwind_data): Record the target
11635 frame's selected window and its terminal's top-frame.
11636 (unwind_format_mode_line): Restore them.
11637 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11638 Callers changed.
11639 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11640 since tty frames can be explicitly named.
11641 (prepare_menu_bars): Likewise.
11642
11643 * term.c (Ftty_top_frame): New function.
11644
defd4196
PE
116452012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11646
11647 Port byte-code-meter to modern targets.
11648 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11649 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11650 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11651 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11652 (METER_1, METER_2): Simplify.
11653
1053a871
SM
116542012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11655
11656 * data.c (Fdefalias): Return `symbol' (bug#11686).
11657
b7e8d081
MR
116582012-06-18 Martin Rudalics <rudalics@gmx.at>
11659
11660 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11661 gets killed during executing of this function (Bug#11665).
11662 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11663 (Vkill_buffer_query_functions): In doc-string say that functions
11664 run by this hook should not change the current buffer.
11665
7ea2b339
PE
116662012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11667
11668 Fix recently-introduced process.c problems found by static checking.
11669 * process.c (write_queue_push, write_queue_pop, send_process):
11670 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11671 (write_queue_pop): Fix pointer signedness problem.
11672 (send_process): Remove unused local.
11673
96a313a1
CY
116742012-06-17 Chong Yidong <cyd@gnu.org>
11675
11676 * xdisp.c (redisplay_internal): No need to redisplay terminal
11677 frames that are not on top.
11678
20ca2e94
TN
116792012-06-17 Troels Nielsen <bn.troels@gmail.com>
11680
11681 * process.c (make_process): Initialize write_queue.
11682 (write_queue_push, write_queue_pop): New functions.
11683 (send_process): Use them to maintain correct ordering of process
11684 writes (Bug#10815).
11685
9a900ca9
PE
116862012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11687
310fbfa8
PE
11688 * lisp.h (eassert): Assume C89 or later.
11689 This removes the need for CHECK.
11690 (CHECK): Remove. Its comments about always evaluating its
11691 argument were confusing, as 'eassert' typically does not evaluate
11692 its argument.
11693
27bb1ca4
PE
11694 * coding.c (produce_chars): Use ptrdiff_t, not int.
11695
9a900ca9
PE
11696 * xterm.c (x_draw_underwave): Check for integer overflow.
11697 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11698
41b7f8bc 116992012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
11700
11701 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11702 referenced (Bug#11583).
11703
9b0e3eba
AA
117042012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11705
11706 Implement wave-style variant of underlining.
11707 * dispextern.h (face_underline_type): New enum.
11708 (face): Add field for underline type.
11709 * nsterm.m (ns_draw_underwave): New function.
11710 (ns_draw_text_decoration): Use it.
11711 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11712 New functions.
11713 (x_draw_glyph_string): Use them.
11714 * xfaces.c (Qline, Qwave): New Lisp objects.
11715 (check_lface_attrs, merge_face_ref)
1053a871
SM
11716 (Finternal_set_lisp_face_attribute, realize_x_face):
11717 Handle wave-style underline face attributes.
9b0e3eba
AA
11718 * xterm.c (x_draw_underwave): New function.
11719 (x_draw_glyph_string): Use it.
11720
0fb52f11
JB
117212012-06-16 Juanma Barranquero <lekktu@gmail.com>
11722
11723 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11724 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11725 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11726 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11727 ($(BLD)/w32select.$(O)): Update dependencies.
11728
e5560ff7
AS
117292012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11730
11731 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11732 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11733 * character.c (_fetch_multibyte_char_p): Remove.
11734 * alloc.c: Include "character.h" before "buffer.h".
11735 * bidi.c: Likewise.
11736 * buffer.c: Likewise.
11737 * bytecode.c: Likewise.
11738 * callint.c: Likewise.
11739 * callproc.c: Likewise.
11740 * casefiddle.c: Likewise.
11741 * casetab.c: Likewise.
11742 * category.c: Likewise.
11743 * cmds.c: Likewise.
11744 * coding.c: Likewise.
11745 * composite.c: Likewise.
11746 * dired.c: Likewise.
11747 * dispnew.c: Likewise.
11748 * doc.c: Likewise.
11749 * dosfns.c: Likewise.
11750 * editfns.c: Likewise.
11751 * emacs.c: Likewise.
11752 * fileio.c: Likewise.
11753 * filelock.c: Likewise.
11754 * font.c: Likewise.
11755 * fontset.c: Likewise.
11756 * fringe.c: Likewise.
11757 * indent.c: Likewise.
11758 * insdel.c: Likewise.
11759 * intervals.c: Likewise.
11760 * keyboard.c: Likewise.
11761 * keymap.c: Likewise.
11762 * lread.c: Likewise.
11763 * macros.c: Likewise.
11764 * marker.c: Likewise.
11765 * minibuf.c: Likewise.
11766 * nsfns.m: Likewise.
11767 * nsmenu.m: Likewise.
11768 * print.c: Likewise.
11769 * process.c: Likewise.
11770 * regex.c: Likewise.
11771 * region-cache.c: Likewise.
11772 * search.c: Likewise.
11773 * syntax.c: Likewise.
11774 * term.c: Likewise.
11775 * textprop.c: Likewise.
11776 * undo.c: Likewise.
11777 * unexsol.c: Likewise.
11778 * w16select.c: Likewise.
11779 * w32fns.c: Likewise.
11780 * w32menu.c: Likewise.
11781 * window.c: Likewise.
11782 * xdisp.c: Likewise.
11783 * xfns.c: Likewise.
11784 * xmenu.c: Likewise.
11785 * xml.c: Likewise.
11786 * xselect.c: Likewise.
11787
2f07e6af
EZ
117882012-06-16 Eli Zaretskii <eliz@gnu.org>
11789
1053a871
SM
11790 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11791 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 11792 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
11793 row.
11794 (handle_face_prop): Use chunk-relative overlay string index when
11795 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
11796 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11797 the rightmost. (Bug#11720)
2f07e6af 11798
29b83cec
AS
117992012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11800
11801 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11802 (CATEGORY_MEMBER): Enforce 1/0 value.
11803 * category.c (_temp_category_set): Remove.
11804
4c5501e9
EZ
118052012-06-16 Eli Zaretskii <eliz@gnu.org>
11806
11807 * window.c (Fdelete_other_windows_internal)
11808 (Fdelete_window_internal): Don't access frame's mouse highlight
11809 info of the initial frame. (Bug#11677)
11810
2b570124
PE
118112012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11812
e93864f9
PE
11813 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11814 Assume USE_2_TAGS_FOR_INTS.
11815 (xreload): Adjust $tagmask width to match recent lisp.h change.
11816
2b570124
PE
11817 Simplify lisp.h in minor ways that should not affect code.
11818 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11819 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11820 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11821 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11822 (INTTYPEBITS): New macro, for clarity.
11823 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
11824 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11825 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
11826 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11827 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11828
81755f69
JB
118292012-06-13 Juanma Barranquero <lekktu@gmail.com>
11830
11831 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11832
16192a57
GM
118332012-06-13 Glenn Morris <rgm@gnu.org>
11834
11835 * s/bsd-common.h (BSD4_3):
11836 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11837
646b5f55
AS
118382012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11839
11840 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11841 instead of union.
11842 (XLI, XIL): Define.
1053a871
SM
11843 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11844 Use them.
11845 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 11846 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 11847 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
11848 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11849 * frame.c (delete_frame): Remove outdated comment.
11850 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11851 USE_LISP_UNION_TYPE.
11852 (Fw32_unregister_hot_key): Likewise.
11853 (Fw32_toggle_lock_key): Likewise.
11854 * w32menu.c (add_menu_item): Likewise.
11855 (w32_menu_display_help): Use XIL instead of checking
11856 USE_LISP_UNION_TYPE.
11857 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11858 (init_heap): Likewise.
11859 * w32term.c (w32_read_socket): Update comment.
11860
1d3823c9
GM
118612012-06-13 Glenn Morris <rgm@gnu.org>
11862
c62ff706
GM
11863 * s/usg5-4-common.h, src/s/unixware.h:
11864 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11865
1d3823c9
GM
11866 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11867
bfe3e0a2
PE
118682012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11869
11870 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11871 * alloc.c (make_number) [!defined make_number]:
11872 Remove, as lisp.h always defines this now.
11873 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11874 (roundup_size): Verify that it is a power of 2.
11875 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11876 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11877 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11878 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11879 USE_LSB_TAG now is always defined to be either 0 or 1.
11880 All uses changed.
11881 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11882 code works fine either way, and efficiency is not a concern here,
11883 as the union type is for debugging, not for production.
11884 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11885 Use an inline function on all platforms when using the union type,
11886 since this is simpler and 'static inline' can be used portably
11887 within Emacs now.
11888 (LISP_INITIALLY_ZERO): New macro.
11889 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11890 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11891
45fa9c0f
GM
118922012-06-12 Glenn Morris <rgm@gnu.org>
11893
b4492cba
GM
11894 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11895
11896 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 11897
45fa9c0f
GM
11898 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11899 Move BROKEN_SIGIO to configure.
11900
11901 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11902 Move NO_TERMIO to configure.
11903
0e25d334
CY
119042012-06-12 Chong Yidong <cyd@gnu.org>
11905
11906 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11907 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11908 MagickExportImagePixels is undefined.
11909
43682bb6
PE
119102012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11911
11912 * image.c (imagemagick_load_image): Remove unused label.
11913
a9be7d2b
GM
119142012-06-11 Glenn Morris <rgm@gnu.org>
11915
11916 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11917 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11918 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11919 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11920
3017f87f
SM
119212012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11922
11923 * alloc.c (make_byte_code): New function.
11924 (Fmake_byte_code): Use it. Don't purify here.
11925 * lread.c (read1): Use it as well to avoid extra allocation.
11926
1b9b4cf4
CY
119272012-06-11 Chong Yidong <cyd@gnu.org>
11928
11929 * image.c (imagemagick_load_image): Implement transparency.
11930
95988fcf
AS
119312012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11932
11933 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11934 account for preceding backslashes. (Bug#11663)
11935
cd4eb164
CY
119362012-06-09 Chong Yidong <cyd@gnu.org>
11937
11938 * term.c: Support italics in capable terminals (Bug#9652).
11939 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11940 (turn_on_face): Output using TS_enter_italic_mode if available.
11941 Don't handle unused blinking and alt-charset cases.
11942 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11943 and tty_alt_charset_p cases.
11944 (tty_capable_p, init_tty): Support italics.
11945
11946 * termchar.h (struct tty_display_info): Add field for italics.
11947 Remove unused blink field.
11948
11949 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11950 Handle slant.
11951
11952 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11953 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11954 tty_alt_charset_p. Add tty_italic_p.
11955
ff88beb8
MA
119562012-06-09 Michael Albinus <michael.albinus@gmx.de>
11957
11958 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11959 dbus_type_is_basic if available.
11960 (xd_extract_signed, xd_extract_unsigned): Rename from
11961 extract_signed and extract_unsigned, respectively. Adapt callers.
11962
44286096
CY
119632012-06-09 Chong Yidong <cyd@gnu.org>
11964
1682701f
CY
11965 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11966
44286096
CY
11967 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11968 case (Bug#9752).
11969
d86feb17
PE
119702012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11971
11972 * xdisp.c (vmessage): Treat frame message as multibyte.
11973 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11974 would generate the diagnostic "Making \302\247 buffer-local while
11975 let-bound!".
11976
d5c20fe8
EZ
119772012-06-08 Eli Zaretskii <eliz@gnu.org>
11978
11979 * dispnew.c (showing_window_margins_p): Undo last change, which
11980 was done due to an inadvertent commit.
11981 (adjust_frame_glyphs_for_frame_redisplay): Do call
11982 showing_window_margins_p.
11983
513749ee
SM
119842012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11985
11986 * eval.c (Fmake_var_non_special): New primitive.
11987 (syms_of_eval): Defsubr it.
11988 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11989
d4a8f5c1
JB
119902012-06-08 Juanma Barranquero <lekktu@gmail.com>
11991
11992 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11993 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11994
8bbbc977
EZ
119952012-06-08 Eli Zaretskii <eliz@gnu.org>
11996
11997 * alloc.c (allocate_vectorlike): Fix last change.
11998
f3372c87
DA
119992012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12000
12001 Block-based vector allocation of small vectors.
12002 * lisp.h (struct vectorlike_header): New field `nbytes',
12003 adjust comment accordingly.
12004 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12005 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12006 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12007 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12008 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
12009 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
12010 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
12011 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12012 (roundup_size): New constant.
12013 (struct vector_block): New data type.
12014 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12015 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12016 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12017 (sweep_vectors): New functions.
12018 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12019 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12020 or equal to VBLOCK_BYTES_MAX.
12021 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12022 (init_alloc_once): Add call to init_vectors.
12023
4f18a4ed
SM
120242012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12025
12026 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12027
86f158bc
PE
120282012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12029
12030 * doprnt.c (doprnt): Truncate multibyte char correctly.
12031 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12032 would mishandle a string argument "Xc" if X was a multibyte
12033 character of length 2: it would truncate after X's first byte
12034 rather than including all of X.
12035
c5cfcbe0
CY
120362012-06-06 Chong Yidong <cyd@gnu.org>
12037
12038 * buffer.c (word_wrap): Doc fix.
12039
c05cf390
PE
120402012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12041
12042 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12043
0c3461de
GM
120442012-06-03 Glenn Morris <rgm@gnu.org>
12045
12046 * xdisp.c (tool-bar-style): Doc fix.
12047
c71232db
UM
120482012-06-03 Ulrich Müller <ulm@gentoo.org>
12049
12050 * Makefile.in (PAXCTL): Define.
12051 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12052 binary via PaX flags if the paxctl utility is available.
12053 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12054 Restore PaX flags to their default. (Bug#11398)
12055
383f7350
CY
120562012-06-03 Chong Yidong <cyd@gnu.org>
12057
12058 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12059 buffer (Bug#11226).
12060
5f2c76c6
CY
120612012-06-03 Chong Yidong <cyd@gnu.org>
12062
12063 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12064 (note_mode_line_or_margin_highlight): If there is no help echo,
12065 use mode-line-default-help-echo. Handle the case where the mouse
12066 position is past the end of the mode line string.
12067
12068 * buffer.c (buffer_local_value_1): New function, split from
12069 Fbuffer_local_value; can return Qunbound.
12070 (Fbuffer_local_value): Use it.
12071 (Vmode_line_format): Docstring tweaks.
12072
773d47f6
PE
120732012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12074
12075 * sysdep.c (system_process_attributes): Improve comment.
12076
f2d6a3df
SM
120772012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12078
12079 * keyboard.c: Export real-this-command to Elisp.
12080 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12081 and DEFVAR it. Update all users.
12082
63810350
PE
120832012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12084
7bd5c1f4
PE
12085 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12086
63810350
PE
12087 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12088 Convert pctcpu and pctmem to Lisp float properly.
12089 Let the compiler fold better, as 100.0/0x8000 is exact.
12090
a2821611
AS
120912012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12092
12093 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12094 cons_block.
12095
5fceba1d
PE
120962012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12097
12098 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12099
c98ff5dd
DA
121002012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12101
12102 For a 'struct window', replace some Lisp_Object fields to
12103 bitfields where appropriate, remove unused fields.
12104 * window.h (struct window): Remove unused 'last_mark_x' and
12105 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12106 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12107 Change type of 'force_start', 'optional_new_start',
12108 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12109 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12110
ca34e0be
PE
121112012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12112
12113 Pacify gcc -Wdouble-precision when using Xaw.
12114 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12115 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12116 Use 'float' consistently, rather than 'float' in most places
12117 and 'double' in a couple of places.
12118
efc00ab1 121192012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12120
12121 * xdisp.c (handle_stop): Detect whether we have overlay strings
12122 loaded by testing it->current.overlay_string_index to be
12123 non-negative, instead of checking whether n_overlay_strings is
12124 positive. (Bug#11587)
12125
efc00ab1 121262012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12127
12128 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12129
12130 * doc.c (Fsubstitute_command_keys): Doc fix.
12131
efc00ab1 121322012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12133
12134 * search.c (search_buffer): Remove calls to
12135 r_alloc_inhibit_buffer_relocation, as it is now called by
12136 maybe_unify_char, which was the cause of relocation of buffer text
12137 in bug#11519.
12138
efc00ab1 121392012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12140
12141 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12142 for the duration of call to load_charset, to avoid problems with
12143 callers of maybe_unify_char that access buffer text through C
12144 pointers.
12145
12146 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12147 decrement the inhibition flag, instead of just setting or
12148 resetting it.
12149
ba93a187
PE
121502012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12151
12152 Remove obsolete '#define static' cruft.
12153 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12154 This #undef was "temporary" in 2000; it is no longer needed
12155 now that '#define static' has gone away.
12156 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12157 (gray_bitmap_bits): Remove; no longer needed.
12158 All uses replaced with definiens.
12159 * xterm.c: Include "bitmaps/gray.xbm".
12160
9e4bf381
PE
121612012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12162
12163 Clean up __executable_start, monstartup when --enable-profiling.
12164 The following changes affect the code only when profiling.
12165 * dispnew.c (__executable_start): Rename from safe_bcopy.
12166 Define only on platforms that need it.
12167 * emacs.c: Include <sys/gmon.h> when profiling.
12168 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12169 (__executable_start): Remove decl, since lisp.h does it now.
12170 (safe_bcopy): Remove decl; no longer has that name.
12171 (main): Coalesce #if into single bit of code, for simplicity.
12172 Cast pointers to uintptr_t, since standard libraries want integers
12173 and not pointers.
12174 * lisp.h (__executable_start): New decl.
12175
32d72c2f
GM
121762012-05-31 Glenn Morris <rgm@gnu.org>
12177
12178 * image.c (Fimagemagick_types): Doc fix.
12179
baac5bc7
JM
121802012-05-30 Jim Meyering <meyering@redhat.com>
12181
12182 * callproc.c (Fcall_process_region): Include directory component
12183 in mkstemp error message (Bug#11586).
12184
72cb32cf
PE
121852012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12186
12187 * alloc.c, lisp.h (make_pure_vector): Now static.
12188
61b108cc
SM
121892012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12190
12191 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12192 Move to byte-run.el.
12193 (Fautoload): Do the hash-doc more carefully.
12194 * data.c (Fdefalias): Purify definition, except for keymaps.
12195 (Qdefun): Move from eval.c.
12196 * lisp.h (Qdefun): Remove.
12197 * lread.c (read1): Tiny simplification.
12198
471fe23d
TN
121992012-05-29 Troels Nielsen <bn.troels@gmail.com>
12200
934f3f58 12201 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12202 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12203 Bug#9642, but explicitly check that the buffer the overlay would
12204 be moved to is live and rearrange lines to make sure that errors
12205 will not put the overlay in an inconsistent state.
12206 (Fdelete_overlay): Cosmetics.
12207
85d0efd1
EZ
122082012-05-28 Eli Zaretskii <eliz@gnu.org>
12209
12210 * w32term.c (my_bring_window_to_top): New function.
12211 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12212 could be different from the original one.
12213 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12214 (Bug#11513)
12215
12216 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12217 by calling BringWindowToTop.
12218
12219 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12220 (WM_EMACS_END): Increase by one.
12221
da92a98c
PE
122222012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12225 This avoids undefined behavior that might cause the eassert
12226 to not catch an out-of-range value.
12227
74d1f848
JB
122282012-05-28 Juanma Barranquero <lekktu@gmail.com>
12229
12230 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12231 Update dependencies.
12232
9e1a06fc
EZ
122332012-05-27 Eli Zaretskii <eliz@gnu.org>
12234
12235 * bidi.c (bidi_mirror_char): Fix last change.
12236
f3dd7312
AS
122372012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12238
12239 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12240 when referring to sectname field in printf format.
12241
81899c91
PE
122422012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12243
57b81a9f
PE
12244 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12245 Only r_alloc_inhibit_buffer_relocation needed to be added;
12246 the others were already declared.
12247
81899c91
PE
12248 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12249 before checking whether it's out of range. Put the check inside
12250 eassert. See
12251 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12252
33017faf 122532012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12254
12255 * callproc.c (Fcall_process): Restore a line that was accidentally
12256 commented out in the 2011-02-13 change (bug#11547).
12257
33017faf 122582012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12259
12260 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12261 defined on ralloc.c.
12262
12263 * buffer.c [REL_ALLOC]: Remove prototypes of
12264 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12265 they are now on lisp.h.
12266
12267 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12268
12269 * search.c (search_buffer): Use it to inhibit relocation of buffer
12270 text while re_search_2 is doing its job, because re_search_2 is
12271 passed C pointers to buffer text. (Bug#11519)
12272
23415acf
EZ
12273 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12274 Update value to 24.
12275
44e27368
EZ
12276 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12277 state after an additional call to move_it_in_display_line_to, keep
12278 the values of it->max_ascent and it->max_descent found for the
12279 entire line.
12280 (pos_visible_p): Revert the comparison against bottom_y to what it
12281 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12282 (Bug#11464)
12283
c1892f11
PE
122842012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12285
12286 Fix coding-related core dumps with gcc -ftrapv.
12287 The code was computing A - B, where A and B are pointers, and B is
12288 random garbage. This can lead to core dumps on platforms that
12289 have special pointer registers, and it also leads to core dumps on
12290 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12291 A - B only when B is initialized properly.
12292 * coding.c (coding_set_source, coding_set_destination): Return void.
12293 (coding_change_source, coding_change_destinations): New functions,
12294 with the old behaviors of coding_set_source and coding_set_destination.
12295 All callers that need an offset changed to use these new functions.
12296
eb7afdad
GM
122972012-05-26 Glenn Morris <rgm@gnu.org>
12298
12299 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12300
f12fdf02
EZ
123012012-05-26 Eli Zaretskii <eliz@gnu.org>
12302
53a63be6 12303 Extend mouse support on W32 text-mode console.
61b108cc
SM
12304 * xdisp.c (draw_row_with_mouse_face):
12305 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12306
eb3f6f01 12307 * w32console.c: Include window.h.
61b108cc
SM
12308 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12309 New functions.
eb3f6f01
EZ
12310 (initialize_w32_display): Initialize mouse-highlight data.
12311
53a63be6
EZ
12312 * w32inevt.c: Include termchar.h and window.h.
12313 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12314 moves, call note_mouse_highlight. If help_echo changed, call
12315 gen_help_event to produce help-echo message in the echo area.
12316 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12317 highlight info.
12318
4cfd81f6
PE
123192012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12320
12321 * lread.c (read1): Simplify slightly to avoid an overflow warning
12322 with GCC 4.7.0 on x86-64.
12323
4446092a
EZ
123242012-05-26 Eli Zaretskii <eliz@gnu.org>
12325
12326 * bidi.c (bidi_mirror_char): Revert last change: an int is
12327 definitely wide enough here.
12328
42b2a986 123292012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12330
42b2a986 12331 Fix integer width and related bugs (Bug#9874).
eb106a49 12332 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12333 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12334 (string_bytes, check_sblock, allocate_string_data):
12335 (compact_small_strings, Fmake_bool_vector, make_string)
12336 (make_unibyte_string, make_multibyte_string)
12337 (make_string_from_bytes, make_specified_string)
12338 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12339 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12340 (mark_vectorlike):
12341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12342 (allocate_pseudovector):
12343 Use int, not EMACS_INT, where int is wide enough.
12344 (inhibit_garbage_collection, Fgarbage_collect):
12345 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12346 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12347 int might not be wide enough.
12348 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12349 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12350 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12351 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12352 (bidi_level_of_next_char, bidi_move_to_visually_next):
12353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12354 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12355 (Fkill_buffer, Fset_buffer_major_mode)
12356 (advance_to_char_boundary, Fbuffer_swap_text)
12357 (Fset_buffer_multibyte, overlays_at, overlays_in)
12358 (overlay_touches_p, struct sortvec, record_overlay_string)
12359 (overlay_strings, recenter_overlay_lists)
12360 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12361 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12362 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12363 (Foverlay_recenter, last_overlay_modification_hooks_used)
12364 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12366 (validate_region): Omit unnecessary test for b <= e,
12367 since that's guaranteed by the previous test.
d311d28c
PE
12368 (adjust_overlays_for_delete): Avoid pos + length overflow.
12369 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12370 (report_overlay_modification):
12371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12372 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12373 Omit pointer cast, which isn't needed anyway, and doesn't work
12374 after the EMACS_INT -> ptrdiff_t change.
02481186 12375 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12376 * buffer.h: Adjust decls to match defn changes elsewhere.
12377 (struct buffer_text, struct buffer):
12378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12379 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12380 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12381 not int, to avoid needless 32-bit limit on 64-bit hosts.
12382 (exec_byte_code): Use tighter memory-full test, one that checks
12383 for alloca overflow. Don't compute the address of the object just
12384 before an array, as that's not portable. Use EMACS_INT, not
12385 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12386 * callint.c (Fcall_interactively):
12387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12388 * callproc.c (call_process_kill, Fcall_process):
12389 Don't assume pid_t fits into an Emacs fixnum.
12390 (call_process_cleanup, Fcall_process, child_setup):
12391 Don't assume pid_t fits into int.
12392 (call_process_cleanup, Fcall_process, delete_temp_file)
12393 (Fcall_process_region):
12394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12395 (Fcall_process): Simplify handling of volatile integers.
12396 Use int, not EMACS_INT, where int will do.
12397 * casefiddle.c (casify_object, casify_region, operate_on_word)
12398 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12400 (casify_object): Avoid integer overflow when overallocating buffer.
12401 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12402 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12403 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12404 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12405 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12406 integers are now checked earlier. All uses replaced with XINT.
12407 (ccl_driver):
12408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12409 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12410 (ccl_driver, Fregister_code_conversion_map):
12411 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12412 (resolve_symbol_ccl_program): Check that vector header is in range.
12413 Always copy the vector, so that we can check its contents reliably
12414 now rather than having to recheck each instruction as it's being
12415 executed. Check that vector words fit in 'int'.
12416 (ccl_get_compiled_code, Fregister_ccl_program)
12417 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12418 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12419 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12420 contents are in range.
12421 (Fccl_execute_on_string): Check that status is in range.
12422 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12423 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12424 Accept and return EMACS_INT, not int, because callers can pass values
12425 out of 'int' range.
12426 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12427 (multibyte_chars_in_text, parse_str_as_multibyte)
12428 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12429 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12430 (string_escape_byte8, Fget_byte):
12431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12432 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12433 avoid mishandling large integers.
12434 * character.h: Adjust decls to match defn changes elsewhere.
12435 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12436 (Ffind_charset_region):
12437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12438 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12439 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12440 Don't assume fixnum fits in int.
d311d28c
PE
12441 (load_charset_map_from_vector, Fmap_charset_chars):
12442 Remove now-unnecessary CHECK_NATNUMs.
12443 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12444 Don't rely on undefined behavior with signed left shift overflow.
12445 Don't assume unsigned int fits into fixnum, or that fixnum fits
12446 into unsigned int. Don't require max_code to be a valid fixnum;
12447 that's not true for gb10830 4-byte on a 32-bit host. Allow
12448 invalid_code to be a cons, for the same reason. Require code_offset
12449 to be a character. Avoid int overflow if max_char is close
12450 to INT_MAX.
12451 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12452 this is intended anyway and avoids some undefined behavior.
12453 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12454 INDEX_TO_CODE_POINT, as that's what it expects.
12455 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12456 * charset.h (DECODE_CHAR): Return int, not unsigned;
12457 this is what was intended anyway, and it avoids undefined behavior.
12458 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12459 integer-overflow issues.
12460 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12461 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12462 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12463 * chartab.c (Fmake_char_table, Fset_char_table_range)
12464 (uniprop_get_decoder, uniprop_get_encoder):
12465 Don't assume fixnum fits in int.
12466 * cmds.c (move_point): New function, that does the gist of
12467 Fforward_char and Fbackward_char, but does so while checking
12468 for integer overflow more accurately.
c96e5d6a 12469 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12470 (Fforward_line, Fend_of_line, internal_self_insert)
12471 (internal_self_insert):
12472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12473 Fix a FIXME, by checking for integer overflow when calculating
12474 target_clm and actual_clm.
12475 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12476 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12477 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12478 (coding_alloc_by_making_gap, alloc_destination)
12479 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12480 (encode_coding_utf_16, detect_coding_emacs_mule)
12481 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12482 (detect_coding_iso_2022, decode_coding_iso_2022)
12483 (encode_invocation_designation, encode_designation_at_bol)
12484 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12485 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12486 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12487 (encode_coding_ccl, encode_coding_raw_text)
12488 (detect_coding_charset, decode_coding_charset)
12489 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12490 (produce_composition, produce_charset, produce_annotation)
12491 (decode_coding, handle_composition_annotation)
12492 (handle_charset_annotation, consume_chars, decode_coding_gap)
12493 (decode_coding_object, encode_coding_object, detect_coding_system)
12494 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12495 (code_convert_region, code_convert_string)
8f50130c
PE
12496 (Fdefine_coding_system_internal)
12497 (coding_set_source, coding_set_destination):
d311d28c
PE
12498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12499 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12500 (Fdefine_coding_system_internal):
12501 Don't assume fixnums fit in int.
12502 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12503 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12504 (Funencodable_char_position, Fcheck_coding_systems_region)
12505 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12507 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12508 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12509 Don't access memory outside of the args array.
d311d28c 12510 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12511 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12512 result of ENCODE_CHAR.
d311d28c
PE
12513 * coding.h: Adjust decls to match defn changes elsewhere.
12514 (struct coding_system):
12515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12516 * composite.c (get_composition_id, find_composition)
12517 (run_composition_function, update_compositions)
12518 (compose_text, composition_gstring_put_cache)
12519 (composition_gstring_p, composition_gstring_width)
12520 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12521 (composition_compute_stop_pos, composition_reseat_it)
12522 (composition_update_it, struct position_record)
12523 (find_automatic_composition, composition_adjust_point)
12524 (Fcomposition_get_gstring, Ffind_composition_internal):
12525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12526 (update_compositions):
12527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12528 * composite.h: Adjust decls to match defn changes elsewhere.
12529 (struct composition):
12530 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12531 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12532 Do not attempt to compute the address of the object just before a
12533 buffer; this is not portable.
12534 (Faref, Faset):
12535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12536 (Faset): Use int, not EMACS_INT, where int is wide enough.
12537 (Fstring_to_number): Don't assume fixnums fit in int.
12538 (Frem): Don't assume arg is nonnegative.
12539 * dbusbind.c (xd_append_arg): Check for integers out of range.
12540 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12541 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12542 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12543 (xd_get_connection_references): Return ptrdiff_t, not int.
12544 All uses changed.
12545 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12546 (xd_read_message_1):
12547 Use int, not unsigned, where the dbus API uses int.
12548 (Fdbus_message_internal): Don't overflow mtype.
12549 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12550 * dired.c (directory_files_internal, file_name_completion, scmp)
12551 (file_name_completion_stat):
12552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12553 (file_name_completion): Don't overflow matchcount.
12554 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12555 * dispextern.h: Adjust decls to match defn changes elsewhere.
12556 (struct text_pos, struct glyph, struct bidi_saved_info)
12557 (struct bidi_string_data, struct bidi_it, struct composition_it)
12558 (struct it):
12559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12560 (struct display_pos, struct composition_it, struct it):
12561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12562 * dispnew.c (increment_matrix_positions)
12563 (increment_row_positions, mode_line_string)
12564 (marginal_area_string):
12565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12566 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
12567 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12568 (duration_to_sec_usec): New function, to check for overflow better.
12569 (Fsleep_for, sit_for): Use it.
12570 * doc.c (get_doc_string, store_function_docstring):
12571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12572 (get_doc_string, Fsnarf_documentation):
12573 Use int, not EMACS_INT, where int is wide enough.
12574 (get_doc_string):
12575 Use SAFE_ALLOCA, not alloca.
12576 Check for overflow when converting EMACS_INT to off_t.
12577 * doprnt.c (doprnt):
12578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12579 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12580 Don't assume uid_t fits into fixnum.
12581 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12582 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12583 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12584 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12585 (general_insert_function)
12586 (Finsert_char, make_buffer_string, make_buffer_string_both)
12587 (update_buffer_properties, Fbuffer_substring)
12588 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12589 (Fsubst_char_in_region, check_translation)
12590 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12591 (transpose_markers, Ftranspose_regions):
12592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12593 (clip_to_bounds): Move to lisp.h as an inline function).
12594 (Fconstrain_to_field): Don't assume integers are nonnegative.
12595 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12596 (Fsubst_char_in_region, Fsave_restriction):
12597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12598 (Femacs_pid): Don't assume pid_t fits into fixnum.
12599 (lo_time): Use int, not EMACS_INT, when int suffices.
12600 (lisp_time_argument): Check for usec out of range.
12601 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
12602 (Fuser_login_name, Fuser_full_name): Signal an error
12603 if a uid argument is out of range, rather than relying on
12604 undefined behavior.
c8d5c857
PE
12605 (Fformat_time_string): Remove now-unnecessary check.
12606 lisp_time_argument checks for out-of-range usec now.
243e0530 12607 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
12608 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12609 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12610 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12611 (init_cmdargs, Fdump_emacs):
12612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12613 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12614 the bottom (typically) 32 bits of the fixnum.
12615 * eval.c (specpdl_size, call_debugger):
12616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12617 (when_entered_debugger, Fbacktrace_debug):
12618 Don't assume fixnum can fit in int.
12619 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12620 the object just before a buffer; this is not portable.
12621 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12622 (grow_specpdl, unbind_to):
12623 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12624 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12625 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 12626 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
12627 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12628 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12630 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12631 (a_write, e_write):
12632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12633 (Fcopy_file, non_regular_nbytes, read_non_regular)
12634 (Finsert_file_contents):
12635 Use int, not EMACS_INT, where int is wide enough.
12636 (READ_BUF_SIZE): Verify that it fits in int.
12637 (Finsert_file_contents): Check that counts are in proper range,
12638 rather than assuming fixnums fit into ptrdiff_t etc.
12639 Don't assume fixnums fit into int.
125b3835 12640 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12641 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12642 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12643 (string_char_to_byte, string_byte_to_char)
12644 (string_make_multibyte, string_to_multibyte)
12645 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12646 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12647 (substring_both, Fdelete, internal_equal, Ffillarray)
12648 (Fclear_string, mapcar1)
12649 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12650 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12651 (larger_vector, make_hash_table, maybe_resize_hash_table)
12652 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12653 (Fmaphash, secure_hash):
12654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12655 (concat): Check for string index and length overflow.
12656 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12657 (Frequire):
12658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12659 (larger_vector): New API (vec, incr_min, size_max) replaces old
12660 one (vec, new_size, init). This catches size overflow.
12661 INIT was removed because it was always Qnil.
12662 All callers changed.
12663 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12664 the upper bound on a hash table index size.
12665 (make_hash_table, maybe_resize_hash_table): Use it.
12666 (secure_hash): Computer start_byte and end_byte only after
12667 they're known to be in ptrdiff_t range.
12668 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12669 (Ffont_get_glyphs, Ffont_at):
12670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12671 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12672 (Flist_fonts, Fopen_font):
12673 Don't assume fixnum can fit in int.
12674 (check_gstring): Don't assume index can fit in int.
12675 (font_match_p): Check that fixnum is a character, not a nonnegative
12676 fixnum, since the later code needs to stuff it into an int.
12677 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12678 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12679 conversion overflow issues.
12680 (Fopen_font): Check for integer out of range.
12681 (Ffont_get_glyphs): Don't assume index can fit in int.
12682 * font.h: Adjust decls to match defn changes elsewhere.
12683 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12684 integer overflow.
12685 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12686 printmax_t, where ptrdiff_t is wide enough.
12687 (Finternal_char_font):
12688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12689 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12690 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12691 (Fset_frame_position, x_set_frame_parameters)
12692 (x_set_line_spacing, x_set_border_width)
12693 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12694 Check that fixnums are in proper range for system types.
12695 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12697 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12698 Use SAFE_ALLOCA_LISP, not alloca.
12699 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12700 intptr_t is wide enough.
12701 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12702 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12703 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12704 Check for fixnum out of range.
12705 * ftfont.c (ftfont_list): Don't assume index fits in int.
12706 Check that fixnums are in proper range for system types.
12707 (ftfont_shape_by_flt):
12708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
12709 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12711 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12712 Check that fixnums are in proper range for system types.
12713 * gnutls.h: Adjust decls to match defn changes elsewhere.
12714 * gtkutil.c (xg_dialog_run):
12715 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12716 (update_frame_tool_bar):
12717 Check that fixnums are in proper range for system types.
12718 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 12719 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
12720 * indent.c (last_known_column, last_known_column_point):
12721 (current_column_bol_cache):
12722 (skip_invisible, current_column, check_display_width):
12723 (check_display_width, scan_for_column, current_column_1)
12724 (Findent_to, Fcurrent_indentation, position_indentation)
12725 (indented_beyond_p, Fmove_to_column, compute_motion):
12726 (Fcompute_motion, Fvertical_motion):
12727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12728 (last_known_column_modified): Use EMACS_INT, not int.
12729 (check_display_width):
12730 (Fcompute_motion):
12731 Check that fixnums and floats are in proper range for system types.
12732 (compute_motion): Don't assume index or fixnum fits in int.
12733 (compute_motion, Fcompute_motion):
12734 Use int, not EMACS_INT, when it is wide enough.
12735 (vmotion): Omit local var start_hpos that is always 0; that way
12736 we don't need to worry about overflow in expressions involving it.
12737 * indent.h: Adjust decls to match defn changes elsewhere.
12738 (struct position):
12739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12740 Use int, not EMACS_INT, where int is wide enough.
12741 Remove unused members ovstring_chars_done and tab_offset;
12742 all uses removed.
12743 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12744 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12745 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12746 (make_gap, copy_text, insert, insert_and_inherit)
12747 (insert_before_markers, insert_before_markers_and_inherit)
12748 (insert_1, count_combining_before, count_combining_after)
12749 (insert_1_both, insert_from_string)
12750 (insert_from_string_before_markers, insert_from_string_1)
12751 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12752 (adjust_after_replace, adjust_after_insert, replace_range)
12753 (replace_range_2, del_range, del_range_1, del_range_byte)
12754 (del_range_both, del_range_2, modify_region)
12755 (prepare_to_modify_buffer, signal_before_change)
12756 (signal_after_change, Fcombine_after_change_execute):
12757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12758 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12759 (balance_an_interval, split_interval_right, split_interval_left)
12760 (find_interval, next_interval, update_interval)
12761 (adjust_intervals_for_insertion, delete_node, delete_interval)
12762 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12763 (static_offset_intervals, offset_intervals)
12764 (merge_interval_right, merge_interval_left, make_new_interval)
12765 (graft_intervals_into_buffer, temp_set_point_both)
12766 (temp_set_point, set_point, adjust_for_invis_intang)
12767 (set_point_both, move_if_not_intangible, get_property_and_range)
12768 (get_local_map, copy_intervals, copy_intervals_to_string)
12769 (compare_string_intervals, set_intervals_multibyte_1):
12770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12771 * intervals.h: Adjust decls to match defn changes elsewhere.
12772 (struct interval):
12773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12774 * keyboard.c (this_command_key_count, this_single_command_key_start)
12775 (before_command_key_count, before_command_echo_length, echo_now)
12776 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12777 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12778 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12779 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12780 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12781 (last_non_minibuf_size, last_point_position, echo_truncate)
12782 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12783 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12784 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12785 (stuff_buffered_input):
12786 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12787 (last_auto_save, command_loop_1, read_char):
12788 Use EMACS_INT, not int, to avoid integer overflow.
12789 (record_char): Avoid overflow in total_keys computation.
12790 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12791 * keyboard.h: Adjust decls to match defn changes elsewhere.
12792 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12793 (Fkey_description, Fdescribe_vector, Flookup_key):
12794 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12795 (click_position): New function, to check that positions are in range.
12796 (Fcurrent_active_maps):
12797 (describe_command):
12798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12799 (Faccessible_keymaps, Fkey_description):
12800 (preferred_sequence_p):
12801 Don't assume fixnum can fit into int.
12802 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12803 Check for integer overflow in size calculations.
12804 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12805 avoid mishandling large integers.
12806 * lisp.h: Adjust decls to match defn changes elsewhere.
12807 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12808 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12809 (struct Lisp_Marker):
12810 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12811 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
12812 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12813 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12814 All callers changed.
12815 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12816 Assume the arg has valid form, since it always does.
12817 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12818 unsigned integer system type.
12819 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12820 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12822 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12823 (duration_to_sec_usec): New decl.
12824 * lread.c (read_from_string_index, read_from_string_index_byte)
12825 (read_from_string_limit, readchar, unreadchar, openp)
12826 (read_internal_start, read1, oblookup):
12827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12828 (Fload, readevalloop, Feval_buffer, Feval_region):
12829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12830 (openp): Check for out-of-range argument to 'access'.
12831 (read1): Use int, not EMACS_INT, where int is wide enough.
12832 Don't assume fixnum fits into int.
6efdadfd 12833 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
12834 (read_filtered_event): Use duration_to_sec_usec
12835 to do proper overflow checking on durations.
d311d28c
PE
12836 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12837 in size calculation.
12838 (Fexecute_kbd_macro):
12839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12840 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12841 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12842 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12843 (set_marker_both, set_marker_restricted_both, marker_position)
12844 (marker_byte_position, Fbuffer_has_markers_at):
12845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12846 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 12847 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
12848 It now merely ensures that the menu is large enough, without
12849 necessarily growing it, as this avoids some integer overflow issues.
12850 All callers changed.
12851 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12853 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12854 Use SAFE_ALLOCA_LISP, not alloca.
12855 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12856 to EMACS_INT. Check that fixnums are in proper range for system types.
12857 * minibuf.c (minibuf_prompt_width, string_to_object)
12858 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12859 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12861 (get_minibuffer, read_minibuf_unwind):
12862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12863 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12864 this simplifies overflow checking. All callers changed.
12865 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12866 (Ftest_completion):
12867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12868 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12869 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12870 Check that fixnums are in proper range for system types.
12871 (Fx_create_frame, Fx_show_tip):
12872 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12873 * nsfont.m (ns_findfonts, nsfont_list_family):
12874 Don't assume fixnum fits in long.
12875 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12877 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12878 wide enough.
17fdb222 12879 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
12880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12881 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12882 (PRINTDECLARE, PRINTPREPARE):
12883 (strout, print_string):
12884 (print, print_preprocess, print_check_string_charset_prop)
12885 (print_object):
12886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12887 (PRINTDECLARE):
12888 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12890 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 12891 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 12892 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
12893 (print_error_message): Use SAFE_ALLOCA, not alloca.
12894 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
12895 (print_depth, new_backquote_output, print_number_index):
12896 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
12897 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12898 (Fset_process_window_size, Fformat_network_address)
12899 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 12900 (sigchld_handler):
d311d28c 12901 Check that fixnums are in proper range for system types.
d44287d4 12902 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
12903 Check for process-ids out of pid_t range rather than relying on
12904 undefined behavior.
e4d81efc 12905 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
12906 (Fformat_network_address, read_process_output, send_process)
12907 (Fprocess_send_region, status_notify):
12908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12909 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12910 (wait_reading_process_output, read_process_output, exec_sentinel):
12911 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12912 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12913 (Faccept_process_output): Use duration_to_sec_usec to do proper
12914 overflow checking on durations.
dde14581
PE
12915 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12916 Don't assume pid_t fits in int.
02481186
PE
12917 * process.h (struct Lisp_Process): Members tick and update_tick
12918 are now of type EMACS_INT, not int.
b62b53e8
PE
12919 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12920 configured --with-wide-int.
d311d28c
PE
12921 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12922 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12923 * search.c (looking_at_1, string_match_1):
12924 (fast_string_match, fast_c_string_match_ignore_case)
12925 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12926 (scan_newline, find_before_next_newline, search_command)
12927 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12928 (set_search_regs, wordify):
12929 (Freplace_match):
12930 (Fmatch_data):
12931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12932 (string_match_1, search_buffer, set_search_regs):
12933 (Fmatch_data):
12934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12935 (wordify): Check for overflow in size calculation.
12936 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12937 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12938 Check that fixnums are in proper range for system types.
12939 * sound.c (struct sound_device)
12940 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12941 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12942 (Fplay_sound_internal):
12943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 12944 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
12945 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12946 (Fparse_partial_sexp):
12947 Don't assume fixnums can fit in int.
12948 (struct lisp_parse_state, find_start_pos, find_start_value)
12949 (find_start_value_byte, find_start_begv)
12950 (update_syntax_table, char_quoted, dec_bytepos)
12951 (find_defun_start, prev_char_comend_first, back_comment):
12952 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12953 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12955 (Finternal_describe_syntax_value): Check that match_lisp is a
12956 character, not an integer, since the code stuffs it into int.
12957 (scan_words, scan_sexps_forward):
12958 Check that fixnums are in proper range for system types.
12959 (Fforward_word):
12960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12961 (scan_sexps_forward):
12962 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12963 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12964 * syntax.h: Adjust decls to match defn changes elsewhere.
12965 (struct gl_state_s):
12966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12967 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12968 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12969 * sysdep.c (wait_for_termination_1, wait_for_termination)
12970 (interruptible_wait_for_termination, mkdir):
12971 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12972 (emacs_read, emacs_write):
12973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12974 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12975 and double all fit in int.
d311d28c
PE
12976 * term.c (set_tty_color_mode):
12977 Check that fixnums are in proper range for system types.
12978 * termhooks.h (struct input_event):
12979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12980 * textprop.c (validate_interval_range, interval_of)
12981 (Fadd_text_properties, set_text_properties_1)
12982 (Fremove_text_properties, Fremove_list_of_text_properties)
12983 (Ftext_property_any, Ftext_property_not_all)
12984 (copy_text_properties, text_property_list, extend_property_ranges)
12985 (verify_interval_modification):
12986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12987 (Fnext_single_char_property_change)
12988 (Fprevious_single_char_property_change):
12989 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12990 (copy_text_properties):
12991 Check for integer overflow in index calculation.
d311d28c
PE
12992 * undo.c (last_boundary_position, record_point, record_insert)
12993 (record_delete, record_marker_adjustment, record_change)
12994 (record_property_change):
12995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12996 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12998 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12999 (Fx_hide_tip, Fx_file_dialog):
13000 * w32menu.c (set_frame_menubar):
13001 Use ptrdiff_t, not int, for consistency with rest of code.
13002 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13003 (select_window, Fdelete_other_windows_internal)
13004 (window_scroll_pixel_based, window_scroll_line_based)
13005 (Frecenter, Fset_window_configuration):
13006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13007 (Fset_window_hscroll, run_window_configuration_change_hook)
13008 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13009 (Fscroll_other_window, Frecenter):
d311d28c
PE
13010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13011 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13012 Don't assume fixnum fits in int.
13013 (Fset_window_scroll_bars):
13014 Check that fixnums are in proper range for system types.
13015 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13016 (string_pos, c_string_pos, number_of_chars, init_iterator)
13017 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13018 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13019 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13020 (face_before_or_after_it_pos, handle_invisible_prop)
13021 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13022 (display_prop_intangible_p, string_buffer_position_lim)
13023 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13024 (get_overlay_strings_1, get_overlay_strings)
13025 (iterate_out_of_display_property, forward_to_next_line_start)
13026 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13027 (get_next_display_element, set_iterator_to_next)
13028 (get_visually_first_element, compute_stop_pos_backwards)
13029 (handle_stop_backwards, next_element_from_buffer)
13030 (move_it_in_display_line_to, move_it_in_display_line)
13031 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13032 (add_to_log, message_dolog, message_log_check_duplicate)
13033 (message2, message2_nolog, message3, message3_nolog
13034 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13035 (current_message_1, truncate_echo_area, truncate_message_1)
13036 (set_message, set_message_1, store_mode_line_noprop)
13037 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13038 (text_outside_line_unchanged_p, check_point_in_composition)
13039 (reconsider_clip_changes)
13040 (redisplay_internal, set_cursor_from_row, try_scrolling)
13041 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13042 (redisplay_window, find_last_unchanged_at_beg_row)
13043 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13044 (trailing_whitespace_p, find_row_edges, display_line)
13045 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13046 (display_mode_element, store_mode_line_string)
13047 (pint2str, pint2hrstr, decode_mode_spec)
13048 (display_count_lines, display_string, draw_glyphs)
13049 (x_produce_glyphs, x_insert_glyphs)
13050 (rows_from_pos_range, mouse_face_from_buffer_pos)
13051 (fast_find_string_pos, mouse_face_from_string_pos)
13052 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13053 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13054 (safe_call, init_from_display_pos, handle_fontified_prop)
13055 (handle_single_display_spec, load_overlay_strings)
13056 (with_echo_area_buffer, setup_echo_area_for_printing)
13057 (display_echo_area, echo_area_display)
13058 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13059 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13060 (redisplay_window, dump_glyph_row, display_mode_line)
13061 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13062 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13064 (handle_single_display_spec, build_desired_tool_bar_string)
13065 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13066 (get_specified_cursor_type):
13067 Check that fixnums are in proper range for system types.
13068 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13069 (Flookup_image_map):
13070 Don't assume fixnums fit in int.
13071 (compare_overlay_entries):
13072 Avoid mishandling comparisons due to subtraction overflow.
13073 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13074 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13075 (handle_tool_bar_click):
13076 Use int, not unsigned, since we prefer signed and the signedness
13077 doesn't matter here.
13078 (get_next_display_element, next_element_from_display_vector):
13079 Use int, not EMACS_INT, when int is wide enough.
13080 (start_hourglass): Use duration_to_sec_usec to do proper
13081 overflow checking on durations.
13082 * xfaces.c (Fbitmap_spec_p):
13083 Check that fixnums are in proper range for system types.
13084 (compare_fonts_by_sort_order):
13085 Avoid mishandling comparisons due to subtraction overflow.
13086 (Fx_family_fonts, realize_basic_faces):
13087 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13088 (Fx_family_fonts):
13089 Don't assume fixnum fits in int.
13090 Use SAFE_ALLOCA_LISP, not alloca.
13091 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13092 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13093 (face_at_buffer_position, face_for_overlay_string)
13094 (face_at_string_position):
13095 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13096 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13097 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13098 (Fx_show_tip):
13099 Check that fixnums are in proper range for system types.
13100 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13101 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13103 (Fx_change_window_property): Don't assume fixnums fit in int.
13104 * xfont.c (xfont_chars_supported):
13105 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13106 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13107 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13109 * xml.c (parse_region):
13110 * xrdb.c (magic_file_p):
13111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13112 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13113 (x_get_local_selection, x_reply_selection_request)
13114 (x_handle_selection_request, wait_for_property_change):
13115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13116 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13117 short is wide enough.
13118 (x_send_client_event): Don't assume fixnum fits in int.
13119 * xterm.c (x_x_to_emacs_modifiers):
13120 Don't assume EMACS_INT overflows nicely into int.
13121 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13122 may come from Lisp.
13123 (handle_one_xevent): NATNUMP can eval its arg twice.
13124 (x_connection_closed):
13125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13126 * xterm.h: Adjust decls to match defn changes elsewhere.
13127 (struct scroll_bar): Use struct vectorlike_header
13128 rather than rolling our own approximation.
13129 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13130
c6574eb5
GM
131312012-05-25 Glenn Morris <rgm@gnu.org>
13132
13133 * lisp.mk (lisp): Update for more files being compiled now.
13134
e8d32c7e
SM
131352012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13136
48def666
SM
13137 * lread.c: Remove `read_pure' which makes no difference.
13138 (read_pure): Remove var.
13139 (unreadpure): Remove function.
13140 (readevalloop): Don't call read_list with -1 flag.
13141 (read1, read_vector): Don't test read_pure any more.
13142 (read_list): Simplify.
13143
e8d32c7e
SM
13144 * fileio.c, character.h: Minor style tweaks.
13145
4b2addb7
DA
131462012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13147
13148 * window.h (clip_changed): Remove useless declaration.
13149
584461b2
JB
131502012-05-22 Juanma Barranquero <lekktu@gmail.com>
13151
13152 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13153 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13154
34374650
PE
131552012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13156
13157 Remove src/m/*.
13158 This directory predates autoconf and is no longer needed nowadays.
13159 Move its few remaining bits of functionality to where they're needed.
13160 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13161 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13162 * m/template.h: Remove.
13163 * Makefile.in (M_FILE): Remove. All uses removed.
13164 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13165 * lisp.h (USE_LSB_TAG):
13166 * mem-limits.h (EXCEEDS_LISP_PTR):
13167 Use VAL_MAX, not VALBITS, in #if.
13168 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13169 (EMACS_UINT): Define unconditionally now.
13170 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13171 (BITS_PER_EMACS_INT): New constants, replacing
13172 what used to be in config.h, but not useful in #if.
13173 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13174 define them any more.
13175 (VAL_MAX): New macro.
13176 (VALMASK): Use it.
13177 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13178 BITS_PER_EMACS_INT, in #if.
13179 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13180 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13181 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13182 * s/ms-w32.h (DATA_START):
13183 Move here from removed file m/intel386.h.
13184 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13185 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13186
261cb4bb
PE
131872012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13188
13189 Assume C89 or later.
13190 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13191 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13192 (xrealloc):
13193 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13194 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13195 * textprop.c, tparam.c (NULL): Remove.
13196 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13197 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13198 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13199 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13200 * xterm.c (input_signal_count): Assume volatile works.
13201
ff23cd9f
KB
132022012-05-21 Ken Brown <kbrown@cornell.edu>
13203
13204 * xgselect.c (xg_select): Fix first argument in call to 'select'
13205 (bug#11508).
13206
1b170bc6
KB
132072012-05-20 Ken Brown <kbrown@cornell.edu>
13208
13209 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13210 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13211
b2f4d39f
KB
132122012-05-19 Ken Brown <kbrown@cornell.edu>
13213
13214 * xfns.c (x_in_use): Remove `static' qualifier.
13215 * xterm.h (x_in_use): Declare.
13216 * xgselect.c: Include xterm.h.
13217 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13218 and `display_arg' (bug#9754).
13219
003fdae2
PE
132202012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13221
9232a6d9
PE
13222 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13223
003fdae2
PE
13224 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13225 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13226
784b56e2
EZ
132272012-05-18 Eli Zaretskii <eliz@gnu.org>
13228
13229 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13230
13231 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13232 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13233
13234 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13235 reference to image_cache->refcount.
13236 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13237
a0a79cde
JL
132382012-05-17 Juri Linkov <juri@jurta.org>
13239
13240 * search.c (Fword_search_regexp, Fword_search_backward)
13241 (Fword_search_forward, Fword_search_backward_lax)
13242 (Fword_search_forward_lax): Move functions to isearch.el
13243 (bug#10145, bug#11381).
13244
b0572523
PE
132452012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13246
13247 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13248
9660f5fc
SM
132492012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13250
13251 * lread.c (init_obarray): Declare Qt and Qnil as special.
13252
4374de83
GM
132532012-05-14 Glenn Morris <rgm@gnu.org>
13254
13255 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13256 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13257
dc44c39a
PE
132582012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13259
078c97cb
PE
13260 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13261
dc44c39a
PE
13262 * unexaix.c: Port to more-recent AIX compilers.
13263 (report_error, report_error_1, make_hdr, copy_sym)
13264 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13265 Make arguments const char *, not char *, to avoid violations of C
13266 standard and to fix some AIX warnings reported by Gilles Pion.
13267
e18afed7 132682012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13269
13270 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13271 already have overlays loaded.
13272 (handle_single_display_spec): Before returning without displaying
13273 fringe bitmap, synchronize the bidi iterator with the main display
13274 iterator, by calling iterate_out_of_display_property.
13275 (iterate_out_of_display_property): Detect buffer iteration by
13276 testing that it->string is a Lisp string.
13277 (get_next_display_element): When the current object is exhausted,
13278 and there's something on it->stack, call set_iterator_to_next to
13279 proceed with what's on the stack, instead of returning zero.
13280 (set_iterator_to_next): If called at the end of a Lisp string,
13281 proceed to consider_string_end without incrementing string
13282 position. Don't increment display vector index past the end of
13283 the display vector. (Bug#11417)
c8fb9dc6
EZ
13284 (pos_visible_p): Don't report a position visible when move_it_to
13285 stopped at the last line of window, which happens to be scanned
13286 backwards by the bidi iteration. (Bug#11464)
ac268e67 13287
e18afed7 132882012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13289
13290 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13291 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13292 are on a TTY, and thus unable to display on the fringes.
13293 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13294 so we need to signal to the caller that this is a "replacing"
13295 display spec. This fixes display when the spec is invalid or we
13296 are on a TTY.
13297
e18afed7 132982012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13299
13300 * unexaix.c (make_hdr): Fix typo in prototype.
13301 This bug broke the build on AIX. Problem reported by Gilles Pion.
13302
9d0a235a
MA
133032012-05-14 Michael Albinus <michael.albinus@gmx.de>
13304
13305 * keyboard.c (kbd_buffer_get_event): Read special events also in
13306 batch mode. (Bug#11415)
13307
9e6b06ed
GM
133082012-05-12 Glenn Morris <rgm@gnu.org>
13309
13310 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13311
c1a1d7a3
EZ
133122012-05-12 Eli Zaretskii <eliz@gnu.org>
13313
13314 * lisp.mk (lisp): Add newcomment.elc.
13315
3fe7cdc8
GM
133162012-05-12 Glenn Morris <rgm@gnu.org>
13317
13318 * Makefile.in (MKDIR_P): New, set by configure.
13319 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13320
53f7d2c0
PE
133212012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13322
13323 Remove unused function hourglass_started.
13324 * dispextern.h (hourglass_started):
13325 * w32fns.c (hourglass_started):
13326 * xdisp.c (hourglass_started): Remove.
13327
75aafb17
JB
133282012-05-10 Juanma Barranquero <lekktu@gmail.com>
13329
13330 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13331 Update dependencies.
13332
12959e8e
PE
133332012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13334
97107e2e
PE
13335 * xgselect.c (xg_select): Put maxfds+1 into a var.
13336 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13337
12959e8e
PE
13338 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13339
836d29b3
DA
133402012-05-10 Dave Abrahams <dave@boostpro.com>
13341
13342 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13343 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13344
5cb67954
MA
133452012-05-09 Michael Albinus <michael.albinus@gmx.de>
13346
13347 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13348 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13349 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13350 Initialize xd_registered_buses.
13351
3478ec45
PE
133522012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13353
b263a6b0
PE
13354 Untag more efficiently if USE_LSB_TAG.
13355 This is based on a proposal by YAMAMOTO Mitsuharu in
13356 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13357 For an admittedly artificial (nth 8000 longlist) benchmark on
13358 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13359 Emacs's overall text size by 1%.
13360 * lisp.h (XUNTAG): New macro.
13361 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13362 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13363 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13364 * eval.c (Fautoload):
13365 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13366 * frame.h (XFRAME): Use XUNTAG.
13367
3478ec45
PE
13368 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13369 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13370 Remove unportable assumptions about print widths of types like
13371 dbus_uint32_t.
13372 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13373 intptr_t when converting between pointer and integer, to avoid GCC
13374 warnings about wrong width.
13375
666b903b 133762012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13377
13378 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13379 stack for each reader_thread, instead of defaulting to 8MB
13380 determined by the linker. This avoids failures in creating
13381 subprocesses on Windows 7, see the discussion in this thread:
13382 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13383
b120cc17
JC
133842012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13385
13386 Fix up display of the *Minibuf-0* buffer in the mini window.
13387 * keyboard.c (read_char): Don't clear the echo area if there's no
13388 message to clear.
13389 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13390 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13391
9a4b36f8
MA
133922012-05-07 Michael Albinus <michael.albinus@gmx.de>
13393
13394 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13395 batch mode.
13396
e5f9458f
CY
133972012-05-06 Chong Yidong <cyd@gnu.org>
13398
13399 * lisp.mk (lisp): Update.
13400
eceeb5fc 134012012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13402
13403 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13404
71873e2b
SM
134052012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13406
13407 * data.c (PUT_ERROR): New macro.
13408 (syms_of_data): Use it. Add new error type `user-error'.
13409 * undo.c (user_error): New function.
13410 (Fprimitive_undo): Use it.
13411 * print.c (print_error_message): Adjust print style for `user-error'.
13412 * keyboard.c (user_error): New function.
13413 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13414
ab0fa4e4
PE
134152012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13416
13417 Do not limit current-time-string to years 1000..9999.
13418 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13419 (Fcurrent_time_string): Support any year that is supported by the
13420 underlying localtime representation. Don't use asctime, as it
13421 has undefined behavior for years outside the range -999..9999.
13422
7ed806a7
PE
134232012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13424
13425 Fix race conditions involving setenv, gmtime, localtime, asctime.
13426 Without this fix, interrupts could mess up code that uses these
13427 nonreentrant functions, since setting TZ invalidates existing
13428 tm_zone or tzname values, and since most of these functions return
13429 pointers to static storage.
13430 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13431 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13432 Grow the critical sections to include not just invoking
13433 localtime/gmtime, but also accessing these functions' results
13434 including their tm_zone values if any, and any related TZ setting.
13435 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13436 so that the struct tm is saved in the critical section.
13437 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13438 motivated by the fact that memory allocation needs to be outside
13439 the critical section.
13440
0c16dfed
DA
134412012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13442
13443 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13444 with RESET_INTERVAL.
13445
13446 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13447 Remove duplicated buffer name initialization.
13448
3f83ace8
JM
134492012-05-02 Jim Meyering <jim@meyering.net>
13450
13451 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13452
c7b8541e
JM
13453 * xfns.c (x_window): Use xstrdup (Bug#11375).
13454
90207a15 134552012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13456
13457 * xdisp.c (pos_visible_p): If already at a newline from the
13458 display string before the 'while' loop, don't walk back the glyphs
13459 from it3.glyph_row. Solves assertion violation when the display
13460 string begins with a newline (egg.el). (Bug#11367)
13461
b593d6a9
AH
134622012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13463
13464 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13465 Move to simple.el.
13466
4737362e
GM
134672012-05-01 Glenn Morris <rgm@gnu.org>
13468
99cf43f9
GM
13469 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13470 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13471 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13472 All were removed before 23.1.
13473
9311dcff
GM
13474 * dispnew.c: Remove HAVE_LIBNCURSES test;
13475 it is always true on relevant platforms.
13476
4d5c6349
GM
13477 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13478 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13479
4737362e
GM
13480 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13481
74dd3a6b
AS
134822012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13483
13484 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13485 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13486 Remove.
13487
13c379ee
PE
134882012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13489
13490 Do not avoid creating empty evaporating overlays (Bug#9642).
13491 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13492 That is, do not delete an evaporating overlay if it becomes
13493 empty after its bounds are adjusted to fit within its buffer.
13494 This fix caused other problems, and I'm reverting it until we get
13495 to the bottom of them.
13496
a8e7d6d7 134972012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13498
13499 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13500
a8e7d6d7 135012012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13502
13503 * xdisp.c (pos_visible_p): If the window start position is beyond
13504 ZV, start the display from buffer beginning. Prevents assertion
13505 violation in init_iterator when the minibuffer window is scrolled
13506 via the scroll bar.
13507
13508 * window.c (window_scroll_pixel_based): Likewise.
13509
a8e7d6d7 135102012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13511
13512 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13513
a8e7d6d7 135142012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13515
13516 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13517 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13518
a8e7d6d7 135192012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13520
b593d6a9
AH
13521 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13522 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13523
1c6900d9
EZ
135242012-04-26 Eli Zaretskii <eliz@gnu.org>
13525
4c3fa1d9
EZ
13526 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13527 display element, check also the underlying string or buffer
13528 character. (Bug#11341)
13529
1c6900d9
EZ
13530 * w32menu.c: Include w32heap.h.
13531 (add_menu_item): If the call to AppendMenuW (via
13532 unicode_append_menu) fails, disable Unicode menus only if we are
13533 running on Windows 9X/Me.
13534
42bf8205
AS
135352012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13536
13537 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13538 (xgetint): Add missing shift for LSB tags.
13539
b1bac16e
MR
135402012-04-24 Martin Rudalics <rudalics@gmx.at>
13541
13542 * keyboard.c (read_char): Don't wipe echo area for select window
13543 events: These might get delayed via `mouse-autoselect-window'
13544 (Bug#11304).
13545
d69621cc
JB
135462012-04-24 Juanma Barranquero <lekktu@gmail.com>
13547
13548 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13549 manipulation of :loaded-from data.
13550
02fd101b
JB
135512012-04-23 Juanma Barranquero <lekktu@gmail.com>
13552
13553 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13554 now a cons (bug#11311).
13555
888bec30
PE
135562012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13557
89a438bd
PE
13558 Do not create empty overlays with the evaporate property (Bug#9642).
13559 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13560 if it becomes empty after its bounds are adjusted to fit within
13561 its buffer. Without this fix, in a nonempty buffer (let ((o
13562 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13563 yields an empty overlay that has the evaporate property, which is
13564 not supposed to happen.
13565
1068fe4d
PE
13566 Fix minor GTK3 problems found by static checking.
13567 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13568 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13569 (struct _EmacsFixedClass, emacs_fixed_get_type):
13570 Move decls here from emacsgtkfixed.h, since they needn't be public.
13571 (emacs_fixed_get_type): Now static.
13572 (emacs_fixed_class_init): Omit unused local.
13573 (emacs_fixed_child_type): Remove; unused.
13574 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13575 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13576 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13577 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13578 (EMACS_FIXED_GET_CLASS): Remove; unused.
13579 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13580
888bec30
PE
13581 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13582 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13583
de85e130
PE
135842012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13585
d0baac98 13586 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 13587 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
13588 (__malloc_size_t, __malloc_ptrdiff_t):
13589 Remove. All uses removed, replaced by the definiens if needed,
13590 since we can assume C89 or better now.
13591 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13592 (protect_malloc_state, align, get_contiguous_space)
13593 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13594 (malloc_atfork_handler_child, malloc_enable_thread)
13595 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13596 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13597 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13598 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13599 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13600 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13601 Define using prototypes, not old style.
13602 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13603 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13604 (align): Don't assume that signed integer overflow wraps around.
13605 Omit unused local var.
13606 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13607 (_free_internal_nolock, memalign, mallochook, reallochook):
13608 Omit no-longer-needed casts.
13609 (valloc): Use getpagesize, not __getpagesize.
13610 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13611 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13612
de85e130
PE
13613 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13614
dcbf5805
MA
136152012-04-22 Michael Albinus <michael.albinus@gmx.de>
13616
13617 Move functions from C to Lisp. Make non-blocking method calls
13618 the default. Implement further D-Bus standard interfaces.
13619
13620 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13621 (QCdbus_request_name_allow_replacement)
13622 (QCdbus_request_name_replace_existing)
13623 (QCdbus_request_name_do_not_queue)
13624 (QCdbus_request_name_reply_primary_owner)
13625 (QCdbus_request_name_reply_in_queue)
13626 (QCdbus_request_name_reply_exists)
13627 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13628 (QCdbus_registered_serial, QCdbus_registered_method)
13629 (QCdbus_registered_signal): New Lisp objects.
13630 (XD_DEBUG_MESSAGE): Use sizeof.
13631 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13632 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13633 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13634 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13635 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13636 (xd_signature, xd_append_arg): Allow float for integer types.
13637 (xd_get_connection_references): New function.
b593d6a9
AH
13638 (xd_get_connection_address): Rename from xd_initialize.
13639 Return cached address.
dcbf5805
MA
13640 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13641 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13642 level.
13643 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13644 Return number of refcounts.
dcbf5805
MA
13645 (Fdbus_get_unique_name): Make stronger parameter check.
13646 (Fdbus_message_internal): New defun.
13647 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13648 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13649 (Fdbus_send_signal, Fdbus_register_service)
13650 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13651 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13652 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13653 (Vdbus_compiled_version, Vdbus_runtime_version)
13654 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13655 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13656 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13657 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13658 Adapt docstring.
dcbf5805 13659
52828e02
PE
136602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13661
da05bc4c
PE
13662 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13663 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13664 Do not assume ptrdiff_t is the same width as 'int'.
13665
52828e02
PE
13666 * alloc.c: Handle unusual debugging option combinations.
13667 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13668 since the two debugging options are incompatible.
13669 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13670 is defined.
13671 (mem_init, mem_insert, mem_insert_fixup):
13672 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13673 (NEED_MEM_INSERT): Remove; no longer needed.
13674
f01769f9
LL
136752012-04-22 Leo Liu <sdl.web@gmail.com>
13676
13677 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13678
5790543d
PE
136792012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13680
13681 * sysdep.c [__FreeBSD__]: Minor cleanups.
13682 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13683 Use Emacs indenting style more consistently. Avoid some casts.
13684 Use 'double' consistently rather than mixing 'float' and 'double'.
13685
b91b7e4d
EW
136862012-04-21 Eduard Wiebe <usenet@pusto.de>
13687
b593d6a9
AH
13688 * sysdep.c (list_system_processes, system_process_attributes):
13689 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 13690
6114eb15
AS
136912012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13692
13693 * lisp.mk (lisp): Update.
13694
2f38dff7
PE
136952012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13696
13697 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13698 It is never used otherwise.
13699
4ae29f89
SM
137002012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13701
13702 * print.c (print_preprocess): Only check print_depth if print-circle
13703 is nil.
13704 (print_object): Check for cycles even when print-circle is nil and
13705 print-gensym is t, but only check print_depth if print-circle is nil.
13706
f30d612a
CY
137072012-04-20 Chong Yidong <cyd@gnu.org>
13708
13709 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13710 set the status to "failed" and ensure that sentinel is run.
13711
c07a4c0b 137122012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
13713
13714 * process.c (Fset_process_inherit_coding_system_flag)
13715 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 13716 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 13717
c07a4c0b 137182012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
13719
13720 * xdisp.c (string_buffer_position_lim): Limit starting position to
13721 BEGV.
13722 (set_cursor_from_row): If called for a mode-line or header-line
13723 row, return zero immediately.
13724 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
13725 farther than the first row after the header line, if any.
13726 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
13727 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13728
c07a4c0b 137292012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13730
4ae29f89
SM
13731 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13732 (bug#11238).
ad3a2b41 13733
c07a4c0b 137342012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 137352012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
13736
13737 configure: new option --enable-gcc-warnings (Bug#11207)
13738 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13739 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13740 (ALL_CFLAGS): Use new macros rather than old.
13741 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13742 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13743 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13744 -Wunused-result, -Wunused-variable. This should go away once
13745 the Emacs and Gnulib regex code is merged.
13746 (xmalloc, xrealloc): Now static.
13747
aba027e8
PE
137482012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13749
13750 * dired.c (Fsystem_groups): Remove unused local.
13751
e5a36063
GM
137522012-04-17 Glenn Morris <rgm@gnu.org>
13753
13754 * dired.c (Fsystem_users): Doc fix.
13755
316411f0
DA
137562012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13757
13758 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13759 (syms_of_dired): Add them.
13760
9426aba4
PE
137612012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13762
b62a57be
PE
13763 Fix minor alloc.c problems found by static checking.
13764 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13765 New extern decls, to avoid calling undeclared functions.
13766 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13767 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13768 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13769 (NEED_MEM_INSERT): New macro.
13770 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 13771 Remove one incorrect comment and fix another.
b62a57be 13772
3539f31f
PE
13773 Fix minor ralloc.c problems found by static checking.
13774 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13775 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13776 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13777 (r_alloc_sbrk): Now static.
13778
a041960a
PE
13779 Improve ralloc.c interface checking.
13780 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13781 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13782 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13783 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13784 [REL_ALLOC]: ... to here, to check interface.
13785 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13786 Remove decls. This fixes an "It stinks!".
13787
9426aba4
PE
13788 * alloc.c (which_symbols): Fix alignment issue / type clash.
13789
d55c12ed
AS
137902012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13791
13792 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13793 (struct Lisp_Misc_Any): Likewise.
13794 (struct Lisp_Free): Likewise.
13795 * alloc.c (union aligned_Lisp_Symbol): Define.
13796 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13797 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13798 (union aligned_Lisp_Misc): Define.
13799 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13800 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 13801 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 13802
b948ce8b
PE
138032012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13804
13805 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13806 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13807 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13808 * s/netbsd.h, s/sol2-6.h:
13809 Remove definition of GC_MARK_STACK, since the default now works.
13810 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13811 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13812 no longer the default.
13813 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13814
35dc09a1 138152012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13816
35dc09a1
GM
13817 * lread.c (lisp_file_lexically_bound_p):
13818 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 13819
35dc09a1
GM
138202012-04-14 Eli Zaretskii <eliz@gnu.org>
13821
13822 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13823 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13824
138252012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13826
13827 * nsterm.m (constrainFrameRect): Always constrain when there is only
13828 one screen (Bug#10962).
13829
bcd86815
KB
138302012-04-13 Ken Brown <kbrown@cornell.edu>
13831
13832 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13833
c25df26e
RT
138342012-04-13 Reuben Thomas <rrt@sc3d.org>
13835
13836 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13837
0fc59f1e
DC
138382012-04-11 Daniel Colascione <dancol@dancol.org>
13839
13840 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13841 against is gone. It's better to use vfork now so that when Cygwin
13842 gains a new, working vfork, we use it automatically (bug#10398).
13843
de8c03dc
SM
138442012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13845
13846 * window.c (save_window_save): Obey window-point-insertion-type.
13847
2f097256
GM
138482012-04-11 Glenn Morris <rgm@gnu.org>
13849
13850 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13851
453b951e
SM
138522012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13853
13854 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13855
75f1671a 138562012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
13857
13858 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13859 (force_quit_count): New var.
13860 (handle_interrupt): Use it.
13861
2a8ce227
JB
138622012-04-10 Juanma Barranquero <lekktu@gmail.com>
13863
13864 * w32.c (w32_delayed_load): Record the full path of the library
13865 being loaded (bug#10424).
13866
935396c0
GM
138672012-04-09 Glenn Morris <rgm@gnu.org>
13868
05920a43
GM
13869 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13870 not just in the obarray, before snarfing them. (Bug#11036)
13871
935396c0
GM
13872 * Makefile.in ($(leimdir)/leim-list.el):
13873 Pass EMACS rather than BUILT_EMACS.
13874
a18ecafa
TZ
138752012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13876
13877 * process.c (make_process):
13878 * process.h: Add integer `gnutls_handshakes_tried' member to
13879 process struct.
13880
6bbef4e5
JC
13881 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13882 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
13883
13884 * gnutls.c (gnutls_log_function2i): Convenience log function.
13885 (emacs_gnutls_read): Use new log functions,
13886 `gnutls_handshakes_tried' process member, and
13887 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13888 attempts per process (connection).
13889
b4d3bc10
CY
138902012-04-09 Chong Yidong <cyd@gnu.org>
13891
13892 * eval.c (Fuser_variable_p, user_variable_p_eh)
13893 (lisp_indirect_variable): Functions deleted.
13894 (Fdefvar): Caller changed.
13895
13896 * callint.c (Finteractive, Fcall_interactively):
13897 * minibuf.c (Fread_variable): Callers changed.
13898
70f4d973
EZ
138992012-04-09 Eli Zaretskii <eliz@gnu.org>
13900
13901 * xdisp.c (set_cursor_from_row): If the display string appears in
13902 the buffer at position that is closer to point than the position
13903 after the display string, display the cursor on the first glyph of
13904 the display string. Fixes cursor display when a 'display' text
13905 property immediately follows invisible text. (Bug#11094)
13906
cb3c2e3e
PE
139072012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13908
13909 composite.c: use 'double' consistently
13910 * composite.c (get_composition_id): Use 'double' consistently
13911 instead of converting 'float' to 'double' and vice versa; this is
13912 easier to understand and avoids a GCC warning.
13913
fd06db5d
GM
139142012-04-09 Glenn Morris <rgm@gnu.org>
13915
50fe702a
GM
13916 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13917 preparation for dumping it with emacs. (Bug#4789)
13918 (leimdir): New variable.
13919 ($(leimdir)/leim-list.el): New rule.
13920 (emacs$(EXEEXT)): Depend on leim-list.el.
13921
fd06db5d
GM
13922 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13923 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13924 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13925
55c131ee
AS
139262012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13927
13928 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13929 proper alignment.
13930
9209588f
JB
139312012-04-07 Juanma Barranquero <lekktu@gmail.com>
13932
13933 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13934 Remove unused local variable.
13935
e3fb2efb
PE
139362012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13937
13938 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13939 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13940 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13941 objects, as mark_maybe_pointer will catch them otherwise.
13942 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13943 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13944
b5385551
PE
139452012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13946
13947 Fix typo that broke non-Windows builds.
13948 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13949
9078ead6
EZ
139502012-04-07 Eli Zaretskii <eliz@gnu.org>
13951
13952 Support building on MS-Windows with libxml2.
13953
13954 * makefile.w32-in (OBJ2): Add xml.$(O).
13955 (GLOBAL_SOURCES): Add xml.c.
13956 ($(BLD)/xml.$(O)): New dependency list.
13957
13958 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13959 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13960 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13961 [!WINDOWSNT]: New macros.
13962 (init_libxml2_functions, libxml2_loaded_p): New functions.
13963 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13964 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13965 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13966 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13967 linked in).
6bbef4e5
JC
13968 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13969 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13970 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13971
13972 * emacs.c: Don't include libxml/parser.h.
13973 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13974 xmlCleanupParser directly.
13975
13976 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13977
3811fdf3
EZ
139782012-04-07 Eli Zaretskii <eliz@gnu.org>
13979
13980 * indent.c (Fvertical_motion): If there is a display string at
13981 point, use it.vpos to compute how many lines to backtrack after
13982 move_it_to point. (Bug#11133)
13983
2f8e16b2
EZ
139842012-04-06 Eli Zaretskii <eliz@gnu.org>
13985
13986 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13987 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13988 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13989 macros related to unification of CJK characters. For the details,
13990 see the discussion following the message here:
13991 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13992
3d439cd1
CY
139932012-04-04 Chong Yidong <cyd@gnu.org>
13994
13995 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13996
8bc53d00
EZ
139972012-04-01 Eli Zaretskii <eliz@gnu.org>
13998
13999 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14000 instead of alloca. (Bug#11138)
14001
3b0512a3
AS
140022012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14003
14004 * w32menu.c (is_simple_dialog): Properly check lisp types.
14005 (Bug#11141)
14006
8427ddd2
EZ
140072012-03-31 Eli Zaretskii <eliz@gnu.org>
14008
979022ef
EZ
14009 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14010 position we get to after a call to move_it_to fails the
14011 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14012 only if we wind up in a string from display property. (Bug#11063)
14013
a6b1c7cc
EZ
14014 * window.c (Fdelete_other_windows_internal): Invalidate the row
14015 and column information about mouse highlight, so that redisplay
14016 restores it after reallocating the glyph matrices. (Bug#7464)
14017
8427ddd2
EZ
14018 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14019 string comes from a `display' text property, use the buffer
14020 position of that property as if we actually saw that position in
14021 the row's glyphs.
697ba24b
EZ
14022 (move_it_by_lines): Remove the assertion that
14023 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14024 violated when there's a before-string at the beginning of a line.
14025 (Bug#11063)
8427ddd2 14026
65a0a738
EZ
140272012-03-30 Eli Zaretskii <eliz@gnu.org>
14028
14029 * xdisp.c (append_space_for_newline): If the default face was
14030 remapped, use the remapped face for the appended newline.
14031 (extend_face_to_end_of_line): Use the remapped default face for
14032 extending the face to the end of the line.
14033 (display_line): Call extend_face_to_end_of_line when the default
14034 face was remapped. (Bug#11068)
14035
581355cc
EZ
140362012-03-29 Eli Zaretskii <eliz@gnu.org>
14037
14038 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14039
e8fc049f
SM
140402012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14041
14042 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14043
4fb9a543
GM
140442012-03-27 Glenn Morris <rgm@gnu.org>
14045
14046 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14047 Doc fixes.
14048
679910f1
KH
140492012-03-26 Kenichi Handa <handa@m17n.org>
14050
14051 * dispextern.h (struct glyph): Fix previous change. Change the
14052 bit length of glyphless.ch to 25 (Bug#11082).
14053
90d49b7f
CY
140542012-03-26 Chong Yidong <cyd@gnu.org>
14055
14056 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14057 (command_loop_1): Use it; inhibit selection update for
14058 handle-select-window too (Bug#8996).
14059
f514f6f0
FP
140602012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14061
e8fc049f 14062 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14063
bf43fa51
KH
140642012-03-25 Kenichi Handa <handa@m17n.org>
14065
14066 * dispextern.h (struct glyph): Change the bit length of
14067 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14068
8a0c01dd
EZ
140692012-03-24 Eli Zaretskii <eliz@gnu.org>
14070
14071 * s/ms-w32.h (tzname): Include time.h before redirecting to
14072 _tzname. Fixes the MSVC build. (Bug#9960)
14073
7d1c3a76
AS
140742012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14075
8ed79523
AS
14076 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14077 characters.
14078
7d1c3a76
AS
14079 * xterm.c (XTread_socket): Only modify handling_signal if
14080 !SYNC_INPUT. (Bug#11080)
14081
e99a9b8b
EZ
140822012-03-23 Eli Zaretskii <eliz@gnu.org>
14083
14084 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14085 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14086 when fetching a multibyte character consumes more bytes than
14087 CHAR_BYTES returns, due to unification of CJK characters in
14088 string_char. (Bug#11073)
14089
5063c0e1
TN
140902012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14091
14092 * process.c (wait_reading_process_output): Handle pty disconnect
14093 by refraining from sending oneself a SIGCHLD (bug#10933).
14094
9f851fbd
CY
140952012-03-22 Chong Yidong <cyd@gnu.org>
14096
14097 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14098
5063c0e1 14099 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14100 Mark string as coming from a prefix property.
14101 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14102 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14103
fb5b8aca
CY
141042012-03-21 Chong Yidong <cyd@gnu.org>
14105
14106 * xfaces.c (Vface_remapping_alist): Doc fix.
14107
62356a1b
EZ
141082012-03-20 Eli Zaretskii <eliz@gnu.org>
14109
14110 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14111 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14112 Doc fixes.
62356a1b 14113
025de85b
CY
141142012-03-20 Chong Yidong <cyd@gnu.org>
14115
14116 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14117 to reflect default non-nil value of redisplay-dont-pause.
14118
4827f94e
KH
141192012-03-19 Kenichi Handa <handa@m17n.org>
14120
14121 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14122 it fit in a valid range (Bug#11003).
14123
e50a24a2
EZ
141242012-03-18 Eli Zaretskii <eliz@gnu.org>
14125
14126 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14127 that is not from display property, accept the row as a "cursor
14128 row" if one of the string's character has a non-nil `cursor'
14129 property. Fixes cursor positioning when there are newlines in
14130 overlay strings, e.g. in icomplete.el. (Bug#11035)
14131
9af5ed87
PE
141322012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14133
14134 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14135
d1f55f16
CY
141362012-03-12 Chong Yidong <cyd@gnu.org>
14137
14138 * eval.c (inhibit_lisp_code): Rename from
14139 inhibit_window_configuration_change_hook; move from window.c.
14140
14141 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14142 * window.c (run_window_configuration_change_hook)
14143 (syms_of_window): Callers changed.
14144
66c5eebd
CY
141452012-03-11 Chong Yidong <cyd@gnu.org>
14146
413df973
CY
14147 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14148
66c5eebd
CY
14149 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14150
1de11f56
CY
141512012-03-10 Chong Yidong <cyd@gnu.org>
14152
14153 * frame.c (other_visible_frames): Don't assume the selected frame
14154 is visible (Bug#10955).
14155
cae07000
SM
141562012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14157
14158 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14159
89c94350
JD
141602012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14161
14162 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14163 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14164 zero (Bug#10954).
14165
999dd333
GM
141662012-03-03 Glenn Morris <rgm@gnu.org>
14167
01a6dcc8 14168 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14169
de0100f2
EZ
141702012-03-02 Eli Zaretskii <eliz@gnu.org>
14171
14172 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14173 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14174 (redisplay_window, next_element_from_string): Fix typos in
14175 comments.
3e441275
EZ
14176 (redisplay_window): Pass to move_it_vertically the margin in
14177 pixels, not in screen lines.
de0100f2 14178
96a72ee9
GM
141792012-03-02 Glenn Morris <rgm@gnu.org>
14180
14181 * buffer.c (buffer-list-update-hook): Doc fix.
14182
312508d7
EZ
141832012-02-29 Eli Zaretskii <eliz@gnu.org>
14184
14185 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14186 push_it before setting up the iterator for the first overlay
14187 string, even if we have an empty string loaded.
14188 (next_overlay_string): If there's an empty string on the iterator
14189 stack, pop the stack. (Bug#10903)
14190
27f3c637
PE
141912012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14192
14193 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14194 Suggested by Stefan Monnier in
14195 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14196 * alloc.c (widen_to_Lisp_Object): New static function.
14197 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14198 and widening them to Lisp_Objects. This would work even if
14199 USE_LSB_TAG is defined and wide integers are used, which might
14200 happen in a future version of Emacs.
14201
3c9dfce6
CY
142022012-02-25 Chong Yidong <cyd@gnu.org>
14203
fa74b241
CY
14204 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14205 Doc fix.
14206
3c9dfce6
CY
14207 * xselect.c (Fx_selection_exists_p): Doc fix.
14208 (x_clipboard_manager_save_all): Print an informative message
14209 before saving to clipboard manager.
14210
9486df08
CY
142112012-02-24 Chong Yidong <cyd@gnu.org>
14212
14213 * keyboard.c (process_special_events): Handle all X selection
14214 requests in kbd_buffer, not just the next one (Bug#8869).
14215
f01d3321
CY
142162012-02-23 Chong Yidong <cyd@gnu.org>
14217
14218 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14219 call when setting menu-bar-lines and tool-bar-lines parameters.
14220 (unwind_create_frame_1): New helper function.
14221
14222 * window.c (inhibit_window_configuration_change_hook): New var.
14223 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14224 (syms_of_window): Initialize it.
f01d3321 14225
86b847b6
CY
142262012-02-22 Chong Yidong <cyd@gnu.org>
14227
14228 * xterm.c (x_draw_image_relief): Add missing type check for
14229 Vtool_bar_button_margin (Bug#10743).
14230
a59225b1
CY
142312012-02-21 Chong Yidong <cyd@gnu.org>
14232
14233 * fileio.c (Vfile_name_handler_alist): Doc fix.
14234
14235 * buffer.c (Fget_file_buffer): Protect against invalid file
14236 handler return value.
14237
310f5bd4
PE
142382012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14239
cb3a28cc
PE
14240 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14241 when computing $valmask.
14242
310f5bd4
PE
14243 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14244 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14245 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14246 It's useless in that case, and it can cause problems on hosts
14247 that allocate halves of EMACS_INT values separately.
14248 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14249 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14250 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14251 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14252 it avoids undefined behavior on hosts where shifting right by more
14253 than the word width has undefined behavior.
14254
2375c96a
CY
142552012-02-19 Chong Yidong <cyd@gnu.org>
14256
14257 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14258 (Funhandled_file_name_directory, Ffile_name_as_directory)
14259 (Fdirectory_file_name, Fexpand_file_name)
14260 (Fsubstitute_in_file_name): Protect against invalid file handler
14261 return values (Bug#10845).
14262
3eb49e71
EZ
142632012-02-18 Eli Zaretskii <eliz@gnu.org>
14264
14265 * .gdbinit (pitx): Fix incorrect references to fields of the
14266 iterator stack.
14267
7b926f3f
CY
142682012-02-17 Chong Yidong <cyd@gnu.org>
14269
14270 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14271
11273115
PE
142722012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14273
14274 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14275 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14276
c3a70e2b
CY
142772012-02-15 Chong Yidong <cyd@gnu.org>
14278
14279 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14280 marked as special. Also, starting docstrings with * is obsolete.
14281
0ca43699
AS
142822012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14283
14284 * gnutls.c (emacs_gnutls_write): Fix last change.
14285
2e8f3c56
LI
142862012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14287
14288 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14289 send_process.
14290
af70074f
SM
142912012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14292
14293 * keymap.c (Fsingle_key_description): Handle char ranges.
14294
95986d52
CY
142952012-02-12 Chong Yidong <cyd@gnu.org>
14296
afd83bd1
CY
14297 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14298 as that creates a dangerous corner case.
14299
95986d52
CY
14300 * window.c (Fdelete_window_internal): Invalidate the mouse
14301 highlight (Bug#9904).
14302
bd7da63e
GM
143032012-02-12 Glenn Morris <rgm@gnu.org>
14304
14305 * xselect.c (Fx_own_selection_internal)
14306 (Fx_get_selection_internal, Fx_disown_selection_internal)
14307 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14308 * nsselect.m (Fx_own_selection_internal)
14309 (Fx_disown_selection_internal, Fx_selection_exists_p)
14310 (Fx_selection_owner_p, Fx_get_selection_internal):
14311 Sync docs and argument specs with the xselect.c versions.
14312
77abcbc2
LI
143132012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14314
14315 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14316
90b671e2
EZ
143172012-02-11 Eli Zaretskii <eliz@gnu.org>
14318
1c0ca0b7
EZ
14319 * w32select.c (Fx_selection_exists_p): Sync doc string and
14320 argument list with xselect.c. (Bug#10783)
14321
14322 * w16select.c (Fx_selection_exists_p): Sync doc string and
14323 argument list with xselect.c. (Bug#10783)
90b671e2 14324
49241268
GM
143252012-02-10 Glenn Morris <rgm@gnu.org>
14326
14327 * fns.c (Fsecure_hash): Doc fix.
14328
f998bbe7 143292012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14330
14331 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14332
0992bd9c
CY
143332012-02-07 Chong Yidong <cyd@gnu.org>
14334
14335 * buffer.c (Fbuffer_local_variables)
14336 (buffer_lisp_local_variables): Handle unbound vars correctly;
14337 don't let Qunbound leak into Lisp.
14338
af008560
GM
143392012-02-07 Glenn Morris <rgm@gnu.org>
14340
dd605cc4
GM
14341 * image.c (Fimagemagick_types): Doc fix.
14342
af008560
GM
14343 * image.c (imagemagick-render-type): Change it from a lisp object
14344 to an integer. Move the doc here from the lisp manual.
14345 Treat all values not equal to 0 the same.
14346
1449fa1d
CY
143472012-02-06 Chong Yidong <cyd@gnu.org>
14348
14349 * doc.c (store_function_docstring): Avoid applying docstring of
14350 alias to base function (Bug#2603).
14351
3723ec07
AS
143522012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14353
14354 * .gdbinit (pp1, pv1): Remove redundant defines.
14355 (pr): Use pp.
14356
79c1cc1e
CY
143572012-02-04 Chong Yidong <cyd@gnu.org>
14358
14359 * nsterm.m: Declare a global (Bug#10694).
14360
d7f29f8e
EZ
143612012-02-04 Eli Zaretskii <eliz@gnu.org>
14362
cae07000
SM
14363 * w32.c (get_emacs_configuration_options):
14364 Include --enable-checking, if specified, in the return value.
d7f29f8e 14365
3b95a6f9
MR
143662012-02-04 Martin Rudalics <rudalics@gmx.at>
14367
14368 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14369 after rounding frame sizes. (Bug#9723)
14370
d6fa96a6
EZ
143712012-02-04 Eli Zaretskii <eliz@gnu.org>
14372
14373 * keyboard.c (adjust_point_for_property): Don't position point
14374 before BEGV. (Bug#10696)
14375
df0b2940
PE
143762012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14377
14378 Handle overflow when computing char display width (Bug#9496).
14379 * character.c (char_width): Return EMACS_INT, not int.
14380 (char_width, c_string_width): Check for overflow when
14381 computing the width; this is possible now that individual
14382 characters can have unbounded width. Problem introduced
14383 by merge from Emacs 23 on 2012-01-19.
14384
6bee44d6
MA
143852012-02-02 Michael Albinus <michael.albinus@gmx.de>
14386
14387 * dbusbind.c (Fdbus_register_method): Mention the return value
14388 :ignore in the docstring.
14389
44f92739
GM
143902012-02-02 Glenn Morris <rgm@gnu.org>
14391
1b9f60cc
GM
14392 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14393
44f92739
GM
14394 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14395 Unconditionally set to t. (Bug#10673)
14396 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14397 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14398 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14399
c5d3843c
KH
144002012-02-02 Kenichi Handa <handa@m17n.org>
14401
14402 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14403 0, do not call append_composite_glyph.
14404
159462d4 144052012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14406
14407 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14408 NULL (Bug#6988).
14409 (x_produce_glyphs): If the component of a composition is a null
14410 string, set it->pixel_width to 1 to avoid zero-width glyph.
14411
78cef877
EZ
144122012-02-01 Eli Zaretskii <eliz@gnu.org>
14413
14414 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14415 first 2 arguments are identical. This makes inserting large
14416 output from a subprocess an order of magnitude faster on
14417 MS-Windows, where all sbrk'ed memory is always contiguous.
14418
97897668
GM
144192012-01-31 Glenn Morris <rgm@gnu.org>
14420
14421 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14422 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14423 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14424
31fd3586
GM
144252012-01-29 Glenn Morris <rgm@gnu.org>
14426
14427 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14428
0e24a8b2
CY
144292012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14430
14431 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14432
cc0adcb0
CY
144332012-01-28 Chong Yidong <cyd@gnu.org>
14434
14435 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14436
acc28cb9
CY
144372012-01-26 Chong Yidong <cyd@gnu.org>
14438
9c69cfb7
CY
14439 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14440
acc28cb9
CY
14441 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14442 repeat counts (Bug#10507).
14443
48da7392
GM
144442012-01-26 Glenn Morris <rgm@gnu.org>
14445
14446 * lread.c (syms_of_lread): Doc fix.
14447
14af5f7f
CY
144482012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14449
14450 * coding.c (encode_designation_at_bol): Change return value to
14451 EMACS_INT.
14452
0b21c100
CY
144532012-01-25 Chong Yidong <cyd@gnu.org>
14454
14455 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14456
3c2907f7
CY
144572012-01-21 Chong Yidong <cyd@gnu.org>
14458
14459 * floatfns.c (Fcopysign): Make the second argument non-optional,
14460 since nil is not allowed anyway.
14461
959ad23f
AS
144622012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14463
14464 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14465 (send_process): Likewise.
14466
34a02f46
MR
144672012-01-19 Martin Rudalics <rudalics@gmx.at>
14468
14469 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14470 (Vwindow_persistent_parameters): Do not use Qstate.
14471 Rewrite doc-strings.
34a02f46 14472
1259009a 144732012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14474
14475 * character.c (char_width): New function.
70d4fdf6
GM
14476 (Fchar_width, c_string_width, lisp_string_width):
14477 Use char_width (Bug#9496).
25ed9e61 14478
6a6ee00d
MR
144792012-01-16 Martin Rudalics <rudalics@gmx.at>
14480
14481 * window.c (Vwindow_persistent_parameters): New variable.
14482 (Fset_window_configuration, save_window_save): Handle persistent
14483 window parameters.
14484
c85efaf7
EZ
144852012-01-14 Eli Zaretskii <eliz@gnu.org>
14486
14487 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14488 thrashing the stack of the thread. (Bug#9087)
14489
5944709e
PE
144902012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14491
14492 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14493
e71f5d99
EZ
144942012-01-11 Eli Zaretskii <eliz@gnu.org>
14495
14496 * xdisp.c (rows_from_pos_range): Handle the case where the
14497 highlight ends on a newline. (Bug#10464)
14498 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14499 he end column for display of highlight that ends on a newline
14500 before a R2L line.
14501
ce316182
GM
145022012-01-11 Glenn Morris <rgm@gnu.org>
14503
14504 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14505 from load-path also when installation-directory is nil. (Bug#10208)
14506
5b43da69
GM
145072012-01-10 Glenn Morris <rgm@gnu.org>
14508
74cc8ff9
GM
14509 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14510
7d8d6e4e
GM
14511 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14512 Update template values to be closer to their typical values these days.
5b43da69 14513
a0db8d43
EZ
145142012-01-09 Eli Zaretskii <eliz@gnu.org>
14515
14516 * xdisp.c (rows_from_pos_range): Accept additional argument
14517 DISP_STRING, and accept any glyph in a row whose object is that
14518 string as eligible for mouse highlight. Fixes mouse highlight of
14519 display strings from overlays. (Bug#10464)
14520
9a0115ab 145212012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14522
b9110d6a 14523 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14524 * fileio.c (auto_saving_dir_umask): New static var.
14525 (Fmake_directory_internal): Use it.
14526 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14527 creating the directory. The old code temporarily assigns
14528 too-generous permissions to the directory.
14529 (do_auto_save_eh): Clear it.
b9110d6a 14530 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14531 that the var is always cleared.
14532
6c1bd3f3
EZ
145332012-01-07 Eli Zaretskii <eliz@gnu.org>
14534
14535 * search.c (scan_buffer): Pass character positions to
14536 know_region_cache, not byte positions. (Bug#6540)
14537
069d2b50
L
145382012-01-07 LynX <_LynX@bk.ru> (tiny change)
14539
14540 * w32.c (sys_rename): Report EXDEV when rename of a directory
14541 fails because the target is on another logical disk. (Bug#10284)
14542
75bf0d33
DB
145432012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14544
14545 * xterm.c (x_embed_request_focus): New function.
14546
14547 * xterm.h: Add prototype.
14548
14549 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14550
1c6e5a32
GM
145512012-01-05 Glenn Morris <rgm@gnu.org>
14552
14553 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14554
651e947e
EZ
145552012-01-01 Eli Zaretskii <eliz@gnu.org>
14556
14557 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14558 Load gnutls_transport_set_lowat only if GnuTLS version is below
14559 2.11.1.
14560 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14561 GnuTLS versions below 2.11.1.
14562
3778cdd8
AL
145632011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14564
14565 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14566 to the doc string advising against its use for altering the way
14567 windows are scrolled.
14568
0e5317f7
KH
145692011-12-28 Kenichi Handa <handa@m17n.org>
14570
14571 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14572 coding-system ASCII compatible only when it does not produce BOM
14573 on encoding (Bug#10383).
14574
93d5ca1f
JD
145752011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14576
14577 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14578 can scroll.
14579 (create_and_show_popup_menu): Always use menu_position_func for
14580 Gtk3 (Bug#10361).
14581
ca22b785
AS
145822011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14583
14584 * callint.c (Fcall_interactively): Don't truncate prompt string.
14585
d048e1e6
EZ
145862011-12-23 Eli Zaretskii <eliz@gnu.org>
14587
14588 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14589 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 14590 resumed from there (after widening). (Bug#10360)
d048e1e6 14591
5ccaba1f
JD
145922011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14593
14594 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14595
204ee57f
JD
145962011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14597
b81d40f0
JB
14598 * nsterm.m (x_free_frame_resources):
14599 Release f->output_data.ns->miniimage.
204ee57f
JD
14600 (ns_index_color): Fix indentation. Do not retain
14601 color_table->colors[i].
14602
14603 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14604 before returning.
14605
14606 * nsfns.m (x_set_background_color): Assign return value from
14607 ns_index_color to face-background instead of NSColor*.
14608 (ns_implicitly_set_icon_type): Fix indentation.
14609 Change assignment in for loop to comparison.
14610
14611 * emacs.c (ns_pool): New variable.
14612 (main): Assign ns_pool.
14613 (Fkill_emacs): Call ns_release_autorelease_pool.
14614
14615 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14616 autorelease fdesc, release fdAttrs and tdict.
14617 (ns_get_covering_families): Release charset.
14618 (ns_findfonts): Release NSFontDescriptor created with new.
14619 (ns_uni_to_glyphs): Fix indentation.
14620 (setString): Release attrStr before assigning new value.
14621
c803b2b7
JD
146222011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14623
678f4426
JD
14624 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14625 and NS_IMPL_COCOA.
14626 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14627 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14628
cd394be1 146292011-12-18 David Reitter <reitter@cmu.edu>
678f4426 14630
5fecd5fc
JD
14631 * nsterm.m (ns_term_init): Subscribe for notifications
14632 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14633 to method trackingNotification in EmacsMenu.
14634
14635 * nsmenu.m (trackingMenu): New variable.
3771cb17 14636 (trackingNotification): New method (from Aquamacs).
5fecd5fc 14637 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14638 from Aquamacs (Bug#7030).
678f4426
JD
14639
146402011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14641
c803b2b7
JD
14642 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14643 (symbol_to_nsstring): Fix indentation.
14644 (ns_symbol_to_pb): New function.
cae07000
SM
14645 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14646 (Fns_rotate_cut_buffers_internal): Remove.
14647 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14648 Fns_store_cut_buffer_internal.
14649 (ns_get_foreign_selection, Fx_own_selection_internal)
14650 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14651 (Fns_get_selection_internal, Fns_store_selection_internal):
14652 Use ns_symbol_to_pb and check if return value is nil.
14653 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14654 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14655 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14656 renamed to Sns_store_selection_internal.
14657 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14658 and remove this function.
14659 (ns_handle_selection_clear): Remove, never used.
14660 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14661 here.
14662
e1b01a3a
KB
146632011-12-17 Ken Brown <kbrown@cornell.edu>
14664
14665 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14666 GID is unknown (Bug#10257).
14667
2adb6e85
PE
146682011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14669
14670 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14671 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14672 which caused a build failure on GNU/Linux IA-64. This problem was
14673 introduced by my 2011-10-07 patch.
14674
d1d7b339
JL
146752011-12-15 Juri Linkov <juri@jurta.org>
14676
14677 * image.c (imagemagick_error): New function. (Bug#10112)
14678 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14679 Use `imagemagick_error' where ImageMagick functions return
14680 `MagickFalse'.
14681 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14682 proper order.
14683
100d5755
KH
146842011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14685
14686 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14687 fill background (Bug#8992).
14688
454592a6
MR
146892011-12-13 Martin Rudalics <rudalics@gmx.at>
14690
14691 * window.c (Vwindow_combination_resize)
14692 (Vwindow_combination_limit): Use t instead of non-nil in
14693 doc-strings.
61d4b438
MR
14694 (Vrecenter_redisplay): Add first sentence of doc-string on
14695 separate line.
53524d93 14696 (Frecenter): Fix doc-string typo.
454592a6 14697
3633e3aa
KH
146982011-12-11 Kenichi Handa <handa@m17n.org>
14699
14700 * coding.c (Funencodable_char_position): Pay attention to the
14701 buffer text relocation (Bug#9389).
14702
7b9d523a 147032011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 14704
7b9d523a
JD
14705 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14706 gtk_init (Bug#10100).
14707
b73189c6
EZ
147082011-12-10 Eli Zaretskii <eliz@gnu.org>
14709
14710 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14711 IT->string is nil. (Bug#10263)
14712
f7dfe5d6
JD
147132011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14714
83faebb4
JD
14715 * nsterm.h (x_free_frame_resources): Declare.
14716
f7dfe5d6
JD
14717 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14718 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14719
14720 * nsterm.h (ns_get_defaults_value): Declare.
14721
14722 * nsterm.m (ns_default): Call ns_get_defaults_value.
14723
7cd4e72c
EZ
147242011-12-09 Eli Zaretskii <eliz@gnu.org>
14725
14726 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14727 (Bug#10170)
14728
b34d7317
YM
147292011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14730
14731 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14732 that where the value of an _OBJC_* symbol points to is in the .bss
14733 section (Bug#10240).
14734
76470ad1
KH
147352011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14736
14737 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 14738 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 14739
745fff94
KH
147402011-12-08 Kenichi Handa <handa@m17n.org>
14741
14742 * ftfont.c (get_adstyle_property): Fix previous change
14743 (Bug#10233).
14744
6e44397c
JB
147452011-12-07 Juanma Barranquero <lekktu@gmail.com>
14746
14747 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14748 dirs from the default value of EMACSLOADPATH (bug#10208).
14749
7efa6272
GM
147502011-12-07 Glenn Morris <rgm@gnu.org>
14751
14752 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14753 installation and source directories as well. (Bug#10208)
14754
f6fc4d87
CY
147552011-12-06 Chong Yidong <cyd@gnu.org>
14756
14757 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14758
2bf26180
GM
147592011-12-06 Glenn Morris <rgm@gnu.org>
14760
14761 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14762 as an error, not just -1. (Bug#10217)
14763
3a6ad4f0
CY
147642011-12-05 Chong Yidong <cyd@gnu.org>
14765
14766 * keyboard.c (process_special_events): New function.
14767 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14768
75a3b399
PE
147692011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14770
14771 * coding.c (encode_designation_at_bol): Don't use uninitialized
14772 local variable (Bug#9318).
14773
c3c9e25e
KH
147742011-12-05 Kenichi Handa <handa@m17n.org>
14775
14776 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14777 return Qnil (Bug#8046, Bug#10193).
14778
5eb05ea3
KH
147792011-12-05 Kenichi Handa <handa@m17n.org>
14780
14781 * coding.c (encode_designation_at_bol): New args charbuf_end and
14782 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
14783 (coding_set_source): Return how many bytes coding->source was
14784 relocated.
14785 (coding_set_destination): Return how many bytes
14786 coding->destination was relocated.
14787 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 14788 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
14789
147902011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14791
14792 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14793 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14794 macro (Bug#9318).
14795
147962011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14797
14798 The following changes are to fix Bug#9318.
14799
a79703f5 14800 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
14801 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14802 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 14803 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 14804
7dbda6df
JB
148052011-12-05 Juanma Barranquero <lekktu@gmail.com>
14806
14807 * lisp.h (process_quit_flag): Fix external declaration.
14808
6d5eb5b0
SM
148092011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14810
14811 Don't macro-inline non-performance-critical code.
14812 * eval.c (process_quit_flag): New function.
14813 * lisp.h (QUIT): Use it.
14814
a0c3fad0
JD
148152011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14816
14817 * nsfns.m (get_geometry_from_preferences): New function.
14818 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14819
6c07aac2
AS
148202011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14821
14822 * emacs.c (Qkill_emacs): Define.
14823 (syms_of_emacs): Initialize it.
14824 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14825 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
14826 (quit_throw_to_read_char): Add parameter `from_signal'.
14827 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
14828 * lisp.h (QUIT): Call Fkill_emacs if requested.
14829
c052ead4
JD
148302011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14831
14832 * widget.c (update_wm_hints): Return if wmshell is null.
14833 (widget_update_wm_size_hints): New function.
14834
14835 * widget.h (widget_update_wm_size_hints): Declare.
14836
14837 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14838 widget_update_wm_size_hints (Bug#10104).
14839
9e49252b
EZ
148402011-12-03 Eli Zaretskii <eliz@gnu.org>
14841
14842 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14843 before a newline, prepare the bidi iterator for consuming the
14844 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 14845 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 14846
02b16839
JL
148472011-12-02 Juri Linkov <juri@jurta.org>
14848
14849 * search.c (Fword_search_regexp): New Lisp function created from
14850 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14851 (Fword_search_backward, Fword_search_forward)
14852 (Fword_search_backward_lax, Fword_search_forward_lax):
14853 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14854 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14855
0068070e
SM
148562011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14857
14858 * fileio.c (Finsert_file_contents): Move after-change-function call
14859 to before the "handled:" label, since all "goto handled" appear in
14860 cases where the *-change-functions have already been properly called
14861 (bug#10117).
14862
3360a3fc
AS
148632011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14864
14865 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14866 waiting for input. (Bug#10169)
14867
73d6c093
EZ
148682011-11-30 Eli Zaretskii <eliz@gnu.org>
14869
14870 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14871 verifies glyph row's hash code--we have just reallocated the
14872 glyphs, so their contents can be complete garbage. (Bug#10164)
14873
febe6bea
JB
148742011-11-30 Juanma Barranquero <lekktu@gmail.com>
14875
14876 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14877
801a4313
EZ
148782011-11-30 Eli Zaretskii <eliz@gnu.org>
14879
14880 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14881 attributes are tested _before_ calling verify_row_hash, to protect
14882 against GCC re-ordering of the tests. (Bug#10164)
14883
2b56b87e
JD
148842011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14885
14886 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14887
14888 * xterm.c (handle_one_xevent): Only set async_visible and friends
14889 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 14890 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
14891 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14892
dbf31225
PE
148932011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14894
14895 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14896 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14897 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14898 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14899 All uses changed to use GCPRO1 etc.
14900 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14901 Revert to old implementation (i.e., before 2011-03-11).
14902
1305621b
YM
149032011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14904
14905 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14906 of scroll runs so as to avoid assigning disabled bogus rows and
14907 unnecessary graphics copy operations.
14908
8c9afb46
EZ
149092011-11-27 Eli Zaretskii <eliz@gnu.org>
14910
14911 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14912 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14913 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14914 (malloc, free, realloc, calloc): Redirect to e_* only when
14915 compiling Emacs.
14916
14917 * lisp.h (GCTYPEBITS): Move before first use.
14918 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14919 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14920 this macro definition.
14921
14922 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14923 _MSC_VER.
14924
54e9e3bf
JD
149252011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14926
6d5eb5b0
SM
14927 * gtkutil.c (xg_create_frame_widgets):
14928 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
14929 present with Gtk+ 2.0.
14930
83aca1cb
PE
149312011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14932
14933 * fileio.c (Finsert_file_contents): Undo previous change; see
14934 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14935
5b76caa4
PE
149362011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14937
14938 Rename locals to avoid shadowing.
14939 * fileio.c (Finsert_file_contents):
14940 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14941 * process.c (wait_reading_process_output):
14942 Rename inner 'proc' to 'p' to avoid shadowing.
14943 Indent for consistency with usual Emacs style.
14944
8c535114
EZ
149452011-11-25 Eli Zaretskii <eliz@gnu.org>
14946
14947 * xdisp.c (redisplay_window): If cursor row is not fully visible
14948 after recentering, and scroll-conservatively is set to a large
14949 number, scroll window by a few more lines to make the cursor fully
14950 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14951 (start_display): Don't move to the next line if the display should
14952 start at a newline that is part of a display vector or an overlay
14953 string. (Bug#10119)
8c535114 14954
fa4fdb5c
JL
149552011-11-24 Juri Linkov <juri@jurta.org>
14956
14957 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14958 after the `MagickPingImage' call. (Bug#10112)
14959
90ec88df
CY
149602011-11-23 Chong Yidong <cyd@gnu.org>
14961
14962 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14963
56e2e794
MR
149642011-11-23 Martin Rudalics <rudalics@gmx.at>
14965
14966 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14967 making another buffer current. (Bug#10114)
14968
b6e64c41
GM
149692011-11-23 Glenn Morris <rgm@gnu.org>
14970
14971 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14972
6b21de18
CY
149732011-11-23 Chong Yidong <cyd@gnu.org>
14974
14975 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14976 using it (Bug#5984).
14977
b12cd789
EZ
149782011-11-22 Eli Zaretskii <eliz@gnu.org>
14979
14980 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14981 and header-lines, as they don't have one computed for them.
14982 (Bug#10098)
14983
14984 * .gdbinit (prow): Make displayed values more self-explaining.
14985 Add row's hash code.
14986
261b6fd4
LMI
149872011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14988
14989 * process.c (wait_reading_process_output): Fix asynchrounous
14990 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14991 (wait_reading_process_output): Add comment and URL.
261b6fd4 14992
e7cfd277
JD
149932011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14994
14995 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14996
a9b9b7f5
CY
149972011-11-21 Chong Yidong <cyd@gnu.org>
14998
14999 * window.c (Fnext_window, Fprevious_window): Doc fix.
15000
b0d15b4f
SM
150012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15002
15003 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15004
fe7a3057
JB
150052011-11-20 Juanma Barranquero <lekktu@gmail.com>
15006
15007 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15008
d2999b1a
MR
150092011-11-20 Martin Rudalics <rudalics@gmx.at>
15010
15011 * window.c (Fset_window_combination_limit): Rename argument
15012 STATUS to LIMIT.
15013 (Vwindow_combination_limit): Remove "status" from doc-string.
15014
d5ff9cd0
AS
150152011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15016
15017 * m/ibms390.h: Remove.
15018 * m/ibms390x.h: Don't include "ibms390.h".
15019
a5bb9bd3
SM
150202011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15021
15022 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15023 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15024
cd1181db
JB
150252011-11-20 Juanma Barranquero <lekktu@gmail.com>
15026
15027 * casetab.c (Fset_case_table):
15028 * charset.c (Fcharset_after): Fix typos.
15029
615a3b8d 150302011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15031
17e845af
PE
15032 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15033 Otherwise, valgrind does not work on some platforms.
15034 Problem reported by Andreas Schwab in
6a0bf43d
PE
15035 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15036 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15037 is set, removing the need for VIRT_ADDRESS_VARIES.
15038 (PURE_P): Use a more-efficient implementation that needs just one
15039 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15040 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15041 to 4 (xorl, subq, cmpq, setbe).
15042 * alloc.c (pure): Always extern now, since that's the
15043 VIRT_ADDR_VARIES behavior.
15044 (PURE_POINTER_P): Use a single comparison, not two, for
15045 consistency with the new puresize.h.
15046 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15047 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15048 Remove VIRT_ADDR_VARIES no longer needed.
15049
f8fe6f96
EZ
150502011-11-19 Eli Zaretskii <eliz@gnu.org>
15051
15052 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15053 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15054 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15055 behave as if the cursor position were at the window margin.
15056
15057 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15058 and the cursor position is out of bounds, behave as if the cursor
15059 position were at the window margin. (Bug#10075)
15060
df05a53c
CY
150612011-11-18 Chong Yidong <cyd@gnu.org>
15062
15063 * window.c (Fwindow_combination_limit): Make first argument
15064 non-optional, since it is meaningless for live windows like the
15065 selected window.
61ccba97 15066
2071918e
DA
150672011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15068
15069 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15070
b50a28de
SM
150712011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15072
15073 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15074 (graft_intervals_into_buffer): Simplify.
15075
015137db
EZ
150762011-11-18 Eli Zaretskii <eliz@gnu.org>
15077
15078 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15079 hash values of the two rows.
15080 (copy_row_except_pointers): Preserve the used[] arrays and the
15081 hash values of the two rows. (Bug#10035)
68c95424 15082 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15083
15084 * xdisp.c (row_hash): New function, body extracted from
15085 compute_line_metrics.
15086 (compute_line_metrics): Call row_hash, instead of computing the
15087 hash code inline.
15088
15089 * dispnew.c (verify_row_hash): Call row_hash for computing the
15090 hash code of a row, instead of duplicating code from xdisp.c.
15091
15092 * dispextern.h (row_hash): Add prototype.
15093
a2addb04
TH
150942011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15095
15096 * frame.c (delete_frame): Don't delete the terminal when the last
15097 X frame is closed if emacs is built with GTK toolkit.
15098
df85d315
JB
150992011-11-17 Juanma Barranquero <lekktu@gmail.com>
15100
15101 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15102
a0c2d0ae
MR
151032011-11-17 Martin Rudalics <rudalics@gmx.at>
15104
15105 * window.c (Vwindow_splits): Rename to
15106 Vwindow_combination_resize. Suggested by Juri Linkov.
15107 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15108 of Vwindow_splits.
15109
58179cce
JB
151102011-11-16 Juanma Barranquero <lekktu@gmail.com>
15111
7877f373
JB
15112 * nsfns.m (Fns_font_name):
15113 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15114
b6f67890
MR
151152011-11-16 Martin Rudalics <rudalics@gmx.at>
15116
15117 * window.h (window): Rename slot "nest" to "combination_limit".
15118 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15119 (Fset_window_nest): Rename to Fset_window_combination_limit.
15120 (Vwindow_nest): Rename to Vwindow_combination_limit.
15121 (recombine_windows, make_parent_window, make_window)
15122 (Fsplit_window_internal, saved_window)
15123 (Fset_window_configuration, save_window_save): Rename all
15124 occurrences of window_nest to window_combination_limit.
15125
c7015153
JB
151262011-11-15 Juanma Barranquero <lekktu@gmail.com>
15127
15128 * image.c (imagemagick_load_image): Fix typo.
15129
322ad6ec
EZ
151302011-11-14 Eli Zaretskii <eliz@gnu.org>
15131
15132 * xdisp.c (display_line): Move the call to
15133 highlight_trailing_whitespace before the call to
15134 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15135 faces of all the glyphs to compute ROW's hash value.
15136 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15137
f067b8ec
JB
151382011-11-14 Juanma Barranquero <lekktu@gmail.com>
15139
15140 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15141 just return (bug#10044).
15142
1e5b2111
EZ
151432011-11-12 Eli Zaretskii <eliz@gnu.org>
15144
7ef3cbd5
EZ
15145 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15146 with user-defined heap size. Bump the default size of the temacs
15147 heap to 27MB, to avoid memory warning when running temacs.
15148 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15149
1e5b2111
EZ
15150 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15151 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15152 (verify_row_hash) [XASSERTS]: New function.
15153 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15154 that the hash value of glyph rows is correct.
1e5b2111 15155
89d61221
MR
151562011-11-12 Martin Rudalics <rudalics@gmx.at>
15157
15158 * window.h (window): Remove splits slot.
15159 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15160 (Fdelete_other_windows_internal, make_parent_window)
15161 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15162 (Fset_window_configuration, save_window_save): Don't deal with
15163 split status of windows.
15164 (saved_window): Remove splits slot.
15165 (Vwindow_splits): Rewrite doc-string.
15166
97f18cc8
JD
151672011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15168
15169 * xfns.c (unwind_create_frame):
15170 * nsfns.m (unwind_create_frame):
15171 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15172 Vframe_list (Bug#9999).
15173
22a648b4
DA
151742011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15175
0b381c7e 15176 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15177
659afede
KH
151782011-11-11 Kenichi Handa <handa@m17n.org>
15179
15180 * callproc.c (Fcall_process): Set the member dst_multibyte of
15181 process_coding.
15182
9ac0394b
KH
151832011-11-11 Johan Bockgård <bojohan@gnu.org>
15184
15185 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15186 avoid a crash (bug#9496).
15187
2fbdc249
CY
151882011-11-09 Chong Yidong <cyd@gnu.org>
15189
15190 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15191 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15192
ac6b1f81
PE
151932011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15194
15195 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15196
09db192c
PE
151972011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15198
15199 Avoid some portability problems by eschewing 'extern inline' functions.
15200 The trivial performance wins aren't worth the portability hassles; see
15201 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15202 et seq.
15203 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15204 (window_box_width, window_box_left, window_box_left_offset)
15205 (window_box_right, window_box_right_offset): Undo previous change,
15206 by removing the "extern"s.
15207 * intervals.c (adjust_intervals_for_insertion)
15208 (adjust_intervals_for_deletion): Undo previous change,
15209 making these static again.
15210 (offset_intervals, temp_set_point_both, temp_set_point)
15211 (copy_intervals_to_string): No longer inline.
15212 * xdisp.c (window_text_bottom_y, window_box_width)
15213 (window_box_height, window_box_left_offset)
15214 (window_box_right_offset, window_box_left, window_box_right)
15215 (window_box): No longer inline.
15216
105216ed
CY
152172011-11-08 Chong Yidong <cyd@gnu.org>
15218
15219 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15220 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15221 Signal an error if not a live window.
105216ed
CY
15222 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15223 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15224
ae9e237f
JB
152252011-11-07 Juanma Barranquero <lekktu@gmail.com>
15226
15227 * lisp.h (syms_of_abbrev): Remove declaration.
15228 Reported by CHENG Gao <chenggao@royau.me>.
15229
c7aa8333
EZ
152302011-11-07 Eli Zaretskii <eliz@gnu.org>
15231
15232 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15233 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15234 of temacs in GUI mode.
15235
be7f5545
MR
152362011-11-07 Martin Rudalics <rudalics@gmx.at>
15237
15238 * window.h: Declare delete_all_child_windows instead of
15239 delete_all_subwindows.
15240 * window.c (Fwindow_nest, Fset_window_nest)
15241 (Fset_window_new_total, Fset_window_new_normal)
15242 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15243 (delete_all_subwindows): Rename to delete_all_child_windows.
15244 (Fdelete_other_windows_internal, Fset_window_configuration):
15245 Call delete_all_child_windows instead of delete_all_subwindows.
15246 * frame.c (delete_frame): Call delete_all_child_windows instead
15247 of delete_all_subwindows.
15248
ca78dc43
PE
152492011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15250
15251 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15252 This is also needed for porting to any host where GC_MARK_STACK is
15253 not GC_MAKE_GCPROS_NOOPS.
15254 (which_symbols): Use it.
15255
a0241d01
KH
152562011-11-07 Kenichi Handa <handa@m17n.org>
15257
15258 * coding.c (coding_set_destination): Check coding->src_pos only
15259 when coding->src_object is a buffer (bug#9910).
15260
15261 * process.c (send_process): Set the member src_multibyte of coding
15262 to 0 (bug#9911) when sending a unibyte text.
15263
15264 * callproc.c (Fcall_process): Set the member src_multibyte of
15265 process_coding to 0 (bug#9912).
15266
a64bfdfa 152672011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15268
15269 * xmenu.c (cleanup_widget_value_tree): New function.
15270 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15271 calling free_menubar_widget_value_tree directly (Bug#9830).
15272
cb41b32a
PE
152732011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15274
15275 Fix some portability problems with 'inline'.
15276 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15277 (window_box_width, window_box_left, window_box_left_offset)
15278 (window_box_right, window_box_right_offset): Declare extern.
15279 Otherwise, these inline functions do not conform to C99 and
15280 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15281 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15282 * intervals.c (adjust_intervals_for_insertion)
15283 (adjust_intervals_for_deletion): Now extern, because otherwise the
15284 extern inline functions 'offset_intervals' couldn't refer to it.
15285 (static_offset_intervals): Remove.
15286 (offset_intervals): Rewrite using the old contents of
15287 static_offset_intervals. The old version didn't conform to C99
15288 because an extern inline function contained a reference to an
15289 identifier with static linkage.
15290
b7041366
AS
152912011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15292
15293 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15294 GC.
15295
88a37c4d
EZ
152962011-11-06 Eli Zaretskii <eliz@gnu.org>
15297
15298 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15299 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15300 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15301 return Qleft_to_right.
15302
49745b39
CY
153032011-11-06 Chong Yidong <cyd@gnu.org>
15304
15305 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15306 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15307 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15308 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15309 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15310 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15311 (Fwindow_vscroll): Doc fix.
15312 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15313 argument, since it makes no sense to pass a live window and for
15314 consistency with window-child.
15315
1f05cd82
CS
153162011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15317
15318 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15319 support MSVC.
15320
22610910
JR
153212011-11-05 Jason Rumney <jasonr@gnu.org>
15322
15323 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15324 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15325 fonts (Bug#6029).
15326 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15327 bitwise arithmetic preventing use of unicode-sip and non-truetype
15328 opentype fonts.
15329
a06776b2
EZ
153302011-11-05 Eli Zaretskii <eliz@gnu.org>
15331
3ad924ba
EZ
15332 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15333 "emacs"-only part.
15334
a06776b2
EZ
15335 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15336 initialization code to keep similarity to xfns.c after changes
15337 from 2011-11-05.
15338
c9e7db78
JD
153392011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15340
a97f8f3f
JD
15341 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15342 (unwind_create_frame): New function (Bug#9943).
15343 (Fx_create_frame): Restructure code to be more similar to the one in
15344 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15345 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15346 Move terminal->reference_count++ just before making the frame official
15347 (Bug#9943).
15348
15349 * nsterm.m (x_free_frame_resources): New function.
15350 (x_destroy_window): Move code to x_free_frame_resources.
15351
c9e7db78 15352 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15353 (Fx_create_frame, x_create_tip_frame):
15354 Move terminal->reference_count++ just before making the frame
75f1671a 15355 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15356 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15357
a6fc3b5c
EZ
153582011-11-05 Eli Zaretskii <eliz@gnu.org>
15359
15360 Support MSVC build with newer versions of Visual Studio.
15361 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15362 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15363 nt/gmake.defs.
15364
15365 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15366 which are not supported by MSVC.
15367 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15368 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15369 bitfields.
15370 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15371 types in bitfields.
15372 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15373
15374 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15375
58179cce 153762011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15377
15378 Support MSVC build with newer versions of Visual Studio.
15379 * w32.c: Don't include w32api.h for MSVC.
15380 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15381
15382 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15383 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15384 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15385 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15386 e_* cousins.
15387 (alloca) [_MSC_VER]: Define to _alloca.
15388
15389 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15390
15391 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15392
a58c13ed
EZ
153932011-11-04 Eli Zaretskii <eliz@gnu.org>
15394
15395 * xdisp.c (note_mouse_highlight): If either of
15396 previous/next-single-property-change returns nil, treat that as
15397 the beginning or the end of the buffer. (Bug#9955)
15398
fe0b6370
JD
153992011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15400
a58c13ed 15401 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15402 label is not null (Bug#9951).
15403 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15404 may be NULL.
15405
89bd5ee1
EZ
154062011-11-04 Eli Zaretskii <eliz@gnu.org>
15407
15408 * window.c (Fwindow_body_size): Mention in the doc string that the
15409 return value is in frame's canonical units. (Bug#9949)
15410
84c3edb9
EZ
154112011-11-03 Eli Zaretskii <eliz@gnu.org>
15412
4e2fb5c7
EZ
15413 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15414
84c3edb9 15415 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15416 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15417 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15418
bc17a887
EZ
154192011-11-01 Eli Zaretskii <eliz@gnu.org>
15420
15421 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15422 Don't stop backward scan on the continuation glyph, even though
15423 its CHARPOS is positive.
6d5eb5b0
SM
15424 (mouse_face_from_buffer_pos, note_mouse_highlight):
15425 Rename cover_string to disp_string.
bc17a887 15426
4ee88440
MR
154272011-11-01 Martin Rudalics <rudalics@gmx.at>
15428
15429 * window.c (temp_output_buffer_show): Don't use
15430 Vtemp_buffer_show_specifiers.
15431 (Vtemp_buffer_show_specifiers): Remove unused variable.
15432
c2ff3c02
EZ
154332011-10-30 Eli Zaretskii <eliz@gnu.org>
15434
15435 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15436 past the beginning of the current glyph matrix.
15437
58179cce 154382011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15439
15440 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15441 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15442 HAVE_GTK3 (Bug#9869).
b77a6a7f 15443
3b574623
JD
15444 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15445 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15446
b77a6a7f
JD
15447 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15448
15449 * xterm.c: Declare x_handle_net_wm_state to return int.
15450 (handle_one_xevent): Check if we are iconified but don't have
15451 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15452 (get_current_wm_state): Return non-zero if not hidden,
15453 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15454 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15455 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15456 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15457
196e41e4
PE
154582011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15459
15460 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15461 so that this new function doesn't get optimized away by a
15462 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15463
021f2e1a
AS
154642011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15465
15466 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15467
8b058d44
EZ
154682011-10-29 Eli Zaretskii <eliz@gnu.org>
15469
15470 Fix the `xbytecode' command.
15471 * .gdbinit (xprintbytestr): New command.
b50a28de 15472 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15473 (xbytecode): Print the byte-code string as well.
15474
4452fb80
EZ
154752011-10-29 Kim Storm <storm@cua.dk>
15476
8b058d44
EZ
15477 * alloc.c (which_symbols): New function.
15478
21b72067
AS
154792011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15480
15481 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15482 line. (Bug#9903)
15483
83ed7b5c
GM
154842011-10-29 Glenn Morris <rgm@gnu.org>
15485
15486 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15487 Not clear what it was for, and it causes various bugs. (Bug#9839)
15488
5a7a728b
EZ
154892011-10-28 Eli Zaretskii <eliz@gnu.org>
15490
15491 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15492 possible random value that matches one of those tested as
15493 condition to clear the mouse face.
15494
d3d0842f
CY
154952011-10-28 Chong Yidong <cyd@gnu.org>
15496
15497 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15498
31b39d13
DN
154992011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15500
15501 * window.c (make_window): Initialize phys_cursor_on_p.
15502
9aba6043
SM
155032011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15504
15505 * lisp.h (struct Lisp_Symbol): Update comments.
15506
c20992f4
JB
155072011-10-28 Juanma Barranquero <lekktu@gmail.com>
15508
15509 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15510
db4f02f2
EZ
155112011-10-28 Eli Zaretskii <eliz@gnu.org>
15512
15513 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15514 <oslsachem@gmail.com> for helping to debug this.
15515
15516 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15517 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15518 (g_b_init_get_glyph_outline_w): New static variables.
15519 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15520 (GetGlyphOutlineW_Proc): New typedefs.
15521 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15522 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15523 New functions.
15524 (w32font_open_internal, compute_metrics):
15525 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15526 instead of calling the "wide" APIs directly.
15527
15528 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15529
15530 * w32.h (syms_of_w32font): Add prototype.
15531
87e68db4
JB
155322011-10-27 Juanma Barranquero <lekktu@gmail.com>
15533
15534 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15535 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15536 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15537 (Fmove_to_window_line): Doc fix.
15538
435c1d67
CY
155392011-10-27 Chong Yidong <cyd@gnu.org>
15540
15541 * process.c (make_process): Set gnutls_state to NULL.
15542
15543 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15544 non-NULL, regardless of GNUTLS_INITSTAGE.
15545 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15546 an error. Set process slots as soon as we allocate them.
15547
15548 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15549
9c6c6f49
CY
155502011-10-27 Chong Yidong <cyd@gnu.org>
15551
9aba6043
SM
15552 * gnutls.c (emacs_gnutls_deinit): New function.
15553 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15554 (Fgnutls_deinit, Fgnutls_boot): Use it.
15555
15556 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15557 (deactivate_process): Call emacs_gnutls_deinit.
15558
657d08d3
JB
155592011-10-27 Juanma Barranquero <lekktu@gmail.com>
15560
15561 * image.c (x_create_x_image_and_pixmap):
15562 * w32.c (sys_rename, w32_delayed_load):
15563 * w32font.c (fill_in_logfont):
15564 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15565
5430d399
JB
155662011-10-26 Juanma Barranquero <lekktu@gmail.com>
15567
15568 * w32fns.c (w32_default_color_map): New function,
15569 extracted from Fw32_default_color_map.
a7ef684b 15570 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 15571
fe0055fa
PE
155722011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15573
15574 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15575
e6346438
SM
155762011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15577
15578 * keyboard.c (test_undefined): New function (bug#9751).
15579 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15580
e112cc37
ET
155812011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15582
15583 * sysdep.c (init_sys_modes): Fix the check for the controlling
15584 terminal (Bug#6649).
15585
7b5d6677
EZ
155862011-10-20 Eli Zaretskii <eliz@gnu.org>
15587
15588 * dispextern.h (struct bidi_it): New member next_en_type.
15589
15590 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15591 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15592 current character, check also for next_en_type being WEAK_EN.
15593 (bidi_resolve_weak): Don't enter the expensive loop if the current
15594 position is before next_en_pos. Record the bidi type of the first
15595 non-ET, non-BN character we find, in addition to its position.
15596 (bidi_level_of_next_char): Invalidate next_en_type when
15597 next_en_pos is over-stepped.
15598
7da0b018
PE
155992011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15600
15601 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15602 * editfns.c: Rewrite current-time-zone so that it invokes
15603 the equivalent of (format-time-string "%Z") to get the time zone name.
15604 This fixes a bug when the time zone name contains characters that
15605 need converting from the system time locale to Emacs internal format.
15606 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15607 that patch fixed format-time-string to do the conversion, but
15608 I forgot to fix current-time-zone.
15609 (format_time_string): New function, containing most of
15610 what Fformat_time_string used to contain.
15611 (Fformat_time_string): Rewrite in terms of format_time_string.
15612 This doesn't change this function's behavior.
15613 (current-time-zone): Rewrite to use format_time_string.
15614 This fixes the bug reported by Michael Schierl in
15615 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15616 Jason Rumney's 2007-06-07 change worked around this bug, but
15617 didn't fix it.
15618 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15619
8547b010
EZ
156202011-10-19 Eli Zaretskii <eliz@gnu.org>
15621
15622 * xdisp.c (start_display): If the character at POS is displayed
15623 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
15624 (try_window_reusing_current_matrix): If a line ends in a display
15625 vector or the next line starts in a display vector, continue
15626 redrawing the window even though the character position of
15627 start_row was reached.
8547b010
EZ
15628 (Bug#9771, part 2)
15629
4e948d15
CY
156302011-10-18 Chong Yidong <cyd@gnu.org>
15631
15632 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15633 with nobreak-char-display too.
15634
4787455f
EZ
156352011-10-18 Eli Zaretskii <eliz@gnu.org>
15636
15637 Fix part 3 of bug#9771.
15638 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15639 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15640 non-neutral characters if the current character is a paragraph
15641 separator (a.k.a. Newline). This avoids running the same
15642 expensive loop twice, once when we consume the preceding newline
15643 and the other time when the line actually needs to be displayed.
15644 Avoid the loop when we see neutrals on the base embedding level
15645 following a character whose directionality is the same as the
15646 paragraph's. This avoids running the expensive loop when a line
15647 ends in a long sequence of neutrals, like control characters.
15648 Add assertion against STRONG_AL type. Slightly rearrange code
15649 that determines the type of a neutral given the first non-neutral
15650 that follows it.
15651 (bidi_level_of_next_char): Set next_en_pos to zero when
15652 invalidating its info.
15653
2c91f553
EZ
156542011-10-17 Eli Zaretskii <eliz@gnu.org>
15655
15656 * xdisp.c (push_display_prop): Determine whether to record string
15657 or buffer position by IT->string, not by IT->method. Allow
15658 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15659 (move_it_vertically_backward): Don't look for character position
15660 immediately after the newline when in a continuation line.
15661 (Bug#9771, part 1)
2c91f553 15662
c7b08b0d
MR
156632011-10-15 Martin Rudalics <rudalics@gmx.at>
15664
15665 * window.c (coordinates_in_window): Rewrite and delabelize
15666 vertical border check. (Bug#5357) (Bug#9618)
15667
6b02f655
SM
156682011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15669
15670 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15671 errors in XSetWindowBorder (bug#9310).
15672
81d40c92
DA
156732011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15674
15675 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15676 avoid crash when xmalloc overrun checking is enabled.
15677
d4172c3b
EZ
156782011-10-13 Eli Zaretskii <eliz@gnu.org>
15679
15680 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15681 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15682 cursor motion with <left> and <right> arrow keys.
15683
15684 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15685 some callers set that themselves.
15686
b00eea75
EZ
156872011-10-12 Eli Zaretskii <eliz@gnu.org>
15688
15689 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15690 display string and the previous row comes from the same string and
15691 is empty. (Bug#9739) (Bug#9738)
15692
8fe012c4
SM
156932011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15694
15695 * doc.c (get_doc_string): Encode file name (bug#9735).
15696
0074aef2
EZ
156972011-10-12 Eli Zaretskii <eliz@gnu.org>
15698
79beb178
EZ
15699 * bidi.c (bidi_level_of_next_char):
15700 * xdisp.c (get_visually_first_element): Remove old incorrect
15701 comments regarding the Unicode Line Separator character.
15702
0074aef2
EZ
15703 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15704
6e4b3fbe
DA
157052011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15706
15707 * alloc.c (Fgc_status): Do not access beyond zombies array
15708 boundary if nzombies > MAX_ZOMBIES.
15709 * alloc.c (dump_zombies): Add missing format specifier.
15710
0324f3af
PE
157112011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15712
b5525cac
PE
15713 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15714 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15715
0324f3af
PE
15716 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15717 Some packages use them to denote characters with modifiers.
15718
e9b5f888
AS
157192011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15720
15721 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15722 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15723 matching a pp-number. Rename parameter var to var1.
15724
127827c0
SM
157252011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15726
15727 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15728
c8fd3bd0
GM
157292011-10-08 Glenn Morris <rgm@gnu.org>
15730
15731 * callint.c (Fcall_interactively): Give a more explicit error for the
15732 'c' case with a non-character input. (Bug#8479)
15733
352ec8ff
EZ
157342011-10-08 Eli Zaretskii <eliz@gnu.org>
15735
03669ccb
EZ
15736 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15737 lines.
7061c986
EZ
15738 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15739 lines that are hscrolled on the left.
03669ccb 15740
352ec8ff
EZ
15741 * dispnew.c (buffer_posn_from_coords): Account for a possible
15742 presence of header-line. (Bug#4426)
15743
a66cfb1c
SM
157442011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15745
6b02f655
SM
15746 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15747 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 15748
7c5ee88e
PE
157492011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15750
15751 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15752 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15753 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15754 this makes Emacs dump core during garbage collection on rare
15755 occasions. sizeof is obviously inferior to offsetof here, so
15756 stick with offsetof.
15757 (GC_POINTER_ALIGNMENT): New macro.
15758 (mark_memory): Omit 3rd (offset) arg; caller changed.
15759 Don't assume EMACS_INT alignment is the same as pointer alignment.
15760
df1bbe5b
SM
157612011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15762
15763 * keyboard.c (read_key_sequence_remapped): New var.
15764 (read_key_sequence): Compute remapping in the right buffer.
15765 (command_loop_1): Use read_key_sequence's remapping directly.
15766
51553db6
SM
157672011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15768
32c1fffd
SM
15769 * dired.c (file_name_completion): Don't expand file name.
15770 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15771 before checking file name handler.
15772
51553db6
SM
15773 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15774 they've been requested explicitly (bug#9591).
15775
b6bd1599 157762011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
15777
15778 * keymap.c (Fsingle_key_description): Use make_specified_string
15779 instead of build_string to build string from push_key_description.
15780 (Bug#5193)
15781
f701dc2a
PE
157822011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15783
4222c55d
PE
15784 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15785 This fixes a Y2038 bug on 64-bit hosts.
15786 * buffer.c (reset_buffer):
15787 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15788 (Fclear_buffer_auto_save_failure):
15789 Use 0, not -1, to represent an unset failure time, since time_t
15790 might not be signed.
15791
f701dc2a
PE
15792 Remove dependency on glibc malloc internals.
15793 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15794 Move back here from lisp.h, but with their new implementations.
15795 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15796 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15797 * charset.c (charset_table_init): New static var.
15798 (syms_of_charset): Use it instead of xmalloc. This removes a
15799 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15800 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15801 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15802 Move back to alloc.c.
15803 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15804 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15805
9ceebf39
JD
158062011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15807
15808 * nsterm.m (windowDidResize): Call x_set_window_size only when
15809 ns_in_resize is true. Otherwise set pixelwidth/height and
15810 call change_frame_size (Bug#9628).
15811
cb993c58
PE
158122011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15813
3930c88b
PE
15814 Port --enable-checking=all to Fedora 14 x86-64.
15815 * charset.c (syms_of_charset): Also account for glibc malloc's
15816 internal overhead when calculating the initial malloc maximum.
15817
cb993c58
PE
15818 Port --enable-checking=all to Fedora 14 x86.
15819 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15820 Move to lisp.h.
15821 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15822 (overrun_check_realloc, overrun_check_free):
15823 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15824 That way, xmalloc returns a properly-aligned pointer even if
15825 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15826 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15827 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15828 into account when calculating the initial malloc maximum.
15829 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15830 Move here from alloc.c, so that charset.c can use it too.
15831 Properly align; the old code wasn't right for common 32-bit hosts
15832 when configured with --enable-checking=all.
15833 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15834 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15835
31bed486
EZ
158362011-09-29 Eli Zaretskii <eliz@gnu.org>
15837
04c70788 15838 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
15839 use EDOM.
15840
fbcaa2f3
EZ
158412011-09-28 Eli Zaretskii <eliz@gnu.org>
15842
15843 * xdisp.c (compute_display_string_end): If there's no display
15844 string at CHARPOS, return -1.
15845
15846 * bidi.c (bidi_fetch_char): When compute_display_string_end
15847 returns a negative value, treat the character as a normal
15848 character not covered by a display string. (Bug#9624)
15849
a239d4e9
JB
158502011-09-28 Juanma Barranquero <lekktu@gmail.com>
15851
15852 * lread.c (Fread_from_string): Fix typo in docstring.
15853
88652fd5
EZ
158542011-09-27 Eli Zaretskii <eliz@gnu.org>
15855
15856 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15857 newline, reseat the iterator instead of bidi-iterating there one
15858 character at a time. (Bug#9610)
32c1fffd
SM
15859 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15860 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 15861
ed497dd4
AS
158622011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15863
15864 * lread.c (readevalloop): Use correct code for NBSP.
15865 (read1): Likewise. (Bug#9608)
15866
b2bf61aa
MA
158672011-09-25 Michael Albinus <michael.albinus@gmx.de>
15868
15869 * dbusbind.c (Fdbus_register_signal): When service is not
15870 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15871
32bbb17c
GM
158722011-09-25 Glenn Morris <rgm@gnu.org>
15873
15874 * buffer.c (truncate-lines): Doc fix.
15875
94e0933e
CY
158762011-09-24 Chong Yidong <cyd@stupidchicken.com>
15877
15878 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15879 (Fset_window_next_buffers): Doc fix.
15880
cddde921
GM
158812011-09-24 Glenn Morris <rgm@gnu.org>
15882
15883 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15884
1260aef1
PE
158852011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15886
25b4bfa0
PE
15887 Fix minor problems found by static checking.
15888 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
15889 * indent.c (Fvertical_motion): Fix == vs = typo.
15890
e3cbd34b
EZ
158912011-09-24 Eli Zaretskii <eliz@gnu.org>
15892
a66cfb1c
SM
15893 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15894 Default value is now t. Doc fix.
6bf7006f 15895
e3cbd34b 15896 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 15897 logic when moving up, not only when moving down. Fix the
e3cbd34b 15898 confusing name and values of the it_overshoot_expected variable;
32c1fffd 15899 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
15900
15901 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15902 CHARPOS is covered by a display string which includes newlines.
15903 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15904 is covered by a display string with embedded newlines.
15905
a3de0cbd
MA
159062011-09-24 Michael Albinus <michael.albinus@gmx.de>
15907
15908 * dbusbind.c (Fdbus_register_signal): Add match rule to
15909 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
15910 (Fdbus_register_method, Vdbus_registered_objects_table):
15911 Fix docstring.
a3de0cbd 15912
b260039d
JM
159132011-09-24 Jim Meyering <meyering@redhat.com>
15914
32c1fffd 15915 do not ignore write error for any output size
b260039d
JM
15916 The previous change was incomplete.
15917 While it makes emacs --batch detect the vast majority of stdout
15918 write failures, errors were still ignored whenever the output size is
15919 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15920 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15921 && echo FAIL: ignored write error
15922 FAIL: ignored write error
15923 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15924 && echo FAIL: ignored write error
15925 FAIL: ignored write error
15926 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15927
8eca8a7c
AS
159282011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15929
15930 * emacs.c (Fkill_emacs): In noninteractive mode exit
15931 non-successfully if a write error occurred on stdout. (Bug#9574)
15932
3341db62
EZ
159332011-09-21 Eli Zaretskii <eliz@gnu.org>
15934
15935 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15936 the xassert test.
15937
15938 * dispextern.h (struct it): Update the comment documenting what
15939 can it->OBJECT be.
15940
8c203dbf
EZ
159412011-09-20 Eli Zaretskii <eliz@gnu.org>
15942
15943 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15944 a display string, extend search for cursor position to end of row.
15945 (find_row_edges): If the row ends in a newline from a display
15946 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15947 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
15948 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15949 non-empty line. Fixes confusing cursor motion with arrow keys at
15950 the beginning of a line that starts with whitespace.
8c203dbf 15951
a4824228
LMI
159522011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15953
15954 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15955 (bug#9493).
15956
33ed493b
CY
159572011-09-18 Chong Yidong <cyd@stupidchicken.com>
15958
15959 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15960 boolean (Bug#9154).
15961
56cd55c8
EZ
159622011-09-18 Eli Zaretskii <eliz@gnu.org>
15963
15964 * xdisp.c (display_line): Record maximum and minimum buffer
15965 positions even if no glyphs were produced (e.g., by a zero-width
15966 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15967 buffer positions that will be removed from the glyph row because
15968 they don't fit.
c02dcedf
EZ
15969 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15970 column is beyond frame width: don't subtract 1 "pixel" when
15971 computing width of the stretch.
3e62b7e0
EZ
15972 (reseat_at_next_visible_line_start): Undo the change made on
15973 2011-09-17 that saved paragraph information and restored it after
15974 the call to `reseat'. (Bug#9545)
56cd55c8 15975
5ed99d36 159762011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15977
15978 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15979 and turn window cursor on if cleared (Bug#9415).
15980
5ed99d36 159812011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15982
15983 * search.c (boyer_moore): Take unibyte characters from pattern
15984 literally. (Bug#9458)
15985
9bade7b2
EZ
159862011-09-18 Eli Zaretskii <eliz@gnu.org>
15987
15988 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15989
e5e9d610
PE
159902011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15991
87e4427a
PE
15992 Fix minor problem found by static checking.
15993 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15994 initialized, to pacify gcc -Wuninitialized.
15995
e5e9d610
PE
15996 * fileio.c: Report proper errno when syscall falls.
15997 (Finsert_file_contents): Save and restore errno,
15998 so that report_file_error outputs the correct diagnostic.
15999 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16000
a1674f0b
EZ
160012011-09-18 Eli Zaretskii <eliz@gnu.org>
16002
16003 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16004
fbfb6dd4
EZ
160052011-09-17 Eli Zaretskii <eliz@gnu.org>
16006
16007 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16008 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16009
bb187662
EZ
160102011-09-17 Eli Zaretskii <eliz@gnu.org>
16011
1137e8b8 16012 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16013 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16014
16015 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16016 (bidi_find_paragraph_start): Search back for paragraph beginning
16017 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16018 (bidi_move_to_visually_next): Only trigger paragraph-related
16019 computations when the last character is a newline or at EOB, not
16020 just any NEUTRAL_B. (Bug#9470)
16021
bb187662
EZ
16022 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16023 truncated lines if point is covered by a display string. (Bug#9524)
16024
2e621251
PE
160252011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16026
16027 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16028 (cons_to_x_long): New function.
16029 (lisp_data_to_selection_data): Use it. Correct the test for
16030 short-versus-long data; it was negated. Break out of vector
16031 loop, for efficiency, when a long datum is discovered.
16032
91a15bc6
SM
160332011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16034
16035 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16036
b41c3a35
EZ
160372011-09-16 Eli Zaretskii <eliz@gnu.org>
16038
16039 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16040 GCC PR/17406) by declaring this function with external scope.
16041
7812ba2d
PE
160422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16043
16044 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16045 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16046
cf7edc2a
AS
160472011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16048
16049 * editfns.c (Fformat): Correctly handle text properties on "%%".
16050
bd01620e
EZ
160512011-09-15 Eli Zaretskii <eliz@gnu.org>
16052
16053 * xterm.c (x_draw_composite_glyph_string_foreground):
16054 * w32term.c (x_draw_composite_glyph_string_foreground):
16055 * term.c (encode_terminal_code):
16056 * composite.c (composition_update_it, get_composition_id):
16057 * xdisp.c (get_next_display_element)
16058 (fill_composite_glyph_string): Add comments about special meaning
16059 of TAB characters in a composition.
16060
a02719a3
PE
160612011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16062
16063 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16064 This occurs when processing a multibyte format.
16065 Problem reported by Wolfgang Jenker.
a02719a3 16066
72589a3c
JB
160672011-09-15 Johan Bockgård <bojohan@gnu.org>
16068
16069 * xdisp.c (try_cursor_movement): Only check for exact match if
16070 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16071
1c14176c
PE
160722011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16073
16074 Remove unused external symbols.
16075 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16076 * xdisp.c (calc_pixel_width_or_height): Now static.
16077 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16078 * indent.c (check_display_width):
16079 * w32term.c: Fix comment to match code.
16080 * xterm.c, xterm.h (x_catching_errors): Remove.
16081
d2eea5b5
PE
160822011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16083
16084 * xselect.c: Use signed conversions more consistently (Bug#9498).
16085 (selection_data_to_lisp_data): Assume incoming selection data are
16086 signed integers, not unsigned. This is to be consistent with
16087 outgoing selection data, which was modified to use signed integers
16088 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16089 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16090 expects long, not unsigned long.
16091
46888499
EZ
160922011-09-14 Eli Zaretskii <eliz@gnu.org>
16093
16094 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16095 computation of loop end. Reported by Johan Bockgård
16096 <bojohan@gnu.org>.
16097
ef8ef9fb
CY
160982011-09-13 Chong Yidong <cyd@stupidchicken.com>
16099
16100 * frame.c (Fother_visible_frames_p): Function deleted.
16101
fa819fed
EZ
161022011-09-12 Eli Zaretskii <eliz@gnu.org>
16103
16104 * indent.c (compute_motion): Process display vector front to back
16105 rather than the other way around. (Bug#2496)
16106
2ba8e008
SM
161072011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16108
16109 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16110
20f53c69
CY
161112011-09-11 Chong Yidong <cyd@stupidchicken.com>
16112
16113 * minibuf.c (Fread_from_minibuffer): Doc fix.
16114
d562d7a4
EZ
161152011-09-11 Eli Zaretskii <eliz@gnu.org>
16116
16117 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16118 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16119
1c4d7f3d
LMI
161202011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16121
16122 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16123 value for non-existent files.
16124
b885bf36
EZ
161252011-09-11 Eli Zaretskii <eliz@gnu.org>
16126
16127 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16128 set its "size" to -1. This will set the modtime_size field of
16129 the corresponding buffer to -1, which is what
16130 verify-visited-file-modtime expects for files that do not exist.
16131 (Bug#9139)
16132
6612f0bf
PE
161332011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16134
16135 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16136 here ...
16137 * lisp.h: ... from here. push_key_description is no longer
16138 defined in keyboard.c, so its declaration should not be in
16139 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16140 logically belongs with push_key_description.
16141
dfb3f755
PE
161422011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16143
16144 * buffer.h: Include <sys/types.h> instead of <time.h>.
16145 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16146 Problem reported by Herbert J. Skuhra.
16147
3134906c
LMI
161482011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16149
16150 * xml.c (parse_region): Make the parsing work for
16151 non-comment-starting XML files again (bug#9144).
16152
8d903f4e
AS
161532011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16154
16155 * image.c (gif_load): Fix calculation of bottom and right corner.
16156 (Bug#9468)
16157
80ad64f4
EZ
161582011-09-10 Eli Zaretskii <eliz@gnu.org>
16159
16160 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16161 redisplay in small windows.
16162
208a048d
EZ
161632011-09-09 Eli Zaretskii <eliz@gnu.org>
16164
16165 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16166
9b1c252e
MR
161672011-09-08 Martin Rudalics <rudalics@gmx.at>
16168
16169 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16170 Operate on live windows only.
16171
2949f33b
JB
161722011-09-08 Juanma Barranquero <lekktu@gmail.com>
16173
16174 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16175
e08dcafd
EZ
161762011-09-07 Eli Zaretskii <eliz@gnu.org>
16177
16178 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16179 only under bidi iteration.
16180
115b96bd
JD
161812011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16182
16183 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16184
c8199d0f
PE
161852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16186
16187 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16188 Without this fix, the command to link temacs failed due to an
16189 undefined symbol __builtin_isnan. This is because
16190 /usr/include/iso/math_c99.h #defines isnan(x) to
16191 __builtin_isnan(x), but the bundled gcc, which identifies itself
16192 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16193 a __builtin_isnan.
16194 * floatfns.c (isnan): #undef, and then #define to a clone of
16195 what's in data.c.
16196 (Fisnan): Always define, since it's always available now.
16197 (syms_of_floatfns): Always define isnan at the Lisp level.
16198
e39b275c 161992011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16200
16201 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16202
b2db44d9 162032011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16204
f4af5137 16205 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16206 The previous code assumed that file offsets (off_t values) fit in
16207 EMACS_INT variables, which is not true on typical 32-bit hosts.
16208 The code messed up by falsely reporting buffer overflow in cases
16209 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16210 when "big" contains more than 2**29 bytes, even though this
16211 inserts just one byte and does not overflow the buffer.
16212 (Finsert_file_contents): Store file offsets as off_t
16213 values, not as EMACS_INT values. Check for overflow when
16214 converting between EMACS_INT and off_t. When checking for
16215 buffer overflow or for overlap, take the offsets into account.
16216 Don't use EMACS_INT for small values where int suffices.
16217 When checking for overlap, fix a typo: ZV was used where
16218 ZV_BYTE was intended.
16219 (Fwrite_region): Don't assume off_t fits into 'long'.
16220 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16221
ecfc0a49
MA
162222011-09-05 Michael Albinus <michael.albinus@gmx.de>
16223
16224 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16225
6511acf2 162262011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16227
0999621a 16228 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16229
16230 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16231 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16232 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16233 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16234 (modify_event_symbol): Do not assume that the length of
16235 name_alist_or_stem is safe to alloca and fits in int.
16236 (Fexecute_extended_command): Likewise for function name and binding.
16237 (Frecursion_depth): Wrap around reliably on integer overflow.
16238 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16239 since some callers pass EMACS_INT values.
16240 (Fsingle_key_description): Don't crash if symbol name contains more
16241 than MAX_ALLOCA bytes.
16242 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16243 (get_minibuffer): Arg is now EMACS_INT, not int.
16244 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16245 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16246 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16247
2be7d702
PE
16248 * dbusbind.c (signature_cat): New function.
16249 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16250 Do not overrun buffer; instead, report string overflow.
16251
9d1df220
PE
16252 * dispnew.c (add_window_display_history): Don't overrun buffer.
16253 Truncate instead; this is OK since it's just a log.
16254
33ef5c64
PE
16255 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16256 even if the time zone offset is outlandishly large.
16257 Don't mishandle offset == INT_MIN.
16258
66c6fdd5
PE
16259 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16260 when creating daemon; the previous buffer-overflow check was incorrect.
16261
d749b01b
PE
16262 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16263 which has the guts of the old verror function.
16264
b5cd1905
PE
16265 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16266 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16267
6e1a67fb
PE
16268 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16269 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16270 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16271 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16272 length of string rather than counting it via multiple sprintfs;
16273 that's simpler and more reliable.
c21721cc
PE
16274 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16275 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16276 sprintf, in case result does not fit in int.
16277
c57b67fc
PE
16278 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16279 (fontset_from_font): Print it.
16280
8a401434
PE
16281 * frame.c (tty_frame_count): Now printmax_t, not int.
16282 (make_terminal_frame, set_term_frame_name): Print it.
16283 (x_report_frame_params): In X, window IDs are unsigned long,
16284 not signed long, so print them as unsigned.
16285 (validate_x_resource_name): Check for implausibly long names,
16286 and don't assume name length fits in 'int'.
16287 (x_get_resource_string): Don't blindly alloca invocation name;
16288 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16289 not fit in int.
16290
6e1a67fb
PE
16291 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16292 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16293 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16294
0df02bf3
PE
16295 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16296 Use esprintf, not sprintf, in case result does not fit in int.
16297
48e30793
PE
16298 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16299 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16300 it as a large positive number.
16301 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16302 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16303
a66ff6d8
PE
16304 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16305 in case result does not fit in int.
16306
aca216ff
PE
16307 * print.c (float_to_string): Detect width overflow more reliably.
16308 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16309 buffer overrun. Don't assume list length fits in 'int'. Treat
16310 print length of 0 as 0, not as infinity; to be consistent with other
16311 uses of print length in this function. Don't overflow print length
16312 index. Don't assume hash table size fits in 'long', or that
16313 vectorlike size fits in 'unsigned long'.
16314
31c286f7
PE
16315 * process.c (make_process): Use printmax_t, not int, to format
16316 process-name gensyms.
16317
55e5faa1
PE
16318 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16319
80f2e268
PE
16320 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16321 to avoid potential buffer overrun.
16322
670741ab
PE
16323 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16324 if X resource line is longer than 512 bytes.
16325
b7163a50
PE
16326 * xfns.c (x_window): Make sprintf buffer a bit bigger
16327 to avoid potential buffer overrun.
16328
ae58ff1f
PE
16329 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16330
c43c8a6a
PE
16331 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16332
3f8236f4
PE
163332011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16334
53e9fe90 16335 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16336 Without these, Emacs silently mishandles large integers sometimes.
16337 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16338 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16339
6511acf2
PE
16340 * xdisp.c (try_window_id): Check Emacs fixnum range before
16341 converting to 'int'.
806add1d 16342
6511acf2 16343 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16344 Check that an Emacs fixnum is in range before assigning it to 'int'.
16345 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16346 values converted from Emacs fixnums.
16347 (Frecenter): Don't wrap around a line count if it is out of 'int'
16348 range; instead, treat it as an extreme value.
16349 (Fset_window_configuration, compare_window_configurations):
16350 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16351
6511acf2
PE
16352 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16353 that can exceed INT_MAX. Check that EMACS_INT value is in range
16354 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16355 (match_limit): Don't assume that a fixnum can fit in 'int'.
16356
6511acf2 16357 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16358 exceed INT_MAX.
16359
6511acf2 16360 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16361 (Fvertical_motion): Don't wrap around LINES values that don't fit
16362 in 'int'. Instead, treat them as extreme values. This is good
16363 enough for windows, which can't have more than INT_MAX lines anyway.
16364
fcb901a7
LMI
163652011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16366
0f2f6b6d
LMI
16367 * Require libxml/parser.h to avoid compilation warning.
16368
fcb901a7
LMI
16369 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16370
16371 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16372 since this reportedly can destroy thread storage.
16373
6e20a0d4
CY
163742011-08-30 Chong Yidong <cyd@stupidchicken.com>
16375
16376 * syntax.c (find_defun_start): Update all cache variables if
16377 exiting early (Bug#9401).
16378
148ae00e
EZ
163792011-08-30 Eli Zaretskii <eliz@gnu.org>
16380
f6cfbd8f
EZ
16381 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16382
148ae00e
EZ
16383 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16384 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16385 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16386
16387 * term.c (tty_append_glyph): New function.
16388 (produce_stretch_glyph): Static function and its prototype deleted.
16389
a66cfb1c
SM
16390 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16391 Add prototypes.
148ae00e 16392
c4a07a4c
PE
163932011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16394
16395 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16396 when checking :margin (Bug#9390).
16397 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16398 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16399 so that the name doesn't mislead. All uses changed.
16400
6bc8cd65
JB
164012011-08-28 Johan Bockgård <bojohan@gnu.org>
16402
16403 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16404 set_tty_hooks.
16405
dca4927e
EZ
164062011-08-27 Eli Zaretskii <eliz@gnu.org>
16407
16408 * xdisp.c (move_it_to): Don't bail out early when reaching
16409 position beyond to_charpos, if we are scanning backwards.
16410 (move_it_vertically_backward): When DY == 0, make sure we get to
16411 the first character in the line after the newline.
16412
f2cad773
PE
164132011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16414
16415 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16416 (ccl_driver): Do not generate an out-of-range pointer.
16417 (Fccl_execute_on_string): Remove unnecessary check for
16418 integer overflow, noted by Stefan Monnier in
16419 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16420 Remove a FIXME that didn't need fixing.
16421 Simplify the newly-introduced buffer reallocation code.
16422
0cae2cdb
JB
164232011-08-27 Juanma Barranquero <lekktu@gmail.com>
16424
16425 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16426
5fc295a4 164272011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16428
70c60eb2 16429 Integer and memory overflow issues (Bug#9196).
726e0ab1 16430
d31850da
PE
16431 * doc.c (get_doc_string): Rework so that
16432 get_doc_string_buffer_size is the actual buffer size, rather than
16433 being 1 less than the actual buffer size; this makes xpalloc more
16434 convenient.
16435
a69fbedb
PE
16436 * image.c (x_allocate_bitmap_record, cache_image):
16437 * xselect.c (Fx_register_dnd_atom):
16438 Simplify previous changes by using xpalloc.
16439
fe5c5d37
PE
16440 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16441 since either will do and ptrdiff_t is convenient with xpalloc.
16442
0065d054
PE
16443 * charset.c (charset_table_size)
16444 (struct charset_sort_data.priority): Now ptrdiff_t.
16445 (charset_compare): Don't overflow if priorities differ greatly.
16446 (Fsort_charsets): Don't assume list length fits in int.
16447 Check for size-calculation overflow when allocating sort data.
16448 (syms_of_charset): Allocate an initial charset table that is
16449 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16450
16451 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16452
16453 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16454 The actual value is always <= INT_MAX, and leaving it unsigned made
16455 overflow checking harder.
16456
16457 * dispextern.h (struct glyph_matrix.rows_allocated)
16458 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16459 with xpalloc. The values are still always <= INT_MAX.
16460
16461 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16462
16463 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16464 (SAFE_NALLOCA): New macro.
16465
16466 * region-cache.c (struct boundary.pos, find_cache_boundary)
16467 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16468 (set_cache_region, invalidate_region_cache)
16469 (revalidate_region_cache, know_region_cache, region_cache_forward)
16470 (region_cache_backward, pp_cache):
16471 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16472 so that ptrdiff_t * can be passed to xpalloc.
16473 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16474 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16475 (pp_cache): Don't assume cache_len fits in int.
16476 * region-cache.h: Adjust extern decls to match.
16477
16478 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16479 EMACS_INT, since either will do, for xpalloc.
16480
16481 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16482 (xnmalloc, xnrealloc, xpalloc): New functions.
16483
726e0ab1
PE
16484 * bidi.c (bidi_shelve_header_size): New constant.
16485 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16486 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16487
51f30bc5 16488 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16489 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16490 (overlay_strings):
16491 Don't update size of array until after memory allocation succeeds,
16492 because xmalloc/xrealloc may not return.
0065d054
PE
16493 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16494 now that we have proper integer overflow checking.
16495 (record_overlay_string, overlay_strings): Catch overflows when
16496 calculating size of overlay_str_buf.
726e0ab1 16497
0065d054
PE
16498 * callproc.c (Fcall_process): Check for size overflow when
16499 calculating size of args2.
16500 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16501 Normally we prefer signed values, but sticking with ptrdiff_t would
16502 require adding more-complicated checks.
726e0ab1
PE
16503
16504 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16505 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16506 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16507 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16508
16509 * character.c (Fstring): Check for size-calculation overflow.
16510
16511 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16512 unnecessary integer overflow. Check for size overflow.
16513 (encode_coding_object): Don't update size until xmalloc succeeds.
16514
16515 * composite.c (get_composition_id): Check for overflow in glyph
16516 length calculations.
16517
16518 Integer and memory overflow fixes for display code.
16519 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16520 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16521 (scrolling_window): Check for overflow in size calculations.
16522 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16523 Don't assume glyph table len fits in int.
16524 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16525 (row_table_size): Now ptrdiff_t, not int.
16526 (scrolling_window): Avoid overflow in size calculations.
16527 Don't update size until allocation succeeds.
16528 * fns.c (concat): Check for overflow in size calculations.
16529 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16530 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16531 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16532
16533 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16534 (get_doc_string): Check for size calculation overflow.
16535 Don't update size until allocation succeeds.
16536 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16537 EMACS_INT, where ptrdiff_t will do.
16538 (Fsubstitute_command_keys): Check for string overflow.
16539
16540 * editfns.c (set_time_zone_rule): Don't assume environment length
16541 fits in int.
16542 (message_length): Now ptrdiff_t, not int.
16543 (Fmessage_box): Don't update size until allocation succeeds.
16544 Don't assume message length fits in int.
16545 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16546
0065d054
PE
16547 * emacs.c (main): Do not reallocate argv, since there is a null at
16548 the end that can be overwritten, and this way there's no need to
16549 worry about size-calculation overflow.
16550 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16551
16552 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16553 alloc succeeds.
16554 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16555
16556 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16557 (x_set_scroll_bar_width, x_figure_window_size):
16558 Check for integer overflow.
16559 (x_set_alpha): Do not assume XINT fits in int.
16560
16561 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16562 This is for the members text_lines, text_cols, total_lines, total_cols,
16563 where the system imposes an 'int' limit.
16564
16565 * fringe.c (Fdefine_fringe_bitmap):
16566 Don't update size until alloc works.
16567
16568 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16569 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16570
16571 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16572 Check for size-calculation overflow.
16573 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16574 do, as we prefer signed integers.
16575 (id_to_widget.max_size, id_to_widget.used)
16576 (xg_store_widget_in_map, xg_remove_widget_from_map)
16577 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16578 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16579 Use and return ptrdiff_t, not int.
16580 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16581 * gtkutil.h: Change prototypes to match the above.
16582
16583 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16584 are duplicate now that they've been promoted to lisp.h.
16585 (x_allocate_bitmap_record, x_alloc_image_color)
16586 (make_image_cache, cache_image, xpm_load):
16587 Don't update size until alloc is done.
16588 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16589 (x_detect_edges):
3256efce 16590 Check for size calculation overflow.
726e0ab1
PE
16591 (ct_colors_allocated_max): New constant.
16592 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16593 overflow.
3256efce 16594
726e0ab1
PE
16595 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16596 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16597 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16598 Use ptrdiff_t, not int, to count maps.
16599 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
16600 calculations. Don't update size until allocation succeeds.
16601 Redo calculations to avoid overflow.
726e0ab1
PE
16602 * keyboard.h: Change prototypes to match the above.
16603
16604 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16605 to count maps.
16606 (current_minor_maps): Check for size calculation overflow.
16607 * keymap.h: Change prototypes to match the above.
16608
16609 * lread.c (read1, init_obarray): Don't update size until alloc done.
16610
16611 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16612 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16613
726e0ab1
PE
16614 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16615 Now ptrdiff_t, not int.
16616 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16617 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16618
16619 * process.c (Fnetwork_interface_list): Check for overflow
16620 in size calculation.
16621
16622 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16623
16624 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16625 overflow. Don't bother calling xmalloc when xrealloc will do.
16626
16627 * search.c (Freplace_match): Check for size calculation overflow.
16628 (Fset_match_data): Don't assume list lengths fit in 'int'.
16629
16630 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16631 for command line length. Do not attempt to address one before the
16632 beginning of an array, as that's not portable.
16633
16634 * term.c (max_frame_lines): Remove; unused.
16635 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16636 not int.
16637 (encode_terminal_code, calculate_costs): Check for size
16638 calculation overflow.
16639 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16640 table lengths and related sizes. Don't update size until alloc
16641 done. Redo calculations to avoid overflow.
16642 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16643
16644 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16645 subtracting pointers.
16646 (gobble_line): Check for overflow more carefully. Don't update size
16647 until alloc done.
16648
16649 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16650 Don't update size until alloc done.
16651 Redo size calculations to avoid overflow.
16652 Check for size calculation overflow.
0065d054 16653 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16654
16655 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16656 Use ptrdiff_t, not int, for sizes.
16657 (store_mode_line_noprop_char): Don't update size until alloc done.
16658
0065d054
PE
16659 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16660 Use ptrdiff_t, not int, for sizes.
16661 (Finternal_make_lisp_face, cache_face):
16662 Check for size calculation overflow.
16663 (cache_face): Treat size calculation overflows as if they were
16664 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16665
16666 * xfns.c (x_encode_text, x_set_name_internal)
16667 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16668 sizes, since they can exceed INT_MAX in size. Check for size
16669 calculation overflow.
16670
0065d054
PE
16671 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16672 (xg_select): Check for size calculation overflow.
726e0ab1
PE
16673 Don't update size until alloc done.
16674
0065d054 16675 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 16676 as sprintf is limited to int lengths.
1d526e2f 16677
252c5ee1
PE
16678 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16679 (X_LONG_MIN): New macros.
864d7ce7
PE
16680 Use them to make the following changes clearer.
16681 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16682 This change doesn't affect the value now, but it may help remind
16683 future maintainers not to raise the value too much later.
16684 (SELECTION_QUANTUM): Remove, replacing with ...
16685 (selection_quantum): ... new function, which avoids overflow.
16686 All uses changed.
16687 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16688 assumption that selection length fits in 'int'.
16689 (x_reply_selection_request, x_handle_selection_request)
16690 (x_get_window_property, receive_incremental_selection)
16691 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16692 (lisp_data_to_selection_data, clean_local_selection_data):
16693 Use ptrdiff_t, not int, to record length of selection.
16694 (x_reply_selection_request, x_get_window_property)
16695 (receive_incremental_selection, x_property_data_to_lisp):
16696 Redo calculations to avoid overflow.
16697 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 16698 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
16699 something.
16700 (x_get_window_property, receive_incremental_selection)
16701 (lisp_data_to_selection_data, x_property_data_to_lisp):
16702 Check for size-calculation overflow.
16703 (x_get_window_property, receive_incremental_selection)
16704 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16705 Don't store size until memory allocation succeeds.
16706 (x_get_window_property): Plug memory leak on memory exhaustion.
16707 Don't double-block input; malloc is safe here. Don't assume 2**34
16708 - 4 fits in unsigned long. Add an xassert to check
16709 XGetWindowProperty overflow. Be more careful about overflow
16710 calculations, and distinguish size from memory overflow better.
16711 (receive_incremental_selection): When tracing, don't assume
16712 unsigned int is less than INT_MAX.
16713 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16714 harmful) conversions of unsigned short to int.
16715 (lisp_data_to_selection_data): Don't assume that integers
16716 in the range -65535 through -1 fit in an X unsigned short.
16717 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16718 result parameters unless successful. Rely on cons_to_unsigned
16719 to report problems with elements; the old code wasn't right anyway.
16720 (x_check_property_data): Check for int overflow; we cannot use
16721 a wider type due to X limits.
16722 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16723
726e0ab1 16724 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 16725
0065d054
PE
16726 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16727 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
16728 (x_color_cells): Don't store size until memory allocation succeeds.
16729 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 16730 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
16731 (x_term_init): Don't assume length fits in int (sprintf is limited
16732 to int size).
bc18e09d 16733
ebfa62c0
PE
16734 Use ptrdiff_t for composition IDs.
16735 * character.c (lisp_string_width):
16736 * composite.c (composition_table_size, n_compositions)
16737 (get_composition_id, composition_gstring_from_id):
16738 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16739 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16740 * window.c (Frecenter):
16741 Use ptrdiff_t, not int, for composition IDs.
16742 * composite.c (get_composition_id): Check for integer overflow.
16743 * composite.h: Adjust prototypes to match the above changes.
16744
d3411f89
PE
16745 Use ptrdiff_t for hash table indexes.
16746 * category.c (hash_get_category_set):
16747 * ccl.c (ccl_driver):
16748 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16749 * coding.c (coding_system_charset_list, detect_coding_system):
16750 * coding.h (struct coding_system.id):
16751 * composite.c (get_composition_id, gstring_lookup_cache):
16752 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16753 * image.c (xpm_get_color_table_h):
16754 * lisp.h (hash_lookup, hash_put):
16755 * minibuf.c (Ftest_completion):
16756 Use ptrdiff_t for hash table indexes, not int (which is too
16757 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16758 32-bit --with-wide-int hosts).
16759
e097a6fa
PE
16760 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16761 Add a FIXME comment about memory leaks.
16762 (syms_of_charset): Don't assume xmalloc returns.
16763
5637687f
PE
16764 Don't assume that stated character widths fit in int.
16765 * character.c (Fchar_width, c_string_width, lisp_string_width):
16766 * character.h (CHAR_WIDTH):
16767 * indent.c (MULTIBYTE_BYTES_WIDTH):
16768 Use sanitize_char_width to avoid undefined and/or bad behavior
16769 with outlandish widths.
a66cfb1c 16770 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
16771 now that we have two such functions. All uses changed.
16772 (sanitize_char_width): New inline function.
16773
a2271ba2
PE
16774 Don't assume that tab-width fits in int.
16775 * character.h (sanitize_width): New inline function.
16776 (SANE_TAB_WIDTH): New macro.
16777 (ASCII_CHAR_WIDTH): Use it.
16778 * indent.c (sane_tab_width): Remove. All uses replaced by
16779 SANE_TAB_WIDTH (current_buffer).
16780 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16781
18c52557
PE
16782 * fileio.c: Integer overflow issues with file modes.
16783 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16784
caeeedc1
PE
16785 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16786 Remove unreachable code.
16787 (read_hex, load_charset_map_from_file): Check for integer overflow.
16788
6df6ae42 16789 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
16790 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16791 (x_send_scroll_bar_event): Likewise. Check that the size does not
16792 exceed limits imposed by XClientMessageEvent, as well as the usual
16793 ptrdiff_t and size_t limits.
16794
b13995db
PE
16795 * keyboard.c: Overflow, signedness and related fixes.
16796 (make_lispy_movement): Use same integer type in forward decl
16797 that is used in the definition.
16798 (read_key_sequence, keyremap_step):
16799 Change bufsize argument back to int, undoing my 2011-03-30 change.
16800 We prefer signed types, and int is wide enough here.
16801 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16802 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16803 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16804 length, not size_t. Use ptrdiff_t for index, not int.
16805 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16806 possibility of integer overflow.
16807
13464394
PE
16808 Overflow, signedness and related fixes for images.
16809
16810 * dispextern.h (struct it.stack[0].u.image.image_id)
16811 (struct_it.image_id, struct image.id, struct image_cache.size)
16812 (struct image_cache.used, struct image_cache.ref_count):
16813 * gtkutil.c (update_frame_tool_bar):
16814 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16815 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16816 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16817 * nsmenu.m (update_frame_tool_bar):
16818 * xdisp.c (calc_pixel_width_or_height):
16819 * xfns.c (image_cache_refcount):
16820 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16821 on typical 64-bit hosts.
16822
16823 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16824 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16825 Omit unnecessary casts to int.
16826 (parse_image_spec): Check that integers fall into 'int' range
16827 when the callers expect that.
16828 (image_ascent): Redo ascent calculation to avoid int overflow.
16829 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16830 (lookup_image): Remove unnecessary tests.
16831 (xbm_image_p): Locals are now of int, not EMACS_INT,
16832 since parse_image_check makes sure they fit into int.
16833 (png_load, gif_load, svg_load_image):
16834 Prefer int to unsigned where either will do.
16835 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
16836 old tiff_error_handler and tiff_warning_handler.
16837 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
16838 stack buffer overflows. It uses only the features of vsnprintf
16839 that are common to both POSIX and native Microsoft.
16840 (tiff_error_handler, tiff_warning_handler): Use it.
16841 (tiff_load, gif_load, imagemagick_load_image):
16842 Don't assume :index value fits in 'int'.
16843 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16844 (imagemagick_load_image): Check that crop parameters fit into
16845 the integer types that MagickCropImage accepts. Don't assume
16846 Vimagemagick_render_type has a nonnegative value. Don't assume
16847 size_t fits in 'long'.
16848 (gs_load): Use printmax_t to print the widest integers possible.
16849 Check for integer overflow when computing image height and width.
16850
c11821d4
EZ
168512011-08-26 Eli Zaretskii <eliz@gnu.org>
16852
16853 * xdisp.c (redisplay_window): Don't force window start if point
16854 will be invisible in the resulting window. (Bug#9324)
16855
0c95fcf7
EZ
168562011-08-25 Eli Zaretskii <eliz@gnu.org>
16857
16858 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16859 the display spec is of the form `(space ...)'.
16860 (handle_display_spec): Return the value returned by
16861 handle_single_display_spec, not just 1 or zero.
16862 (handle_single_display_spec): If the display spec is of the form
16863 `(space ...)', and specifies display in the text area, return 2
16864 rather than 1.
fee65a97 16865 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
16866 accurately, and prefer exact match for point under bidi.
16867 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
16868
16869 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16870 into disp_prop; all users changed.
16871
16872 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16873 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16874 for the text covered by the display property.
16875
e4ed06f1
CY
168762011-08-25 Chong Yidong <cyd@stupidchicken.com>
16877
16878 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16879 Change return value to nil.
16880 (Frecord_buffer): Delete unused function.
16881
f67cdd7f
EZ
168822011-08-24 Eli Zaretskii <eliz@gnu.org>
16883
5980d4c6
EZ
16884 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16885 buffers, return left-to-right.
8610fe8b
EZ
16886 (set_cursor_from_row): Consider candidate row a win if its glyph
16887 represents a newline and point is on that newline. Fixes cursor
16888 positioning on the newline at EOL of R2L text within L2R
16889 paragraph, and vice versa.
16890 (try_cursor_movement): Check continued rows, in addition to
16891 continuation rows. Fixes unwarranted scroll when point enters a
16892 continued line of R2L text within an L2R paragraph, or vice versa.
16893 (cursor_row_p): Consider the case of point being equal to
16894 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16895 from the end of a short line to the beginning of a continued line
16896 of R2L text within L2R paragraph.
16897 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16898 composed characters.
5980d4c6 16899
f67cdd7f
EZ
16900 * bidi.c (bidi_check_type): Use xassert.
16901 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16902 members.
16903
bca633fb
EZ
169042011-08-23 Eli Zaretskii <eliz@gnu.org>
16905
16906 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16907 a character.
16908
4a5885a7
CY
169092011-08-23 Chong Yidong <cyd@stupidchicken.com>
16910
16911 * nsfont.m (ns_otf_to_script): Fix typo.
16912
0902a04e
KH
169132011-08-22 Kenichi Handa <handa@m17n.org>
16914
16915 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16916 extra slot even if the purpose is char-code-property-table.
16917
1a2e6670
EZ
169182011-08-23 Eli Zaretskii <eliz@gnu.org>
16919
8ddde651
EZ
16920 * xdisp.c (redisplay_window): When computing centering_position,
16921 account for the height of the header line. (Bug#8874)
16922
425cc014
EZ
16923 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16924 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16925 candidate is selected by the mouse, and that candidate has a
16926 composed character under the mouse.
16927
1a2e6670
EZ
16928 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16929 coordinates reported by pos-visible-in-window-p for a composed
16930 character in column zero.
16931
8b76d6f8
SM
169322011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16933
16934 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16935
dac347dd
EZ
169362011-08-22 Eli Zaretskii <eliz@gnu.org>
16937
16938 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16939 consider it a hit if to_charpos is anywhere in the range of the
16940 composed buffer positions.
16941
e013fb34
CY
169422011-08-22 Chong Yidong <cyd@stupidchicken.com>
16943
16944 * image.c (gif_load): Don't assume that each subimage has the same
16945 dimensions as the base image. Handle disposal method that is
16946 "undefined" by the gif spec (Bug#9335).
16947
bd1ba3e8
CY
169482011-08-20 Chong Yidong <cyd@stupidchicken.com>
16949
16950 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16951 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16952
54a1215b
EZ
169532011-08-19 Eli Zaretskii <eliz@gnu.org>
16954
823564e5
EZ
16955 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16956 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16957 from an Org mode buffer to a Speedbar frame.
16958
54a1215b
EZ
16959 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16960 a composition, take its buffer position from IT->cmp_it.charpos.
16961 Fixes cursor positioning at the beginning of a line that begins
16962 with a composed character.
16963
9778ebcc
EZ
169642011-08-18 Eli Zaretskii <eliz@gnu.org>
16965
0be6ee06
EZ
16966 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16967 character bidirectional type, use STRONG_L instead. Fixes crashes
16968 in a buffer produced by `describe-categories'.
16969
9778ebcc
EZ
16970 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16971 members before the level stack, so they would be saved and
16972 restored when copying iterator state. Fixes incorrect reordering
16973 around TABs covered by display properties.
16974
156bffbe
AS
169752011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16976
6b02f655 16977 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16978
72ad093b
CY
169792011-08-17 Chong Yidong <cyd@stupidchicken.com>
16980
16981 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16982 (internal_condition_case_2, internal_condition_case_n):
16983 Remove unnecessary aborts (Bug#9081).
72ad093b 16984
35774242
EZ
169852011-08-17 Eli Zaretskii <eliz@gnu.org>
16986
16987 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16988 has no `load' handler, try opening the file locally. (Bug#9311)
16989
db76dd85
KB
169902011-08-16 Ken Brown <kbrown@cornell.edu>
16991
16992 * gmalloc.c: Expand comment.
16993
b215eee5
EZ
169942011-08-16 Eli Zaretskii <eliz@gnu.org>
16995
16996 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16997 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16998
a4579d33
KB
169992011-08-16 Ken Brown <kbrown@cornell.edu>
17000
17001 Fix memory allocation problems in Cygwin build (Bug#9273).
17002
17003 * unexcw.c ( __malloc_initialized): Declare external variable.
17004 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17005
8b76d6f8
SM
17006 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17007 New variables.
a4579d33
KB
17008 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17009 dumped emacs.
17010 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17011 in the static heap.
17012 [CYGWIN] (special_realloc): New function.
17013 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17014 requests to realloc storage in the static heap.
17015
3ebec551
PE
170162011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17017
17018 * bidi.c (bidi_initialize): Remove unused local.
17019
9fd8be00
EZ
170202011-08-15 Eli Zaretskii <eliz@gnu.org>
17021
6b02f655
SM
17022 * bidimirror.h:
17023 * biditype.h: Remove file.
17024 * makefile.w32-in ($(BLD)/bidi.$(O)):
17025 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17026
17027 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17028
17029 * chartab.c: Improve commentary for the uniprop_table API.
17030
32413314
EZ
17031 * bidi.c (bidi_paragraph_init): Support zero value of
17032 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17033 (bidi_initialize): Use uniprop_table instead of including
17034 biditype.h and bidimirror.h.
32413314 17035
9fd8be00
EZ
17036 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17037 coordinates of the iterator when restoring from ppos_it.
17038 (Bug#9296)
17039
5cf2b69b
KH
170402011-08-14 Kenichi Handa <handa@m17n.org>
17041
17042 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17043 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17044
daf17d00
EZ
170452011-08-14 Eli Zaretskii <eliz@gnu.org>
17046
17047 * xdisp.c (move_it_in_display_line_to): Don't invoke
17048 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17049 ppos_it. Fixes vertical cursor motion when line beginning is
17050 covered by an image. (Bug#9296)
17051
08e3161a
JD
170522011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17053
17054 * nsterm.h (ns_run_ascript): Declare.
17055 (NSAPP_DATA2_RUNASSCRIPT): Define.
17056
17057 * nsfns.m (as_script, as_result, as_status): New static variables.
17058 (ns_run_ascript): New function.
5e617bc2 17059 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17060 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17061 the event loop. Get status from as_status (Bug#7276).
17062
17063 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17064 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17065 the event loop (Bug#7276).
17066
a3720aa2
AS
170672011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17068
17069 * gnutls.c (QCgnutls_bootprop_priority)
17070 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17071 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17072 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17073 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17074 (QCgnutls_bootprop_verify_hostname_error)
17075 (QCgnutls_bootprop_callbacks_verify): Rename from
17076 Qgnutls_bootprop_..., all uses changed.
17077
17078 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17079 uses changed.
17080
0a0d27fb
PE
170812011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17082
19d5c50c
PE
17083 * xfaces.c (Qframe_set_background_mode): Now static.
17084 * dispextern.h (Qframe_set_background_mode): Remove decl.
17085
0a0d27fb
PE
17086 * process.c (Fnetwork_interface_info): Declare local only if needed.
17087
377538cb
JD
170882011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17089
17090 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17091 (Fnetwork_interface_list): Allocate in increments of bytes instead
17092 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17093 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17094 sockaddr.
17095 (struct ifflag_def): notrailers is smart on OSX.
17096 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17097 Get hardware address with getifaddrs if available.
17098
08fff70c
EZ
170992011-08-12 Eli Zaretskii <eliz@gnu.org>
17100
17101 * xdisp.c (iterate_out_of_display_property): xassert that
17102 IT->position is set to within IT->object's boundaries. Break from
17103 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17104 when IT->position is set up wrongly due to some bug.
17105 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17106 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17107 entry. Force push_it to save on the stack the current
17108 buffer/string position, to be restored by pop_it. Fix flags in
17109 the iterator structure wrt the object coming from a display
17110 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17111 properties. (Bug#9284)
17112
7be1c708 171132011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17114
7be1c708
CY
17115 * fontset.c (fontset_get_font_group): Add proper type checks.
17116 (Bug#9172)
aac0c6e3 17117
7be1c708 171182011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17119
7be1c708
CY
17120 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17121 and LC_VERSION_MIN_MACOSX.
17122 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17123 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17124
97bb72a6
EZ
171252011-08-08 Eli Zaretskii <eliz@gnu.org>
17126
17127 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17128 no-display-properties-and-no-overlays under bidi display.
17129 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17130 properties and overlays.
97bb72a6 17131
d5617611
CY
171322011-08-08 Chong Yidong <cyd@stupidchicken.com>
17133
37e11a63
CY
17134 * editfns.c (Fset_time_zone_rule): Document relationship with the
17135 setenv function.
17136
d5617611
CY
17137 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17138 the font entity extracted from the cache (Bug#8109).
17139
58872834
CY
171402011-08-07 Chong Yidong <cyd@stupidchicken.com>
17141
17142 * composite.c (autocmp_chars): Don't reset point. That is done by
17143 restore_point_unwind (Bug#5984).
17144
75bfc667
JL
171452011-08-07 Juri Linkov <juri@jurta.org>
17146
17147 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17148 to show the arg `TIME' instead of `TIMEVAL'.
17149
d1410150
EZ
171502011-08-06 Eli Zaretskii <eliz@gnu.org>
17151
17152 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17153 display property strides EOL and includes a newline, as in
17154 longlines-mode. (Bug#9254)
75b771e4
EZ
17155 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17156 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17157
17158 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17159 is non-zero, even if the data buffer is NULL. Fixes a crash in
17160 vertical-motion with longlines-mode. (Bug#9254)
17161
35928349
EZ
171622011-08-05 Eli Zaretskii <eliz@gnu.org>
17163
ec7cc85b
EZ
17164 * bidi.c <bidi_cache_total_alloc>: Now static.
17165 (bidi_initialize): Initialize bidi_cache_total_alloc.
17166
8b76d6f8 17167 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17168 cache. (Bug#9221)
17169
17170 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17171 amount allocated this far in `bidi_cache_total_alloc'.
17172 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17173 non-zero, only free the data buffer without restoring the cache
17174 contents. All callers changed.
17175
17176 * dispextern.h (bidi_unshelve_cache): Update prototype.
17177
17178 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17179 (move_it_in_display_line, move_it_to)
17180 (move_it_vertically_backward, move_it_by_lines): Replace the call
17181 to xfree to an equivalent call to bidi_unshelve_cache.
17182 (move_it_in_display_line_to): Fix logic of returning
412b6358 17183 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17184
e2e2423b
EZ
171852011-08-05 Eli Zaretskii <eliz@gnu.org>
17186
17187 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17188 came from a string character with a `cursor' property. (Bug#9229)
17189
ae9e757a
JD
171902011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17191
17192 * Makefile.in (LIB_PTHREAD): New variable.
17193 (LIBES): Add LIB_PTHREAD (Bug#9216).
17194
17195 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17196 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17197
213bd7f2
AS
171982011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17199
6b02f655 17200 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17201
99aaf75f
JD
172022011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17203
17204 * xterm.c (x_find_topmost_parent): New function.
17205 (x_set_frame_alpha): Find topmost parent window with
17206 x_find_topmost_parent and set the property there also (bug#9181).
17207 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17208
c74e9d86
PE
172092011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17210
17211 * callproc.c (Fcall_process): Avoid vfork clobbering
17212 the local vars buffer, coding_systems, current_dir.
17213
640c8776
SM
172142011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17215
17216 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17217
f26d0e4c
PE
172182011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17219
8a10d76c
PE
17220 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17221 so that it is not optimized away.
17222
f26d0e4c
PE
17223 * xdisp.c (compute_display_string_pos): Remove unused local.
17224
55439c61
EZ
172252011-08-02 Eli Zaretskii <eliz@gnu.org>
17226
17227 Fix slow cursor motion and scrolling in large buffers with
17228 selective display, like Org Mode buffers. (Bug#9218)
17229
17230 * dispextern.h (struct bidi_it): New member disp_prop_p.
17231
17232 * xdisp.c: Remove one-slot cache of display string positions.
17233 (compute_display_string_pos): Accept an additional argument
5e617bc2 17234 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17235 for a display string or property. If found, set DISP_PROP_P
17236 non-zero.
17237
17238 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17239 DISP_PROP_P, and pass it to compute_display_string_pos.
17240 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17241 non-zero. All callers of bidi_fetch_char changed.
17242
fb33fa43
SM
172432011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17244
17245 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17246
b099e063
DM
172472010-12-03 Don March <don@ohspite.net>
17248
17249 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17250 last character M-[char] is translated to ESC [char] (bug#7541).
17251
5cc7f7af
KH
172522011-08-02 Kenichi Handa <handa@m17n.org>
17253
d0fffa3f 17254 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17255
17256 * chartab.c (uniprop_table): Make it non-static.
17257
525d5e6e
EZ
172582011-08-01 Eli Zaretskii <eliz@gnu.org>
17259
17260 * xdisp.c (forward_to_next_line_start): Accept additional argument
17261 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17262 on the newline.
17263 (reseat_at_next_visible_line_start): Use the bidi iterator state
17264 returned by forward_to_next_line_start to restore the state of
17265 it->bidi_it after backing up to previous newline. (Bug#9212)
17266
31011111
AS
172672011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17268
17269 * regex.c (re_comp): Protoize.
17270 (re_exec): Fix return type.
17271 (regexec): Fix type of `ret'. (Bug#9203)
17272
476371c4
PE
172732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17274
e5d76069
PE
17275 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17276 This is needed if max-image-size is a floating-point number.
17277
9a79b20c
AS
172782011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17279
17280 * print.c (print_object): Print empty symbol as ##.
17281
17282 * lread.c (read1): Read ## as empty symbol.
17283
d8c2fa78
AA
172842011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17285
17286 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17287 setting frame foreground color (Bug#9175).
17288 (x_set_background_color): Likewise.
17289
ffe57a7a
AA
17290 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17291 contents (Bug#9176).
17292 (EmacsTooltip -init): Remove bezels and add shadows to
17293 tooltip windows.
17294
bf3492a5
AA
17295 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17296 or scroll bar (Bug#8470).
17297
d55e9c53
AA
17298 * nsfont.m (nsfont_open): Remove assignment to voffset and
17299 unnecessary vars hshink, expand, hd, full_height, min_height.
17300 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17301
17302 * nsterm.h (nsfont_info): Remove voffset field.
17303
d8c2fa78 173042011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17305
17306 Implement strike-through and overline on NextStep (Bug#8863).
17307
17308 * nsfont.m (nsfont_open): Use underline position provided by font,
17309 instead of hard-coded value of 2.
17310 (nsfont_draw): Call ns_draw_text_decoration instead.
17311
17312 * nsterm.h: Add declaration for ns_draw_text_decoration.
17313
17314 * nsterm.m (ns_draw_text_decoration): New function for drawing
17315 underline, overline, and strike-through.
17316 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17317 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17318 accommodate underlining, etc.
4843aac3 17319
4cc60b9b
EZ
173202011-07-28 Eli Zaretskii <eliz@gnu.org>
17321
bc7ece87
EZ
17322 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17323 default.
4cc60b9b 17324
476371c4
PE
173252011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17326
66606eea
PE
17327 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17328 Without this fix, if a signal arrives just after memory fills up,
17329 'malloc' might be invoked reentrantly.
17330
476371c4
PE
17331 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17332 In other words, assume that every image size is allowed, on non-X
17333 hosts. This assumption is probably wrong, but it lets Emacs compile.
17334
f3fcc40d
AS
173352011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17336
17337 * regex.c (re_iswctype): Convert return values to boolean.
17338
350c992f
EZ
173392011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17340
17341 * xdisp.c (compute_display_string_pos): Don't use cached display
17342 string position if the buffer had its restriction changed.
17343 (Bug#9184)
17344
5266b4bb
PE
173452011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17346
17347 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17348
2573a837 173492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17350
41f55ccd 17351 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17352
39e378da
PE
17353 * bidi.c: Integer size and overflow fixes.
17354 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17355 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17356 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17357 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17358 (bidi_find_other_level_edge):
17359 Use ptrdiff_t instead of EMACS_INT where either will do.
17360 This works better on 32-bit hosts configured --with-wide-int.
17361 (bidi_cache_ensure_space): Check for size-calculation overflow.
17362 Use % rather than repeated addition, for better worst-case speed.
17363 Don't set bidi_cache_size until after xrealloc returns, because it
17364 might not return.
17365 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17366 (bidi_cache_ensure_space): Also check that the bidi cache size
17367 does not exceed that of the largest Lisp string or buffer. See Eli
17368 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17369
5e927815
PE
17370 * alloc.c (__malloc_size_t): Remove.
17371 All uses replaced by size_t. See Andreas Schwab's note
17372 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17373
ca4aa935
PE
17374 * image.c: Improve checking for integer overflow.
17375 (check_image_size): Assume that f is nonnull, since
17376 it is always nonnull in practice. This is one less thing to
17377 worry about when checking for integer overflow later.
17378 (x_check_image_size): New function, which checks for integer
17379 overflow issues inside X.
17380 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17381 This removes the need for a memory_full check.
17382 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17383 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17384 (xbm_read_bitmap_data): Change locals back to 'int', since
17385 their values must fit in 'int'.
17386 (xpm_load_image, png_load, tiff_load):
17387 Invoke x_create_x_image_and_pixmap earlier,
17388 to avoid much needless work if the image is too large.
17389 (tiff_load): Treat overly large images as if
17390 x_create_x_image_and_pixmap failed, not as malloc failures.
17391 (gs_load): Use x_check_image_size.
17392
5f8f9cc2
PE
17393 * gtkutil.c: Omit integer casts.
17394 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17395 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17396
5adf60bc
PE
17397 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17398
c8907a93
PE
17399 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17400 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17401 would wrongly return t on a 64-bit host.
17402
e3c25c68
PE
17403 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17404 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17405 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17406 and therefore cause GCC to emit a bogus diagnostic in some cases.
17407
3f791afe
PE
17408 * image.c: Integer signedness and overflow and related fixes.
17409 This is not an exhaustive set of fixes, but it's time to
17410 record what I've got.
17411 (lookup_pixel_color, check_image_size): Remove redundant decls.
17412 (check_image_size): Don't assume that arbitrary EMACS_INT values
17413 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17414 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17415 (tiff_load, imagemagick_load_image):
17416 Check for overflow in size calculations.
17417 (x_create_x_image_and_pixmap): Remove unnecessary test for
17418 xmalloc returning NULL; that can't happen.
17419 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17420 (xpm_color_bucket): Use better integer hashing function.
17421 (xpm_cache_color): Don't possibly over-allocate memory.
17422 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17423 (gif_memory_source):
17424 Use ptrdiff_t, not int or size_t, to record sizes.
17425 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17426 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17427 either works, as we prefer signed integers.
17428 (tiff_read_from_memory, tiff_write_from_memory):
17429 Return tsize_t, not size_t, since that's what the TIFF API wants.
17430 (tiff_read_from_memory): Don't fail simply because the read would
17431 go past EOF; instead, return a short read.
17432 (tiff_load): Omit no-longer-needed casts.
17433 (Fimagemagick_types): Don't assume size fits into 'int'.
17434
3cc5a532
PE
17435 Improve hashing quality when configured --with-wide-int.
17436 * fns.c (hash_string): New function, taken from sxhash_string.
17437 Do not discard information about ASCII character case; this
17438 discarding is no longer needed.
17439 (sxhash-string): Use it. Change sig to match it. Caller changed.
17440 * lisp.h: Declare it.
17441 * lread.c (hash_string): Remove, since we now use fns.c's version.
17442 The fns.c version returns a wider integer if --with-wide-int is
17443 specified, so this should help the quality of the hashing a bit.
17444
b312a492
PE
17445 * emacs.c: Integer overflow minor fix.
17446 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17447 Define only if GNU_LINUX.
17448 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17449
dfd153ae
PE
17450 * dispnew.c: Integer signedness and overflow fixes.
17451 Remove unnecessary forward decls, that were a maintenance hassle.
17452 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17453 All uses changed.
17454 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17455 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17456 (prepare_desired_row, line_draw_cost):
17457 Use int, not unsigned, where either works.
17458 (save_current_matrix, restore_current_matrix):
17459 Use ptrdiff_t, not size_t, where either works.
17460 (init_display): Check for overflow more accurately, and without
17461 relying on undefined behavior.
17462
a81d11a3
PE
17463 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17464 Remove, replacing with the new symbols in lisp.h. All uses changed.
17465 * fileio.c (make_temp_name):
17466 * filelock.c (lock_file_1, lock_file):
17467 * xdisp.c (message_dolog):
17468 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17469 Use pMd etc. instead.
17470 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17471 replacing the pWIDE etc. symbols removed from editfns.c.
17472
3300e6fd
PE
17473 * keyboard.h (num_input_events): Now uintmax_t.
17474 This is (very slightly) less likely to mess up due to wraparound.
17475 All uses changed.
17476
fd05c7e9
PE
17477 * buffer.c: Integer signedness fixes.
17478 (alloc_buffer_text, enlarge_buffer_text):
17479 Use ptrdiff_t rather than size_t when either will do, as we prefer
17480 signed integers.
17481
903fe15d
PE
17482 * alloc.c: Integer signedness and overflow fixes.
17483 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17484 (__malloc_size_t): Default to size_t, not to int.
17485 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17486 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17487 Prefer ptrdiff_t to size_t when either would do, as we prefer
17488 signed integers.
17489 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17490 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17491 Now const. Initialize with values that are in range even if char
17492 is signed.
17493 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17494 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17495 These functions do the right thing with sizes > 2**32.
17496 (check_depth): Now ptrdiff_t, not int.
17497 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17498 Adjust to new way of storing sizes. Check for size overflow bugs
17499 in rest of code.
17500 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17501 slightly wrong anyway, as it missed one instance of
17502 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17503 (refill_memory_reserve): Omit needless cast to size_t.
17504 (mark_object_loop_halt): Mark as externally visible.
17505
ac82cc6a
PE
17506 * xselect.c: Integer signedness and overflow fixes.
17507 (Fx_register_dnd_atom, x_handle_dnd_message):
17508 Use ptrdiff_t, not size_t, since we prefer signed.
17509 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17510 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17511 x_dnd_atoms_size and x_dnd_atoms_length.
17512
c2d1e36d
PE
17513 * doprnt.c: Prefer signed to unsigned when either works.
17514 * eval.c (verror):
17515 * doprnt.c (doprnt):
17516 * lisp.h (doprnt):
17517 * xdisp.c (vmessage):
17518 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17519 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17520 prefer signed arithmetic to avoid comparison confusion.
17521 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17522 but is a bit tricky.
17523
0e926e56
PE
17524 Assume freestanding C89 headers, string.h, stdlib.h.
17525 * data.c, doprnt.c, floatfns.c, print.c:
17526 Include float.h unconditionally.
17527 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17528 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17529 * regex.c: Likewise for stddef.h, string.h.
17530 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17531 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17532 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17533 (STDC_HEADERS): Remove obsolete defines.
17534 * sysdep.c: Include limits.h unconditionally.
17535
9cfdb3ec
PE
17536 Assume support for memcmp, memcpy, memmove, memset.
17537 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17538 * regex.c (memcmp, memcpy):
17539 Remove; we assume C89 now.
17540
17541 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17542 (__malloc_safe_bcopy): Remove; no longer needed.
17543
cf950e6b 17544 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17545 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17546 well either way, and we prefer signed to unsigned.
17547
dbf38e02
LMI
175482011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17549
17550 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17551 closes the connection while we're reading (bug#9182).
17552
d6f0886c 175532011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17554
d6f0886c
JD
17555 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17556 are specified (Bug#9168).
24e0f6b1 17557
2eb1f9e6
PE
175582011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17559
17560 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17561 Found by GCC static checking and --with-wide-int on a 32-bit host.
17562
22381272 175632011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17564
17565 * xdisp.c (compute_display_string_pos): Fix logic of caching
17566 previous display string position. Initialize cached_prev_pos to
17567 -1. Fixes slow-down at the beginning of a buffer.
17568
f25e39b4
EZ
175692011-07-24 Eli Zaretskii <eliz@gnu.org>
17570
17571 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17572 for attrs[LFACE_FONTSET_INDEX].
17573
04c4b52e
PE
175742011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17575
17576 * xml.c (parse_region): Remove unused local
17577 that was recently introduced.
17578
c1734fbd
EZ
175792011-07-23 Eli Zaretskii <eliz@gnu.org>
17580
be18c5a5
EZ
17581 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17582 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17583
c1734fbd
EZ
17584 * xdisp.c (move_it_in_display_line_to): Record the best matching
17585 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
17586 exit if none of the characters scanned was an exact match.
17587 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
17588 when exact match is impossible due to invisible text, and the
17589 lines are truncated.
17590
a258d627
JD
175912011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17592
17593 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17594 for OSX >= 10.7.
17595
b6d5a689
EZ
175962011-07-22 Eli Zaretskii <eliz@gnu.org>
17597
0f74f785
EZ
17598 Fix a significant slow-down of cursor motion with C-n, C-p,
17599 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17600 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 17601 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
17602 (next_element_from_buffer): Call compute_stop_pos_backwards to
17603 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
17604 base_level_stop.
17605 (reseat): Don't look for prev_stop, as that could mean a very long
17606 run.
17607 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17608 <cached_disp_overlay_modiff>: Cache for last found display string
17609 position.
551918c1 17610 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
17611 about the same buffer in the same area of character positions, and
17612 the buffer wasn't changed since the time the display string
17613 position was cached.
551918c1 17614
b2d0c91a
EZ
176152011-07-22 Eli Zaretskii <eliz@gnu.org>
17616
17617 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17618 is an integer, which is important for empty lines. (Bug#9149)
17619
043604ee
CY
176202011-07-22 Chong Yidong <cyd@stupidchicken.com>
17621
17622 * frame.c (Fmodify_frame_parameters): In tty case, update the
17623 default face if necessary (Bug#4238).
17624
da4adb04
CY
176252011-07-21 Chong Yidong <cyd@stupidchicken.com>
17626
17627 * editfns.c (Fstring_to_char): No need to explain what a character
17628 is in the docstring (Bug#6576).
17629
9abd0532
LMI
176302011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17631
17632 * xml.c (parse_region): Make sure we always return a tree.
17633
36881d16
HK
176342011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17635
17636 * xml.c (parse_region): If a document contains only comments,
17637 return that, too.
17638
1e98674d
LMI
176392011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17640
17641 * xml.c (make_dom): Return comments, too.
17642
590bd467
PE
176432011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17644
17645 Port to OpenBSD.
17646 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17647 and the surrounding thread.
17648 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17649 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17650 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17651 timer goes off.
17652 * s/openbsd.h (BROKEN_SIGIO): Define.
17653 * unexelf.c (unexec) [__OpenBSD__]:
17654 Don't update the .mdebug section of the Alpha COFF symbol table.
17655
f41628b2
LMI
176562011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17657
17658 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17659 (bug#8460).
17660
b59b67c5
PE
176612011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17662
15e3a074
PE
17663 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17664 This fixes some race conditions on the permissions of any newly
17665 created file.
17666
41bed37d
PE
17667 * alloc.c (valid_pointer_p): Use pipe, not open.
17668 This fixes some permissions issues when debugging.
17669
b59b67c5
PE
17670 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17671 If fchown fails to set both uid and gid, try to set just gid,
17672 as that is sometimes allowed. Adjust the file's mode to eliminate
17673 setuid or setgid bits that are inappropriate if fchown fails.
17674
925a6be7
SM
176752011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17676
17677 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17678 to compare Lisp_Objects.
17679 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17680 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17681 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17682
52968808
AS
176832011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17684
0a6a104b
AS
17685 * lread.c (read_integer): Unread even EOF character.
17686 (read1): Likewise. Properly record start position of symbol.
17687
52968808
AS
17688 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17689 symbol character follows.
17690
9e381cdd
PE
176912011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17692
17693 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17694 This works around a problem with the previous change to Fcopy_file.
17695 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17696 and without this change, GCC might complain about discarding
17697 fchown's return value.
17698
b5641435
JB
176992011-07-16 Juanma Barranquero <lekktu@gmail.com>
17700
17701 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17702
a8031457
PE
177032011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17704
17705 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17706
dd889327
LMI
177072011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17708
750c33f7
LMI
17709 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17710 it's used from the C level.
17711
dd889327
LMI
17712 * process.c: Use the same condition for POLL_FOR_INPUT in both
17713 keyboard.c and process.c (bug#1858).
17714
87e86684
LM
177152011-07-09 Lawrence Mitchell <wence@gmx.li>
17716
17717 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17718 (Fgnutls_boot): Use it.
17719
64348f40
AS
177202011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17721
17722 * doc.c (Fsubstitute_command_keys): Revert last change.
17723
1d698799
LMI
177242011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17725
f863868c
LMI
17726 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17727 quotes the next character, and doesn't affect other longer
17728 sequences (bug#8935).
17729
1d698799
LMI
17730 * lread.c (syms_of_lread): Clarify that is isn't only
17731 `eval-buffer' and `eval-defun' that's affected by
17732 `lexical-binding' (bug#8460).
17733
aa4b6df6
EZ
177342011-07-15 Eli Zaretskii <eliz@gnu.org>
17735
17736 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 17737 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 17738
5d856da6
PE
177392011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17740
ad6042bb
PE
17741 Fix minor problems found by static checking.
17742 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17743 (elsz): Now a signed constant, not a size_t var. We prefer signed
17744 types to unsigned, to avoid integer comparison confusion. Without
17745 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17746 "cannot optimize loop, the loop counter may overflow", a symptom
17747 of the confusion.
f00bbb22 17748 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
17749 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17750
6468f31c
LMI
177512011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17752
49080b10
LMI
17753 * search.c (Fre_search_backward): Mention `case-fold-search' in
17754 all the re_search_* functions (bug#8138).
17755
6468f31c
LMI
17756 * keyboard.c (Fopen_dribble_file): Document when the file is
17757 closed (bug#8056).
17758
c965adc5
EZ
177592011-07-14 Eli Zaretskii <eliz@gnu.org>
17760
df9733bf
EZ
17761 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17762 bidi_cache_idx.
17763
0bb23927
EZ
17764 Support bidi reordering of display and overlay strings.
17765 * xdisp.c (compute_display_string_pos)
17766 (compute_display_string_end): Accept additional argument STRING.
17767 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17768 (reseat_to_string): Initialize bidi_it->string.s and
17769 bidi_it->string.schars.
17770 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
17771 NULL (avoids a crash in bidi_paragraph_init).
17772 Initialize itb.string.lstring.
0bb23927
EZ
17773 (init_iterator): Call bidi_init_it only of a valid
17774 buffer position was specified. Initialize paragraph_embedding to
17775 L2R.
17776 (reseat_to_string): Initialize the bidi iterator.
17777 (display_string): If we need to ignore text properties of
17778 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17779 original value of -1 will not work with bidi.)
17780 (compute_display_string_pos): First arg is now struct
17781 `text_pos *'; all callers changed. Support display properties on
17782 Lisp strings.
17783 (compute_display_string_end): Support display properties on Lisp
17784 strings.
17785 (init_iterator, reseat_1, reseat_to_string): Initialize the
17786 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17787 when iterating on a string not from display properties).
640c8776
SM
17788 (compute_display_string_pos, compute_display_string_end):
17789 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
17790 arrow keys.
17791 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
17792 base_level_stop; instead, set base_level_stop to BEGV.
17793 Fixes crashes in vertical-motion.
0bb23927
EZ
17794 (next_element_from_buffer): Improve commentary for when
17795 the iterator is before prev_stop.
17796 (init_iterator): Initialize bidi_p from the default value of
17797 bidi-display-reordering, not from buffer-local value. Use the
17798 buffer-local value only if initializing for buffer iteration.
17799 (handle_invisible_prop): Support invisible properties on strings
17800 that are being bidi-reordered.
17801 (set_iterator_to_next): Support bidi reordering of C strings and
17802 Lisp strings.
17803 (next_element_from_string): Support bidi reordering of Lisp
17804 strings.
17805 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
17806 (display_string): Support display of R2L glyph rows.
17807 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
17808 (init_iterator): Don't initialize it->bidi_p for strings
17809 here.
17810 (reseat_to_string): Initialize it->bidi_p for strings here.
17811 (next_element_from_string, next_element_from_c_string)
17812 (next_element_from_buffer): Add xassert's for correspondence
17813 between IT's object being iterated and it->bidi_it.string
17814 structure.
17815 (face_before_or_after_it_pos): Support bidi iteration.
17816 (next_element_from_c_string): Handle the case of the first string
17817 character that is not the first one in the visual order.
17818 (get_visually_first_element): New function, refactored from common
17819 parts of next_element_from_buffer, next_element_from_string, and
17820 next_element_from_c_string.
17821 (tool_bar_lines_needed, redisplay_tool_bar)
17822 (display_menu_bar): Force left-to-right direction. Add a FIXME
17823 comment for making that be controlled by a user option.
17824 (push_it, pop_it): Save and restore the state of the
17825 bidi iterator. Save and restore the bidi_p flag.
17826 (pop_it): Iterate out of display property for string iteration as
17827 well.
17828 (iterate_out_of_display_property): Support iteration over strings.
17829 (handle_single_display_spec): Set up it->bidi_it for iteration
17830 over a display string, and call bidi_init_it.
17831 (handle_single_display_spec, next_overlay_string)
17832 (get_overlay_strings_1, push_display_prop): Set up the bidi
17833 iterator for displaying display or overlay strings.
17834 (forward_to_next_line_start): Don't use the shortcut if
17835 bidi-iterating.
17836 (back_to_previous_visible_line_start): If handle_display_prop
17837 pushed the iterator stack, restore the internal state of the bidi
17838 iterator by calling bidi_pop_it same number of times.
17839 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17840 and we are bidi-iterating, don't decrement the iterator position;
17841 instead, set the first_elt flag in the bidi iterator, to produce
17842 the same effect.
17843 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17844 (push_display_prop): xassert that we are iterating a buffer.
17845 (push_it, pop_it): Save and restore paragraph_embedding member.
17846 (handle_single_display_spec, next_overlay_string)
17847 (get_overlay_strings_1, reseat_1, reseat_to_string)
17848 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17849 correctly. Don't assume unibyte strings are not bidi-reordered.
17850 (compute_display_string_pos)
17851 (compute_display_string_end): Fix handling the case of C string.
17852 (push_it, pop_it): Save and restore from_disp_prop_p.
17853 (handle_single_display_spec, push_display_prop): Set the
17854 from_disp_prop_p flag.
17855 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17856 (pop_it): Call iterate_out_of_display_property only if we are
17857 popping after iteration over a string that came from a display
17858 property. Fix a typo in popping stretch info. Add an assertion
17859 for verifying that the iterator position is in sync with the bidi
17860 iterator.
17861 (handle_single_display_spec, get_overlay_strings_1)
17862 (push_display_prop): Fix initialization of paragraph direction for
17863 string when that of the parent object is not yet determined.
17864 (reseat_1): Call bidi_init_it to resync the bidi
17865 iterator with IT's position. (Bug#7616)
17866 (find_row_edges): If ROW->start.pos gives position
17867 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17868 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17869 Reset the from_disp_prop_p flag.
17870 (SAVE_IT, RESTORE_IT): New macros.
17871 (pos_visible_p, face_before_or_after_it_pos)
17872 (back_to_previous_visible_line_start)
17873 (move_it_in_display_line_to, move_it_in_display_line)
17874 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17875 (try_scrolling, redisplay_window, display_line): Use them when
17876 saving a temporary copy of the iterator and restoring it back.
17877 (back_to_previous_visible_line_start, reseat_1)
17878 (init_iterator): Empty the bidi cache "stack".
17879 (move_it_in_display_line_to): If iterator ended up at
17880 EOL, but we never saw any buffer positions smaller than
17881 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17882 motion in bidi-reordered lines.
17883 (move_it_in_display_line_to): Record prev_method and prev_pos
17884 immediately before the call to set_iterator_to_next. Fixes cursor
17885 motion in bidi-reordered lines with stretch glyphs and strings
17886 displayed in margins. (Bug#8133) (Bug#8867)
17887 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17888 TO_CHARPOS.
640c8776
SM
17889 (pos_visible_p): Support positions in bidi-reordered lines.
17890 Save and restore bidi cache.
0bb23927
EZ
17891
17892 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17893 (bidi_paragraph_info): Delete unused struct.
17894 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17895 (bidi_cache_start): New variable.
17896 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17897 to zero.
17898 (bidi_cache_fetch_state, bidi_cache_search)
17899 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17900 (bidi_cache_find, bidi_peek_at_next_level)
17901 (bidi_level_of_next_char, bidi_find_other_level_edge)
17902 (bidi_move_to_visually_next): Compare cache index with
17903 bidi_cache_start rather than with zero.
17904 (bidi_fetch_char): Accept new argument STRING; all callers
17905 changed. Support iteration over a string. Support strings with
17906 display properties. Support unibyte strings. Fix the type of
17907 `len' according to what STRING_CHAR_AND_LENGTH expects.
17908 (bidi_paragraph_init, bidi_resolve_explicit_1)
17909 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
17910 (bidi_level_of_next_char, bidi_move_to_visually_next):
17911 Support iteration over a string.
0bb23927
EZ
17912 (bidi_set_sor_type, bidi_resolve_explicit_1)
17913 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17914 can now be zero (for strings); special values 0 and -1 were
17915 changed to -1 and -2, respectively.
17916 (bidi_char_at_pos): New function.
17917 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17918 Call it instead of FETCH_MULTIBYTE_CHAR.
17919 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17920 initialized to valid values.
17921 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17922 values.
17923 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17924 the test for valid cached positions. Fix the logic for looking up
17925 the sentinel state in the cache. GCPRO the Lisp string we are
17926 iterating.
17927 (bidi_push_it, bidi_pop_it): New functions.
17928 (bidi_initialize): Initialize the bidi cache start stack pointer.
17929 (bidi_cache_ensure_space): New function, refactored from part of
17930 bidi_cache_iterator_state. Don't assume the required size is just
17931 one BIDI_CACHE_CHUNK away.
17932 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17933 (bidi_count_bytes, bidi_char_at_pos): New functions.
17934 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17935 always valid if bidi_cache_idx is valid.
17936 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17937 is valid if it's going to be used.
17938 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17939 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
17940 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17941 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
17942 (bidi_find_other_level_edge, bidi_cache_start_stack):
17943 All variables related to cache indices are now EMACS_INT.
c965adc5 17944
0bb23927
EZ
17945 * dispextern.h (struct bidi_string_data): New structure.
17946 (struct bidi_it): New member `string'. Make flag members be 1-bit
17947 fields, and put them last in the struct.
640c8776
SM
17948 (compute_display_string_pos, compute_display_string_end):
17949 Update prototypes.
0bb23927
EZ
17950 (bidi_push_it, bidi_pop_it): Add prototypes.
17951 (struct iterator_stack_entry): New members bidi_p,
17952 paragraph_embedding, and from_disp_prop_p.
17953 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17954 (bidi_shelve_cache, bidi_unshelve_cache):
17955 Declare prototypes.
0bb23927
EZ
17956
17957 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17958 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17959 and vector-like objects.
17960
17961 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17962 cache around display iteration.
17963
17964 * window.c (Fwindow_end, window_scroll_pixel_based)
17965 (displayed_window_lines, Frecenter): Save and restore the bidi
17966 cache around display iteration.
17967
3bbd2265
LMI
179682011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17969
17970 * editfns.c (Fdelete_region): Clarify the use of the named
17971 parameters (bug#6788).
17972
adc47434
MR
179732011-07-14 Martin Rudalics <rudalics@gmx.at>
17974
17975 * indent.c (Fvertical_motion): Set and restore w->pointm when
17976 saving and restoring the window's buffer (Bug#9006).
17977
837c31f8
LMI
179782011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17979
17980 * editfns.c (Fstring_to_char): Clarify just what is returned
17981 (bug#6576). Text by Eli Zaretskii.
17982
ac389d0c
JB
179832011-07-13 Juanma Barranquero <lekktu@gmail.com>
17984
17985 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17986
0be0ce47
EZ
179872011-07-13 Eli Zaretskii <eliz@gnu.org>
17988
17989 * buffer.c (mmap_find): Fix a typo.
17990
cd18e7e3
JB
179912011-07-13 Johan Bockgård <bojohan@gnu.org>
17992
17993 Fix execution of x selection hooks.
17994 * xselect.c (Qx_lost_selection_functions)
17995 (Qx_sent_selection_functions): New vars.
17996 (syms_of_xselect): DEFSYM them.
17997 (x_handle_selection_request): Pass Qx_sent_selection_functions
17998 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17999 (x_handle_selection_clear,x_clear_frame_selections):
18000 Pass Qx_lost_selection_functions rather than
18001 Vx_lost_selection_functions to Frun_hook_with_args.
18002
47ea7f44
PE
180032011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18004
ac389d0c 18005 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18006 The old code sometimes used this field without initializing it.
18007
47ea7f44
PE
18008 * alloc.c (gc_sweep): Don't read past end of array.
18009 In theory, the old code could also have corrupted Emacs internals,
18010 though it'd be very unlikely.
18011
bc985c87
AS
180122011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18013
18014 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18015 argument. (Bug#4026)
bc985c87 18016
0cf34688
LMI
180172011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18018
b3dadd76
LMI
18019 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18020 key" (bug#4257).
18021
0cf34688
LMI
18022 * window.c (Fset_window_start): Doc fix (bug#4199).
18023 (Fset_window_hscroll): Ditto.
18024
270768cd
PE
180252011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18026
077e3dda 18027 Fix minor new problems caught by GCC 4.6.1.
270768cd 18028 * term.c (init_tty): Remove unused local.
490011a6 18029 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18030 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18031 not used otherwise.
270768cd 18032
b1f58454
CY
180332011-07-12 Chong Yidong <cyd@stupidchicken.com>
18034
18035 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18036
22b9578d
LMI
180372011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18038
6e70ab07
LMI
18039 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18040 are the mini-buffer and the echo area (bug#3320).
18041
22b9578d
LMI
18042 * term.c (init_tty): Remove support for supdup, c10 and perq
18043 terminals, which are no longer supported (bug#1482).
18044
8974cc9f
JB
180452011-07-10 Johan Bockgård <bojohan@gnu.org>
18046
18047 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18048
a560d974
JD
180492011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18050
18051 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18052 for non-popups (Bug#3642).
18053
1dae0f0a
AS
180542011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18055
268c2c36 18056 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18057 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18058 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18059 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18060 * data.c (fmod): Likewise.
18061 * dispnew.c (swap_glyphs_in_rows): Likewise.
18062 * emacs.c (memory_warning_signal): Likewise.
18063 * floatfns.c (float_error): Likewise.
18064 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18065 (otf_open, font_otf_capability, generate_otf_features)
18066 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18067 Likewise.
18068 * image.c (pbm_read_file): Likewise.
18069 * indent.c (string_display_width): Likewise.
18070 * intervals.c (check_for_interval, search_for_interval)
18071 (inc_interval_count, count_intervals, root_interval)
18072 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18073 * lread.c (defalias): Likewise.
268c2c36 18074 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18075 * regex.c (set_image_of_range_1, set_image_of_range)
18076 (regex_grow_registers): Likewise.
18077 * sysdep.c (strerror): Likewise.
18078 * termcap.c (valid_filename_p, tprint, main): Likewise.
18079 * tparam.c (main): Likewise.
18080 * unexhp9k800.c (run_time_remap, save_data_space)
18081 (update_file_ptrs, read_header, write_header, calculate_checksum)
18082 (copy_file, copy_rest, display_header): Likewise.
18083 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18084 Likewise.
18085 * xdisp.c (check_it): Likewise.
18086 * xfaces.c (register_color, unregister_color, unregister_colors):
18087 Likewise.
18088 * xfns.c (print_fontset_result): Likewise.
18089 * xrdb.c (member, fatal, main): Likewise.
18090
99033785
PE
180912011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18092
18093 Fix minor problems found by static checking (Bug#9031).
18094 * chartab.c (char_table_set_range, map_sub_char_table):
18095 Remove unused locals.
18096 (uniprop_table): Now static.
18097 * composite.c (_work_char): Remove unused static var.
18098
9cb2ac56
JB
180992011-07-09 Juanma Barranquero <lekktu@gmail.com>
18100
18101 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18102
f25661f0
JD
181032011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18104
18105 * gtkutil.c (qttip_cb): Remove code without function.
18106
8278c4fe
EZ
181072011-07-09 Eli Zaretskii <eliz@gnu.org>
18108
18109 * w32.c (pthread_sigmask): New stub.
18110
1692ae2d 181112011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18112
8a6ebd58 18113 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18114 sigprocmask is portable only for single-threaded applications, and
18115 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18116 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18117 (LIBES): Use it.
18118 * callproc.c (Fcall_process):
18119 * process.c (create_process):
18120 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18121 Use pthread_sigmask, not sigprocmask.
123403e4 18122
1b854618
JD
181232011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18124
18125 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18126 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18127 wrong (Bug#8591).
18128
3fe4b549
JD
181292011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18130
0ce7e563
JD
18131 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18132 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18133 (xg_hide_tooltip): Fix comment.
18134
3fe4b549
JD
18135 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18136 in registerServicesMenuSendTypes.
18137 (validRequestorForSendType): Don't check ns_return_types.
18138
18139 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18140 ns_return_type.
18141
5df75e47
JR
181422011-07-08 Jason Rumney <jasonr@gnu.org>
18143
22610910
JR
18144 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18145 SH_SHOW for hidden windows (Bug#5482).
18146
5df75e47
JR
18147 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18148 frame struct members of non-existent frames (Bug#6284).
18149
699c10bd
JD
181502011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18151
4393663b
JD
18152 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18153 variable firstTime not needed on OSX >= 10.6.
18154 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18155 >= 10.5. Use setKnobProportion, setDoubleValue.
18156
18157 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18158 (MAC_OS_X_VERSION_10_5): Define if not defined.
18159 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18160 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18161 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18162
18163 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18164 cString and lossyCString on OSX >= 10.4.
4393663b 18165
58179cce 18166 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18167 sizeToFit on OSX >= 10.2.
18168
18169 * nsimage.m (allocInitFromFile): Don't use deprecated method
18170 bestRepresentationForDevice on OSX >= 10.6.
18171
18172 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18173 to avoid warning.
18174
18175 * emacs.c: Declare unexec_init_emacs_zone.
18176
a63e0781
JD
18177 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18178
699c10bd
JD
18179 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18180
18181 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18182 on svcsMenu (Bug#8842).
18183
18184 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18185 ns_return_types.
18186 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18187
18188 * nsterm.m (QUTF8_STRING): Declare.
18189 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18190 (validRequestorForSendType): Return type is (id).
18191 Change indexOfObjectIdenticalTo to indexOfObject.
18192 Check if we have local selection before returning self (Bug#8842).
18193 (writeSelectionToPasteboard): Put local selection into paste board
18194 if we have a local selection (Bug#8842).
18195 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18196
18197 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18198 (ns_get_local_selection): Declare.
18199
54e10184
LMI
182002011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18201
9888ff71
LMI
18202 * keymap.c (describe_map_tree): Don't insert a double newline at
18203 the end of the buffer (bug#1169) and return whether we inserted
18204 something.
18205
54e10184
LMI
18206 * callint.c (Fcall_interactively): Change "reading args" to
18207 "providing args" to try to clarify what it does (bug#1010).
18208
15fa4783
KH
182092011-07-07 Kenichi Handa <handa@m17n.org>
18210
18211 * composite.c (composition_compute_stop_pos): Ignore a static
18212 composition starting before CHARPOS (Bug#8915).
18213
18214 * xdisp.c (handle_composition_prop): Likewise.
18215
a8815b00
EZ
182162011-07-07 Eli Zaretskii <eliz@gnu.org>
18217
18218 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18219 (Bug#9015)
18220
ef7b981d 182212011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18222
18223 * character.h (unicode_category_t): New enum type.
18224
18225 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18226 (Qchar_code_property_table): New variable.
18227 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18228 (UNIPROP_COMPRESSED_FORM_P): New macros.
18229 (char_table_ascii): Uncompress the compressed values.
18230 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18231 Uncompress the compressed values.
ac389d0c 18232 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18233 (char_table_ref_and_range): Uncompress the compressed values.
18234 (sub_char_table_set): New arg is_uniprop. Callers changed.
18235 Uncompress the compressed values.
18236 (sub_char_table_set_range): Args changed. Callers changed.
18237 (char_table_set_range): Adjuted for the above change.
18238 (map_sub_char_table): Delete args default_val and parent. Add arg
18239 top. Give decoded values to a Lisp function.
640c8776 18240 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18241 values to a Lisp function. Gcpro more variables.
18242 (uniprop_table_uncompress)
18243 (uniprop_decode_value_run_length): New functions.
18244 (uniprop_decoder, uniprop_decoder_count): New variables.
18245 (uniprop_get_decoder, uniprop_encode_value_character)
18246 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18247 New functions.
18248 (uniprop_encoder, uniprop_encoder_count): New variables.
18249 (uniprop_get_encoder, uniprop_table)
18250 (Funicode_property_table_internal, Fget_unicode_property_internal)
18251 (Fput_unicode_property_internal): New functions.
18252 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18253 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18254 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18255 char-code-property-alist.
18256
640c8776 18257 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18258 Vunicode_category_table.
18259
640c8776 18260 * font.c (font_range): Adjust for the change of
c805dec0
KH
18261 Vunicode_category_table.
18262
76b397fb
DN
182632011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18264
18265 * m/iris4d.h: Remove file, move contents ...
18266 * s/irix6-5.h: ... here.
18267
22b4128e
PE
182682011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18269
18270 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18271 * alloc.c (mark_buffer):
18272 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18273 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18274 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18275 This isn't true in general, and it's particularly not true
18276 if Emacs is configured with --with-wide-int.
18277 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18278 New macros, used in the buffer.c change.
18279
869795d6
JD
182802011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18281
18282 * xsettings.c: Use both GConf and GSettings if both are available.
18283 (store_config_changed_event): Add comment.
18284 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18285 (store_tool_bar_style_changed): New functions.
5e617bc2 18286 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18287 (struct xsettings): Move font inside HAVE_XFT.
18288 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18289 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18290 Move inside HAVE_XFT.
640c8776 18291 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18292 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18293 also.
18294 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18295 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18296 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18297 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18298 (parse_settings): Move check for font inside HAVE_XFT.
18299 (read_settings, apply_xft_settings): Add comment.
18300 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18301 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18302 call store_font_name_changed.
18303 (xft_settings_event): Add comment.
18304 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18305 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18306 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18307 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18308 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18309 (xsettings_get_system_font, xsettings_get_system_normal_font):
18310 Add comment.
869795d6 18311
d8ed26bd
PE
183122011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18313
18314 Random fixes. E.g., (random) never returned negative values.
18315 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18316 subseconds part to the entropy, as that's a bit more random.
18317 Prefer signed to unsigned, since the signedness doesn't matter and
18318 in general we prefer signed. When given a limit, use a
18319 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18320 latter isn't right if USE_2_TAGS_FOR_INTS.
18321 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18322 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18323
cabf1cac
SM
183242011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18325
18326 * textprop.c (text_property_stickiness):
18327 Obey Vtext_property_default_nonsticky.
18328 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18329 * w32fns.c (syms_of_w32fns):
18330 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18331
6e9b2be9
PE
183322011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18333
18334 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18335 This is more efficient than Ffile_directory_p and avoids a minor race.
18336
90186c68
LMI
183372011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18338
7c301272
LMI
18339 * buffer.c (Foverlay_put): Say what the return value is
18340 (bug#7835).
18341
c4f2d8d4
LMI
18342 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18343 is a directory before asking whether to use the file name
18344 (bug#7564).
ad637907
LMI
18345 (barf_or_query_if_file_exists): Make the "File is a directory"
18346 error be more correct.
c4f2d8d4 18347
90186c68
LMI
18348 * fns.c (Frequire): Remove the mention of the .gz files, since
18349 that's installation-specific, but keep the mention of
18350 `get-load-suffixes'.
18351
da64016e
PE
183522011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18353
18354 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18355 Report string overflow if the output is too long.
18356
7d47b580
JB
183572011-07-04 Juanma Barranquero <lekktu@gmail.com>
18358
a555cb87
JB
18359 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18360 (syms_of_gnutls): Remove duplicate DEFSYM for
18361 Qgnutls_bootprop_verify_hostname_error, an error for
18362 Qgnutls_bootprop_verify_error (which is no longer used).
18363
7d47b580
JB
18364 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18365 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18366 Also (re)move comments that are misplaced or no longer relevant.
18367
1e49bfab
LMI
183682011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18369
18370 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18371
1485f4c0
CY
183722011-07-03 Chong Yidong <cyd@stupidchicken.com>
18373
18374 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18375 and background color parameters if they have been changed.
18376
a9ab721e
LMI
183772011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18378
18379 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18380
cf7cff57
PE
183812011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18382
2e13213d
PE
18383 * xsettings.c (SYSTEM_FONT): Define only when used.
18384 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18385
cf7cff57
PE
18386 * keymap.c (access_keymap_1): Now static.
18387
7a8e04f7
CY
183882011-07-02 Chong Yidong <cyd@stupidchicken.com>
18389
18390 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18391 leave any prefix arg for the up event (Bug#1586).
18392
61352f62
LMI
183932011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18394
69bb1ef7
LMI
18395 * lread.c (syms_of_lread): Mention single symbols defined by
18396 `defvar' or `defconst' (bug#7154).
18397
61352f62 18398 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18399 (Frequire): Mention get-load-suffixes.
61352f62 18400
28545e04
MR
184012011-07-02 Martin Rudalics <rudalics@gmx.at>
18402
18403 * window.h (window): Remove clone_number slot.
18404 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18405 Remove.
18406 (make_parent_window, make_window, saved_window)
18407 (Fset_window_configuration, save_window_save): Don't deal with
18408 clone numbers.
18409 * buffer.c (Qclone_number): Remove declaration.
18410 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18411
3349e122
SM
184122011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18413
18414 Add multiple inheritance to keymaps.
18415 * keymap.c (Fmake_composed_keymap): New function.
18416 (Fset_keymap_parent): Simplify.
18417 (fix_submap_inheritance): Remove.
18418 (access_keymap_1): New function extracted from access_keymap to handle
18419 embedded parents and handle lists of maps.
18420 (access_keymap): Use it.
18421 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18422 (Fcopy_keymap): Handle embedded parents.
18423 (Fcommand_remapping, define_as_prefix): Simplify.
18424 (Fkey_binding): Simplify.
18425 (syms_of_keymap): Move minibuffer-local-completion-map,
18426 minibuffer-local-filename-completion-map,
18427 minibuffer-local-must-match-map, and
18428 minibuffer-local-filename-must-match-map to Elisp.
18429 (syms_of_keymap): Defsubr make-composed-keymap.
18430 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18431 (parse_menu_item): Trivial simplification.
18432
3279eb87
GM
184332011-07-01 Glenn Morris <rgm@gnu.org>
18434
18435 * Makefile.in (SETTINGS_LIBS): Fix typo.
18436
39cb9e56 184372011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18438
18439 * coding.c (Fencode_coding_string): Record the last coding system
18440 used, as the function doc string says (bug#8738).
18441
0949d2b6
JD
184422011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18443
18444 * xsettings.c (store_monospaced_changed): Take new font as arg and
18445 check for change against current_mono_font.
18446 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18447 (emacs_settings_constructor, emacs_settings_get_property)
18448 (emacs_settings_set_property, emacs_settings_class_init)
18449 (emacs_settings_init, gsettings_obj): Remove.
18450 (something_changedCB): New function for HAVE_GSETTINGS.
18451 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18452 with value as argument.
18453 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18454 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18455 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18456 "changed".
18457
18458 * xgselect.c: Add defined (HAVE_GSETTINGS).
18459 (xgselect_initialize): Ditto.
18460
18461 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18462 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18463 xg_select.
18464
bbc6b304
PE
184652011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18466
18467 * eval.c (struct backtrace): Simplify and port the data structure.
18468 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18469 signed bit field, as this assumption is not portable and it makes
18470 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18471 "char debug_on_exit : 1" as this is not portable either; instead,
18472 use the portable "unsigned int debug_on_exit : 1". Remove unused
18473 member evalargs. Remove obsolete comments about cc bombing out.
18474
9851bfc5
JD
184752011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18476
51bb811f 18477 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18478 Let HAVE_GSETTINGS override HAVE_GCONF.
18479 (store_monospaced_changed): New function.
18480 (EMACS_SETTINGS): A new type derived from GObject to handle
18481 GSettings notifications.
18482 (emacs_settings_constructor, emacs_settings_get_property)
18483 (emacs_settings_set_property, emacs_settings_class_init):
18484 New functions.
18485 (gsettings_client, gsettings_obj): New variables.
18486 (GSETTINGS_SCHEMA): New define.
18487 (something_changedCB): Call store_monospaced_changed.
18488 (init_gsettings): New function.
18489 (xsettings_initialize): Call init_gsettings.
18490 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18491 to NULL.
18492
640c8776 18493 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18494 GCONF_CFLAGS/LIBS.
18495
5386012d
MR
184962011-06-29 Martin Rudalics <rudalics@gmx.at>
18497
18498 * window.c (resize_root_window, grow_mini_window)
18499 (shrink_mini_window): Rename Qresize_root_window to
18500 Qwindow_resize_root_window and Qresize_root_window_vertically to
18501 Qwindow_resize_root_window_vertically.
18502
f13e0b08
PE
185032011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18504
18505 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18506
94515237
JB
185072011-06-27 Juanma Barranquero <lekktu@gmail.com>
18508
18509 * makefile.w32-in: Redesign dependencies so they reflect more
18510 clearly which files are directly included by each source file,
18511 and not through other includes.
18512
e43b6e43
MR
185132011-06-27 Martin Rudalics <rudalics@gmx.at>
18514
18515 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18516 (sort_overlays, overlay_strings): When an overlay's clone number
18517 matches the window's clone number process the overlay even if
18518 the overlay's window property doesn't match the current window.
18519
d68443dc
MR
18520 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18521 (Fwindow_hchild): Rename to Fwindow_left_child.
18522 (Fwindow_next): Rename to Fwindow_next_sibling.
18523 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18524 (resize_window_check): Rename to window_resize_check.
18525 (resize_window_apply): Rename to window_resize_apply.
18526 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18527 (Fdelete_other_windows_internal, resize_frame_windows)
18528 (Fsplit_window_internal, Fdelete_window_internal)
18529 (grow_mini_window, shrink_mini_window)
18530 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18531
c7e73be5
JD
185322011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18533
18534 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18535 (emacs_fixed_set_min_size): Remove.
18536 (emacs_fixed_new): Take frame as argument.
18537
18538 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18539 (_EmacsFixedPrivate): Remove minwidth/height.
18540 Add struct frame *f.
18541 (emacs_fixed_init): Initialize priv->f.
18542 (get_parent_class, emacs_fixed_set_min_size): Remove.
18543 (emacs_fixed_new): Set priv->f to argument.
18544 (emacs_fixed_get_preferred_width)
18545 (emacs_fixed_get_preferred_height): Use min_width/height from
18546 frames size_hint to set minimum and natural (Bug#8919).
18547 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18548 and use min_width/height from frames size_hint to set
18549 min_width/height (Bug#8919).
18550
18551 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18552 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18553 Fix indentation.
c7e73be5 18554
cf99dcf8
EZ
185552011-06-26 Eli Zaretskii <eliz@gnu.org>
18556
18557 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18558 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18559 called at ZV.
18560
029529ac
CY
185612011-06-26 Chong Yidong <cyd@stupidchicken.com>
18562
18563 * process.c (wait_reading_process_output): Bypass select if
18564 waiting for a cell while ignoring keyboard input, and input is
18565 pending. Suggested by Jan Djärv (Bug#8869).
18566
7a7ef429
PE
185672011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18568
18569 Use gnulib's dup2 module instead of rolling our own.
18570 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18571
11fdef7d 185722011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
18573
18574 * dispnew.c (scrolling_window): Before scrolling, turn off a
18575 mouse-highlight in the window being scrolled.
18576
cd3520a4
JB
185772011-06-24 Juanma Barranquero <lekktu@gmail.com>
18578
18579 Move DEFSYM to lisp.h and use everywhere.
18580
18581 * character.h (DEFSYM): Move declaration...
18582 * lisp.h (DEFSYM): ...here.
18583
18584 * gnutls.c:
18585 * minibuf.c:
18586 * w32menu.c:
18587 * w32proc.c:
18588 * w32select.c: Don't include character.h.
18589
18590 * alloc.c (syms_of_alloc):
18591 * buffer.c (syms_of_buffer):
18592 * bytecode.c (syms_of_bytecode):
18593 * callint.c (syms_of_callint):
18594 * casefiddle.c (syms_of_casefiddle):
18595 * casetab.c (init_casetab_once):
18596 * category.c (init_category_once, syms_of_category):
18597 * ccl.c (syms_of_ccl):
18598 * cmds.c (syms_of_cmds):
18599 * composite.c (syms_of_composite):
18600 * dbusbind.c (syms_of_dbusbind):
18601 * dired.c (syms_of_dired):
18602 * dispnew.c (syms_of_display):
18603 * doc.c (syms_of_doc):
18604 * editfns.c (syms_of_editfns):
18605 * emacs.c (syms_of_emacs):
18606 * eval.c (syms_of_eval):
18607 * fileio.c (syms_of_fileio):
18608 * fns.c (syms_of_fns):
18609 * frame.c (syms_of_frame):
18610 * fringe.c (syms_of_fringe):
18611 * insdel.c (syms_of_insdel):
18612 * keymap.c (syms_of_keymap):
18613 * lread.c (init_obarray, syms_of_lread):
18614 * macros.c (syms_of_macros):
18615 * msdos.c (syms_of_msdos):
18616 * print.c (syms_of_print):
18617 * process.c (syms_of_process):
18618 * search.c (syms_of_search):
18619 * sound.c (syms_of_sound):
18620 * syntax.c (init_syntax_once, syms_of_syntax):
18621 * terminal.c (syms_of_terminal):
18622 * textprop.c (syms_of_textprop):
18623 * undo.c (syms_of_undo):
18624 * w32.c (globals_of_w32):
18625 * window.c (syms_of_window):
18626 * xdisp.c (syms_of_xdisp):
18627 * xfaces.c (syms_of_xfaces):
18628 * xfns.c (syms_of_xfns):
18629 * xmenu.c (syms_of_xmenu):
18630 * xsettings.c (syms_of_xsettings):
18631 * xterm.c (syms_of_xterm): Use DEFSYM.
18632
4228cf16
TZ
186332011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18634
cd3520a4 18635 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 18636
7fcccf1e
PE
186372011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18638
7efb4e0e
PE
18639 Integer and buffer overflow fixes (Bug#8873).
18640
ff5844ad
PE
18641 * print.c (printchar, strout): Check for string overflow.
18642 (PRINTPREPARE, printchar, strout):
18643 Don't set size unless allocation succeeds.
18644
90532f02
PE
18645 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18646 for sizes. Check for string overflow more accurately.
18647 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18648
6d84508d
PE
18649 * macros.c: Integer and buffer overflow fixes.
18650 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18651 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18652 Use ptrdiff_t, not int, for sizes.
18653 Don't increment bufsize until after realloc succeeds.
18654 Check for size-calculation overflow.
18655 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18656
437b2cb4
PE
18657 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18658
8b9ac8b4
PE
18659 * lread.c: Integer overflow fixes.
18660 (read_integer): Radix is now EMACS_INT, not int,
18661 to improve quality of diagnostics for out-of-range radices.
18662 Calculate buffer size correctly for out-of-range radices.
18663 (read1): Check for integer overflow in radices, and in
18664 read-circle numbers.
82cb60d3
PE
18665 (read_escape): Avoid int overflow.
18666 (Fload, openp, read_buffer_size, read1)
18667 (substitute_object_recurse, read_vector, read_list, map_obarray):
18668 Use ptrdiff_t, not int, for sizes.
18669 (read1): Use EMACS_INT, not int, for sizes.
20270765 18670 Check for size overflow.
8b9ac8b4 18671
7fcccf1e
PE
18672 * image.c (cache_image): Check for size arithmetic overflow.
18673
bfbbd7e7
PE
18674 * lread.c: Integer overflow issues.
18675 (saved_doc_string_size, saved_doc_string_length)
18676 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18677 Now ptrdiff_t, not int.
18678 (read1): Don't assume doc string length fits in int. Check for
18679 out-of-range doc string lengths.
18680 (read_list): Don't assume file position fits in int.
39019e54 18681 (read_escape): Check for hex character overflow.
bfbbd7e7 18682
4e323265
LL
186832011-06-22 Leo Liu <sdl.web@gmail.com>
18684
18685 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18686 Move to minibuffer.el.
18687
85fece3e
PE
186882011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18689
20b84ce9 18690 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
18691 The following patches are for when GLYPH_DEBUG && !XASSERT.
18692 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18693 * dispnew.c (flush_stdout):
18694 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18695 Mark as externally visible.
18696 * dispnew.c (check_window_matrix_pointers): Now static.
18697 * dispnew.c (window_to_frame_vpos):
18698 * xfns.c (unwind_create_frame):
18699 * xterm.c (x_check_font): Remove unused local.
18700 * scroll.c (CHECK_BOUNDS):
18701 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18702 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18703 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18704 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18705 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18706 Now static.
18707 (debug_method_add): Use va_list and vsprintf rather than relying
18708 on undefined behavior with wrong number of arguments.
18709 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18710 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18711 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18712 since we're not interested in debugging glyphs with old libraries.
18713 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18714 GCC 4.6.0's static checking.
18715
0766b489
PE
187162011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18717
31fd4b32
PE
18718 Integer overflow and signedness fixes (Bug#8873).
18719 A few related buffer overrun fixes, too.
18720
b79e8648
PE
18721 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18722
0766b489
PE
18723 * dispextern.h (struct face.stipple):
18724 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18725 (x_bitmap_mask, x_allocate_bitmap_record)
18726 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18727 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18728 (x_create_bitmap_from_xpm_data):
18729 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18730 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18731 (.bitmaps_last):
18732 * xfaces.c (load_pixmap):
18733 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18734 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18735 (.bitmaps_last, struct x_output.icon_bitmap):
18736 Use ptrdiff_t, not int, for bitmap indexes.
18737 (x_allocate_bitmap_record): Check for size overflow.
18738 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18739
b081724f
PE
18740 Use ptrdiff_t, not int, for overlay counts.
18741 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18742 * editfns.c (overlays_around, get_pos_property):
18743 * textprop.c (get_char_property_and_overlay):
18744 * xdisp.c (next_overlay_change, note_mouse_highlight):
18745 * xfaces.c (face_at_buffer_position):
21514da7
PE
18746 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18747 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18748 (Fnext_overlay_change, Fprevious_overlay_change)
18749 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 18750 Use ptrdiff_t, not int, for sizes.
21514da7 18751 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 18752
3de73e5e
PE
18753 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18754
2606c57b
PE
18755 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18756 (x_session_initialize): Do not assume string length fits in int.
18757
aaafe47a
PE
18758 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18759 This is unlikely, but can occur if DPI is outlandish.
18760
2674ddc8 18761 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
18762 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18763
28154962
PE
18764 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18765 * xrdb.c (magic_file_p, search_magic_path):
18766 Omit last arg SUFFIX; it was always 0. All callers changed.
18767 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18768
7de51af5
PE
18769 * xfont.c (xfont_match): Avoid need for strlen.
18770
25ed6cc3
PE
18771 * xfns.c: Don't assume strlen fits in int.
18772 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18773
4eab31dd
PE
18774 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18775 not unsigned long, as we prefer signed integers. All callers changed.
18776 Detect integer overflow in repeat count.
18777 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 18778 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 18779
171e2a58
PE
18780 * termcap.c: Don't assume sizes fit in int and never overflow.
18781 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18782 (gobble_line): Check for size-calculation overflow.
18783
ad39faca 18784 * minibuf.c (Fread_buffer):
6e5bb2dc 18785 * lread.c (intern, intern_c_string):
74ca2eb3
PE
18786 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18787 Don't assume string length fits in int.
18788
52c61c22 18789 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
18790 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18791
b5b8c9e5
PE
18792 * font.c: Don't assume string length fits in int.
18793 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18794 Use ptrdiff_t, not int.
ccd6111c
PE
18795 (font_intern_prop): Don't assume string length fits in int.
18796 Don't assume integer property fits in fixnum.
18797 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 18798
882f0d81 18799 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 18800 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
18801 Reformulate so as not to need the command string.
18802 Invoke gzip -cd rather than gunzip, as it's more portable.
18803 (lock_info_type, lock_file_1, lock_file):
18804 Don't assume pid_t and time_t fit in unsigned long.
18805 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18806 (current_lock_owner): Prefer signed type for sizes.
18807 Use memcpy, not strncpy, where memcpy is what is really wanted.
18808 Don't assume (via atoi) that time_t and pid_t fit in int.
18809 Check for time_t and/or pid_t out of range, e.g., via a network share.
18810 Don't alloca where an auto var works fine.
18811
93f4cf88
PE
18812 * fileio.c: Fix some integer overflow issues.
18813 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18814 Don't assume string length fits in int.
18815 (directory_file_name): Don't assume string length fits in long.
18816 (make_temp_name): Don't assume pid fits in int, or that its print
18817 length is less than 20.
18818
f3e92b69
PE
18819 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18820
1bfdaf10
PE
18821 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18822
35016e9a
PE
18823 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18824
3d1e65a1
PE
18825 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18826 We prefer signed integers, even for size calculations.
18827
0b963a93
PE
18828 * emacs.c: Don't assume string length fits in 'int'.
18829 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18830 (main): Don't invoke strlen when not needed.
18831
573f4b54
PE
18832 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18833 (XD_DEBUG_MESSAGE): Don't waste a byte.
18834
989f33ba
PE
18835 * callproc.c (getenv_internal_1, getenv_internal)
18836 (Fgetenv_internal):
965d34eb
PE
18837 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18838
e4d29b33
PE
18839 * lread.c (invalid_syntax): Omit length argument.
18840 All uses changed. This doesn't fix a bug, but it simplifies the
18841 code away from its former Hollerith-constant appearance, and it's
18842 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 18843 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 18844
eb49b136
PE
18845 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18846 This didn't break anything, but it didn't help either.
18847 It's confusing to put a bogus integer in a place where the actual
18848 value does not matter.
9f62aeb1 18849 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 18850 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 18851
15375a22
PE
18852 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18853 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18854 implementation.
b61cc01c
PE
18855 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18856 We prefer signed types, and the value cannot exceed the EMACS_INT
18857 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
18858 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18859 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18860 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 18861
53b2623d
PE
18862 * indent.c (sane_tab_width): New function.
18863 (current_column, scan_for_column, Findent_to, position_indentation)
18864 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 18865 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 18866
51cab52b 18867 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 18868
f2ed8a70
PE
18869 * lisp.h (lint_assume): New macro.
18870 * composite.c (composition_gstring_put_cache):
18871 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18872
abe80cc6
PE
18873 * editfns.c, insdel.c:
18874 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 18875
b02c740e
PE
18876 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18877
ebc96716
PE
18878 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18879
b4e50fa0 18880 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 18881 Use much-faster test for byte-length change.
311d5d7c 18882 Don't assume string byte-length fits in 'int'.
a4cf38e4 18883 Check that character arg fits in 'int'.
85461888 18884 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 18885
c0c1ee9f
PE
18886 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18887
a498d7f4
PE
18888 * fns.c (concat): Catch string overflow earlier.
18889 Do not rely on integer wraparound.
18890
51cab52b
PE
18891 * dispextern.h (struct it.overlay_strings_charpos)
18892 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
18893 * xdisp.c (forward_to_next_line_start)
18894 (back_to_previous_visible_line_start)
18895 (reseat_at_next_visible_line_start, next_element_from_buffer):
18896 Don't arbitrarily truncate the value of 'selective' to int.
18897
76031fad
PE
18898 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18899
5eb55db9
PE
18900 * composite.c: Don't truncate sizes to 'int'.
18901 (composition_gstring_p, composition_reseat_it)
18902 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
18903 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18904 not EMACS_UINT, for indexes.
5eb55db9 18905
0703a717
PE
18906 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18907
d6202519
PE
18908 * buffer.c: Include <verify.h>.
18909 (struct sortvec.priority, struct sortstr.priority):
8961a454 18910 Now EMACS_INT, not int.
c20998a7 18911 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
18912 (struct sortstr.size, record_overlay_string)
18913 (struct sortstrlist.size, struct sortlist.used):
18914 Don't truncate size to int.
18915 (record_overlay_string): Check for size-calculation overflow.
d6202519 18916 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 18917
d5a19415
JM
189182011-06-22 Jim Meyering <meyering@redhat.com>
18919
029529ac 18920 Don't leak an XBM-image-sized buffer
d5a19415
JM
18921 * image.c (xbm_load): Free the image buffer after using it.
18922
a9041e6c
PE
189232011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18924
18925 Port to Sun C.
18926 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18927 that Sun C diagnosed.
18928 * fns.c (secure_hash): Fix pointer signedness issue.
18929 * intervals.c (static_offset_intervals): New function.
18930 (offset_intervals): Use it.
18931
7f3f739f
LL
189322011-06-21 Leo Liu <sdl.web@gmail.com>
18933
18934 * deps.mk (fns.o):
18935 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18936 sha512.h.
18937
18938 * fns.c (secure_hash): Rename from crypto_hash_function and change
18939 the first arg to accept symbols.
5b66d427 18940 (Fsecure_hash): New primitive.
7f3f739f
LL
18941 (syms_of_fns): New symbols.
18942
76147d94
DD
189432011-06-20 Deniz Dogan <deniz@dogan.se>
18944
18945 * process.c (Fset_process_buffer): Clarify return value in
18946 docstring.
18947
7d7d0045
CY
189482011-06-18 Chong Yidong <cyd@stupidchicken.com>
18949
18950 * dispnew.c (add_window_display_history): Use BVAR.
18951
18952 * xdisp.c (debug_method_add): Use BVAR.
18953 (check_window_end, dump_glyph_matrix, dump_glyph)
18954 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18955
18956 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18957 Likewise.
18958
18959 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18960 check till after the cache is created in init_frame_faces.
18961
ff2bc410
SM
189622011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18963
18964 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18965
28177add
PE
189662011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18967
dd3482fe
PE
18968 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18969 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18970 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18971
393d71f3 18972 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18973 * fileio.c (Finsert_file_contents):
18974 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18975 Remove the old (too-loose) buffer overflow checks.
18976 They weren't needed, since make_gap checks for buffer overflow.
18977 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18978 The old code merely checked for Emacs fixnum overflow, and relied
18979 on undefined (wraparound) behavior. The new code avoids undefined
18980 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18981
2e6813b0 18982 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18983 Tune. Don't use wider integers than needed. Don't use alloca.
18984 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18985
599a9e4f
PE
18986 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18987
99561444
PE
18988 * insdel.c, lisp.h (buffer_overflow): New function.
18989 (insert_from_buffer_1, replace_range, replace_range_2):
18990 * insdel.c (make_gap_larger):
18991 * editfns.c (Finsert_char):
18992 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18993
28177add
PE
18994 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18995
e69dafad
PE
189962011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18997
4baa020d 18998 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18999
b1c46f02
PE
19000 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19001 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19002
e69dafad
PE
19003 * fileio.c: Don't assume EMACS_INT fits in off_t.
19004 (emacs_lseek): New static function.
19005 (Finsert_file_contents, Fwrite_region): Use it.
19006 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19007
566684ea
PE
19008 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19009
e6966cd6
PE
19010 * fns.c: Don't overflow int when computing a list length.
19011 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19012 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19013 truncation on 64-bit hosts. Check for QUIT every
19014 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19015 faster and is responsive enough.
19016 (Flength): Report an error instead of overflowing an integer.
19017 (Fsafe_length): Return a float if the value is not representable
19018 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19019 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19020 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19021
dd0b0efb
PE
19022 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19023 (header_size, word_size): New constants.
19024 (allocate_vectorlike): Don't check size overflow here.
19025 (allocate_vector): Check it here instead, since this is the only
19026 caller of allocate_vectorlike that could cause overflow.
19027 Check that the new vector's length is representable as a fixnum.
19028
86fe5cfe
PE
19029 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19030 The previous code was bogus. For example, next_almost_prime (32)
19031 returned 39, which is undesirable as it is a multiple of 3; and
19032 next_almost_prime (24) returned 25, which is a multiple of 5 so
19033 why was the code bothering to check for multiples of 7?
19034
80e88859
PE
19035 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19036
4a2f0ad6
PE
19037 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19038
f66c7cf8
PE
19039 Variadic C functions now count arguments with ptrdiff_t.
19040 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19041 Back then I didn't know that the Emacs coding style prefers signed int.
19042 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19043 were being counted with int, which may truncate counts on 64-bit
19044 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19045 * lisp.h (struct Lisp_Subr.function.aMANY)
19046 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19047 Arg counts are now ptrdiff_t, not size_t.
19048 All variadic functions and their callers changed accordingly.
19049 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19050 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19051 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19052 * callint.c (Fcall_interactively): Check arg count for overflow,
19053 to avoid potential buffer overrun. Use signed char, not 'int',
19054 for 'varies' array, so that we needn't bother to check its size
19055 calculation for overflow.
19056 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19057 * eval.c (apply_lambda):
19058 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19059 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19060 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19061
a1759b76
PE
19062 * callint.c (Fcall_interactively): Don't use index var as event count.
19063
d96be9fc
PE
19064 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19065 * mem-limits.h (SIZE): Remove; no longer used.
19066
a690a978 19067 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19068
578c21e6
PE
19069 Remove unnecessary casts.
19070 * xterm.c (x_term_init):
19071 * xfns.c (x_set_border_pixel):
19072 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19073 These aren't needed now that we assume ANSI C.
19074
96f53c6c
PE
19075 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19076 It's more likely to cause problems (due to unsigned overflow)
19077 than to cure them.
19078
83c77d31
PE
19079 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19080
ee2079f1
PE
19081 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19082
6da65536
PE
19083 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19084
7147c4a4
PE
19085 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19086
193e32d9
PE
19087 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19088
e5533da6
PE
19089 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19090
9910e595
PE
19091 GLYPH_CODE_FACE returns EMACS_INT, not int.
19092 * dispextern.h (merge_faces):
19093 * xfaces.c (merge_faces):
01103c44
PE
19094 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19095 Don't assume EMACS_INT fits in int.
9910e595 19096
2638320e
PE
19097 * character.h (CHAR_VALID_P): Remove unused parameter.
19098 * fontset.c, lisp.h, xdisp.c: All uses changed.
19099
045eb8d9
PE
19100 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19101
c1f134b5
PE
19102 * fns.c (concat): Minor tuning based on overflow analysis.
19103 This doesn't fix any bugs. Use int to hold character, instead
19104 of constantly refetching from Emacs object. Use XFASTINT, not
19105 XINT, for value known to be a character. Don't bother comparing
19106 a single byte to 0400, as it's always less.
19107
395fcb93 19108 * floatfns.c (Fexpt):
327eeec8
PE
19109 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19110
abbd3d23
PE
19111 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19112 for characters.
19113
684a03ef
PE
19114 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19115
0fed43f3
PE
19116 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19117 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19118 incorrectly succeed when S was a string, because 4294967386 was
19119 truncated before it was used.
19120
8fd02eb7
PE
19121 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19122 Otherwise, an out-of-range integer could cause undefined behavior
19123 on a 64-bit host.
19124
f8c86b69
PE
19125 * composite.c: Use int, not EMACS_INT, for characters.
19126 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19127 EMACS_INT, for values that are known to be in character range.
19128 This doesn't fix any bugs but is the usual style inside Emacs and
19129 may generate better code on 32-bit machines.
19130
34206dd2
PE
19131 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19132 This is for reasons similar to the recent CHAR_STRING fix.
19133 * charset.c (Fencode_char): Check that character arg is actually
19134 a character. Pass an int to ENCODE_CHAR.
19135 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19136 wider than 'int', as a compile-time check to prevent future regressions
19137 in this area.
19138
c5958d4c 19139 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19140
19141 Make sure a 64-bit char is never passed to CHAR_STRING.
19142 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19143 by silently ignoring the top 32 bits, allowing some values
19144 that were far too large to be valid characters.
19145 * character.h: Include <verify.h>.
19146 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19147 arguments are no wider than unsigned, as a compile-time check
19148 to prevent future regressions in this area.
19149 * data.c (Faset):
01103c44 19150 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19151 (Fsubst_char_in_region):
19152 * fns.c (concat):
19153 * xdisp.c (decode_mode_spec_coding):
19154 Adjust to CHAR_STRING's new requirement.
19155 * editfns.c (Finsert_char, Fsubst_char_in_region):
19156 * fns.c (concat): Check that character args are actually
19157 characters. Without this test, these functions did the wrong
19158 thing with wildly out-of-range values on 64-bit hosts.
19159
d37ca623
PE
19160 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19161 These casts should not be needed on 32-bit hosts, either.
19162 * keyboard.c (read_char):
19163 * lread.c (Fload): Remove casts to unsigned.
19164
ea204efb
PE
19165 * lisp.h (UNSIGNED_CMP): New macro.
19166 This fixes comparison bugs on 64-bit hosts.
19167 (ASCII_CHAR_P): Use it.
19168 * casefiddle.c (casify_object):
01103c44 19169 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19170 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19171 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19172 * dispextern.h (FACE_FROM_ID):
19173 * keyboard.c (read_char): Use UNSIGNED_CMP.
19174
41cb286c
PE
19175 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19176 not to EMACS_INT, to avoid GCC warning.
19177
4a1b9832
PE
19178 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19179
55daad71
PE
19180 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19181 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19182 isn't needed on 32-bit machines.
8f95c75c 19183
01103c44
PE
19184 * buffer.c (Fgenerate_new_buffer_name):
19185 Use EMACS_INT for count, not int.
0ceccced 19186 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19187
19188 * data.c (Qcompiled_function): Now static.
19189
c6f072e7
PE
19190 * window.c (window_body_lines): Now static.
19191
20ce5912
PE
19192 * image.c (gif_load): Rename local to avoid shadowing.
19193
9c4c5f81
PE
19194 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19195 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19196 * alloc.c (make_save_value): Integer argument is now of type
19197 ptrdiff_t, not int.
19198 (mark_object): Use ptrdiff_t, not int.
19199 * lisp.h (pD): New macro.
19200 * print.c (print_object): Use it.
19201
c0c5c8ae
PE
19202 * alloc.c: Use EMACS_INT, not int, to count objects.
19203 (total_conses, total_markers, total_symbols, total_vector_size)
19204 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19205 (total_free_floats, total_floats, total_free_intervals)
19206 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19207 Now EMACS_INT, not int. All uses changed.
19208 (Fgarbage_collect): Compute overall total using a double, so that
19209 integer overflow is less likely to be a problem. Check for overflow
19210 when converting back to an integer.
5a25e253
PE
19211 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19212 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19213 These were 'int' variables that could overflow on 64-bit hosts;
19214 they were never used, so remove them instead of repairing them.
211a0b2a 19215 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19216 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19217 Previously, this ceilinged at INT_MAX, but that doesn't work on
19218 64-bit machines.
e46bb31a 19219 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19220
c78baabf 19221 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19222 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19223 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19224 when a (possibly-narrower) signed value would do just as well.
19225 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19226
c9d624c6
PE
19227 * alloc.c: Catch some string size overflows that we were missing.
19228 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19229 for convenience in STRING_BYTES_MAX.
19230 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19231 The definition here is exact; the one in lisp.h was approximate.
19232 (allocate_string_data): Check for string overflow. This catches
19233 some instances we weren't catching before. Also, it catches
19234 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19235 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19236 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19237
c9d624c6
PE
19238 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19239 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19240 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19241
353032ce
PE
19242 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19243
2bccce07
PE
19244 * alloc.c (Fmake_string): Check for out-of-range init.
19245
0ac30604
SM
192462011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19247
19248 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19249
c195f2de
JD
192502011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19251
19252 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19253 xg_get_default_scrollbar_width.
19254
19255 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19256 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19257 (style_changed_cb): Call update_theme_scrollbar_width and call
19258 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19259 all frames (Bug#8505).
19260 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19261 Call gtk_window_set_resizable if HAVE_GTK3.
19262 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19263 and height if HAVE_GTK3 (Bug#8505).
19264 (scroll_bar_width_for_theme): New variable.
19265 (update_theme_scrollbar_width): New function.
19266 (xg_get_default_scrollbar_width): Move code to
19267 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19268 (xg_initialize): Call update_theme_scrollbar_width.
19269
19270 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19271
19272 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19273
e10ac9f1
MR
192742011-06-12 Martin Rudalics <rudalics@gmx.at>
19275
19276 * frame.c (make_frame): Call other_buffer_safely instead of
19277 other_buffer.
19278
19279 * window.c (temp_output_buffer_show): Call display_buffer with
19280 second argument Vtemp_buffer_show_specifiers and reset latter
19281 immediately after the call.
19282 (Vtemp_buffer_show_specifiers): New variable.
19283 (auto_window_vscroll_p, next_screen_context_lines)
19284 (Vscroll_preserve_screen_position): Remove leading asterisks from
19285 doc-strings.
19286
2d3c217e 192872011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19288
7b7f97e8 19289 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19290 * buffer.c (Qclone_number): Remove for now, as it's unused.
19291 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19292 (record_buffer): Remove unused local.
19293 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19294 (set_frame_buffer_list): Remove; unused.
19295 * frame.h (other_visible_frames): Remove decl.
19296 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19297 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19298 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19299 if HAVE_GPM.
19300 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19301 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19302 Define only if HAVE_GPM.
19303 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19304 (update_hints_inhibit): Remove; never set. All uses removed.
19305 * widgetprv.h (emacsFrameClassRec): Remove decl.
19306 * window.c (delete_deletable_window): Now returns void, since it
19307 wasn't returning anything.
19308 (compare_window_configurations): Remove unused locals.
19309 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19310 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19311 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19312 the same widths as pointers. This follows up on the 2011-05-06 patch.
19313 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19314 * xterm.h: Likewise.
19315 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19316
1384b89e
JB
193172011-06-12 Juanma Barranquero <lekktu@gmail.com>
19318
19319 * makefile.w32-in: Update dependencies.
19320 (LISP_H): Add lib/intprops.h.
19321
1100a63c
CY
193222011-06-11 Chong Yidong <cyd@stupidchicken.com>
19323
19324 * image.c (gif_load): Add animation frame delay to the metadata.
19325 (syms_of_image): Use DEFSYM. New symbol `delay'.
19326
6198ccd0
MR
193272011-06-11 Martin Rudalics <rudalics@gmx.at>
19328
19329 * window.c (delete_deletable_window): Re-add.
19330 (Fset_window_configuration): Rewrite to handle dead buffers and
19331 consequently deletable windows.
19332 (window_tree, Fwindow_tree): Remove. Supply functionality in
19333 window.el.
19334 (compare_window_configurations): Simplify code.
19335
b6e3633c
AS
193362011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19337
1ab0dee5
AS
19338 * image.c (imagemagick_load_image): Fix type mismatch.
19339 (Fimagemagick_types): Likewise.
19340
b6e3633c
AS
19341 * window.h (replace_buffer_in_windows): Declare.
19342
9397e56f
MR
193432011-06-11 Martin Rudalics <rudalics@gmx.at>
19344
19345 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19346 Qclone_number. Remove external declaration of Qdelete_window.
19347 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19348 code.
640c8776
SM
19349 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19350 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19351 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19352 buffer list implementation.
19353 (other_buffer_safely): New function.
19354 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19355 calls to replace_buffer_in_windows and
19356 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19357 if allowed.
19358 (record_buffer): Inhibit quitting and rewrite using quittable
19359 functions. Run Qbuffer_list_update_hook if allowed.
19360 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19361 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19362 Move switch-to-buffer to window.el.
9397e56f
MR
19363 (bury-buffer): Move to window.el.
19364 (Vbuffer_list_update_hook): New variable.
19365
19366 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19367 section.
19368
19369 * window.h (resize_frame_windows): Move up in code.
19370 (Fwindow_frame): Remove EXFUN.
19371 (replace_buffer_in_all_windows): Remove prototype.
19372 (replace_buffer_in_windows_safely): Add prototype.
19373
19374 * window.c: Declare Qdelete_window static again. Move down
19375 declaration of select_count.
19376 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19377 (Fother_window): Move to window.el.
19378 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19379 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19380 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19381 window.el.
19382 (replace_buffer_in_windows): Implement by calling
19383 Qreplace_buffer_in_windows.
19384 (replace_buffer_in_all_windows): Remove with some functionality
19385 moved into replace_buffer_in_windows_safely.
19386 (replace_buffer_in_windows_safely): New function.
19387 (select_window_norecord, select_frame_norecord): Move in front
19388 of run_window_configuration_change_hook. Remove now obsolete
19389 declarations.
640c8776
SM
19390 (Fset_window_buffer): Rewrite doc-string.
19391 Call Qrecord_window_buffer.
9397e56f
MR
19392 (keys_of_window): Move binding for other-window to window.el.
19393
b50691aa
CY
193942011-06-11 Chong Yidong <cyd@stupidchicken.com>
19395
19396 * dispextern.h (struct image): Replace data member, whose int_val
19397 and ptr_val fields were not used by anything, with a single
19398 lisp_val object.
19399
19400 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19401 (gif_clear_image, gif_load, imagemagick_load_image)
19402 (gs_clear_image, gs_load): Callers changed.
19403
3f754b86
PE
194042011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19405
cca69397
PE
19406 * buffer.h: Include <time.h>, for time_t.
19407 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19408
109e28d0
PE
19409 Fix minor problems found by static checking.
19410
60737f02
PE
19411 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19412
4b66faf3
PE
19413 Make identifiers static if they are not used in other modules.
19414 * data.c (Qcompiled_function, Qframe, Qvector):
19415 * image.c (QimageMagick, Qsvg):
19416 * minibuf.c (Qmetadata):
19417 * window.c (resize_window_check, resize_root_window): Now static.
19418 * window.h (resize_window_check, resize_root_window): Remove decls.
19419
109e28d0
PE
19420 * window.c (window_deletion_count, delete_deletable_window):
19421 Remove; unused.
46a4ce9e
PE
19422 (window_body_lines): Now static.
19423 (Fdelete_other_windows_internal): Mark vars as initialized.
19424 Make sure 'resize_failed' is initialized.
19425 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19426 (resize_window_apply): Remove unused local.
19427 * window.h (delete_deletable_window): Remove decl.
19428
109e28d0 19429 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19430 (imagemagick_load_image): Fix pointer signedness problem by changing
19431 last arg from unsigned char * to char *. All uses changed.
19432 Also, fix a local for similar reasons.
19433 Remove unused locals. Remove locals to avoid shadowing.
19434 (fn_rsvg_handle_free): Remove; unused.
19435 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19436 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19437
3f754b86
PE
19438 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19439
2547adb1
CY
194402011-06-10 Chong Yidong <cyd@stupidchicken.com>
19441
19442 * image.c (gif_load): Fix omitted cast error introduced by
19443 2011-06-06 change.
19444
2c8e37d4
MR
194452011-06-10 Martin Rudalics <rudalics@gmx.at>
19446
19447 * window.h (resize_proportionally, orig_total_lines)
19448 (orig_top_line): Remove from window structure.
19449 (set_window_height, set_window_width, change_window_heights)
19450 (Fdelete_window): Remove prototypes.
19451 (resize_frame_windows): Remove duplicate declaration.
19452
440a42e3
EZ
194532011-06-10 Eli Zaretskii <eliz@gnu.org>
19454
19455 * window.h (resize_frame_windows, resize_window_check)
19456 (delete_deletable_window, resize_root_window)
19457 (resize_frame_windows): Declare prototypes.
19458
19459 * window.c (resize_window_apply): Make definition be "static" to
19460 match the prototype.
19461
562dd5e9
MR
194622011-06-10 Martin Rudalics <rudalics@gmx.at>
19463
19464 * window.c: Remove declarations of Qwindow_size_fixed,
19465 window_min_size_1, window_min_size_2, window_min_size,
19466 size_window, window_fixed_size_p, enlarge_window, delete_window.
19467 Remove static from declaration of Qdelete_window, it's
19468 temporarily needed by Fbury_buffer.
19469 (replace_window): Don't assign orig_top_line and
19470 orig_total_lines.
19471 (Fdelete_window, delete_window): Remove. Window deletion is
19472 handled by window.el.
640c8776
SM
19473 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19474 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19475 (Fdelete_other_windows): Remove. Deleting other windows is
19476 handled by window.el.
19477 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19478 handled in window.el.
19479 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19480 Window minimum sizes are handled in window.el.
19481 (shrink_windows, size_window, set_window_height)
19482 (set_window_width, change_window_heights, window_height)
19483 (window_width, CURBEG, CURSIZE, enlarge_window)
19484 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19485 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19486 handled in window.el.
19487 (make_dummy_parent): Rename to make_parent_window and give it a
19488 second argument horflag.
19489 (make_window): Don't set resize_proportionally any more.
19490 (Fsplit_window): Remove. Windows are split in window.el.
19491 (save_restore_action, save_restore_orig_size)
19492 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19493 Resize mini windows in window.el.
19494 (grow_mini_window, shrink_mini_window): Implement by calling
19495 Qresize_root_window_vertically, resize_window_check and
19496 resize_window_apply.
640c8776
SM
19497 (saved_window, Fset_window_configuration, save_window_save):
19498 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19499 resize_proportionally.
19500 (window_min_height, window_min_width): Move to window.el.
19501 (keys_of_window): Move bindings for delete-other-windows,
19502 split-window, delete-window and enlarge-window to window.el.
19503
19504 * buffer.c: Temporarily extern Qdelete_window.
19505 (Fbury_buffer): Temporarily call Qdelete_window instead of
19506 Fdelete_window (Fbury_buffer will move to window.el soon).
19507
19508 * frame.c (set_menu_bar_lines_1): Remove code handling
19509 orig_top_line and orig_total_lines.
19510
19511 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19512 set_window_height but set heights directly.
19513 (change_frame_size_1): Use resize_frame_windows.
19514
19515 * xdisp.c (init_xdisp): Don't use set_window_height but set
19516 heights directly.
19517
640c8776
SM
19518 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19519 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19520 run_window_configuration_change_hook.
19521
19522 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19523 instead of change_window_heights and run
19524 run_window_configuration_change_hook.
19525
1a13852e
MR
195262011-06-09 Martin Rudalics <rudalics@gmx.at>
19527
19528 * window.c (replace_window): Rename second argument REPLACEMENT to
19529 NEW. New third argument SETFLAG. Rewrite.
19530 (delete_window, make_dummy_parent): Call replace_window with
19531 third argument 1.
19532 (window_list_1): Move down in code.
19533 (run_window_configuration_change_hook): Move set_buffer part
19534 before select_frame_norecord part in order to unwind correctly.
19535 Rename count1 to count.
19536 (recombine_windows, delete_deletable_window, resize_root_window)
19537 (Fdelete_other_windows_internal)
19538 (Frun_window_configuration_change_hook, make_parent_window)
19539 (resize_window_check, resize_window_apply, Fresize_window_apply)
19540 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19541 (Fdelete_window_internal, Fresize_mini_window_internal):
19542 New functions.
1a13852e
MR
19543 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19544
f3d1777e
MR
195452011-06-08 Martin Rudalics <rudalics@gmx.at>
19546
496e208e
MR
19547 * window.h (window): Add some new members to window structure -
19548 normal_lines, normal_cols, new_total, new_normal, clone_number,
19549 splits, nest, prev_buffers, next_buffers.
19550 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19551 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19552
f3d1777e
MR
19553 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19554 Remove.
496e208e
MR
19555 (make_dummy_parent): Set new members of windows structure.
19556 (make_window): Move down in code. Handle new members of window
19557 structure.
19558 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19559 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19560 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19561 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19562 (Fset_window_next_buffers, Fset_window_clone_number):
19563 New functions.
496e208e
MR
19564 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19565 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19566 Doc-string fixes.
19567 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19568 Argument WINDOW can be now internal window too.
19569 (Fwindow_use_time): Move up in code.
19570 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19571 Rewrite doc-string.
19572 (Fset_window_configuration, saved_window)
19573 (Fcurrent_window_configuration, save_window_save): Handle new
19574 members of window structure.
b9e809c2
MR
19575 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19576 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19577 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19578 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19579 Qget_mru_window, Qresize_root_window,
19580 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19581 Qauto_buffer_name; staticpro them.
f3d1777e 19582
abde8f8c
MR
195832011-06-07 Martin Rudalics <rudalics@gmx.at>
19584
19585 * window.c (Fwindow_total_size, Fwindow_left_column)
19586 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19587 (Fwindow_list_1): New functions.
19588 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
19589 (Fwindow_width, Fscroll_left, Fscroll_right):
19590 Use window_body_cols instead of window_box_text_cols.
19591 (delete_window, Fset_window_configuration):
19592 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
19593 (delete_all_subwindows): Take a window as argument and not a
19594 structure. Rewrite.
190b47e6
MR
19595 (window_loop): Remove handling of GET_LRU_WINDOW and
19596 GET_LARGEST_WINDOW.
19597 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
19598
19599 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
19600 window_box_text_cols. delete_all_subwindows now takes a
19601 Lisp_Object as argument.
abde8f8c 19602
640c8776
SM
19603 * indent.c (compute_motion, Fcompute_motion):
19604 Use window_body_cols instead of window_box_text_cols.
abde8f8c 19605
fa8a67e6
MR
19606 * frame.c (delete_frame): Call delete_all_subwindows with root
19607 window as argument.
19608
a54e3482
DC
196092011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19610
19611 * fns.c (Fputhash): Document return value.
19612
60002bf5
CY
196132011-06-06 Chong Yidong <cyd@stupidchicken.com>
19614
19615 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19616
0c671da6 196172011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 19618
b862a52a 19619 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 19620
be44ca6c
PE
19621 Check for overflow when converting integer to cons and back.
19622 * charset.c (Fdefine_charset_internal, Fdecode_char):
19623 Use cons_to_unsigned to catch overflow.
19624 (Fencode_char): Use INTEGER_TO_CONS.
19625 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19626 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19627 * data.c (long_to_cons, cons_to_long): Remove.
19628 (cons_to_unsigned, cons_to_signed): New functions.
19629 These signal an error for invalid or out-of-range values.
19630 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19631 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19632 * font.c (Ffont_variation_glyphs):
19633 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19634 * lisp.h: Include <intprops.h>.
19635 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19636 (cons_to_signed, cons_to_unsigned): New decls.
19637 (long_to_cons, cons_to_long): Remove decls.
19638 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19639 (Fprimitive_undo): Use CONS_TO_INTEGER.
19640 * xfns.c (Fx_window_property): Likewise.
19641 * xselect.c: Include <limits.h>.
19642 (x_own_selection, selection_data_to_lisp_data):
19643 Use INTEGER_TO_CONS.
19644 (x_handle_selection_request, x_handle_selection_clear)
19645 (x_get_foreign_selection, Fx_disown_selection_internal)
19646 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19647 (lisp_data_to_selection_data): Use cons_to_unsigned.
19648 (x_fill_property_data): Use cons_to_signed.
19649 Report values out of range.
19650
d1f3d2af
PE
19651 Check for buffer and string overflow more precisely.
19652 * buffer.h (BUF_BYTES_MAX): New macro.
19653 * lisp.h (STRING_BYTES_MAX): New macro.
19654 * alloc.c (Fmake_string):
19655 * character.c (string_escape_byte8):
19656 * coding.c (coding_alloc_by_realloc):
19657 * doprnt.c (doprnt):
19658 * editfns.c (Fformat):
19659 * eval.c (verror):
19660 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19661 since they may not be the same number.
19662 * editfns.c (Finsert_char):
19663 * fileio.c (Finsert_file_contents):
19664 Likewise for BUF_BYTES_MAX.
19665
dd52fcea
PE
19666 * image.c: Use ptrdiff_t, not int, for sizes.
19667 (slurp_file): Switch from int to ptrdiff_t.
19668 All uses changed.
19669 (slurp_file): Check that file size fits in both size_t (for
19670 malloc) and ptrdiff_t (for sanity and safety).
19671
7f9bbdbb
PE
19672 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19673 if b->modtime has its maximal value.
19674
dfe18f82
PE
19675 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19676
84acfcf0
PE
19677 Don't assume time_t can fit into int.
19678 * buffer.h (struct buffer.modtime): Now time_t, not int.
19679 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19680 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19681
ccd9a01a
PE
19682 Minor fixes for signed vs unsigned integers.
19683 * character.h (MAYBE_UNIFY_CHAR):
19684 * charset.c (maybe_unify_char):
19685 * keyboard.c (read_char, reorder_modifiers):
19686 XINT -> XFASTINT, since the integer must be nonnegative.
19687 * ftfont.c (ftfont_spec_pattern):
19688 * keymap.c (access_keymap, silly_event_symbol_error):
19689 XUINT -> XFASTINT, since the integer must be nonnegative.
19690 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19691 since it makes no difference and we prefer signed.
19692 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19693 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19694 nonnegative.
19695
d6d100dd
SM
196962011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19697
19698 * window.h (Fwindow_frame): Declare.
19699
2b6148e4
PE
197002011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19701
19702 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19703 (SPARE_MEMORY): Always define.
19704 (LARGE_REQUEST): Remove.
19705 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19706
f230ecc9
MR
197072011-06-06 Martin Rudalics <rudalics@gmx.at>
19708
727e958e
MR
19709 * lisp.h: Move EXFUNS for Fframe_root_window,
19710 Fframe_first_window and Fset_frame_selected_window to window.h.
19711
19712 * window.h: Move EXFUNS for Fframe_root_window,
19713 Fframe_first_window and Fset_frame_selected_window here from
19714 lisp.h.
19715
19716 * frame.c (Fwindow_frame, Fframe_first_window)
19717 (Fframe_root_window, Fframe_selected_window)
19718 (Fset_frame_selected_window): Move to window.c.
19719 (Factive_minibuffer_window): Move to minibuf.c.
19720 (Fother_visible_frames_p): New function.
19721
19722 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19723
f230ecc9
MR
19724 * window.c (decode_window, decode_any_window): Move up in code.
19725 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19726 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
19727 (Fwindow_buffer): Move up and rewrite doc-string.
19728 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19729 (Fwindow_prev): New functions.
727e958e
MR
19730 (Fwindow_frame): Move here from frame.c. Accept any window as
19731 argument.
19732 (Fframe_root_window, Fframe_first_window)
19733 (Fframe_selected_window): Move here from frame.c. Accept frame
19734 or arbitrary window as argument. Update doc-strings.
19735 (Fminibuffer_window): Move up in code.
19736 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
19737 (Fset_frame_selected_window): Move here from frame.c.
19738 Marginal rewrite.
727e958e
MR
19739 (Fselected_window, select_window, Fselect_window): Move up in
19740 code. Minor doc-string fixes.
f230ecc9 19741
4d09bcf6
PE
197422011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19743
19744 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19745 Do not assume that spare memory exists; that assumption is valid
19746 only if SYSTEM_MALLOC.
19747 (LARGE_REQUEST): New macro, so that the issue of large requests
19748 is separated from the issue of spare memory.
19749
810928a2
AS
197502011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19751
172418ad
AS
19752 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19753 format. (Bug#8806)
19754
43f862f7
AS
19755 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19756
810928a2
AS
19757 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19758 before statements.
19759
a059fe24
JD
197602011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19761
19762 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19763
19764 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19765
19766 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19767 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19768
989bf368
JB
197692011-06-05 Juanma Barranquero <lekktu@gmail.com>
19770
19771 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19772
4b80f674
CY
197732011-06-04 Chong Yidong <cyd@stupidchicken.com>
19774
19775 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19776 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
19777 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19778 New error handlers.
4b80f674
CY
19779 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19780 Obey Vx_select_enable_clipboard_manager. Catch errors in
19781 x_clipboard_manager_save (Bug#8779).
19782 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 19783 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 19784
99a33b77 197852011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
19786
19787 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19788
99a33b77 197892011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
19790
19791 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19792 in the current matrix if keep_current_p is non-zero.
19793
8264569d
EZ
197942011-06-04 Eli Zaretskii <eliz@gnu.org>
19795
19796 * bidi.c (bidi_level_of_next_char): Fix last change.
19797
57f97249
EZ
197982011-06-03 Eli Zaretskii <eliz@gnu.org>
19799
fec2107c 19800 Support bidi reordering of text covered by display properties.
57f97249 19801
fec2107c
EZ
19802 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19803 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19804 (bidi_cache_search, bidi_cache_iterator_state)
19805 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
19806 (bidi_level_of_next_char, bidi_move_to_visually_next):
19807 Support character positions inside a run of characters covered by a
fec2107c
EZ
19808 display string.
19809 (bidi_paragraph_init, bidi_resolve_explicit_1)
19810 (bidi_level_of_next_char): Call bidi_fetch_char and
19811 bidi_fetch_char_advance instead of FETCH_CHAR and
19812 FETCH_CHAR_ADVANCE.
19813 (bidi_init_it): Initialize new members.
19814 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19815 definitions.
19816 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19817 instead of using explicit *_CHAR codes.
d6d100dd
SM
19818 (bidi_resolve_explicit, bidi_resolve_weak):
19819 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
19820 bidirectional text is supported only in multibyte buffers.
19821 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19822 it to initialize the frame_window_p member of struct bidi_it.
19823 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19824 (bidi_resolve_explicit, bidi_resolve_weak)
19825 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19826 bidi_it->nchars is non-positive.
19827 (bidi_level_of_next_char): Don't try to lookup the cache for the
19828 next/previous character if nothing is cached there yet, or if we
19829 were just reseat()'ed to a new position.
c40e2fb2 19830
0e14fe90
EZ
19831 * xdisp.c (set_cursor_from_row): Set start and stop points
19832 according to the row's direction when priming the loop that looks
19833 for the glyph on which to display cursor.
19834 (single_display_spec_intangible_p): Function deleted.
19835 (display_prop_intangible_p): Reimplement to call
19836 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
19837 Accept 3 additional arguments needed by handle_display_spec.
19838 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
19839 values: lists, `(when COND...)' forms, etc.
19840 (single_display_spec_string_p): Support property values that are
19841 lists with the argument STRING its top-level element.
19842 (display_prop_string_p): Fix the condition for processing a
19843 property that is a list to be consistent with handle_display_spec.
fec2107c 19844 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
19845 last portion of handle_display_prop.
19846 (compute_display_string_pos): Accept additional argument
19847 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19848 value of a `display' property is a "replacing spec".
19849 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19850 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19851 the display property, but just return a value indicating whether
19852 the display property will replace the characters it covers.
19853 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19854 frame_window_p members of struct bidi_it.
d6d100dd
SM
19855 (compute_display_string_pos, compute_display_string_end):
19856 New functions.
fec2107c
EZ
19857 (push_it): Accept second argument POSITION, where pop_it should
19858 jump to continue iteration.
19859 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 19860
fec2107c
EZ
19861 * keyboard.c (adjust_point_for_property): Adjust the call to
19862 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
19863
19864 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
19865 (bidi_init_it): Update prototypes.
19866 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
19867 (compute_display_string_pos, compute_display_string_end):
19868 Declare prototypes.
fec2107c
EZ
19869 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19870 EMACS_INT.
fc6f18ce 19871
40087514 198722011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 19873
57f53182
PE
19874 Malloc failure behavior now depends on size of allocation.
19875 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19876 * lisp.h: Change signatures accordingly.
19877 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19878 All callers changed. (Bug#8762)
19879
19880 * gnutls.c: Use Emacs's memory allocators.
19881 Without this change, the gnutls library would invoke malloc etc.
19882 directly, which causes problems on non-SYNC_INPUT hosts, and which
19883 runs afoul of improving memory_full behavior. (Bug#8761)
19884 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19885 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19886 xfree instead of the default malloc, realloc, free.
19887 (Fgnutls_boot): No need to check for memory allocation failure,
19888 since xmalloc does that for us.
19889
ac32cd99 19890 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
19891 * category.c (hash_get_category_set):
19892 * ccl.c (ccl_driver):
19893 * charset.c (Fdefine_charset_internal):
19894 * charset.h (struct charset.hash_index):
19895 * composite.c (get_composition_id, gstring_lookup_cache)
19896 (composition_gstring_put_cache):
19897 * composite.h (struct composition.hash_index):
19898 * dispextern.h (struct image.hash):
19899 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19900 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19901 (hashfn_equal, hashfn_user_defined, make_hash_table)
19902 (maybe_resize_hash_table, hash_lookup, hash_put)
19903 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19904 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19905 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19906 * image.c (make_image, search_image_cache, lookup_image)
19907 (xpm_put_color_table_h):
19908 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 19909 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 19910 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 19911 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
19912 * alloc.c (allocate_vectorlike):
19913 Check for overflow in vector size calculations.
19914 * ccl.c (ccl_driver):
19915 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
19916 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19917 need to be updated by these changes.
40087514
PE
19918 * fns.c (make_hash_table, maybe_resize_hash_table):
19919 Check for integer overflow with large hash tables.
0de4bb68
PE
19920 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19921 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19922 (SXHASH_REDUCE): New macro.
19923 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19924 Use it instead of discarding useful hash info with large hash values.
19925 (sxhash_float): New function.
19926 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19927 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
19928 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19929 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
19930 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19931 Adjust signatures to match updated version of code.
19932 (consing_since_gc): Now EMACS_INT, since a single hash table can
19933 use more than INT_MAX bytes.
19934
698d32e2
DN
199352011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19936
19937 Make it possible to build with GCC-4.6+ -O2 -flto.
19938
19939 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19940
fd6fa53f
SM
199412011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19942
19943 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19944 Call minibuffer-inactive-mode.
19945
864db017
JB
199462011-05-31 Juanma Barranquero <lekktu@gmail.com>
19947
19948 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19949 Update dependencies.
19950
2ad0baf4
DN
199512011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19952
19953 * data.c (init_data): Remove code for UTS, this system is not
19954 supported anymore.
19955
4fcc2638
DN
199562011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19957
19958 Don't force ./temacs to start in terminal mode.
19959
19960 * frame.c (make_initial_frame): Initialize faces in all cases, not
19961 only when CANNOT_DUMP is defined.
19962 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19963
c56e0fd5
DN
199642011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19965
19966 * dispnew.c (add_window_display_history): Use const for the string
19967 pointer. Remove declaration, not needed.
19968
333d54da 199692011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19970
55d4c1b2 19971 Use 'inline', not 'INLINE'.
333d54da 19972 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19973 * alloc.c, fontset.c (INLINE): Remove.
19974 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19975 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19976 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19977 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19978 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19979
738db178
DN
199802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19981
19982 Make it possible to run ./temacs.
19983
19984 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19985 syms_of_callproc does the same thing. Remove test for
19986 "initialized", do it in the caller.
19987 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19988
620c53a6
SM
199892011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19990
19991 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19992 (read_minibuf): Use get_minibuffer.
19993 (syms_of_minibuf): Use DEFSYM.
19994 (Qmetadata): New var.
19995 * data.c (Qbuffer): Don't make it static.
19996 (syms_of_data): Use DEFSYM.
19997
e003a292
PE
199982011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19999
20000 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20001 (CCL_CODE_MIN): New macro.
20002
ed008a6d
PE
200032011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20004
3687c2ef
PE
20005 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20006
ed008a6d
PE
20007 * eval.c (Qdebug): Now static.
20008 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20009 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20010 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20011
d66c4c7c
CY
200122011-05-29 Chong Yidong <cyd@stupidchicken.com>
20013
20014 * image.c: Various fixes to ImageMagick code comments.
20015 (Fimagemagick_types): Doc fix.
20016
5fbc2025
PE
200172011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20018
0196f88a
PE
20019 Minor fixes prompted by GCC 4.6.0 warnings.
20020
20021 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20022
5fbc2025
PE
20023 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20024 (x_clipboard_manager_save_all): Move extern decl to ...
20025 * xterm.h: ... here, so that it can be checked for consistency.
20026
1dd3c2d9
CY
200272011-05-29 Chong Yidong <cyd@stupidchicken.com>
20028
20029 * xselect.c (x_clipboard_manager_save_frame)
20030 (x_clipboard_manager_save_all): New functions.
20031 (Fx_clipboard_manager_save): Lisp function deleted.
20032
20033 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20034 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20035
20036 * xterm.h: Update prototype.
20037
5ba6571d
WX
200382011-05-28 William Xu <william.xwl@gmail.com>
20039
20040 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20041 exiting (Bug#8239).
20042
3eaff834
JM
200432011-05-28 Jim Meyering <meyering@redhat.com>
20044
e1900994 20045 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20046 * fns.c (to_uchar): Define.
20047 (crypto_hash_function): Use it to convert some newly-signed
20048 variables to unsigned, to avoid sign-extension bugs. For example,
20049 without this change, (md5 "truc") would evaluate to
20050 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20051 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20052 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20053
0f6990a7
PE
200542011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20055
20056 Integer overflow fixes.
c8a9ca5a 20057
08686060
PE
20058 * dbusbind.c: Serial number integer overflow fixes.
20059 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20060 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20061 to hold a serial number that is too large for a fixnum.
20062 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20063 Check for serial numbers out of range. Decode any serial number
59568bf0 20064 that was so large that it became a float. (Bug#8722)
08686060 20065
2d1fc3c7
PE
20066 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20067 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20068 Use XFASTINT rather than XUINT when numbers are nonnegative.
20069 (xd_append_arg, Fdbus_method_return_internal):
20070 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20071 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20072 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20073 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20074 (Bug#8722)
2d1fc3c7 20075
c8a9ca5a
PE
20076 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20077
519e1d69
PE
20078 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20079
6df6ae42 20080 ccl: Add integer overflow checks.
30569699
PE
20081 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20082 (IN_INT_RANGE): New macros.
20083 (ccl_driver): Use them to check for integer overflow when
20084 decoding a CCL program. Many of the new checks are whether XINT (x)
20085 fits in int; it doesn't always, on 64-bit hosts. The new version
20086 doesn't catch all possible integer overflows, but it's an
847044ea 20087 improvement. (Bug#8719)
30569699 20088
c11285dc
PE
20089 * alloc.c (make_event_array): Use XINT, not XUINT.
20090 There's no need for unsigned here.
20091
fdccd48e
PE
20092 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20093 This follows up to the 2011-05-06 change that substituted uintptr_t
20094 for EMACS_INT. This case wasn't caught back then.
20095
37910ab2
PE
20096 Rework Fformat to avoid integer overflow issues.
20097 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20098 now (part of C89). Include <verify.h>.
20099 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20100 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20101 (Fformat): Avoid the prepass trying to compute sizes; it was only
20102 approximate and thus did not catch overflow reliably. Instead, walk
20103 through the format just once, formatting and computing sizes as we go,
20104 checking for integer overflow at every step, and allocating a larger
20105 buffer as needed. Keep track separately whether the format is
20106 multibyte. Keep only the most-recently calculated precision, rather
20107 than them all. Record whether each argument has been converted to
20108 string. Use EMACS_INT, not int, for byte and char and arg counts.
20109 Support field widths and precisions larger than INT_MAX. Avoid
20110 sprintf's undefined behavior with conversion specifications such as %#d
20111 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20112 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20113 formatting out-of-range floating point numbers with int
9173deec 20114 formats. (Bug#8668)
37910ab2 20115
2e6578fb
PE
20116 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20117
0ae6bdee
PE
20118 * data.c: Avoid integer truncation in expressions involving floats.
20119 * data.c: Include <intprops.h>.
20120 (arith_driver): When there's an integer overflow in an expression
20121 involving floating point, convert the integers to floating point
20122 so that the resulting value does not suffer from catastrophic
20123 integer truncation. For example, on a 64-bit host (* 4
20124 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20125 Do not rely on undefined behavior after integer overflow.
20126
de883a70
PE
20127 merge count_size_as_multibyte, parse_str_to_multibyte
20128 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20129 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20130 Check for integer overflow.
20131 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20132 since it's now a duplicate of the other. This is more of
20133 a character than a buffer op, so better that it's in character.c.
20134 * fns.c, print.c: Adjust to above changes.
20135
2ff916cb
PE
201362011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20137
20138 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20139
f1b54466
PE
201402011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20141
fb1ac845
PE
20142 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20143 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20144 (x_clipboard_manager_save): Now static.
20145 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20146
f1b54466
PE
20147 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20148 (crypto_hash_function): Now static.
20149 Fix pointer signedness problems. Avoid unnecessary initializations.
20150
a9f737ee
CY
201512011-05-27 Chong Yidong <cyd@stupidchicken.com>
20152
20153 * termhooks.h (Vselection_alist): Make it terminal-local.
20154
20155 * terminal.c (create_terminal): Initialize it.
20156
20157 * xselect.c: Support for clipboard managers.
20158 (Vselection_alist): Move to termhooks.h as terminal-local var.
20159 (LOCAL_SELECTION): New macro.
20160 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20161 (symbol_to_x_atom): Remove gratuitous arg.
20162 (x_handle_selection_request, lisp_data_to_selection_data)
20163 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20164 (x_own_selection, x_get_local_selection, x_convert_selection):
20165 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20166 (some_frame_on_display): Delete unused function.
20167 (Fx_own_selection_internal, Fx_get_selection_internal)
20168 (Fx_disown_selection_internal, Fx_selection_owner_p)
20169 (Fx_selection_exists_p): New optional frame arg.
20170 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20171 (x_handle_selection_clear): Don't treat other terminals with the
20172 same keyboard specially. Use the terminal-local Vselection_alist.
20173 (x_clear_frame_selections): Use Frun_hook_with_args.
20174
20175 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20176
20177 * xterm.h: Add support for those atoms.
20178
e067f0c1
CY
201792011-05-26 Chong Yidong <cyd@stupidchicken.com>
20180
20181 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20182 (converted_selections, conversion_fail_tag): New global variables.
20183 (x_selection_request_lisp_error): Free the above.
20184 (x_get_local_selection): Remove unnecessary code.
20185 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20186 of converted selections stored in converted_selections.
20187 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20188 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20189 (x_convert_selection): New function.
20190 (x_handle_selection_event): Simplify.
20191 (x_get_foreign_selection): Don't ignore incoming requests while
20192 waiting for an answer; this will fail when we implement
20193 SAVE_TARGETS, and seems unnecessary anyway.
20194 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20195 (Vx_sent_selection_functions): Doc fix.
20196
0f4aebc0
LL
201972011-05-26 Leo Liu <sdl.web@gmail.com>
20198
20199 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20200
e61124cd
YM
202012011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20202
20203 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20204
20205 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20206 for fringe update if it has periodic bitmap.
ac389d0c 20207 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20208 and fringe_bitmap_periodic_p.
20209
20210 * fringe.c (get_fringe_bitmap_data): New function.
20211 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20212 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20213 row. Mark glyph row for fringe update if periodicity changed.
20214
20215 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20216 for fringe update unless it has periodic bitmap.
20217
f16d9837
KH
202182011-05-25 Kenichi Handa <handa@m17n.org>
20219
20220 * xdisp.c (get_next_display_element): Set correct it->face_id for
20221 a static composition.
20222
e1b90ef6
LL
202232011-05-24 Leo Liu <sdl.web@gmail.com>
20224
20225 * deps.mk (fns.o):
20226 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20227
20228 * fns.c (crypto_hash_function, Fsha1): New function.
20229 (Fmd5): Use crypto_hash_function.
20230 (syms_of_fns): Add Ssha1.
20231
7400048f
PE
202322011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20233
20234 * gnutls.c: Remove unused macros.
20235 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20236 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20237 Remove macros that are defined and never used.
20238 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20239
abb71cf4
CY
202402011-05-22 Chong Yidong <cyd@stupidchicken.com>
20241
20242 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20243 (Fx_get_selection_internal): Minor cleanup.
20244 (Fx_own_selection_internal): Rename arguments for consistency with
20245 select.el.
20246
6307db39
PE
202472011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20248
20249 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20250
f3d4e0a4
CY
202512011-05-22 Chong Yidong <cyd@stupidchicken.com>
20252
20253 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20254
4d8ade89
YM
202552011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20256
20257 * dispnew.c (scrolling_window): Don't exclude the case that the
20258 last enabled row in the desired matrix touches the bottom boundary.
20259
32078c8d
GM
202602011-05-21 Glenn Morris <rgm@gnu.org>
20261
20262 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20263 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20264 and add some more files.
32078c8d 20265
7285dc67
EZ
202662011-05-20 Eli Zaretskii <eliz@gnu.org>
20267
20268 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20269 report_file_error introduced by the change from 2011-05-07.
20270
89d1bd22
PE
202712011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20272
20273 * systime.h (Time): Define only if emacs is defined.
20274 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20275 where the include path doesn't have X11/X.h by default. See
20276 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20277
cd394be1 202782011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20279
20280 * composite.c (find_automatic_composition): Fix previous change.
20281
b9704ad9
GM
202822011-05-20 Glenn Morris <rgm@gnu.org>
20283
20284 * lisp.mk: New file, split from Makefile.in.
20285 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20286 (shortlisp): Remove.
20287 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20288
4a720484
GM
202892011-05-19 Glenn Morris <rgm@gnu.org>
20290
20291 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20292 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20293 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20294 (lisp): Set the order to that of loadup.el.
20295 (shortlisp): Make it a copy of $lisp.
20296 (SOME_MACHINE_LISP): Remove.
20297 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20298 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20299
a28d4396
KH
203002011-05-18 Kenichi Handa <handa@m17n.org>
20301
20302 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20303 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20304 (find_automatic_composition): Mostly rewrite for efficiency.
20305
a2b1fa8e
JB
203062011-05-18 Juanma Barranquero <lekktu@gmail.com>
20307
20308 * makefile.w32-in: Update dependencies.
20309
8e1f5610
CS
203102011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20311
20312 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20313 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20314
7025ee00 203152011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20316
cdfa6eab
PE
20317 Fix some integer overflow issues, such as string length overflow.
20318
06d6db33
PE
20319 * insdel.c (count_size_as_multibyte): Check for string overflow.
20320
2b4560a8
PE
20321 * character.c (lisp_string_width): Check for string overflow.
20322 Use EMACS_INT, not int, for string indexes and lengths; in
20323 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20324 the resulting string length overflows an EMACS_INT; instead,
20325 report a string overflow if no precision given. When checking for
20326 precision exhaustion, use a check that cannot possibly have
20327 integer overflow. (Bug#8675)
20328 * character.h (lisp_string_width): Adjust to new signature.
20329
cb93f9be
PE
20330 * alloc.c (string_overflow): New function.
20331 (Fmake_string): Use it. This doesn't change behavior, but saves
20332 a few bytes and will simplify future changes.
20333 * character.c (string_escape_byte8): Likewise.
20334 * lisp.h (string_overflow): New decl.
20335
1a1f3366
PE
20336 Fixups, following up to the user-interface timestamp change.
20337 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20338 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20339 * msdos.c (mouse_get_pos): Likewise.
20340 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20341 * w32gui.h (Time): Define by including "systime.h" rather than by
20342 declaring it ourselves. (Bug#8664)
20343
d4e3e4d3
PE
20344 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20345 * image.c (clear_image_cache): Likewise.
20346
f6a24d19
PE
20347 * term.c (term_mouse_position): Don't assume time_t wraparound.
20348
08dc5ae6
PE
20349 Be more systematic about user-interface timestamps.
20350 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20351 and sometimes 'EMACS_UINT', to represent these timestamps.
20352 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20353 This makes the code easier to follow, and makes it easier to catch
20354 integer overflow bugs such as Bug#8664.
20355 * frame.c (Fmouse_position, Fmouse_pixel_position):
20356 Use Time, not unsigned long, for user-interface timestamps.
20357 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20358 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20359 * keyboard.h (last_event_timestamp): Likewise.
20360 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20361 * menu.h (xmenu_show): Likewise.
20362 * term.c (term_mouse_position): Likewise.
20363 * termhooks.h (struct input_event.timestamp): Likewise.
20364 (struct terminal.mouse_position_hook): Likewise.
20365 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20366 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20367 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20368 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20369 what it was before.
20370 * menu.h, termhooks.h: Include "systime.h", for Time.
20371
8e55734a
PE
20372 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20373 Don't assume that the difference between two unsigned long values
20374 can fit into an integer. At this point, we know button_down_time
20375 <= event->timestamp, so the difference must be nonnegative, so
20376 there's no need to cast the result if double-click-time is
20377 nonnegative, as it should be; check that it's nonnegative, just in
20378 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20379 apart (about 25 days). (Bug#8664)
8e55734a 20380
841f1b75 20381 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20382 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20383
3e26f69c
PE
20384 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20385 that always fit in int. Use a sentinel instead of a counter, to
20386 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20387 * frame.h (struct frame): Use int for menu_bar_items_used
20388 instead of EMACS_INT, since it always fits in int.
3e26f69c 20389
5cc152c0
PE
20390 * menu.c (grow_menu_items): Check for int overflow.
20391
d89eb65e
PE
20392 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20393
5235bd3e
PE
20394 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20395 Before, the code was not consistent. These values cannot exceed
20396 2**31 - 1 so there's no need to make them unsigned.
20397 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20398 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20399 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20400 as modifiers.
20401 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20402
bc827e23
PE
20403 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20404 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20405 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20406 presumably because the widths might not match.
20407
78eb494e
PE
20408 * window.c (size_window): Avoid needless test at loop start.
20409
04f2d78b
CB
204102011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20411
20412 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20413
d2fc7e3d 204142011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20415
20416 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20417
d2fc7e3d 204182011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20419
20420 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20421 `width' to `bar_area_x' and `bar_area_width', respectively.
20422 (x_scroll_run): Take account of fringe background extension.
20423
04f2d78b
CB
20424 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20425 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20426 `bar_area_width', respectively.
20427 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20428 background extension.
20429
79b70037
GM
204302011-05-10 Jim Meyering <meyering@redhat.com>
20431
20432 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20433
2f142cc5
JB
204342011-05-10 Juanma Barranquero <lekktu@gmail.com>
20435
20436 * image.c (Finit_image_library): Return t for built-in image types,
20437 like pbm and xbm. (Bug#8640)
20438
57679c86
AS
204392011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20440
20441 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20442
888c9e86
EZ
204432011-05-07 Eli Zaretskii <eliz@gnu.org>
20444
b0512a1d
EZ
20445 * w32console.c (Fset_screen_color): Doc fix.
20446 (Fget_screen_color): New function.
20447 (syms_of_ntterm): Defsubr it.
20448
7285dc67
EZ
20449 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20450 unlink the temporary file if Fcall_process didn't create it in the
20451 first place.
20452 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20453 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20454 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20455 cue to call_process_cleanup not to close that handle.
20456
4d3fcc8e
BK
204572011-05-07 Ben Key <bkey76@gmail.com>
20458
20459 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20460 one of two shell specific rules, either bootstrap-temacs-CMD or
20461 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20462 to the previous implementation of the bootstrap-temacs rule.
20463 The bootstrap-temacs-CMD rule is similar to the previous
20464 implementation of the bootstrap-temacs rule except that it
20465 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20466 variable.
20467
20468 These changes, along with some changes to nt/configure.bat,
20469 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20470 earlier fix to add support for --cflags and --ldflags options
20471 that include quotes so that it works whether make uses cmd or
20472 sh as the shell.
20473
b4289b64
MA
204742011-05-06 Michael Albinus <michael.albinus@gmx.de>
20475
20476 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20477 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20478 is a constant.
20479 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20480 a string. Handle both cases.
20481 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20482 (Fdbus_register_method): Use Qinvalid_function.
20483
af4c0e28
JB
204842011-05-06 Juanma Barranquero <lekktu@gmail.com>
20485
20486 * makefile.w32-in: Update dependencies.
20487 (LISP_H): Add inttypes.h and stdin.h.
20488 (PROCESS_H): Add unistd.h.
20489
c51453d9
EZ
204902011-05-06 Eli Zaretskii <eliz@gnu.org>
20491
20492 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20493 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20494
8ff0ac3c 204952011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20496
4c4b566b
PE
20497 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20498
aab2b9b5
PE
20499 * term.c (vfatal): Remove stray call to va_end.
20500 It's not needed and the C Standard doesn't allow it here anyway.
20501
c378da0b
PE
20502 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20503 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20504
288b08c7
PE
20505 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20506 bytes.
20507
e3601888
PE
20508 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20509
db6c0e74
PE
20510 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20511
dd5963ea
PE
20512 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20513
88c9450f
PE
20514 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20515
2f9442b8
PE
20516 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20517
c032b5f8
PE
20518 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20519 * charset.c (Fdefine_charset_internal): Don't initialize
20520 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20521 32-bit int (Bug#8600).
a108c10b
PE
20522
20523 * lread.c (read_integer): Be more consistent with string-to-number.
20524 Use string_to_number to do the actual conversion; this avoids
20525 rounding errors and fixes some other screwups. Without this fix,
20526 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20527 (digit_to_number): Move earlier, for benefit of read_integer.
20528 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20529 not a digit in any supported base. (Bug#8602)
a108c10b 20530
ad5f9eea
PE
20531 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20532
aec1708a
PE
20533 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20534 to match comment at start of function. This also removes a
20535 GCC warning about overflow in a 32+64-bit port.
20536
47be4ab5
PE
20537 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20538
371cac43
PE
20539 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20540 Reported by Stefan Monnier in
20541 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20542 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20543 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20544
d01a7826
PE
20545 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20546 (EMACS_UINTPTR): Likewise, with uintptr_t.
20547
7fd47d5c
PE
20548 * lisp.h: Prefer 64-bit EMACS_INT if available.
20549 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20550 on 32-bit hosts that have 64-bit int, so that they can access
20551 large files.
122b0c86
PE
20552 However, temporarily disable this change unless the temporary
20553 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20554
8727937b
PE
20555 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20556
8ac068ac
PE
20557 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20558 This removes an assumption that EMACS_INT and long are the same
20559 width as pointers. The assumption is true for Emacs porting targets
20560 now, but we want to make other targets possible.
20561 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20562 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20563 In the rest of the code, change types of integers that hold casted
20564 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20565 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20566 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20567 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20568 No need to cast type when ORing.
20569 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20570 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20571 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20572 assume EMACS_INT is the same width as char *.
20573 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20574 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20575 Remove no-longer-needed casts.
20576 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20577 (xg_tool_bar_help_callback, xg_make_tool_item):
20578 Use EMACS_INTPTR to hold an integer
20579 that will be cast to void *; this can avoid a GCC warning
20580 if EMACS_INT is not the same width as void *.
20581 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20582 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20583 (current_message_1, set_message_1):
20584 Use a local to convert to proper width without a cast.
20585 * xmenu.c (dialog_selection_callback): Likewise.
20586
ede49d71
PE
20587 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20588 Also, don't assume VALBITS / RAND_BITS is less than 5,
20589 and don't rely on undefined behavior when shifting a 1 left into
20590 the sign bit.
20591 * lisp.h (get_random): Change signature to match.
20592
2f30ecd0
PE
20593 * lread.c (hash_string): Use size_t, not int, for hash computation.
20594 Normally we prefer signed values; but hashing is special, because
20595 it's better to use unsigned division on hash table sizes so that
20596 the remainder is nonnegative. Also, size_t is the natural width
20597 for hashing into memory. The previous code used 'int', which doesn't
20598 retain enough info to hash well into very large tables.
20599 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20600
2a866e7b
PE
20601 * dbusbind.c: Don't possibly lose pointer info when converting.
20602 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20603 Use XPNTR rather than XHASH, so that the high-order bits of
20604 the pointer aren't lost when converting through void *.
20605
51639eac
PE
20606 * eval.c (Fautoload): Don't double-shift a pointer.
20607
92394119
PE
20608 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20609
dbdb9a7c
JB
206102011-05-06 Juanma Barranquero <lekktu@gmail.com>
20611
20612 * gnutls.c (DEF_GNUTLS_FN):
20613 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20614
db7a0b4f
AS
206152011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20616
20617 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20618 marker. (Bug#8610)
20619
cd394be1 206202011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
20621
20622 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20623 New version that can reserve upto 2GB of heap space.
20624
f7ff1b0f 206252011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
20626
20627 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20628
639c109b
TZ
206292011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20630
20631 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20632 `gnutls_certificate_set_x509_key_file'.
20633
d2127135
JB
206342011-05-05 Juanma Barranquero <lekktu@gmail.com>
20635
20636 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20637 Update dependencies.
20638
e968f4f3
JB
206392011-05-04 Juanma Barranquero <lekktu@gmail.com>
20640
20641 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20642 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20643 Remove unused parameter `fildes'.
20644 * process.c (read_process_output, send_process): Don't pass it.
20645
84d358f0
JB
206462011-05-04 Juanma Barranquero <lekktu@gmail.com>
20647
20648 Fix previous change: the library cache is defined in w32.c.
20649 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20650 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20651
0898ca10
JB
206522011-05-04 Juanma Barranquero <lekktu@gmail.com>
20653
20654 Implement dynamic loading of GnuTLS on Windows.
20655
20656 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20657 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20658 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20659 Declare.
20660
20661 * gnutls.c (Qgnutls_dll): Define.
20662 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20663 (gnutls_*): Declare function pointers.
20664 (init_gnutls_functions): New function to initialize function pointers.
20665 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20666 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20667 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20668 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20669 (emacs_gnutls_write, emacs_gnutls_read)
20670 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20671 (Fgnutls_available_p): New function.
20672 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20673 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20674 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20675
20676 * image.c: Include w32.h.
20677 (Vimage_type_cache): Delete.
20678 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20679 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20680 (w32_delayed_load): Move to w32.c.
20681
20682 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20683
20684 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20685 (w32_delayed_load): Move from image.c. When loading a library, record
20686 its filename in the :loaded-from property of the library id.
20687 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20688 Initialize and staticpro them.
20689 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20690
20691 * process.c: Include lisp.h before w32.h, not after.
20692 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20693 instead of gnutls_record_check_pending.
20694
20695 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20696
ff4de4aa
TZ
206972011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20698
20699 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20700 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20701 as passed in.
20702
abe95abb
JD
207032011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20704
20705 * xterm.c (x_set_frame_alpha): Do not set property on anything
20706 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20707
e16e55d4
JB
207082011-05-02 Juanma Barranquero <lekktu@gmail.com>
20709
20710 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20711
bafcf6a5
JB
207122011-05-02 Juanma Barranquero <lekktu@gmail.com>
20713
20714 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20715 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20716 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20717 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20718 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20719 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20720 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20721 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20722 (Qgnutls_bootprop_callbacks_verify): Make static.
20723
e7a6747f
AS
207242011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20725
19ed11ba
AS
20726 * callproc.c: Indentation fixup.
20727
e7a6747f 20728 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
20729 (wait_for_termination, interruptible_wait_for_termination):
20730 Move after wait_for_termination_1.
e7a6747f 20731
1ef14cb4
LMI
207322011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20733
20734 * sysdep.c (interruptible_wait_for_termination): New function
20735 which is like wait_for_termination, but allows keyboard
20736 interruptions.
20737
20738 * callproc.c (Fcall_process): Add (:file "file") as an option for
20739 the STDOUT buffer.
20740 (Fcall_process_region): Ditto.
20741
330d880c
EZ
207422011-04-30 Eli Zaretskii <eliz@gnu.org>
20743
8db90b73
EZ
20744 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20745 rather than `XVECTOR (FOO)->size'.
20746
330d880c
EZ
20747 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20748 inttypes.h, as a gnulib replacement is used if it not available in
20749 system headers.
20750
15cbd324
EZ
207512011-04-21 Eli Zaretskii <eliz@gnu.org>
20752
20753 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20754 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20755 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20756
20757 * coding.c (coding_alloc_by_realloc): Error out if destination
20758 will grow beyond MOST_POSITIVE_FIXNUM.
20759 (decode_coding_emacs_mule): Abort if there isn't enough place in
20760 charbuf for the composition carryover bytes. Reserve an extra
20761 space for up to 2 characters produced in a loop.
20762 (decode_coding_iso_2022): Abort if there isn't enough place in
20763 charbuf for the composition carryover bytes.
20764
207652011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 20766
ae940cca
EZ
20767 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20768 aborting when %lld or %lll format is passed.
20769 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20770 %llo or %llx format is passed. (Bug#8545)
20771
03ab8921
EZ
20772 * window.c (window_scroll_line_based): Use a marker instead of
20773 simple variables to record original value of point. (Bug#7952)
20774
afda1437
EZ
20775 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20776 produced by %s or %c overflows available buffer space. (Bug#8545)
20777
f76dee0c
PE
207782011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20779
20780 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 20781 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 20782
fdc5744d
JB
207832011-04-28 Juanma Barranquero <lekktu@gmail.com>
20784
20785 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20786
638f053a
JB
207872011-04-28 Juanma Barranquero <lekktu@gmail.com>
20788
20789 * keyboard.c (Qdelayed_warnings_hook): Define.
20790 (command_loop_1): Run `delayed-warnings-hook'
20791 if Vdelayed_warnings_list is non-nil.
20792 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20793 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20794
d178f871
EZ
207952011-04-28 Eli Zaretskii <eliz@gnu.org>
20796
20797 * doprnt.c (doprnt): Don't return value smaller than the buffer
20798 size if the message was truncated. (Bug#8545).
20799
b124fd93
JB
208002011-04-28 Juanma Barranquero <lekktu@gmail.com>
20801
20802 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20803 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20804
e810457d
PE
208052011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20806
20807 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20808
ea51cceb
JB
208092011-04-27 Juanma Barranquero <lekktu@gmail.com>
20810
20811 * makefile.w32-in: Update dependencies.
20812
94dcfacf
EZ
208132011-04-27 Eli Zaretskii <eliz@gnu.org>
20814
20815 Improve `doprnt' and its usage. (Bug#8545)
20816 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20817 `format_end'. Remove support for %l as a conversion specifier.
20818 Don't use xrealloc. Improve diagnostics when the %l size modifier
20819 is used. Update the commentary.
20820
20821 * eval.c (verror): Simplify calculation of size_t.
20822
20823 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20824 messages.
20825
f61f41d7
PE
208262011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20827
20828 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20829 change.
20830
96fb4434
PE
208312011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20832
20833 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20834 This makes this file independent of the recent pseudovector change.
20835
671875da 208362011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 20837
69e9b5a3
PE
20838 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20839
b5f869a7 20840 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 20841 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 20842 Remove unused local.
c8926152 20843 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 20844
841a1577 20845 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
20846 GCC 4.6.0 optimizes based on type-based alias analysis.
20847 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
20848 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20849 != &v->size, and therefore "v->size = 1; b->size = 2; return
20850 v->size;" must therefore return 1. This assumption is incorrect
20851 for Emacs, since it type-puns struct Lisp_Vector * with many other
20852 types. To fix this problem, this patch adds a new type struct
f904488f 20853 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
20854 and pseudovectors, and helps optimizing compilers not get fooled
20855 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20856 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
20857 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20858 the size member.
eab3844f
PE
20859 (XSETPVECTYPE): Rewrite in terms of new macro.
20860 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20861 This is a bit clearer, and further avoids the possibility of
20862 undesirable aliasing.
20863 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 20864 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
20865 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20866 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
20867 (ASIZE): Now uses header.size rather than size.
20868 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
20869 to avoid the hassle of writing XVECTOR (foo)->header.size.
20870 (struct vectorlike_header): New type.
eab3844f
PE
20871 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20872 object, to help avoid aliasing.
20873 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20874 (SUBRP): Likewise, since Lisp_Subr is a special case.
20875 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20876 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20877 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 20878 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
20879 changed to be "header.size" and "header.next".
20880 * buffer.h (struct buffer): Likewise.
20881 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20882 * frame.h (struct frame): Likewise.
20883 * process.h (struct Lisp_Process): Likewise.
20884 * termhooks.h (struct terminal): Likewise.
20885 * window.c (struct save_window_data, struct saved_window): Likewise.
20886 * window.h (struct window): Likewise.
20887 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20888 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20889 * buffer.c (init_buffer_once): Likewise.
20890 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20891 special case.
20892 * process.c (Fformat_network_address): Use local var for size,
20893 for brevity.
20894
0df1eac5
PE
20895 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20896
847ab9d1 20897 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
20898 * data.c (atof): Remove decl; no longer used or needed.
20899 (digit_to_number): Move to lread.c.
20900 (Fstring_to_number): Use new string_to_number function, to be
20901 consistent with how the Lisp reader treats infinities and NaNs.
20902 Do not assume that floating-point numbers represent EMACS_INT
20903 without losing information; this is not true on most 64-bit hosts.
20904 Avoid double-rounding errors, by insisting on integers when
20905 parsing non-base-10 numbers, as the documentation specifies.
20906 * lisp.h (string_to_number): New decl, replacing ...
20907 (isfloat_string): Remove.
bc0a5c13 20908 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 20909 (read1): Do not accept +. and -. as integers; this
452f4150
PE
20910 appears to have been a coding error. Similarly, do not accept
20911 strings like +-1e0 as floating point numbers. Do not report
20912 overflow for integer overflows unless the base is not 10 which
20913 means we have no simple and reliable way to continue.
20914 Break out the floating-point parsing into a new
20915 function string_to_number, so that Fstring_to_number parses
20916 floating point numbers consistently with the Lisp reader.
04f2d78b 20917 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
20918 (E_CHAR, EXP_INT): Remove, replacing with ...
20919 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20920 (string_to_number): New function, replacing isfloat_string.
20921 This function checks for valid syntax and produces the resulting
20922 Lisp float number too. Rework it so that string-to-number
bc0a5c13 20923 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
20924 so that overflow for non-base-10 numbers is reported only when
20925 there's no portable and simple way to convert to floating point.
452f4150 20926
67769ffc
PE
20927 * textprop.c (set_text_properties_1): Rewrite for clarity,
20928 and to avoid GCC warning about integer overflow.
20929
c20db43f
PE
20930 * intervals.h (struct interval): Use EMACS_INT for members
20931 where EMACS_UINT might cause problems. See
20932 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20933 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20934 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20935 All uses changed.
37aa2f85
PE
20936 (offset_intervals): Tell GCC not to worry about length overflow
20937 when negating a negative length.
c20db43f 20938
2538aa2f
PE
20939 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20940 (overrun_check_free): Likewise.
20941
f2d3008d
PE
20942 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20943 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20944 word size.
20945
ec8df744
PE
20946 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20947 (gnutls_make_error): Rename local to avoid shadowing.
20948 (gnutls_emacs_global_deinit): ifdef out; not used.
20949 (Fgnutls_boot): Use const for pointer to readonly storage.
20950 Comment out unused local. Fix pointer signedness problems.
20951
640ee02d
PE
20952 * lread.c (openp): Don't stuff size_t into an 'int'.
20953 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20954 about possible signed overflow.
20955
6048fb2a
PE
20956 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20957 (GDK_KEY_g): Don't define if already defined.
20958 (xg_prepare_tooltip): Avoid pointer signedness problem.
20959 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20960
fa3c87e1
PE
20961 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20962 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20963
2172544b
PE
20964 * xfns.c (Fx_window_property): Simplify a bit,
20965 to make a bit faster and to avoid GCC 4.6.0 warning.
20966 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20967
9b821a21
PE
20968 * fns.c (internal_equal): Don't assume size_t fits in int.
20969
3c616cfa
PE
20970 * alloc.c (compact_small_strings): Tighten assertion a little.
20971
c2982e87
PE
20972 Replace pEd with more-general pI, and fix some printf arg casts.
20973 * lisp.h (pI): New macro, generalizing old pEd macro to other
20974 conversion specifiers. For example, use "...%"pI"d..." rather
20975 than "...%"pEd"...".
20976 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20977 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20978 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20979 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20980 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20981 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20982 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20983 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20984 64-bit hosts.
20985 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20986 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20987 * print.c (safe_debug_print, print_object): Likewise.
20988 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20989 to int.
6f04d126
PE
20990 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20991 avoiding the 0 flag, which is not portable.
c2982e87
PE
20992 * process.c (Fmake_network_process): Use pI to avoid cast.
20993 * region-cache.c (pp_cache): Likewise.
20994 * xdisp.c (decode_mode_spec): Likewise.
20995 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20996 behavior on 64-bit hosts with printf arg.
6f04d126 20997 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20998 (x_stop_queuing_selection_requests): Likewise.
20999 (x_get_window_property): Don't truncate byte count to an 'int'
21000 when tracing.
0b432f21 21001
5e073ec7
PE
21002 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21003 here, since it parses constructs like leading '-' and spaces,
21004 which are not wanted; and it overflows with large numbers.
21005 Instead, simply match F[0-9]+, which is what is wanted anyway.
21006
36372bf9
PE
21007 * alloc.c: Remove unportable assumptions about struct layout.
21008 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21009 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21010 (allocate_vectorlike, make_pure_vector): Use the new macros,
21011 plus offsetof, to remove unportable assumptions about struct layout.
21012 These assumptions hold on all porting targets that I know of, but
21013 they are not guaranteed, they're easy to remove, and removing them
21014 makes further changes easier.
21015
0b432f21
PE
21016 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21017 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21018 (string_overrun_cookie): Now const. Use initializers that
21019 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21020 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21021 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21022 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21023 multiple of sizeof (EMACS_INT); it need not be, if
21024 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21025 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21026
895009e1
JB
210272011-04-26 Juanma Barranquero <lekktu@gmail.com>
21028
21029 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21030
6a7a1b0b
TZ
210312011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21032
21033 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21034 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21035 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21036
841a1577 210372011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21038
21039 * lisp.h (Qdebug): List symbol.
895009e1 21040 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21041 * keyboard.c (debug-on-event): New variable.
21042 (handle_user_signal): Break into debugger when debug-on-event
21043 matches the current signal symbol.
21044
f2d3ba6f
DN
210452011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21046
21047 * alloc.c (check_sblock, check_string_bytes)
21048 (check_string_free_list): Convert to standard C.
21049
42ce4c63
TZ
210502011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21051
21052 * w32.c (emacs_gnutls_push): Fix typo.
21053
825cd63c
EZ
210542011-04-25 Eli Zaretskii <eliz@gnu.org>
21055
fb11d64d
EZ
21056 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21057 "cast to pointer from integer of different size".
21058
825cd63c
EZ
21059 Improve doprnt and its use in verror. (Bug#8545)
21060 * doprnt.c (doprnt): Document the set of format control sequences
21061 supported by the function. Use SAFE_ALLOCA instead of always
21062 using `alloca'.
21063
21064 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21065 is one byte too soon. Don't use xrealloc; instead xfree and
21066 xmalloc anew.
21067
e061a11b
TZ
210682011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21069
21070 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21071 callbacks stage.
21072
21073 * gnutls.c: Renamed global_initialized to
21074 gnutls_global_initialized. Added internals for the
21075 :verify-hostname-error, :verify-error, and :verify-flags
21076 parameters of `gnutls-boot' and documented those parameters in the
21077 docstring. Start callback support.
9173deec
JB
21078 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21079 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21080 on error. Return error code.
e061a11b
TZ
21081 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21082 (emacs_gnutls_read): Likewise.
21083 (Fgnutls_boot): Return handshake error code.
21084 (emacs_gnutls_handle_error): New function.
21085 (wsaerror_to_errno): Likewise.
21086
21087 * w32.h (emacs_gnutls_pull): Add prototype.
21088 (emacs_gnutls_push): Likewise.
21089
21090 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21091 (emacs_gnutls_push): Likewise.
21092
210932011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21094
21095 * process.c (wait_reading_process_output): Check if GnuTLS
21096 buffered some data internally if no FDs are set for TLS
21097 connections.
21098
21099 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21100 (LIBS): Link to USER_LIBS.
21101 ($(BLD)/gnutls.$(0)): New target.
21102
fa6996bc
EZ
211032011-04-24 Eli Zaretskii <eliz@gnu.org>
21104
eb35682e
EZ
21105 * xdisp.c (handle_single_display_spec): Rename the
21106 display_replaced_before_p argument into display_replaced_p, to
21107 make it consistent with the commentary. Fix typos in the
21108 commentary.
21109
e2ad650c
EZ
21110 * textprop.c (syms_of_textprop): Remove dead code.
21111 (copy_text_properties): Delete obsolete commentary about an
21112 interface that was deleted long ago. Fix typos in the description
21113 of arguments.
21114
1b2de274
EZ
21115 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21116 to changes in oldXMenu/XMenu.h from 2011-04-16.
21117 <menu_help_message, prev_menu_help_message>: Constify.
21118 (IT_menu_make_room): menu->help_text is now `const char **';
21119 adjust.
21120
21121 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21122 to changes in oldXMenu/XMenu.h from 2011-04-16.
21123 (struct XMenu): Declare `help_text' `const char **'.
21124
21125 * xfaces.c <Qunspecified>: Make extern again.
21126
21127 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21128 required by POSIX.
1b2de274 21129
762b15be
EZ
21130 * doc.c (get_doc_string): Improve the format passed to `error'.
21131
21132 * doprnt.c (doprnt): Improve commentary.
21133
21134 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21135
21136 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21137 them with etags.
21138
f1052e5d
EZ
21139 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21140 changes in globals.h immediately force recompilation.
762b15be
EZ
21141 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21142 $(CURDIR)/s/ms-w32.h.
21143 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21144
fa6996bc
EZ
21145 * character.c (Fchar_direction): Function deleted.
21146 (syms_of_character): Don't defsubr it.
21147 <char-direction-table>: Deleted.
21148
e6c3da20
EZ
211492011-04-23 Eli Zaretskii <eliz@gnu.org>
21150
21151 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21152 * doprnt.c: Include limits.h.
21153 (SIZE_MAX): New macro.
04f2d78b
CB
21154 (doprnt): Return a size_t value. 2nd arg is now size_t.
21155 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21156 Improve overflow protection. Support `l' modifier for integer
21157 conversions. Support %l conversion. Don't assume an EMACS_INT
21158 argument for integer conversions and for %c.
21159
21160 * lisp.h (doprnt): Restore prototype.
21161
21162 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21163 $(SRC)/character.h.
21164
21165 * Makefile.in (base_obj): Add back doprnt.o.
21166
21167 * deps.mk (doprnt.o): Add back prerequisites.
21168 (callint.o): Depend on character.h.
21169
21170 * eval.c (internal_lisp_condition_case): Include the handler
21171 representation in the error message.
21172 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21173 when breaking from the loop.
21174
21175 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21176
21177 * callint.c (Fcall_interactively): When displaying error message
21178 about invalid control letter, pass the character's codepoint, not
21179 a pointer to its multibyte form. Improve display of the character
21180 in octal and display also its hex code.
21181
21182 * character.c (char_string): Use %x to display the (unsigned)
21183 codepoint of an invalid character, to avoid displaying a bogus
21184 negative value.
21185
21186 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21187 `error', not SYMBOL_NAME itself.
21188
21189 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21190 character arguments to `error'.
21191
21192 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21193 to `error' in error message about FINAL_CHAR argument. Make sure
21194 FINAL_CHAR is a character, and use %c when it is passed as
21195 argument to `error'.
21196
4ffd0d6b 211972011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21198
21199 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21200
21201 * w32.c: Include <time.h>.
21202 (sys_localtime): New function.
21203
4ffd0d6b 212042011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21205
21206 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21207
4ffd0d6b 21208 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21209
4ffd0d6b 212102011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21211
4ffd0d6b
GM
21212 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21213 zombies (Bug#8467).
aac0c6e3 21214
04c56954
EZ
212152011-04-19 Eli Zaretskii <eliz@gnu.org>
21216
21217 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21218 gl_state.e_property when gl_state.object is Qt.
21219
21220 * insdel.c (make_gap_larger): Remove limitation of buffer size
21221 to <= INT_MAX.
21222
16a43933
CY
212232011-04-18 Chong Yidong <cyd@stupidchicken.com>
21224
21225 * xdisp.c (lookup_glyphless_char_display)
21226 (produce_glyphless_glyph): Handle cons cell entry in
21227 glyphless-char-display.
21228 (Vglyphless_char_display): Document it.
21229
21230 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21231 glyphless-char-display.
21232
4581706e
CY
212332011-04-17 Chong Yidong <cyd@stupidchicken.com>
21234
21235 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21236
21237 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21238
21239 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21240 definition for no-X builds.
21241
4887c6e2 212422011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21243
fd35b6f9
PE
21244 Static checks with GCC 4.6.0 and non-default toolkits.
21245
5c1ccb01
PE
21246 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21247
006c5daa
PE
21248 * process.c (keyboard_bit_set): Define only if SIGIO.
21249 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21250 (send_process): Repair possible setjmp clobbering.
21251
efc736d3
PE
21252 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21253
4e2fe2e6
PE
21254 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21255
f97334a2
PE
21256 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21257
4e75f29d
PE
21258 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21259 Define only if needed.
21260
90efadd1
PE
21261 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21262 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21263 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21264
3c647824
PE
21265 * dispextern.h (struct redisplay_interface): Rename param
21266 to avoid shadowing.
e264f262 21267 * termhooks.h (struct terminal): Likewise.
761383f4 21268 * xterm.c (xembed_send_message): Likewise.
3c647824 21269
b58c5c4a
PE
21270 * insdel.c (make_gap_smaller): Define only if
21271 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21272
cad59032
PE
21273 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21274 it.
21275
c339dc2e
PE
21276 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21277 so that we aren't warned about unused symbols.
21278
91a3e27b
PE
21279 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21280
399c71d3 21281 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21282
8ffc96f5
PE
21283 * xfns.c (x_real_positions): Mark locals as initialized.
21284
eef9bc79
PE
21285 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21286
098db9dd
PE
21287 * xterm.c: Fix problems found by static analysis with other toolkits.
21288 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21289 (x_dispatch_event): Declare static if USE_GTK, and
21290 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21291 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21292 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21293 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21294 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21295
eb18f6cc
PE
21296 * xmenu.c (menu_help_callback): Pointer type fixes.
21297 Use const pointers when pointing at readonly data. Avoid pointer
21298 signedness clashes.
21299 (FALSE): Remove unused macro.
21300 (update_frame_menubar): Remove unused decl.
21301
1fe72bf8
PE
21302 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21303
60d9e1db
PE
21304 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21305 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21306 (single_menu_item): Rename local to avoid shadowing.
21307
39261c26
PE
21308 * keyboard.c (make_lispy_event): Remove unused local var.
21309
018c5e19
PE
21310 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21311 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21312
63d2b86e
PE
21313 * bitmaps: Change bitmaps from unsigned char back to the X11
21314 compatible char. Avoid the old compiler warnings about
21315 out-of-range initializers by using, for example, '\xab' rather
21316 than 0xab.
21317
aefd87e1
PE
21318 * xgselect.c (xgselect_initialize): Check vs interface
21319 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21320
bf501fb9
PE
21321 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21322
e9829fdf
PE
21323 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21324 to read-only memory.
21325
1086c095
PE
21326 * fns.c (vector): Remove; this old hack is no longer needed.
21327
2baccd04 21328 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21329 Remove unused var.
dde42981 21330 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21331
72391843 21332 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21333
436c16df 21334 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21335 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21336 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21337
92bb796d 21338 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21339 (x_term_init): Remove local to avoid shadowing.
92bb796d 21340
764430a3 21341 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21342
21343 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21344 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21345
d1dfb56c
EZ
213462011-04-16 Eli Zaretskii <eliz@gnu.org>
21347
c4354cb4
EZ
21348 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21349
d1dfb56c
EZ
21350 Fix regex.c, syntax.c and friends for buffers > 2GB.
21351 * syntax.h (struct gl_state_s): Declare character position members
21352 EMACS_INT.
21353
21354 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21355
04f2d78b
CB
21356 * textprop.c (verify_interval_modification, interval_of):
21357 Declare arguments EMACS_INT.
d1dfb56c
EZ
21358
21359 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21360 EMACS_INT.
21361
21362 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21363
21364 * indent.c (Fvertical_motion): Local variable it_start is now
21365 EMACS_INT.
21366
21367 * regex.c (re_match, re_match_2, re_match_2_internal)
21368 (bcmp_translate, regcomp, regexec, print_double_string)
21369 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21370 (re_compile_pattern, re_exec): Declare arguments and local
21371 variables `size_t' and `ssize_t' and return values `regoff_t', as
21372 appropriate.
21373 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21374 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21375 <compile_stack_type>: `size' and `avail' are now `size_t'.
21376
21377 * regex.h <regoff_t>: Use ssize_t, not int.
21378 (re_search, re_search_2, re_match, re_match_2): Arguments that
21379 specify buffer/string position and length are now ssize_t and
21380 size_t. Return type is regoff_t.
21381
613052cd
BK
213822011-04-16 Ben Key <bkey76@gmail.com>
21383
21384 * nsfont.m: Fixed bugs in ns_get_family and
21385 ns_descriptor_to_entity that were caused by using free to
21386 deallocate memory blocks that were allocated by xmalloc (via
21387 xstrdup). This caused Emacs to crash when compiled with
21388 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21389 --enable-checking=xmallocoverrun). xfree is now used to
21390 deallocate these memory blocks.
21391
4170f62f 213922011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21393
71b41406
PE
21394 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21395
9587a89d
PE
21396 emacs_write: Accept and return EMACS_INT for sizes.
21397 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21398 et seq.
21399 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21400 Accept and return EMACS_INT.
21401 (emacs_gnutls_write): Return the number of bytes written on
21402 partial writes.
21403 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21404 (emacs_read, emacs_write): Remove check for negative size, as the
21405 Emacs source code has been audited now.
9587a89d
PE
21406 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21407 (emacs_read, emacs_write): Use it.
273a5f82
PE
21408 * process.c (send_process): Adjust to the new signatures of
21409 emacs_write and emacs_gnutls_write. Do not attempt to store
21410 a byte offset into an 'int'; it might overflow.
9587a89d 21411 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21412
3e047f51
PE
21413 * sound.c: Don't assume sizes fit in 'int'.
21414 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21415 Return EMACS_INT, not int.
3e047f51 21416 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21417 Accept EMACS_INT, not int.
21418 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21419 record read return values.
21420
cc39a9db
BK
214212011-04-15 Ben Key <bkey76@gmail.com>
21422
c9d0ec6d
JB
21423 * keyboard.c (Qundefined): Don't declare static since it is used
21424 in nsfns.m.
21425 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21426 static since they are used in nsfont.m.
cc39a9db 21427
6c60eb9f
SM
214282011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21429
21430 * process.c (Qprocessp): Don't declare static.
21431 * lisp.h (Qprocessp): Declare again.
21432
7990b61a
JB
214332011-04-15 Juanma Barranquero <lekktu@gmail.com>
21434
21435 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21436
5d4cb038
PE
214372011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21438
8bd7b830 21439 Improve C-level modularity by making more things 'static'.
cd64ea1d 21440
e3b27b31
PE
21441 Don't publish debugger-only interfaces to other modules.
21442 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21443 (verify_bytepos, count_markers): Move decls to the only modules
21444 that need them.
21445 * region-cache.h (pp_cache): Likewise.
21446 * window.h (check_all_windows): Likewise.
21447 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21448
5d4cb038
PE
21449 * sysdep.c (croak): Now static, if
21450 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21451 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21452
21453 * alloc.c (refill_memory_reserve): Now static if
21454 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21455 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21456
e87b6180
PE
21457 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21458 Define only if USE_LUCID.
21459
ac64929e
PE
21460 * xrdb.c (x_customization_string, x_rm_string): Now static.
21461
6f37259d
PE
21462 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21463 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21464
1683e3ab
PE
21465 * xdisp.c (draw_row_with_mouse_face): Now static.
21466 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21467
de9c2632
PE
21468 * window.h (check_all_windows): Mark externally visible.
21469
2b96acb7
PE
21470 * window.c (window_deletion_count): Now static.
21471
21472 * undo.c: Make symbols static if they're not exported.
21473 (last_undo_buffer, last_boundary_position, pending_boundary):
21474 Now static.
21475
50436f33
PE
21476 * textprop.c (interval_insert_behind_hooks): Now static.
21477 (interval_insert_in_front_hooks): Likewise.
21478
64520e5c
PE
21479 * term.c: Make symbols static if they're not exported.
21480 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21481 (max_frame_lines, tty_set_terminal_modes):
21482 (tty_reset_terminal_modes, tty_turn_off_highlight):
21483 (get_tty_terminal): Now static.
21484 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21485 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21486 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21487 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21488 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21489
1fa53021
PE
21490 * sysdep.c: Make symbols static if they're not exported.
21491 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21492 Now static.
21493 (sigprocmask_set, full_mask): Remove; unused.
21494 (wait_debugging): Mark as visible.
21495 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21496 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21497
d4b43b22
PE
21498 * syntax.c (syntax_temp): Define only if !__GNUC__.
21499
b7c513d0
PE
21500 * sound.c (current_sound_device, current_sound): Now static.
21501
989b29ad
PE
21502 * search.c (searchbufs, searchbuf_head): Now static.
21503
13a55a78
PE
21504 * scroll.c (scroll_cost): Remove; unused.
21505 * dispextern.h (scroll_cost): Remove decl.
21506
de68a1fc
PE
21507 * region-cache.h (pp_cache): Mark as externally visible.
21508
40ccffa6
PE
21509 * process.c: Make symbols static if they're not exported.
21510 (process_tick, update_tick, create_process, chan_process):
21511 (Vprocess_alist, proc_buffered_char, datagram_access):
21512 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21513 (deactivate_process): Mark defn as static, as well as decl.
21514 * lisp.h (create_process): Remove decl.
21515 * process.h (chan_process, Vprocess_alist): Remove decls.
21516
ad64fc97
PE
21517 * print.c: Make symbols static if they're not exported.
21518 (print_depth, new_backquote_output, being_printed, print_buffer):
21519 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21520 (print_interval, print_number_index, initial_stderr_stream):
21521 Now static.
21522 * lisp.h (Fprinc): Remove decl.
21523 (debug_output_compilation_hack): Mark as externally visible.
21524
adddb265
PE
21525 * sysdep.c (croak): Move decl from here to syssignal.h.
21526 * syssignal.h (croak): Put it here, so the API can be checked when
21527 'croak' is called from dissociate_if_controlling_tty.
21528
1717ede2
PE
21529 * minibuf.c: Make symbols static if they're not exported.
21530 (minibuf_save_list, choose_minibuf_frame): Now static.
21531 * lisp.h (choose_minibuf_frame): Remove decl.
21532
fa5fb2bc
PE
21533 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21534
1e3890d1
PE
21535 * lread.c: Make symbols static if they're not exported.
21536 (read_objects, initial_obarray, oblookup_last_bucket_number):
21537 Now static.
21538 (make_symbol): Remove; unused.
21539 * lisp.h (initial_obarray, make_symbol): Remove decls.
21540
8a1414fa
PE
21541 * keyboard.c: Make symbols static if they're not exported.
21542 (single_kboard, recent_keys_index, total_keys, recent_keys):
21543 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21544 (this_single_command_key_start, echoing, last_auto_save):
21545 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21546 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21547 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21548 (Vlispy_mouse_stem, double_click_count):
21549 Now static.
21550 (force_auto_save_soon): Define only if SIGDANGER.
21551 (ignore_mouse_drag_p): Now static if
21552 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21553 (print_help): Remove; unused.
21554 (stop_character, last_timer_event): Mark as externally visible.
21555 * keyboard.h (ignore_mouse_drag_p): Declare only if
21556 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21557 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21558 * lisp.h (echoing): Remove decl.
21559 (force_auto_save_soon): Declare only if SIGDANGER.
21560 * xdisp.c (redisplay_window): Simplify code, to make it more
21561 obvious that ignore_mouse_drag_p is not accessed if !defined
21562 USE_GTK && !defined HAVE_NS.
21563
93ea6e8f
PE
21564 * intervals.c: Make symbols static if they're not exported.
21565 (merge_properties_sticky, merge_interval_right, delete_interval):
21566 Now static.
21567 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21568
77382fcc
PE
21569 * insdel.c: Make symbols static if they're not exported.
21570 However, leave prepare_to_modify_buffer alone. It's never
21571 called from outside this function, but that appears to be a bug.
21572 (combine_after_change_list, combine_after_change_buffer):
4889fc82 21573 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
21574 (adjust_after_replace_noundo): Remove; unused.
21575 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 21576 (signal_before_change): Remove decls.
77382fcc 21577
9306c32e
PE
21578 * indent.c (val_compute_motion, val_vmotion): Now static.
21579
cd44d2eb
PE
21580 * image.c: Make symbols static if they're not exported.
21581 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21582 if USE_GTK.
21583 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21584 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21585
ad9a7a06
PE
21586 * fringe.c (standard_bitmaps): Now static.
21587 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21588
81626931
PE
21589 * frame.c: Make symbols static if they're not exported.
21590 (x_report_frame_params, make_terminal_frame): Now static.
21591 (get_frame_param): Now static, unless HAVE_NS.
21592 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21593 (x_get_resource_string): Remove; not used.
21594 * frame.h (make_terminal_frame, x_report_frame_params):
21595 (x_get_resource_string); Remove decls.
21596 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21597 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21598
239f9db9
PE
21599 * font.c, fontset.c: Make symbols static if they're not exported.
21600 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21601 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21602 * font.c (font_close_object): Now static.
21603 * font.h (font_close_object): Remove.
21604 * fontset.c (FONTSET_OBJLIST): Remove.
21605 (free_realized_fontset) #if-0 the body, which does nothing.
21606 (face_suitable_for_char_p): #if-0, as it's never called.
21607 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
21608 * xfaces.c (face_at_string_position):
21609 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
21610 since 0 is always ASCII.
21611
dfcf3579
PE
21612 * fns.c (weak_hash_tables): Now static.
21613
5045092b
PE
21614 * fileio.c: Make symbols static if they're not exported.
21615 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21616 (Vwrite_region_annotation_buffers): Now static.
21617
57a96f5c
PE
21618 * eval.c: Make symbols static if they're not exported.
21619 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21620 * lisp.h (backtrace_list): Remove decl.
21621
35f08c38
PE
21622 * emacs.c: Make symbols static if they're not exported.
21623 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21624 (fatal_error_code, fatal_error_signal_hook, standard_args):
21625 Now static.
21626 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21627 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21628 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21629 * lisp.h (fatal_error_signal_hook): Remove decl.
21630 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21631
f44bd759
PE
21632 * editfns.c: Move a (normally-unused) function to its only use.
21633 * editfns.c, lisp.h (get_operating_system_release): Remove.
21634 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21635 worth the hassle of breaking this out.
21636
b532497d
PE
21637 * xterm.c: Make symbols static if they're not exported.
21638 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21639 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21640 (x_destroy_window, x_delete_display):
21641 Now static.
21642 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21643 (x_mouse_leave): Remove; unused.
21644 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21645 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21646 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21647 Remove decls.
21648 (x_mouse_leave): Declare only if WINDOWSNT.
21649 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21650 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21651 USE_X_TOOLKIT.
21652
1675728f
PE
21653 * ftxfont.c: Make symbols static if they're not exported.
21654 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21655 HAVE_FREETYPE.
21656 * font.h (ftxfont_driver): Likewise.
21657
e4cebfca
PE
21658 * xfns.c: Make symbols static if they're not exported.
21659 (x_last_font_name, x_display_info_for_name):
21660 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21661 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21662 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21663 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21664 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21665 (last_show_tip_args): Now static.
21666 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21667 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21668 (x_screen_planes): Remove; unused.
21669 * dispextern.h (x_screen_planes): Remove decl.
21670
5bf46f05
PE
21671 * dispnew.c: Make symbols static if they're not exported.
21672 * dispextern.h (redraw_garbaged_frames, scrolling):
21673 (increment_row_positions): Remove.
21674 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21675 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21676 Now static.
21677 (redraw_garbaged_frames): Remove; unused.
21678
435f4c28
PE
21679 * xfaces.c: Make symbols static if they're not exported.
21680 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21681 Remove decls.
21682 * xterm.h (defined_color): Remove decls.
21683 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21684 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21685 (menu_face_changed_default, defined_color, free_realized_face):
21686 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21687 (ascii_face_of_lisp_face): Remove; unused.
21688
8524aef3
PE
21689 * xdisp.c: Make symbols static if they're not exported.
21690 * dispextern.h (scratch_glyph_row, window_box_edges):
21691 (glyph_to_pixel_coords, set_cursor_from_row):
21692 (get_next_display_element, set_iterator_to_next):
21693 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21694 (show_mouse_face): Remove decls
21695 * frame.h (message_buf_print): Likewise.
21696 * lisp.h (pop_message, set_message, check_point_in_composition):
21697 Likewise.
21698 * xterm.h (set_vertical_scroll_bar): Likewise.
21699 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21700 (message_buf_print, scratch_glyph_row, displayed_buffer):
21701 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21702 (get_next_display_element, show_mouse_face, window_box_edges):
21703 (frame_to_window_pixel_xy, check_point_in_composition):
21704 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21705 (glyph_to_pixel_coords): Remove; unused.
21706
16390cd2
PE
21707 * dired.c (file_name_completion): Now static.
21708
21709 * dbusbind.c (xd_in_read_queued_messages): Now static.
21710
a25f4dfa
PE
21711 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21712 * data.c (circular_list_error): Remove.
21713
14a9c8df
PE
21714 * commands.h (last_point_position, last_point_position_buffer):
21715 (last_point_position_window): Remove decls.
21716 * keyboard.c: Make these variables static.
21717
04f2d78b
CB
21718 * coding.h (coding, code_convert_region, encode_coding_gap):
21719 Remove decls.
74ab6df5
PE
21720 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21721 (iso_code_class, detect_coding, code_convert_region): Now static.
21722 (encode_coding_gap): Remove; unused.
21723
38dfbee1
PE
21724 * chartab.c (chartab_chars, chartab_bits): Now static.
21725
a2cb4e63
PE
21726 * charset.h (charset_iso_8859_1): Remove decl.
21727 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21728 Now static.
21729
127198fd
PE
21730 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21731 * ccl.c (Vccl_program_table): Now static.
21732 (check_ccl_update): Remove; unused.
21733
d85b608f
PE
21734 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21735 * category.h: ... from here.
21736 * category.c (check_category_table, set_category_set): Now static.
21737
31cd66f3
PE
21738 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21739 * lisp.h: Remove these decls.
21740
c358e587
PE
21741 * buffer.c (buffer_count): Remove unused var.
21742
e78aecca
PE
21743 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21744 so that it's not optimized away.
21745 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21746 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21747 exported only to the debugger.
21748
e192d7d3 21749 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 21750 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 21751
92470028
PE
21752 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21753 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21754 was inaccessible from Lisp.
21755 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21756 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21757
244ed907
PE
21758 alloc.c: Import and export fewer symbols, and remove unused items.
21759 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21760 is defined.
21761 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21762 it's not optimized away by whole-program optimization.
21763 (message_enable_multibyte, free_misc): Remove.
21764 (catchlist, handlerlist, mark_backtrace):
21765 Declare only if BYTE_MARK_STACK.
21766 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21767 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21768 (message_enable_multibyte): Remove decl.
21769 (free_misc, interval_free_list, float_block, float_block_index):
21770 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21771 (cons_free_list, last_marked_index):
21772 Now static.
21773 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21774 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21775 (mark_backtrace): Define only if BYTE_MARK_STACK.
21776 * xdisp.c (message_enable_multibyte): Now static.
21777
61c2b50e 21778 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
21779 This makes it easier for human readers (and static analyzers)
21780 to see whether these variables are used from other modules.
21781 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21782 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21783 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21784 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21785 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21786 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21787 * xmenu.c, xselect.c:
21788 Declare Q* vars static if they are not used in other modules.
21789 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21790 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21791 Remove decls of unexported vars.
21792 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21793
95c82688
PE
21794 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21795
16a97296
PE
21796 Make Emacs functions such as Fatom 'static' by default.
21797 This makes it easier for human readers (and static analyzers)
21798 to see whether these functions can be called from other modules.
21799 DEFUN now defines a static function. To make the function external
21800 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
21801 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21802 (Finit_image_library):
16a97296
PE
21803 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21804 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21805 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21806 Remove decls, since these functions are now static.
21807 (Funintern, Fget_internal_run_time): New decls, since these functions
21808 were already external.
95c82688 21809
16a97296
PE
21810 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21811 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21812 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21813 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21814 * keyboard.c, keymap.c, lread.c:
21815 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21816 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21817 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21818 Mark functions with DEFUE instead of DEFUN,
21819 if they are used in other modules.
21820 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21821 decls for now-static functions.
21822 * buffer.h (Fdelete_overlay): Remove decl.
21823 * callproc.c (Fgetenv_internal): Mark as internal.
21824 * composite.c (Fremove_list_of_text_properties): Remove decl.
21825 (Fcomposition_get_gstring): New forward static decl.
21826 * composite.h (Fcomposite_get_gstring): Remove decl.
21827 * dired.c (Ffile_attributes): New forward static decl.
21828 * doc.c (Fdocumntation_property): New forward static decl.
21829 * eval.c (Ffetch_bytecode): New forward static decl.
21830 (Funintern): Remove extern decl; now in .h file where it belongs.
21831 * fileio.c (Fmake_symbolic_link): New forward static decl.
21832 * image.c (Finit_image_library): New forward static decl.
21833 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21834 * intervals.h (Fprevious_property_change):
21835 (Fremove_list_of_text_properties): Remove decls.
21836 * keyboard.c (Fthis_command_keys): Remove decl.
21837 (Fcommand_execute): New forward static decl.
21838 * keymap.c (Flookup_key): New forward static decl.
21839 (Fcopy_keymap): Now static.
21840 * keymap.h (Flookup_key): Remove decl.
21841 * process.c (Fget_process): New forward static decl.
21842 (Fprocess_datagram_address): Mark as internal.
21843 * syntax.c (Fsyntax_table_p): New forward static decl.
21844 (skip_chars): Remove duplicate decl.
21845 * textprop.c (Fprevious_property_change): New forward static decl.
21846 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21847 Now internal.
21848 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21849 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21850
785bbd42
PE
21851 * editfns.c (Fformat): Remove unreachable code.
21852
8b913b57
AS
218532011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21854
21855 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21856 change. (Bug#8496)
21857
a6744a35
EZ
218582011-04-13 Eli Zaretskii <eliz@gnu.org>
21859
21860 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21861 when at ZV. (Bug#8487)
21862
e7974947
AS
218632011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21864
baad03f0
AS
21865 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21866 (Bug#8437)
21867 * keyboard.c (parse_tool_bar_item): Likewise.
21868 * sound.c (sound_cleanup, alsa_close): Likewise.
21869 * termcap.c (tgetent): Likewise.
21870 * xfns.c (x_default_font_parameter): Likewise.
21871 * xsettings.c (read_and_apply_settings): Likewise.
21872
e7974947
AS
21873 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21874 (overrun_check_free): Protoize.
21875
28272684
PE
218762011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21877
21878 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21879 since callers should never pass a negative size.
21880 Change the signature to match that of plain 'read' and 'write'; see
21881 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21882 * lisp.h: Update prototypes of emacs_write and emacs_read.
21883
11997c76
EZ
218842011-04-11 Eli Zaretskii <eliz@gnu.org>
21885
21886 * xdisp.c (redisplay_window): Don't try to determine the character
21887 position of the scroll margin if the window start point w->startp
e896f03c 21888 is outside the buffer's accessible region. (Bug#8468)
11997c76 21889
8a2cbd72
EZ
218902011-04-10 Eli Zaretskii <eliz@gnu.org>
21891
21892 Fix write-region and its subroutines for buffers > 2GB.
21893 * fileio.c (a_write, e_write): Modify declaration of arguments and
21894 local variables to support buffers larger than 2GB.
21895 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21896
21897 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21898 argument, local variables, and return value.
21899
21900 * lisp.h: Update prototypes of emacs_write and emacs_read.
21901
21902 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21903
4073e537 219042011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 21905
1ebfdcb6
PE
21906 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21907
b2ded58d
PE
21908 Fix more problems found by GCC 4.6.0's static checks.
21909
7d66342c
PE
21910 * xdisp.c (vmessage): Use a better test for character truncation.
21911
bbf47d44
PE
21912 * charset.c (load_charset_map): <, not <=, for optimization,
21913 and to avoid potential problems with integer overflow.
9248994d 21914 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 21915 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 21916 * editfns.c (Fformat): Likewise.
1e69125e 21917 * syntax.c (skip_chars): Likewise.
3befa583 21918
e3019616
PE
21919 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21920 This also lets GCC 4.6.0 generate slightly better loop code.
21921
becfa255
PE
21922 * callint.c (Fcall_interactively): <, not <=, for optimization.
21923 (Fcall_interactively): Count the number of arguments produced,
21924 not the number of arguments given. This is simpler and lets GCC
21925 4.6.0 generate slightly better code.
21926
dae0cd48
PE
21927 * ftfont.c: Distingish more carefully between FcChar8 and char.
21928 The previous code passed unsigned char * to a functions like
21929 strlen and xstrcasecmp that expect char *, which does not
21930 conform to the C standard.
21931 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21932 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21933 char * when the C standard requires it.
21934
76032d70
PE
21935 * keyboard.c (read_char): Remove unused var.
21936
eb3f1cc8
PE
21937 * eval.c: Port to Windows vsnprintf (Bug#8435).
21938 Include <limits.h>.
21939 (SIZE_MAX): Define if the headers do not.
21940 (verror): Do not give up if vsnprintf returns a negative count.
21941 Instead, grow the buffer. This ports to Windows vsnprintf, which
21942 does not conform to C99. Problem reported by Eli Zaretskii.
21943 Also, simplify the allocation scheme, by avoiding the need for
21944 calling realloc, and removing the ALLOCATED variable.
21945
70476b54
PE
21946 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21947
12020a9e
PE
21948 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21949 But keep the doprint source code for now, as we might revamp it
21950 and use it again (Bug#8435).
ea6c7ae6
PE
21951 * lisp.h (doprnt): Remove.
21952 * Makefile.in (base_obj): Remove doprnt.o.
21953 * deps.mk (doprnt.o): Remove.
21954
5fdb398c
PE
21955 error: Print 32- and 64-bit integers portably (Bug#8435).
21956 Without this change, on typical 64-bit hosts error ("...%d...", N)
21957 was used to print both 32- and 64-bit integers N, which relied on
21958 undefined behavior.
61bdb816 21959 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21960 * lisp.h (error, verror): Mark as printf-like functions.
21961 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21962 Report overflow in size calculations when allocating printf buffer.
21963 Do not truncate output string at its first null byte.
21964 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21965 Truncate the output at a character boundary, since vsnprintf does not
21966 do that.
21967 * charset.c (check_iso_charset_parameter): Convert internal
21968 character to string before calling 'error', since %c now has the
21969 printf meaning.
21970 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21971 overflow when computing char to be passed to 'error'. Do not
21972 pass Lisp_Object to 'error'; pass the integer instead.
21973 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21974 formatted with plain %d.
21975
b189fa66
PE
21976 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21977
bff87ef0
PE
21978 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21979
7e2cac20
PE
21980 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21981
ce4d90b5
PE
21982 * xterm.c (x_catch_errors): Remove duplicate declaration.
21983
266c9547
PE
21984 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21985
79c49ad2
PE
21986 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21987
368f4090
JM
219882011-04-10 Jim Meyering <meyering@redhat.com>
21989
21990 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21991 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21992 return ssize_t not "int", and use size_t as the buffer length.
21993 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21994 * gnutls.h: Update declarations.
21995 * process.c (read_process_output): Use ssize_t, to match.
21996 (send_process): Likewise.
21997
a32d4040
CY
219982011-04-09 Chong Yidong <cyd@stupidchicken.com>
21999
22000 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22001
8546720e 220022011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22003
04f2d78b
CB
22004 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22005 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22006
8546720e
GM
22007 * xterm.c (handle_one_xevent):
22008 * xmenu.c (create_and_show_popup_menu):
22009 * xselect.c (x_decline_selection_request)
22010 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22011
0a2f5c1a 220122011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22013
22014 Fix some uses of `int' instead of EMACS_INT.
22015 * search.c (string_match_1, fast_string_match)
22016 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22017 (scan_buffer, find_next_newline_no_quit)
22018 (find_before_next_newline, search_command, Freplace_match)
22019 (Fmatch_data): Make some `int' variables be EMACS_INT.
22020
22021 * xdisp.c (display_count_lines): 3rd argument and return value now
22022 EMACS_INT. All callers changed.
22023 (pint2hrstr): Last argument is now EMACS_INT.
22024
22025 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22026 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22027 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22028 (decode_coding_utf_16, decode_coding_emacs_mule)
22029 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22030 (decode_coding_ccl, decode_coding_charset)
22031 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22032 (decode_coding_iso_2022, decode_coding_emacs_mule)
22033 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22034 <char_offset, last_offset>: Declare EMACS_INT.
22035 (encode_coding_utf_8, encode_coding_utf_16)
22036 (encode_coding_emacs_mule, encode_invocation_designation)
22037 (encode_designation_at_bol, encode_coding_iso_2022)
22038 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22039 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22040 Declare EMACS_INT.
22041 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22042 (encode_invocation_designation): Last argument P_NCHARS is now
22043 EMACS_INT.
22044 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22045 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22046
22047 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22048 All users changed.
22049
22050 * ccl.c (Fccl_execute_on_string): Declare some variables
22051 EMACS_INT.
22052
8546720e 220532011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22054
22055 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22056
4e19a977
CS
220572011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22058
22059 * process.c (Fformat_network_address): Doc fix.
22060
87302331
R
220612011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22062
ee7683eb 22063 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22064
cbb59342
CY
220652011-04-08 Chong Yidong <cyd@stupidchicken.com>
22066
22067 * keyboard.c (read_char): Call Lisp function help-form-show,
22068 instead of using internal_with_output_to_temp_buffer.
22069 (Qhelp_form_show): New var.
e0d38eeb 22070 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22071
22072 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22073
22074 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22075
e67a13ab
CY
220762011-04-06 Chong Yidong <cyd@stupidchicken.com>
22077
04f2d78b
CB
22078 * process.c (Flist_processes): Remove to Lisp.
22079 (list_processes_1): Delete.
e67a13ab 22080
973f782d
EZ
220812011-04-06 Eli Zaretskii <eliz@gnu.org>
22082
7c106b1e
EZ
22083 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22084
973f782d
EZ
22085 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22086
41cf7d1a 220872011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22088
ca23cc88
PE
22089 Fix more problems found by GCC 4.6.0's static checks.
22090
f390e2d5
PE
22091 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22092
42eea0d0
PE
22093 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22094
b69769da 22095 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22096
f9541e84
PE
22097 * xdisp.c (vmessage): Mark as a printf-like function.
22098
13841b55
PE
22099 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22100
c136c10f
PE
22101 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22102
5e2d4a30
PE
22103 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22104 printf-like functions.
22105 (tiff_load): Add casts to remove these marks before passing them
22106 to system-supplied API.
22107
583f48b9
PE
22108 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22109
b25d760e
PE
22110 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22111 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22112 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22113 directly, rather than having caller test rule sign. This avoids
22114 some unnecessary tests.
22115 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22116 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22117 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22118
bc7b6697 22119 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22120 (xfont_open): Avoid unnecessary tests.
bc7b6697 22121
27ccc379
PE
22122 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22123
dcd5c89a
PE
22124 * composite.h, composite.c (composition_gstring_put_cache):
22125 Use EMACS_INT, not int, for length.
22126
b13a45c6
PE
22127 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22128 breaking out part of COMPOSITION_DECODE_RULE.
22129 (COMPOSITION_DECODE_RULE): Use it.
22130 * composite.c (get_composition_id): Remove unused local vars,
22131 by using the new macro.
22132
1e792e4d
PE
22133 * textprop.c (set_text_properties_1): Change while to do-while,
22134 since the condition is always true at first.
22135
dc6c6455 22136 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22137 (interval_deletion_adjustment): Return unsigned value.
22138 All uses changed.
dc6c6455 22139
aba7731a
PE
22140 * process.c (list_processes_1, create_pty, read_process_output):
22141 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22142 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22143 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22144 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22145 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22146
fdfc4bf3
PE
22147 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22148
fca8fe46 22149 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22150 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22151
06a0259a 22152 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22153 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22154 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22155
e7b9e80f
PE
22156 * print.c (print_error_message): Avoid int overflow.
22157
56201685
PE
22158 * font.c (font_list_entities): Redo for clarity,
22159 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22160
78834453 22161 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22162 (font_score): Avoid potential overflow in diff calculation.
78834453 22163
0bc0b309 22164 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22165 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22166
e610eaca
PE
22167 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22168
b895abce
PE
22169 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22170 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22171 can always succeed if overflow has undefined behavior.
22172
1f1d9321 22173 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22174 (wordify): Omit three unnecessary tests.
1f1d9321 22175
c59478bc
PE
22176 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22177 All callers changed. This avoids the need for an unused var.
22178
79b73827
PE
22179 * casefiddle.c (casify_region): Remove var that is set but not used.
22180
a4db5dfe
PE
22181 * dired.c (file_name_completion): Remove var that is set but not used.
22182
43aae36e
PE
22183 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22184
2a47c44d 22185 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22186 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22187
a37c69bf
PE
22188 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22189 Check for integer overflow on size calculations.
22190
328ab8e7
PE
22191 * buffer.c (Fprevious_overlay_change): Remove var that is set
22192 but not used.
22193
e5a2a5cb
PE
22194 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22195 Remove vars that are set but not used.
8d84a6eb 22196 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22197 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22198
a60e5f68
PE
22199 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22200
f661cb61 22201 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22202 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22203
f0397f5a
PE
22204 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22205 that are set but not used.
22206
8664db06 22207 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22208 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22209
6abdaa4a
PE
22210 * xselect.c (x_get_local_selection, x_handle_property_notify):
22211 Remove vars that are set but not used.
22212
0ce7538d 22213 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22214 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22215
9ae848fc
PE
22216 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22217 Remove var that is set but not used.
0b918413
PE
22218 (scroll_bar_windows_size): Now size_t, not int.
22219 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22220 Check for overflow.
9ae848fc 22221
a5a62657
PE
22222 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22223 (map_tty_color) [!defined MSDOS]: Likewise.
22224
5c5cdd39
PE
22225 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22226
66ebf983
PE
22227 * coding.c: Remove vars that are set but not used.
22228 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22229 All callers changed.
22230 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22231 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22232 (decode_coding_charset): Remove vars that are set but not used.
22233
1be4d761
PE
22234 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22235 that is set but not used.
22236
47553fa8
PE
22237 * print.c (print_object): Remove var that is set but not used.
22238
1f7196bf 22239 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22240 The gnulib version avoids calling malloc in the usual case,
22241 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22242 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22243 * filelock.c (current_lock_owner): Likewise.
22244 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22245 * sysdep.c: Include allocator.h, careadlinkat.h.
22246 (emacs_no_realloc_allocator): New static constant.
22247 (emacs_readlink): New function.
fdb61804
PE
22248 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22249 ../lib/careadlinkat.h.
d1fdcab7 22250
f84c17c7
SM
222512011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22252
22253 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22254 first non-nil return value).
22255
ef3862ad
JD
222562011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22257
22258 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22259 if not defined (Bug#8403).
22260
376a7006
JB
222612011-04-02 Juanma Barranquero <lekktu@gmail.com>
22262
22263 * xdisp.c (display_count_lines): Remove parameter `start',
22264 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22265 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22266 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22267 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22268 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22269 and thereabouts. All callers changed.
22270 (get_per_char_metric): Remove parameter `f', unused since
22271 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22272
6ca3801d
JM
222732011-04-02 Jim Meyering <meyering@redhat.com>
22274
22275 do not dereference NULL upon failed strdup
22276 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22277 (ns_get_family): Likewise.
22278
d8e2b5ba
JB
222792011-04-02 Juanma Barranquero <lekktu@gmail.com>
22280
22281 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22282
8c74fcbd
JD
222832011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22284
22285 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22286 later (Bug#8403).
22287
7200d79c
SM
222882011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22289
03408648 22290 Add lexical binding.
7200d79c 22291
03408648
SM
22292 * window.c (Ftemp_output_buffer_show): New fun.
22293 (Fsave_window_excursion):
22294 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22295
22296 * lread.c (lisp_file_lexically_bound_p): New function.
22297 (Fload): Bind Qlexical_binding.
22298 (readevalloop): Remove `evalfun' arg.
22299 Bind Qinternal_interpreter_environment.
22300 (Feval_buffer): Bind Qlexical_binding.
22301 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22302 Mark as dynamic.
22303 (syms_of_lread): Declare `lexical-binding'.
22304
22305 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22306
22307 * keyboard.c (eval_dyn): New fun.
22308 (menu_item_eval_property): Use it.
ca105506
SM
22309
22310 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22311
03408648
SM
22312 * fns.c (concat, mapcar1): Accept byte-code-functions.
22313
22314 * eval.c (Fsetq): Handle lexical vars.
22315 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22316 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22317 (FletX, Flet): Obey lexical binding.
22318 (Fcommandp): Handle closures.
22319 (Feval): New `lexical' arg.
22320 (eval_sub): New function extracted from Feval. Use it almost
22321 everywhere where Feval was used. Look up vars in lexical env.
22322 Handle closures.
22323 (Ffunctionp): Move from subr.el.
22324 (Ffuncall): Handle closures.
22325 (apply_lambda): Remove `eval_flags'.
22326 (funcall_lambda): Handle closures and new byte-code-functions.
22327 (Fspecial_variable_p): New function.
22328 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22329 but without exporting it to Lisp.
23aba0ea 22330
23aba0ea 22331 * doc.c (Fdocumentation, store_function_docstring):
03408648 22332 * data.c (Finteractive_form): Handle closures.
23aba0ea 22333
03408648
SM
22334 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22335 interactive spec.
ba83908c 22336
04f2d78b
CB
22337 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22338 New byte-codes.
03408648
SM
22339 (exec_byte_code): New function extracted from Fbyte_code to handle new
22340 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22341
03408648 22342 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22343
03408648 22344 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22345
e2abce01
JB
223462011-03-31 Juanma Barranquero <lekktu@gmail.com>
22347
22348 * xdisp.c (redisplay_internal): Fix prototype.
22349
63696a73 223502011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22351
63696a73 22352 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22353 (try_scrolling): Use it when setting scroll_limit.
22354 Limit scrolling to 100 screen lines.
63696a73
EZ
22355 (redisplay_window): Even when falling back on "recentering",
22356 position point in the window according to scroll-conservatively,
22357 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22358
22359 (try_scrolling): When point is above the window, allow searching
22360 as far as scroll_max, or one screenful, to compute vertical
22361 distance from PT to the scroll margin position. This prevents
22362 try_scrolling from unnecessarily failing when
22363 scroll-conservatively is set to a value slightly larger than the
22364 window height. Clean up the case of PT below the margin at bottom
22365 of window: scroll_max can no longer be INT_MAX. When aggressive
22366 scrolling is in use, don't let point enter the opposite scroll
22367 margin as result of the scroll.
22368 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22369 threshold of 100 lines for never-recentering scrolling.
22370
e4cc2dfc
JB
223712011-03-31 Juanma Barranquero <lekktu@gmail.com>
22372
22373 * dispextern.h (move_it_by_lines):
22374 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22375 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22376 (message_log_check_duplicate): Remove parameters `prev_bol' and
22377 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22378 (redisplay_internal): Remove parameter `preserve_echo_area',
22379 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22380
22381 * indent.c (Fvertical_motion):
22382 * window.c (window_scroll_pixel_based, Frecenter):
22383 Don't pass `need_y_p' to `move_it_by_lines'.
22384
1c470562
SM
223852011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22386
44f230aa
SM
22387 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22388 steal a few bits to be more compact.
22389 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22390 Remove unneeded casts.
22391
1c470562
SM
22392 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22393
888adce9
ZK
223942011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22395
22396 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22397 binding" message (bug#7967).
22398
f838ed7b
PE
223992011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22400
77861b95
PE
22401 Fix more problems found by GCC 4.6.0's static checks.
22402
de6dbc14
PE
22403 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22404 Remove unused local var.
22405
f838ed7b
PE
22406 * editfns.c (Fmessage_box): Remove unused local var.
22407
792c7b2b
PE
22408 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22409 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22410 Omit unused local vars.
c499e557 22411 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22412 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22413 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22414 Omit unused local var.
22415
ba0165e1
PE
22416 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22417 Don't assume string length fits in int.
32ad8845 22418 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22419 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22420
3c59b4c9
PE
22421 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22422 instead of alloca (Bug#8344).
22423
a3eed478 22424 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22425 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22426
eb4d412d
PE
22427 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22428
1658b401
PE
22429 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22430 concerns.
22431
22432 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22433
22434 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22435
9a2c6e05
PE
22436 * keyboard.c (syms_of_keyboard): Use the same style as later
22437 in this function when indexing through an array. This also
22438 works around GCC bug 48267.
22439
03d0a109
PE
22440 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22441
44f730c8
PE
22442 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22443
fe75f926
PE
22444 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22445 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22446
ffa8c828
PE
22447 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22448 This avoids undefined behavior on integer overflow, and is a bit
22449 more convenient anyway since it is compared to a size_t variable.
22450
c5101a77
PE
22451 Variadic C functions now count arguments with size_t, not int.
22452 This avoids an unnecessary limitation on 64-bit machines, which
22453 caused (substring ...) to crash on large vectors (Bug#8344).
22454 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22455 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22456 All variadic functions and their callers changed accordingly.
c5101a77
PE
22457 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22458 * data.c (arith_driver, float_arith_driver): Likewise.
22459 * editfns.c (general_insert_function): Likewise.
22460 * eval.c (struct backtrace.nargs, interactive_p)
22461 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22462 (funcall_lambda, mark_backtrace): Likewise.
22463 * fns.c (concat): Likewise.
22464 * frame.c (x_set_frame_parameters): Likewise.
22465 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22466 0 if not found, not -1. All callers changed.
22467
dd3f25f7
PE
22468 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22469 (stack_copy_size): Now size_t, not int.
22470 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22471
461c2ab9
JB
224722011-03-28 Juanma Barranquero <lekktu@gmail.com>
22473
22474 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22475 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22476 All callers changed.
22477
22478 * lisp.h (multibyte_char_to_unibyte):
22479 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22480 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22481 * character.h (CHAR_TO_BYTE8):
22482 * cmds.c (internal_self_insert):
22483 * editfns.c (general_insert_function):
22484 * keymap.c (push_key_description):
22485 * search.c (Freplace_match):
22486 * xdisp.c (message_dolog, set_message_1): All callers changed.
22487
f6d62986
SM
224882011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22489
22490 * keyboard.c (safe_run_hook_funcall): New function.
22491 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22492 don't set the hook to nil, but remove the offending function instead.
22493 (Qcommand_hook_internal): Remove, unused.
22494 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22495 Vcommand_hook_internal.
22496
22497 * eval.c (enum run_hooks_condition): Remove.
22498 (funcall_nil, funcall_not): New functions.
22499 (run_hook_with_args): Call each function through a `funcall' argument.
22500 Remove `cond' argument, now redundant.
22501 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22502 (Frun_hook_with_args_until_failure): Adjust accordingly.
22503 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22504
1db5b1ad
JB
225052011-03-28 Juanma Barranquero <lekktu@gmail.com>
22506
22507 * dispextern.h (string_buffer_position): Remove declaration.
22508
22509 * print.c (strout): Remove parameter `multibyte', unused since
22510 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22511
22512 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22513 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22514 All callers changed.
22515
22516 * w32.c (_wsa_errlist): Use braces for struct initializers.
22517
22518 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22519 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22520 All callers changed.
22521 (string_buffer_position): Likewise. Also, make static (it's never
22522 used outside xdisp.c).
22523 (cursor_row_p): Remove parameter `w', unused since
22524 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22525 (decode_mode_spec): Remove parameter `precision', introduced during
22526 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22527 All callers changed.
22528
5ffb62aa
JD
225292011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22530
22531 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22532
461c2ab9 225332011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22534
22535 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22536 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22537 (ns_update_auto_hide_menu_bar): New functions.
22538 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22539 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22540 ns_constrain_all_frames.
22541 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22542 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22543
5c380ffb
JD
225442011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22545
22546 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22547
9af30bdf
GM
225482011-03-27 Glenn Morris <rgm@gnu.org>
22549
22550 * syssignal.h: Replace RETSIGTYPE with void.
22551 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22552 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22553 Replace SIGTYPE with void everywhere.
22554 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22555 * s/template.h (SIGTYPE): Remove commented out definition.
22556
e2abce01
JB
225572011-03-26 Eli Zaretskii <eliz@gnu.org>
22558
22559 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22560 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22561
f868cd8a
JB
225622011-03-26 Juanma Barranquero <lekktu@gmail.com>
22563
59eb0929
JB
22564 * w32.c (read_unc_volume): Use parameter `henum', instead of
22565 global variable `wget_enum_handle'.
22566
22567 * keymap.c (describe_vector): Remove parameters `indices' and
22568 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22569 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22570
f868cd8a
JB
22571 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22572
22573 * keyboard.c (timer_check): Remove parameter `do_it_now',
22574 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22575 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22576 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22577
22578 * keyboard.c (read_char):
22579 * w32menu.c (w32_menu_display_help):
22580 * xmenu.c (show_help_event, menu_help_callback):
22581 Adjust calls to `show_help_echo'.
22582
22583 * gtkutil.c (xg_maybe_add_timer):
22584 * keyboard.c (readable_events):
22585 * process.c (wait_reading_process_output):
22586 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22587
22588 * insdel.c (adjust_markers_gap_motion):
22589 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22590 (gap_left, gap_right): Don't call it.
22591
2ecf6fdb
CY
225922011-03-25 Chong Yidong <cyd@stupidchicken.com>
22593
22594 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22595 incurred during fontification.
22596
6b1f9ba4
JB
225972011-03-25 Juanma Barranquero <lekktu@gmail.com>
22598
22599 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22600 (DEFVAR_PER_BUFFER): Don't pass it.
22601
22602 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22603 (scrolling_window): Don't pass it.
22604
0f4a96b5
JB
226052011-03-25 Juanma Barranquero <lekktu@gmail.com>
22606
22607 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22608
22609 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22610 and `suffix'.
22611 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22612 of variables specific to SELinux and computation of `encoded_absname'.
22613
22614 * image.c (XPutPixel): Remove unused variable `height'.
22615
22616 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22617
22618 * unexw32.c (get_section_info): Remove unused variable `section'.
22619
22620 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22621 (system_process_attributes): Remove unused variable `sess'.
22622 (sys_read): Remove unused variable `err'.
22623
22624 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22625 (w32_wnd_proc): Remove unused variable `isdead'.
22626 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22627 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22628 (x_create_tip_frame): Remove unused variable `tem'.
22629
22630 * w32inevt.c (w32_console_read_socket):
22631 Remove unused variable `no_events'.
22632
22633 * w32term.c (x_draw_composite_glyph_string_foreground):
22634 Remove unused variable `width'.
22635
1149507c
JB
226362011-03-24 Juanma Barranquero <lekktu@gmail.com>
22637
22638 * w32term.c (x_set_glyph_string_clipping):
22639 Don't pass uninitialized region to CombineRgn.
22640
9c88f339
JB
226412011-03-23 Juanma Barranquero <lekktu@gmail.com>
22642
22643 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22644 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22645 (Fx_close_connection): Remove unused variable `i'.
22646
22647 * w32font.c (w32font_draw): Return number of glyphs.
22648 (w32font_open_internal): Remove unused variable `i'.
22649 (w32font_driver): Add missing initializer.
22650
22651 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22652 (fill_in_menu): Remove unused variable `items_added'.
22653
22654 * w32term.c (last_mouse_press_frame): Remove static global variable.
22655 (w32_clip_to_row): Remove unused variable `f'.
22656 (x_delete_terminal): Remove unused variable `i'.
22657
22658 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22659 (NOTHING): Remove unused static global variable.
22660 (uniscribe_check_otf): Remove unused variable `table'.
22661 (uniscribe_font_driver): Add missing initializers.
22662
dee091a3
JD
226632011-03-23 Julien Danjou <julien@danjou.info>
22664
22665 * term.c (Fsuspend_tty, Fresume_tty):
22666 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22667 * window.c (temp_output_buffer_show):
22668 * insdel.c (signal_before_change):
22669 * frame.c (Fhandle_switch_frame):
22670 * fileio.c (Fdo_auto_save):
22671 * emacs.c (Fkill_emacs):
22672 * editfns.c (save_excursion_restore):
22673 * cmds.c (internal_self_insert):
22674 * callint.c (Fcall_interactively):
22675 * buffer.c (Fkill_all_local_variables):
22676 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22677 Use Frun_hooks.
0f4a96b5 22678 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 22679 unconditionally since it does the check itself.
dee091a3 22680
2c520ab5 226812011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 22682
c9c49752
PE
22683 Fix more problems found by GCC 4.5.2's static checks.
22684
8abc3f12
PE
22685 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22686 the first time through the loop, since we know p0 < p1 then.
22687 This also avoids a gcc -Wstrict-overflow warning.
22688
a2d26660
PE
22689 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22690 leading to a memory leak, possible in functions like
22691 load_charset_map_from_file that can allocate an unbounded number
b12ef411 22692 of objects (Bug#8318).
a2d26660 22693
916c72e9
PE
22694 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22695 that could (at least in theory) be that large.
22696
19ab8a18
PE
22697 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22698 This is less likely to overflow, and avoids undefined behavior if
22699 overflow does occur. All callers changed. Use strtoul to scan
22700 for the unsigned long integer.
b7cbbd6f
PE
22701 (pint2hrstr): Simplify and tune code slightly.
22702 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 22703
f0641eff
PE
22704 * scroll.c (do_scrolling): Work around GCC bug 48228.
22705 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22706
7f650bb9
PE
22707 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22708 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
22709 (validate_x_resource_name): Simplify count usage.
22710 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 22711
37dd57d1
PE
22712 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22713 fail (Bug#8306).
81e56e61 22714
699979fc 22715 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 22716
401bf9b4
PE
22717 * process.c (Fmake_network_process): Use socklen_t, not int,
22718 where POSIX says socklen_t is required in portable programs.
22719 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 22720 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
22721 (Fmake_network_process, server_accept_connection):
22722 (wait_reading_process_output, read_process_output):
22723 Likewise.
22724
b93aacde
PE
22725 * process.c: Rename or move locals to avoid shadowing.
22726 (list_processes_1, Fmake_network_process):
22727 (read_process_output_error_handler, exec_sentinel_error_handler):
22728 Rename or move locals.
4dc343ee 22729 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 22730 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 22731 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 22732 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 22733 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 22734
af8a867c 22735 Make tparam.h and terminfo.c consistent.
44f230aa
SM
22736 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22737 Include tparam.h instead, since it declares them.
af8a867c
PE
22738 * cm.h (PC): Remove extern decl; tparam.h now does this.
22739 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22740 * terminfo.c: Include tparam.h, to check interfaces.
22741 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22742 (tparam): Adjust signature to match interface in tparam.h;
22743 this removes some undefined behavior. Check that outstring and len
22744 are zero, which they always are with Emacs.
22745 * tparam.h (PC, BC, UP): New extern decls.
22746
0248044d 22747 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 22748 (xftfont_open): Rename locals to avoid shadowing.
0248044d 22749
8ff096c1 22750 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
22751 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22752 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 22753 (ftfont_list): Remove unused local.
49eaafba
PE
22754 (get_adstyle_property, ftfont_pattern_entity):
22755 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22756 Rename locals to avoid shadowing.
8ff096c1 22757
e2be39f6
PE
22758 * xfont.c (xfont_list_family): Mark var as initialized.
22759
c9735e30
PE
22760 * xml.c (make_dom): Now static.
22761
8f5201ae
PE
22762 * composite.c (composition_compute_stop_pos): Rename local to
22763 avoid shadowing.
b246f932
PE
22764 (composition_reseat_it): Remove unused locals.
22765 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 22766 (composition_update_it): Mark var as initialized.
11b61122
PE
22767 (find_automatic_composition): Mark vars as initialized,
22768 with a FIXME (Bug#8290).
8f5201ae 22769
760fbc2c
PE
22770 character.h: Rename locals to avoid shadowing.
22771 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22772 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22773 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22774 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22775 to avoid shadowing.
22776
ff08eb85
PE
22777 * textprop.c (property_change_between_p): Remove; unused.
22778
fc7bf025
PE
22779 * intervals.c (interval_start_pos): Now static.
22780
235d7abc
PE
22781 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22782
44f230aa
SM
22783 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22784 Rename locals to avoid shadowing.
3e7d6594 22785
50060332
PE
22786 * sound.c (wav_play, au_play, Fplay_sound_internal):
22787 Fix pointer signedness.
d01f234b 22788 (alsa_choose_format): Remove unused local var.
c83b8872
PE
22789 (wav_play): Initialize a variable to 0, to prevent undefined
22790 behavior (Bug#8278).
50060332 22791
c4fc4e30
PE
22792 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22793
918436ed
PE
22794 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22795
c939f91b
PE
22796 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22797 clobbering (Bug#8298).
b9c7f648
PE
22798 * sysdep.c (sys_subshell): Likewise.
22799 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 22800
6bd8c144
PE
22801 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22802 This should get cleaned up, so that child_setup has the
22803 same signature on all platforms.
22804
7710357c 22805 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 22806 (relocate_fd): Rename locals to avoid shadowing.
7710357c 22807
c59da222
CY
228082011-03-22 Chong Yidong <cyd@stupidchicken.com>
22809
22810 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22811 not to be necessary, and produces flickering.
22812
66b87493
GM
228132011-03-20 Glenn Morris <rgm@gnu.org>
22814
22815 * config.in: Remove file.
22816
45b6f6d5
JB
228172011-03-20 Juanma Barranquero <lekktu@gmail.com>
22818
22819 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22820 are now in src/globals.h.
22821 (syms_of_minibuf): Remove spurious & from previous change.
22822
cd394be1 228232011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
22824
22825 * minibuf.c (completing-read-function): New variable.
22826 (completing-read-default): Rename from completing-read.
22827 (completing-read): Call completing-read-function.
22828
b14e3e21
CY
228292011-03-19 Juanma Barranquero <lekktu@gmail.com>
22830
22831 * xfaces.c (Fx_load_color_file):
22832 Read color file from absolute filename (bug#8250).
22833
f2b726e6
JB
228342011-03-19 Juanma Barranquero <lekktu@gmail.com>
22835
22836 * makefile.w32-in: Update dependencies.
22837
09f6ff02
EZ
228382011-03-17 Eli Zaretskii <eliz@gnu.org>
22839
22840 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22841
29a6015a
PE
228422011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22843
a3a6c54e
PE
22844 Fix more problems found by GCC 4.5.2's static checks.
22845
b766f867
PE
22846 * process.c (make_serial_process_unwind, send_process_trap):
22847 (sigchld_handler): Now static.
22848
be02381c
PE
22849 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22850 That way, the code declares only the vars that it needs.
22851 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22852 * s/cygwin.h (PTY_ITERATION): Likewise.
22853 * s/darwin.h (PTY_ITERATION): Likewise.
22854 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22855
57048744
PE
22856 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22857 * process.c (allocate_pty): Don't declare stb unless it's needed.
22858
7914961c 22859 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
22860 (CONSTANTLIM): Remove; unused.
22861 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22862 Define only if needed.
7914961c 22863
b3967b18
PE
22864 * unexelf.c (unexec): Name an expression,
22865 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
22866 Use a different way to cause a compilation error if anyone uses
22867 n rather than nn, a way that does not involve shadowing.
73366a00 22868 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 22869
29a6015a
PE
22870 * deps.mk (unexalpha.o): Remove; unused.
22871
43cfc33e 22872 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 22873 * unexec.h: New file.
ce701a33
PE
22874 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22875 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22876 Depend on unexec.h.
22877 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22878 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22879 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 22880 Change as necessary to match prototype in unexec.h.
ce701a33 22881
01f44d5a
PE
22882 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22883 shadowing.
4f63c6bb 22884 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 22885
a6670b0b
PE
22886 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22887 Rename locals to avoid shadowing.
22888
cef2010d 22889 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 22890 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 22891
d4d7173a
PE
22892 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22893
f08b802a
PE
22894 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22895 warning when compiling print.c.
22896
3ddb0639
PE
22897 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22898 instead of using an uninitialized var.
5ad03b97 22899 (font_sort_entities): Mark var as initialized.
3ddb0639 22900
170a2692
PE
22901 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22902
e663c700
PE
22903 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22904 pointers to constants.
89bc529a 22905 (font_parse_fcname): Remove unused vars.
7b81e2d0 22906 (font_delete_unmatched): Now static.
ea838e10 22907 (font_get_spec): Remove; unused.
13a547c6
PE
22908 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22909 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22910 Rename or move locals to avoid shadowing.
e663c700 22911
2a80c887 22912 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 22913 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 22914
1384fa33 22915 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 22916 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 22917
8b2c52e9
PE
22918 * alloc.c (mark_backtrace): Move decl from here ...
22919 * lisp.h: ... to here, so that it can be checked.
22920
475545b5 22921 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 22922 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
22923 (lisp_indirect_variable): Name an expression,
22924 to avoid gcc -Wbad-function-cast warning.
1faed8ae 22925 (Fdefvar): Rename locals to avoid shadowing.
475545b5 22926
b1349114 22927 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 22928 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 22929 Use const pointer when appropriate.
b1349114 22930
a2928364
PE
22931 * lisp.h (get_system_name, get_operating_system_release):
22932 Move decls here, to check interfaces.
22933 * process.c (get_operating_system_release): Move decl to lisp.h.
22934 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
22935 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22936 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22937 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
22938 (Fformat_time_string, Fencode_time, Finsert_char):
22939 (Ftranslate_region_internal, Fformat):
22940 Rename or remove local vars to avoid shadowing.
9710023e 22941 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 22942
a415e694
PE
22943 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22944 avoid shadowing.
22945
8ef4622d
PE
22946 * lisp.h (eassert): Check that the argument compiles, even if
22947 ENABLE_CHECKING is not defined.
22948
946f9a5b
PE
22949 * data.c (Findirect_variable): Name an expression, to avoid
22950 gcc -Wbad-function-cast warning.
112396d6 22951 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22952 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22953 (Fmake_variable_buffer_local, Fmake_local_variable):
22954 Mark variables as initialized.
52746918 22955 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22956
e5aab7e7 22957 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22958 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22959 Rename locals to avoid shadowing.
dff45157
PE
22960 (mark_stack): Move local variables into the #ifdef region where
22961 they're used.
7bc26fdb
PE
22962 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22963 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22964 needed otherwise.
22965 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22966 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22967 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22968
e5aab7e7
PE
22969 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22970 avoids undefined behavior in theory.
22971
4da60324
PE
22972 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22973
88043301
PE
22974 Use functions, not macros, for up- and down-casing (Bug#8254).
22975 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22976 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22977 to use the following functions instead of these macros.
22978 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22979 EMACS_INT, since callers assume the returned value fits in int.
22980 (upcase1): Likewise, for UPCASE_TABLE.
22981 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22982 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22983 the race-condition problem in the old DOWNCASE.
88043301 22984
19ed5445
PE
22985 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22986 Rename locals to avoid shadowing.
22987 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22988 (regex_compile, re_search_2, re_match_2_internal):
22989 Remove unused local vars.
952db0d7
PE
22990 (FREE_VAR): Rewrite so as not to use empty "else",
22991 which gcc can warn about.
da053e48 22992 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22993 (RETALLOC_IF): Define only if needed.
22994 (WORDCHAR_P): Likewise. This one is never needed, but is used
22995 only in a comment talking about a compiler bug, so put inside
22996 the #if 0 of that comment.
22997 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22998 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22999 Remove; unused.
19ed5445 23000
1f3561e4 23001 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23002 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23003 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23004
ded6f8f7
PE
23005 * search.c (simple_search): Remove unused var.
23006
dbd37a95
PE
23007 * dired.c (compile_pattern): Move decl from here ...
23008 * lisp.h: ... to here, so that it can be checked.
23009 (struct re_registers): New forward decl.
23010
7e47afad
PE
23011 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23012
85f24f61
PE
23013 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23014 All uses changed.
23015 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23016 Rename locals to avoid shadowing.
5671df8f 23017 (Fvertical_motion): Mark locals as initialized.
85f24f61 23018
181aa2be 23019 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23020 (casify_region): Mark local as initialized.
181aa2be 23021
930d429c
PE
23022 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23023
7082eac6
PE
23024 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23025 New macros, so that the caller can use some names other than
23026 gcpro1, gcpro2, etc.
23027 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23028 of the new macros.
23029 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23030 argument, for consistency with GCPRO2_VAR, etc: it is now the
23031 prefix of the variable, not the variable itself. All uses
23032 changed.
38b2c076
PE
23033 * dired.c (directory_files_internal, file_name_completion):
23034 Rename locals to avoid shadowing.
23035
15206ed9
PE
23036 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23037 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23038 dired.c's scmp function, had undefined behavior.
23039 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23040 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23041 * buffer.h: ... to here, because these macros use current_buffer,
23042 and the new implementation with inline functions needs to have
23043 current_buffer in scope now, rather than later when the macros
23044 are used.
23045 (downcase, upcase1): New static inline functions.
23046 (DOWNCASE, UPCASE1): Reimplement using these functions.
23047 This avoids undefined behavior in expressions like
23048 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23049 from race conditions in accessing the global variables
23050 case_temp1 and case_temp2.
23051 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23052 * lisp.h (case_temp1, case_temp2): Remove their decls.
23053 * character.h (ASCII_CHAR_P): Move from here ...
23054 * lisp.h: ... to here, so that the inline functions mentioned
23055 above can use them.
23056
4a6bea26
PE
23057 * dired.c (directory_files_internal_unwind): Now static.
23058
f14b7e14
PE
23059 * fileio.c (file_name_as_directory, directory_file_name):
23060 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23061 Now static.
2893f146
PE
23062 (file_name_as_directory): Use const pointers when appropriate.
23063 (Fexpand_file_name): Likewise. In particular, newdir might
23064 point at constant storage, so make it a const pointer.
fd4ead52 23065 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23066 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23067 signedness issues.
f839df0c
PE
23068 (Fset_file_times, Finsert_file_contents, auto_save_error):
23069 Rename locals to avoid shadowing.
f14b7e14 23070
5716756e 23071 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23072 (Ftry_completion, Fall_completions): Rename or remove locals
23073 to avoid shadowing.
5716756e 23074
b4c3046a
PE
23075 * marker.c (bytepos_to_charpos): Remove; unused.
23076
b45db522
PE
23077 * lisp.h (verify_bytepos, count_markers): New decls,
23078 so that gcc does not warn that these functions aren't declared.
23079
85876d07
PE
23080 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23081 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23082 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23083 (copy_text): Remove unused local var.
85876d07 23084
03d78a21 23085 * filelock.c (within_one_second): Now static.
b3dd38ab 23086 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23087
5df8f01b
PE
23088 * buffer.c (fix_overlays_before): Mark locals as initialized.
23089 (fix_start_end_in_overlays): Likewise. This function should be
23090 simplified by using pointers-to-pointers, but that's a different
23091 matter.
b1d876f1 23092 (switch_to_buffer_1): Now static.
8f54f30a
PE
23093 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23094 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23095
a70072c9 23096 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23097 Fix pointer signedness issue.
edced198
PE
23098 (sys_subshell): Mark local as volatile if checking for lint,
23099 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23100 (MAXPATHLEN): Define only if needed.
a70072c9 23101
a0977c44
PE
23102 * process.c (serial_open, serial_configure): Move decls from here ...
23103 * systty.h: ... to here, so that they can be checked.
23104
a884fdcc
PE
23105 * fns.c (get_random, seed_random): Move extern decls from here ...
23106 * lisp.h: ... to here, so that they can be checked.
23107
604efe86 23108 * sysdep.c (reset_io): Now static.
b8950c94 23109 (wait_for_termination_signal): Remove; unused.
604efe86 23110
38fc62d9
PE
23111 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23112 (copy_keymap_item, append_key, push_text_char_description):
23113 Now static.
1004a21a 23114 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23115 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23116 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23117 (describe_map_tree):
23118 Rename locals to avoid shadowing.
38fc62d9 23119
2f2650da
PE
23120 * keyboard.c: Declare functions static if they are not used elsewhere.
23121 (echo_char, echo_dash, cmd_error, top_level_2):
23122 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23123 (read_char, kbd_buffer_get_event, make_lispy_position):
23124 (make_lispy_event, make_lispy_movement, apply_modifiers):
23125 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23126 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23127 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23128 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23129 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23130
a053e86c 23131 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23132 (mark_kboards): Move decl here ...
23133 * alloc.c (mark_kboards): ... from here.
a053e86c 23134
4752793e
PE
23135 * lisp.h (force_auto_save_soon): New decl.
23136
74f10ca7 23137 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23138 (DEFINE_DUMMY_FUNCTION): New macro.
23139 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23140 Use it.
c03cd23f
PE
23141 (main): Add casts to avoid warnings
23142 if GCC considers string literals to be constants.
74f10ca7 23143
022e70d4
PE
23144 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23145
59d6fe83
PE
23146 * dbusbind.c: Pointer signedness fixes.
23147 (xd_signature, xd_append_arg, xd_initialize):
23148 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23149 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23150 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23151 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23152
78320123
PE
23153 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23154 if GCC considers string literals to be constants.
49cebcca 23155 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23156
35ac2a97
SM
231572011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23158
fb103ca9
SM
23159 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23160 (print_preprocess, print_object): New macro to fix last change.
23161
35ac2a97
SM
23162 * print.c (print_preprocess): Don't forget font objects.
23163
62973b41
JB
231642011-03-16 Juanma Barranquero <lekktu@gmail.com>
23165
23166 * emacs.c (USAGE3): Doc fixes.
23167
0e48bb22
AS
231682011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23169
23170 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23171 structure.
23172
7684e57b
JB
231732011-03-14 Juanma Barranquero <lekktu@gmail.com>
23174
23175 * lisp.h (VWindow_system, Qfile_name_history):
23176 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23177 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23178 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23179
23180 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23181 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23182
23183 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23184 * w32console.c (detect_input_pending, read_input_pending)
23185 (encode_terminal_code):
23186 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23187 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23188 (w32_system_caret_y, Qfile_name_history):
23189 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23190 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23191 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23192 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23193 * w32proc.c (Qlocal, report_file_error):
23194 * w32term.c (Vwindow_system, updating_frame):
23195 * w32uniscribe.c (initialized, uniscribe_font_driver):
23196 Remove unneeded extern declarations.
23197
2aa46d6c
CY
231982011-03-14 Chong Yidong <cyd@stupidchicken.com>
23199
c96bbc66 23200 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23201
cffc6f3b
CY
232022011-03-13 Chong Yidong <cyd@stupidchicken.com>
23203
23204 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23205 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23206 These macros can no longer be used for assignment.
23207
44f230aa
SM
23208 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23209 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23210 (record_buffer_markers, fetch_buffer_markers): New functions for
23211 recording and fetching special buffer markers.
23212 (set_buffer_internal_1, set_buffer_temp): Use them.
23213
23214 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23215
23216 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23217
23218 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23219 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23220
23221 * xdisp.c (hscroll_window_tree):
23222 (reconsider_clip_changes): Use PT instead of BUF_PT.
23223
d251f04b
EZ
232242011-03-13 Eli Zaretskii <eliz@gnu.org>
23225
23226 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23227 $(EMACS_ROOT)/lib/intprops.h.
23228
f0c77cd1
PE
232292011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23230
3eca4629
PE
23231 Fix more problems found by GCC 4.5.2's static checks.
23232
7c86ee98
PE
23233 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23234 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23235 (xg_free_frame_widgets): Make it clear that a local variable is
23236 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23237 (gdk_window_get_screen): Make it clear that this macro is needed
23238 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23239 (int_gtk_range_get_value): New function, which avoids a diagnostic
23240 from gcc -Wbad-function-cast.
23241 (xg_set_toolkit_scroll_bar_thumb): Use it.
23242 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23243 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23244 (get_utf8_string, xg_get_file_with_chooser):
23245 Rename locals to avoid shadowing.
23246 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23247
41729b81
PE
23248 * xgselect.c (xg_select): Remove unused var.
23249
f0c77cd1
PE
23250 * image.c (four_corners_best): Mark locals as initialized.
23251 (gif_load): Initialize transparent_p to zero (Bug#8238).
23252 Mark another local as initialized.
ec6cf4c6 23253 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23254
ce0ad53d 23255 * image.c (clear_image_cache): Now static.
d5d5a617 23256 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23257 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23258 (x_edge_detection): Remove unnecessary cast that
23259 gcc -Wbad-function-cast diagnoses.
2037898d 23260 (gif_load): Fix pointer signedness.
6ae141d6
PE
23261 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23262 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23263
33383987 232642011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23265
d32df629
PE
23266 Improve quality of tests for time stamp overflow.
23267 For example, without this patch (encode-time 0 0 0 1 1
23268 1152921504606846976) returns the obviously-bogus value (-948597
23269 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23270 reports time overflow. See
23271 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23272 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23273 * editfns.c: Include limits.h and intprops.h.
23274 (TIME_T_MIN, TIME_T_MAX): New macros.
23275 (time_overflow): Move earlier, to before first use.
23276 (hi_time, lo_time): New functions, for an accurate test for
23277 out-of-range times.
23278 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23279 (Fget_internal_run_time): Don't assume time_t fits in int.
23280 (make_time): Use list2 instead of Fcons twice.
23281 (Fdecode_time): More accurate test for out-of-range times.
23282 (check_tm_member): New function.
23283 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23284 (lisp_time_argument): Don't rely on undefined left-shift and
23285 right-shift behavior when checking for time stamp overflow.
8be6f318 23286
fe31d94c
PE
23287 * editfns.c (time_overflow): New function, refactoring common code.
23288 (Fformat_time_string, Fdecode_time, Fencode_time):
23289 (Fcurrent_time_string): Use it.
23290
8be6f318
PE
23291 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23292 * dired.c (make_time): Move to ...
23293 * editfns.c (make_time): ... here.
23294 * systime.h: Note the move.
23295
09d9db2c 232962011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23297
126bc0dc
YM
23298 * fringe.c (update_window_fringes): Remove unused variables.
23299
c47cbdfd
YM
23300 * unexmacosx.c (copy_data_segment): Also copy __got section.
23301 (Bug#8223)
23302
7ac80be9
EZ
233032011-03-12 Eli Zaretskii <eliz@gnu.org>
23304
c96bbc66 23305 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23306 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23307 Constify `char *' arguments and their references according to
23308 prototypes in tparam.h.
23309
ecb0f94d 23310 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23311
7ac80be9
EZ
23312 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23313 Adapt all references accordingly.
23314
23315 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23316
ef1fd07e
TT
233172011-03-11 Tom Tromey <tromey@redhat.com>
23318
23319 * buffer.c (syms_of_buffer): Remove obsolete comment.
23320
7ef4b50c
EZ
233212011-03-11 Eli Zaretskii <eliz@gnu.org>
23322
23323 * termhooks.h (encode_terminal_code): Declare prototype.
23324
23325 * msdos.c (encode_terminal_code): Don't declare prototype.
23326
23327 * term.c (encode_terminal_code): Now external again, used by
23328 w32console.c and msdos.c.
23329
44f230aa
SM
23330 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23331 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23332
4b1ec863 233332011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23334
1714f52b 23335 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23336
4b1ec863
PE
23337 * fringe.c (update_window_fringes): Mark locals as initialized
23338 (Bug#8227).
23339 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23340
524c7aa6
PE
23341 * alloc.c (mark_fringe_data): Move decl from here ...
23342 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23343 to check its interface.
23344 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23345
a5c0af81 23346 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23347 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23348 (fontset_font): Mark local as initialized.
a9a06e0b 23349 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23350
b4716021
PE
23351 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23352
811e9bac 23353 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23354 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23355 (x_own_selection, Fx_disown_selection_internal): Rename locals
23356 to avoid shadowing.
23357 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23358
7e3ab302
PE
23359 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23360 so that the caller can use some name other than gcpro1.
23361 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23362 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23363 (Fx_backspace_delete_keys_p):
23364 Use them to avoid shadowing, and rename vars to avoid shadowing.
23365 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23366 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23367 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23368 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23369 Remove unused locals.
7e3ab302
PE
23370 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23371 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23372 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23373 macros.
f78faa98 23374
e2b13473
PE
23375 * xterm.h (x_mouse_leave): New decl.
23376
77f23912
PE
23377 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23378 Remove unused functions.
cdf4ba58
PE
23379 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23380 (x_calc_absolute_position): Now static.
7411c686 23381 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23382 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23383 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23384 unless they are used.
38d0b34a
PE
23385 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23386 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23387 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23388 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23389 (x_error_catcher, x_connection_closed, x_error_handler):
23390 (x_error_quitter, xembed_send_message, x_iconify_frame):
23391 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23392 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23393 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23394
44f230aa
SM
23395 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23396 Rename or move locals to avoid shadowing.
6b463e58 23397 (tty_defined_color, merge_face_heights): Now static.
5967d051 23398 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23399 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23400 does not deduce is never used uninitialized.
73719eba
PE
23401 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23402 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23403
426994c3 23404 * terminal.c (store_terminal_param): Now static.
5489860b 23405
032f1620 23406 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23407 (set_frame_menubar): Remove unused local.
d4323972 23408 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23409 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23410 since they might point to immutable storage.
281585b0
PE
23411 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23412 since it's unused otherwise.
032f1620 23413
367c19e5 23414 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23415 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23416 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23417 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23418 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23419 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23420 does not deduce are never used uninitialized.
70739cbe 23421
07b48fa9
PE
23422 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23423
8868a238 23424 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23425 * window.c (window_loop, size_window):
23426 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23427
7e5cf297 23428 * window.c (display_buffer): Now static.
d6550a9f
PE
23429 (size_window): Mark variables that gcc -Wuninitialized
23430 does not deduce are never used uninitialized.
a586633d
PE
23431 * window.h (check_all_windows): New decl, to forestall
23432 gcc -Wmissing-prototypes diagnostic.
5b555da1 23433 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23434
f6095868
PE
23435 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23436 shadowing.
23437 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23438 Include <limits.h>.
23439 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23440 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23441 (load_charset_map): Mark variables that gcc -Wuninitialized
23442 does not deduce are never used uninitialized.
53df7c11 23443 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23444
f38b440c
PE
23445 * coding.c (coding_set_source, coding_set_destination):
23446 Use "else { /* comment */ }" rather than "else /* comment */;"
23447 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23448 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23449 a block, when the outer 'i' will do.
23450 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23451 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23452 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23453 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23454 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23455 Rename locals to avoid shadowing.
23456 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23457 * coding.c (emacs_mule_char, encode_invocation_designation):
23458 Now static, since they're not used elsewhere.
413bb2db 23459 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23460 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23461 (decode_coding_emacs_mule): Mark variables that gcc
23462 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23463 (detect_coding_iso_2022): Initialize a local variable that might
23464 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23465 this initialization is needed. (Bug#8211)
5f58e762
PE
23466 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23467 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23468 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23469 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23470 Remove unused macros.
f38b440c 23471
232b38b9 23472 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23473 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23474 * character.c (string_count_byte8): Likewise.
232b38b9 23475
fb90da1b
PE
23476 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23477 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23478
fb93dbc2
PE
23479 * chartab.c (copy_sub_char_table): Now static, since it's not used
23480 elsewhere.
5c156ace
PE
23481 (sub_char_table_ref_and_range, char_table_ref_and_range):
23482 Rename locals to avoid shadowing.
bbcd0949 23483 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23484
7d3b3862 23485 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23486 (BIDI_BOB): Remove unused macro.
7d3b3862 23487
6be7d3da
PE
23488 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23489 deduce are never used uninitialized.
c2ed9c8b 23490 * term.c (encode_terminal_code): Likewise.
6be7d3da 23491
75f8807f 23492 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23493
50938595
PE
23494 * tparam.h: New file.
23495 * term.c, tparam.h: Include it.
23496 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23497 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23498 Move these decls to tparam.h, and make them agree with what
23499 is actually in tparam.c. The previous trick of using incompatible
23500 decls in different modules does not conform to the C standard.
23501 All callers of tparam changed to use tparam's actual API.
23502 * tparam.c (tparam1, tparam, tgoto):
23503 Use const pointers where appropriate.
23504
fbceeba2
PE
23505 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23506 * cm.h (struct cm): Likewise.
23507 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23508 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23509 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23510 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23511 (turn_on_face, init_tty): Likewise.
23512 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23513
7f3f1250
PE
23514 * term.c (term_mouse_position): Rename local to avoid shadowing.
23515
e6ca6543
PE
23516 * alloc.c (mark_ttys): Move decl from here ...
23517 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23518
c40f8d15
AS
235192011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23520
23521 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23522
cfe0661d
JB
235232011-03-09 Juanma Barranquero <lekktu@gmail.com>
23524
23525 * search.c (compile_pattern_1): Remove argument regp, unused since
23526 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23527 (compile_pattern): Don't pass it.
23528
0afb4571
J
235292011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23530
23531 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23532 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23533 for ! HAVE_GTK3.
23534 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23535
23536 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23537
23538 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23539 gdk_window_get_screen, gdk_window_get_geometry,
23540 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23541 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23542 (xg_get_pixbuf_from_pixmap): New function.
23543 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23544 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23545 Call xg_get_pixbuf_from_pixmap instead of
23546 gdk_pixbuf_get_from_drawable.
23547 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23548 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23549 (xg_check_special_colors): Use GtkStyleContext and its functions
23550 for HAVE_GTK3.
23551 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23552 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23553 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23554 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23555 Call gtk_widget_get_preferred_size.
0afb4571
J
23556 (xg_frame_resized): gdk_window_get_geometry only takes 5
23557 parameters.
44f230aa
SM
23558 (xg_win_to_widget, xg_event_is_for_menubar):
23559 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23560 (xg_set_widget_bg): New function.
23561 (delete_cb): New function.
895009e1 23562 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23563 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23564 (xg_set_background_color): Call xg_set_widget_bg.
23565 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23566 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23567 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23568 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23569 if ! HAVE_GTK3.
23570 (update_frame_tool_bar): Call gtk_widget_hide.
23571 (xg_initialize): Use GDK_KEY_g.
23572
23573 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23574 if ! HAVE_GTK3
23575 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23576
23577 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23578 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23579 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23580
1c2cc4ef
JB
235812011-03-08 Juanma Barranquero <lekktu@gmail.com>
23582
23583 * w32xfns.c (select_palette): Check success of RealizePalette against
23584 GDI_ERROR, not zero.
23585
33383987 23586See ChangeLog.11 for earlier changes.
aac0c6e3
MR
23587
23588;; Local Variables:
23589;; coding: utf-8
aac0c6e3
MR
23590;; End:
23591
ab422c4d 23592 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
23593
23594 This file is part of GNU Emacs.
23595
23596 GNU Emacs is free software: you can redistribute it and/or modify
23597 it under the terms of the GNU General Public License as published by
23598 the Free Software Foundation, either version 3 of the License, or
23599 (at your option) any later version.
23600
23601 GNU Emacs is distributed in the hope that it will be useful,
23602 but WITHOUT ANY WARRANTY; without even the implied warranty of
23603 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23604 GNU General Public License for more details.
23605
23606 You should have received a copy of the GNU General Public License
23607 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.